This commit is contained in:
2023-01-27 18:25:19 +08:00
parent 9be218f673
commit 1488621cd0
5 changed files with 38 additions and 17 deletions

View File

@@ -821,6 +821,12 @@ public class MesToLmsServiceImpl implements MesToLmsService {
String thickness_request = detail.getString("Attribute2");//物料主数据厚度
String width_standard = detail.getString("Attribute3");//要求幅宽
//查询库内是否存在相同的子卷号
JSONObject container_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("container_name = '"+ContainerName+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(container_jo)){
throw new BadRequestException("LMS系统中已存在子卷号"+ContainerName+",请检查!");
}
JSONObject jo = new JSONObject();
jo.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
jo.put("package_box_sn", PackageBoxSN);

View File

@@ -171,7 +171,7 @@ public class ShippingServiceImpl implements ShippingService {
throw new BadRequestException("未查询到可用的空点位!");
}
/*//如果为左边点位判断右边是否存在未完成的任务,如果有则提示不能下发
//如果为左边点位判断右边是否存在未完成的任务,如果有则提示不能下发
//判断输送出来的任务起点是否靠近分切机,如果靠近分切机且远离分切机的点位上存在载具且不存在任务进行载具横移
char dtl_type = empty_point.getString("point_code").charAt(empty_point.getString("point_code").length() - 1);
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
@@ -179,9 +179,9 @@ public class ShippingServiceImpl implements ShippingService {
//判断是否存在任务
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("point_code1 = '"+right_point.getString("point_code")+"' OR point_code2 = '"+right_point.getString("point_code")+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task_jo)){
throw new BadRequestException("当前一截输送线存在未完成的任务,请稍等几分钟后进行下发!");
throw new BadRequestException(empty_point.getString("point_code")+"所在一截输送线存在未完成的任务,请稍等几分钟后进行下发!");
}
}*/
}
//下发输送线任务
JSONObject form = new JSONObject();

View File

@@ -186,7 +186,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
JSONObject material = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + row.get("product_name") + "'").uniqueResult(0);
row.put("material_id", material.getString("material_id"));
row.put("pcsn", row.get("container_name"));
row.put("bill_status", "30");
row.put("bill_status", "10");
row.put("quality_scode", "01");
row.put("qty_unit_id", material.getString("base_unit_id"));
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + material.getString("base_unit_id") + "'").uniqueResult(0);
@@ -356,7 +356,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
JSONObject material = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + row.get("product_name") + "'").uniqueResult(0);
row.put("material_id", material.getString("material_id"));
row.put("pcsn", row.get("container_name"));
row.put("bill_status", "30");
row.put("bill_status", "10");
row.put("quality_scode", "01");
row.put("qty_unit_id", material.getString("base_unit_id"));
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + material.getString("base_unit_id") + "'").uniqueResult(0);
@@ -472,7 +472,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
HashMap<String, String> map = rows.get(0);
Boolean auto_div = false;
if (whereJson2.containsKey("auto_div")){
if (whereJson2.containsKey("auto_div")) {
auto_div = whereJson2.getBoolean("auto_div");
}
//判断该载具是否已经分配货位或者起点
@@ -605,9 +605,8 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
i_form.put("qty_unit_name", dis_jo.getString("qty_unit_name"));
storPublicService.IOStor(i_form, "31");
JSONObject dtl_jo = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "'").uniqueResult(0);
if (StrUtil.isNotEmpty(ios_dis.getString("point_id")) || is_virtual) {
//更新明细表状态
JSONObject dtl_jo = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "'").uniqueResult(0);
if (dtl_jo.getDoubleValue("unassign_qty") == 0) {
//判断该明细下是否还存在未分配货位的分配明细
JSONArray disdiv_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "' AND (struct_id = '' OR struct_id is null) AND (point_id = '' OR point_id is null)").getResultJSONArray(0);
@@ -622,9 +621,23 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
mst_jo.put("dis_optname", nickName);
mst_jo.put("dis_time", now);
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
} else {
mst_jo.put("bill_status", "30");
mst_jo.put("dis_optid", currentUserId);
mst_jo.put("dis_optname", nickName);
mst_jo.put("dis_time", now);
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
}
}
}
} else {
dtl_jo.put("bill_status", "30");
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_jo);
mst_jo.put("bill_status", "30");
mst_jo.put("dis_optid", currentUserId);
mst_jo.put("dis_optname", nickName);
mst_jo.put("dis_time", now);
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
}
}
//如果是虚拟区,直接更新完成分配任务
@@ -696,9 +709,11 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(map, "iostorinv_id = '" + mst_jo.get("iostorinv_id") + "' AND box_no = '" + whereJson.get("box_no") + "'");
//修改明细状态
JSONObject dtl_jo = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinvdtl_id = '" + dis_rows.getJSONObject(0).getString("iostorinvdtl_id") + "'").uniqueResult(0);
HashMap<String, String> dtl_map = new HashMap<>();
map.put("bill_status", "30");
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(map, "iostorinv_id = '" + mst_jo.get("iostorinv_id") + "' AND box_no = '" + whereJson.get("box_no") + "'");
dtl_map.put("bill_status", "10");
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_map, "iostorinv_id = '" + mst_jo.get("iostorinv_id") + "' AND box_no = '" + whereJson.get("box_no") + "'");
//更新主表状态
JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + mst_jo.get("iostorinv_id") + "' AND bill_status IN ('20','30')").getResultJSONArray(0);
@@ -1059,7 +1074,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
//修改明细状态
HashMap<String, String> dtl_map = new HashMap<>();
map.put("bill_status", "30");
map.put("bill_status", "10");
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(map, "iostorinv_id = '" + mst_jo.get("iostorinv_id") + "' AND box_no = '" + whereJson.get("box_no") + "'");
//更新主表状态
@@ -1077,7 +1092,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
public void reIssueTask(Map whereJson) {
String task_id = (String) whereJson.get("task_id");
//判断指令状态,只能下发生成、执行中状态的任务
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_id = '"+task_id+"'").uniqueResult(0);
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_id = '" + task_id + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(task_jo)) {
throw new BadRequestException("请输入正确的任务号!");
}