From f4d3ef2d0f958059a44a633a82d2be9ed0b9905b Mon Sep 17 00:00:00 2001 From: "DESKTOP-5DIJMF9\\admin" <2388969634@qq.com> Date: Wed, 16 Apr 2025 15:09:30 +0800 Subject: [PATCH] =?UTF-8?q?opt:B1=E8=BD=A6=E9=97=B4=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=83=98=E7=AE=B1=E5=A4=96=E5=86=B7=E5=8D=B4=E5=8C=BA=20?= =?UTF-8?q?=E9=80=81=E6=AF=8D=E5=8D=B7=E5=88=B0=E5=88=86=E5=88=87=E4=B8=8A?= =?UTF-8?q?=E6=96=99=E6=9A=82=E5=AD=98=E6=9E=B6=E6=88=96=E5=88=86=E5=88=87?= =?UTF-8?q?=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mps/service/impl/FeedingServiceImpl.java | 57 ++++++++++++++++++- 1 file changed, 54 insertions(+), 3 deletions(-) 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; }