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 a52b75abe..fcbc55d89 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 @@ -265,7 +265,7 @@ public class FeedingServiceImpl implements FeedingService { public JSONObject handleConfirm(JSONObject form) { String point_code = form.getString("point_code"); String next_point_code = form.getString("next_point_code"); - + String container_name = form.getString("container_name"); if (StrUtil.isEmpty(point_code)) { throw new BadRequestException("输入的起点不能为空!"); } @@ -288,6 +288,57 @@ public class FeedingServiceImpl implements FeedingService { if (!StrUtil.equals(cool_jo.getString("full_point_status"), "02")) { throw new BadRequestException("该点位上不存在母卷!"); } + if (!StrUtil.equals(cool_jo.getString("container_name"), container_name)) { + throw new BadRequestException("该点位:"+point_code+"不存在母卷:"+container_name); + } + JSONObject result = new JSONObject(); + result.put("message", "操作成功!"); + //B1烘箱外边的冷却点 + if (cool_jo.getString("product_area").equals("B1") && cool_jo.getString("point_type").equals("1")) { + JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "' and product_area='"+cool_jo.getString("product_area")+"'").uniqueResult(0); + if (ObjectUtil.isEmpty(cut_jo)) { + cut_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + next_point_code + "' and product_area='"+cool_jo.getString("product_area")+"'").uniqueResult(0); + } + if (ObjectUtil.isEmpty(cut_jo)) { + throw new BadRequestException("请扫描B1车间分切机满轴点位或分切缓存位满轴点位做为终点!"); + } + //创建AGV任务 + JSONObject jo = new JSONObject(); + if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) { + jo.put("point_code1", cool_jo.getString("full_point_code")); + jo.put("point_code2", cut_jo.getString("full_point_code")); + jo.put("material_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", cool_jo.getString("full_point_code")); + jo.put("point_code2", cut_jo.getString("full_point_code")); + jo.put("point_code3", cut_jo.getString("empty_point_code")); + // 2.找冷却区空货位 + JSONObject map = new JSONObject(); + map.put("flag", "2"); + map.put("product_area", cut_jo.getString("product_area")); + map.put("point_location", "0"); + + JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0); + // 如果为空 + if (ObjectUtil.isEmpty(jsonCooIvt)) { + map.put("point_location", "1"); + jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0); + } + if (ObjectUtil.isEmpty(jsonCooIvt)) { + throw new BadRequestException("B1车间冷却区空位不足"); + } + jo.put("point_code4", jsonCooIvt.getString("empty_point_code")); + jo.put("material_code", cool_jo.getString("container_name")); + jo.put("product_area", cut_jo.getString("product_area")); + jo.put("task_type", "010301"); + } + AbstractAcsTask task = new CoolCutTask(); + task.createTask(jo); + + return result; + } if (cool_jo.getString("product_area").equals("B1") && cool_jo.getString("point_type").equals("3")) { if (ObjectUtil.isNotEmpty(cool_jo) && cool_jo.getString("point_type").equals("4")) { @@ -384,7 +435,8 @@ public class FeedingServiceImpl implements FeedingService { OutHotTask outHotTask = new OutHotTask(); String task_id = outHotTask.createTask(task_jo); } - } else { + } + else { JSONObject jo = new JSONObject(); //查询该分切机对应的点位 JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0); @@ -467,7 +519,6 @@ public class FeedingServiceImpl implements FeedingService { WQLObject.getWQLObject("ST_IVT_CoolRegionIO").insert(jsonCool); } - JSONObject result = new JSONObject(); result.put("message", "操作成功!"); return result; }