diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/BakingServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/BakingServiceImpl.java index 5ea8ff4da..b7b10fafa 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/BakingServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/BakingServiceImpl.java @@ -208,7 +208,6 @@ public class BakingServiceImpl implements BakingService { if (ObjectUtil.isEmpty(point_code2_jo)) { throw new BadRequestException("未查询到可用的点位类型为入箱的烘箱对接位!"); } - String point_code2 = point_code2_jo.getString("point_code"); /*if (ObjectUtil.isEmpty(pointArr)) { if (StrUtil.equals(point_location, "0")) map.put("point_location", "1"); if (StrUtil.equals(point_location, "1")) map.put("point_location", "0"); @@ -234,15 +233,16 @@ public class BakingServiceImpl implements BakingService { throw new BadRequestException("烘烤区没有合适温度的空位!"); } } + }else { + throw new BadRequestException("烘烤区没有合适温度的空位!"); } - throw new BadRequestException("烘烤区没有合适温度的空位!"); } // 3.创建冷却区 --> 烘烤区任务 JSONObject param = new JSONObject(); param.put("type", "1"); // 1- 冷却区入烘箱 2- 暂存位入烘箱 param.put("point_code1", point_code1); - param.put("point_code2", point_code2); + param.put("point_code2", point_code2_jo.getString("point_code")); param.put("point_code3", jsonHotIvt.getString("point_code")); param.put("material_code", container_name); param.put("product_area", product_area); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/FeedingServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/FeedingServiceImpl.java index a391c61a6..e6e829349 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/FeedingServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/FeedingServiceImpl.java @@ -278,34 +278,44 @@ public class FeedingServiceImpl implements FeedingService { if (!StrUtil.equals(cool_jo.getString("full_point_status"), "02")) { throw new BadRequestException("该点位上不存在母卷!"); } - + JSONObject jo = new JSONObject(); //查询该分切机对应的点位 JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0); - + JSONObject zz_jo = WQLObject.getWQLObject("sch_base_point").query("point_type = '8' AND is_used = '1' AND is_delete = '0' AND point_code = '"+next_point_code+"'").uniqueResult(0); if (ObjectUtil.isEmpty(cut_jo)) { - throw new BadRequestException("请扫描或者输入分切区域的满轴点位做为终点!"); - } - - if (StrUtil.isNotEmpty(cut_jo.getString("container_name")) || "02".equals(cut_jo.getString("full_point_status"))) { - throw new BadRequestException("该分切机对应的上料位存在母卷,不能下发搬运任务!"); - } - - JSONObject jo = new JSONObject(); - if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) { + //查询中转区的点位 + if (ObjectUtil.isEmpty(zz_jo)){ + throw new BadRequestException("请扫描或者输入分切区域的满轴点位或表处中转区做为终点!"); + } + if (zz_jo.getString("point_status").equals("2")){ + throw new BadRequestException("该表处中转区点位上存在母卷,不能下发搬运任务!"); + } jo.put("point_code1", point_code); jo.put("point_code2", next_point_code); jo.put("vehicle_code", cool_jo.getString("container_name")); - jo.put("product_area", cut_jo.getString("product_area")); - jo.put("task_type", "010302"); - } else { - jo.put("point_code1", point_code); - jo.put("point_code2", next_point_code); - jo.put("point_code3", cut_jo.getString("empty_point_code")); - jo.put("point_code4", cool_jo.getString("empty_point_code")); - jo.put("vehicle_code", cool_jo.getString("container_name")); - jo.put("vehicle_code2", cut_jo.getString("empty_vehicle_code")); - jo.put("product_area", cut_jo.getString("product_area")); - jo.put("task_type", "010301"); + jo.put("product_area", zz_jo.getString("product_area")); + jo.put("task_type", "010305"); + }else { + + if (StrUtil.isNotEmpty(cut_jo.getString("container_name")) || "02".equals(cut_jo.getString("full_point_status"))) { + throw new BadRequestException("该分切机对应的上料位存在母卷,不能下发搬运任务!"); + } + if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) { + jo.put("point_code1", point_code); + jo.put("point_code2", next_point_code); + jo.put("vehicle_code", cool_jo.getString("container_name")); + jo.put("product_area", cut_jo.getString("product_area")); + jo.put("task_type", "010302"); + } else { + jo.put("point_code1", point_code); + jo.put("point_code2", next_point_code); + jo.put("point_code3", cut_jo.getString("empty_point_code")); + jo.put("point_code4", cool_jo.getString("empty_point_code")); + jo.put("vehicle_code", cool_jo.getString("container_name")); + jo.put("vehicle_code2", cut_jo.getString("empty_vehicle_code")); + jo.put("product_area", cut_jo.getString("product_area")); + jo.put("task_type", "010301"); + } } //查询该母卷号对应的生箔信息 @@ -336,7 +346,7 @@ public class FeedingServiceImpl implements FeedingService { jsonCool.put("task_id", task_id); jsonCool.put("qty_unit_id", "1"); jsonCool.put("start_point_code", cool_jo.getString("full_point_code")); - jsonCool.put("end_point_code", cut_jo.getString("full_point_code")); + jsonCool.put("end_point_code", ObjectUtil.isNotEmpty(cut_jo) ? cut_jo.getString("full_point_code") : zz_jo.getString("point_code")); jsonCool.put("create_mode", "03"); jsonCool.put("create_id", currentUserId); jsonCool.put("create_name", currentUsername); @@ -351,7 +361,7 @@ public class FeedingServiceImpl implements FeedingService { JSONObject result = new JSONObject(); result.put("message", "操作成功!"); - return jo; + return result; } @Transactional(rollbackFor = Exception.class) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/SerfaceServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/SerfaceServiceImpl.java index 2a4952450..bace0d8c9 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/SerfaceServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/SerfaceServiceImpl.java @@ -30,7 +30,10 @@ public class SerfaceServiceImpl implements SerfaceService { String device_code = whereJson.getString("point_code"); JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + container_name + "'").uniqueResult(0); - if (raw_jo.getString("order_type").equals("2")){ + if (ObjectUtil.isEmpty(raw_jo)) { + throw new BadRequestException("未查询到该母卷号对应的生箔工单!"); + } + if (raw_jo.getString("order_type").equals("2")) { throw new BadRequestException("当前工单为锂电工单,不允许表处!"); } JSONObject device_jo = WQLObject.getWQLObject("st_ivt_stpointivt").query("point_code = '" + device_code + "'").uniqueResult(0); @@ -40,7 +43,7 @@ public class SerfaceServiceImpl implements SerfaceService { param.put("Type", option); MesToLmsService bean = SpringContextHolder.getBean(MesToLmsService.class); JSONObject jsonObject = bean.sendProcessInfo(param); - if (jsonObject.getString("RTYPE").equals("E")){ + if (jsonObject.getString("RTYPE").equals("E")) { throw new BadRequestException(jsonObject.getString("RTMSG")); } } @@ -49,8 +52,8 @@ public class SerfaceServiceImpl implements SerfaceService { public void confirm(JSONObject whereJson) { String point_code = whereJson.getString("point_code"); //查询该点位对应的任务 - JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 like '%"+point_code+"%' + OR point_code2 like '%"+point_code+"%' AND is_delete = '0'").uniqueResult(0); - if (ObjectUtil.isEmpty(task_jo)){ + JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 like '%" + point_code + "%' + OR point_code2 like '%" + point_code + "%' AND is_delete = '0'").uniqueResult(0); + if (ObjectUtil.isEmpty(task_jo)) { throw new BadRequestException("未查询到该点位对应的任务!"); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CoolCutTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CoolCutTask.java index 85f8934a5..07369bb82 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CoolCutTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CoolCutTask.java @@ -244,6 +244,24 @@ public class CoolCutTask extends AbstractAcsTask { WQLObject.getWQLObject("st_ivt_coolpointivt").update(jsonCoolIvt2); } + if ("010305".equals(jsonTask.getString("task_type"))) { + //更新冷却区空轴库存 + JSONObject jsonCoolIvt2 = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + point_code1 + "'").uniqueResult(0); + String container_name = jsonCoolIvt2.getString("container_name"); + jsonCoolIvt2.put("full_point_status", "01"); + jsonCoolIvt2.put("container_name", ""); + jsonCoolIvt2.put("workorder_id", ""); + jsonCoolIvt2.put("ivt_qty", "0"); + jsonCoolIvt2.put("cool_ivt_status", "01"); + WQLObject.getWQLObject("st_ivt_coolpointivt").update(jsonCoolIvt2); + + //更新中转区点位库存 + JSONObject point_jo2 = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code2 + "'").uniqueResult(0); + point_jo2.put("point_status", "2"); + point_jo2.put("material_code", container_name); + WQLObject.getWQLObject("sch_base_point").update(point_jo2); + } + } }