From 3a98deb92afcddc356c98df39200493e7a9bd99a Mon Sep 17 00:00:00 2001 From: zhangzq Date: Tue, 22 Apr 2025 17:26:35 +0800 Subject: [PATCH] =?UTF-8?q?add:=E5=A2=9E=E5=8A=A0=E6=9C=A8=E7=AE=B1?= =?UTF-8?q?=E5=9B=9E=E5=BA=93=EF=BC=8C=E8=A3=85=E7=AE=B1=E5=8C=BA=E8=87=B3?= =?UTF-8?q?=E7=AE=A1=E5=88=B6=E5=8A=9F=E8=83=BD=EF=BC=9B=20opt:=E6=9C=A8?= =?UTF-8?q?=E7=AE=B1=E7=A7=BB=E5=BA=93=E4=BC=98=E5=85=88=E7=BA=A7=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=8F=8A=E4=B8=8B=E5=8F=91=E5=BB=B6=E8=BF=9F=EF=BC=9B?= =?UTF-8?q?=20add:=E5=A2=9E=E5=8A=A0=E9=A1=B5=E9=9D=A2=E8=B0=83=E7=94=A8ME?= =?UTF-8?q?S=E6=8E=A5=E5=8F=A3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PdmBiSubpackagerelationController.java | 12 ++ .../mapper/PdmBiSubpackagerelationMapper.xml | 2 +- .../IpdmBiSubpackagerelationService.java | 5 + .../PdmBiSubpackagerelationServiceImpl.java | 85 +++++++--- .../impl/BstIvtPackageinfoivtServiceImpl.java | 2 +- .../nl/b_lms/sch/tasks/TwoMoveBoxTask.java | 2 +- .../auto/AutoSendDjqToGzq.java | 7 +- .../util/impl/OutBoxManageServiceImpl.java | 4 +- .../acs/service/impl/AcsToWmsServiceImpl.java | 154 +++++++++--------- .../mes/service/impl/LmsToMesServiceImpl.java | 11 +- .../src/main/java/org/nl/wms/sch/AcsUtil.java | 33 ++++ lms/nladmin-ui/src/views/wms/pdm/bi/index.vue | 4 +- 12 files changed, 210 insertions(+), 111 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/controller/PdmBiSubpackagerelationController.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/controller/PdmBiSubpackagerelationController.java index 0ad1b1c5d..6ced32f53 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/controller/PdmBiSubpackagerelationController.java +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/controller/PdmBiSubpackagerelationController.java @@ -179,6 +179,18 @@ public class PdmBiSubpackagerelationController { return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK); } + @PostMapping("/boxReturn") + @SaIgnore + @Log("装箱位木箱回库") + //@SaCheckPermission("@el.check(updateEntityList)") + public ResponseEntity boxReturn(@RequestBody JSONObject whereJson) { + RedissonUtils.lock(c->{ + pdmBiSubpackagerelationService.boxReturn(whereJson); + },"zjInBound",0,this,"装箱送回在操作,稍后再试"); + return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK); + } + + @PostMapping("/transferBoxPackageToMes") @Log("传输子卷包装关系至LMS") diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/dao/mapper/PdmBiSubpackagerelationMapper.xml b/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/dao/mapper/PdmBiSubpackagerelationMapper.xml index 39e42ecaf..f3c329e3a 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/dao/mapper/PdmBiSubpackagerelationMapper.xml +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/dao/mapper/PdmBiSubpackagerelationMapper.xml @@ -98,7 +98,7 @@ FROM `pdm_bi_subpackagerelation` a LEFT JOIN bst_ivt_packageinfoivt b ON a.container_name = b.container_name LEFT JOIN pdm_bi_slittingproductionplan c ON a.container_name = c.container_name - WHERE b.point_status = '3' + WHERE b.point_status in ('3','6') AND b.ivt_status = '3' AND b.is_used = '1' AND c.is_delete = '0' diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/service/IpdmBiSubpackagerelationService.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/service/IpdmBiSubpackagerelationService.java index 99c61d862..b2c536485 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/service/IpdmBiSubpackagerelationService.java +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/subpackagerelation/service/IpdmBiSubpackagerelationService.java @@ -71,6 +71,11 @@ public interface IpdmBiSubpackagerelationService extends IService() + List hasTask = taskService.list(new QueryWrapper() + .select("point_code2") .eq("is_delete", "0") .eq("point_code1", boxAttr.getString("struct_code")) .lt("task_status", TaskStatusEnum.FINISHED.getCode())); - if (hasTask>0){ - throw new BadRequestException("当前空木箱"+boxSn+"存在正在执行的任务,稍后再操作"); + if (!CollectionUtils.isEmpty(hasTask)){ + boolean zxq = hasTask.stream().map(a -> a.getPoint_code2()).filter(a -> a.contains("ZXQ")).findAny().isPresent(); + if (zxq){ + throw new BadRequestException("当前子卷正在执行装箱入库操作"); + }else{ + throw new BadRequestException("当前空木箱"+boxSn+"存在正在执行的任务,稍后再操作"); + } } - + // 查询木箱对应的托盘号 + JSONObject jsonVeExt = WQLObject.getWQLObject("md_pb_storagevehicleext").query("pcsn = '" + boxSn + "'") + .uniqueResult(0); + if (ObjectUtil.isEmpty(jsonVeExt)) { + throw new BadRequestException("此木箱没有绑定托盘号!"+boxSn); + } + //子卷到装箱区 + agvTransfer(containers, deviceCode, boxSn); String task_group_id = null; if (boxAttr.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("深"))) { JSONObject 浅Attr = attrTab @@ -721,16 +725,16 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl djqPointList = packageinfoivtService .list(new LambdaUpdateWrapper() - .eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("待检区")) .eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用")) - .eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("合格品")) - .orderByAsc(BstIvtPackageinfoivt::getSort_seq)); - List djqPoints = djqPointList.stream() - .filter(r -> containerNameList.contains(r.getContainer_name())) - .collect(Collectors.toList()); - if (CollectionUtils.isEmpty(djqPoints) || djqPoints.size()!=containerNameList.size()){ - throw new BadRequestException(containerNameList+"该子卷未设置成合格品"); + .in(BstIvtPackageinfoivt::getContainer_name,containerNameList)); + if (CollectionUtils.isEmpty(djqPointList)){ + throw new BadRequestException(containerNameList+"子卷信息不存在"); } + boolean hasNo = djqPointList.stream().anyMatch(a -> !a.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("合格品"))); + if (hasNo){ + throw new BadRequestException(containerNameList+"子卷未质检合格"); + } + List djqPoints = djqPointList.stream().filter(a -> a.getPoint_status().equals(PackageInfoIvtEnum.POINT_STATUS.code("待检区"))).collect(Collectors.toList()); //任务组id String groupId = deviceCode.substring(deviceCode.indexOf("_") + 1, deviceCode.indexOf("_", deviceCode.indexOf("_") + 1)); String now = DateUtil.now(); @@ -790,5 +794,42 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl getStructInfoBySZLS() { return this.baseMapper.getStructInfoBySZLS(); } + + + @Override + public void boxReturn(JSONObject whereJson) { + String deviceCode = whereJson.getString("device_code"); + String box = whereJson.getString("box"); + if (StringUtils.isEmpty(deviceCode)||StringUtils.isEmpty(box)){ + throw new BadRequestException("参数不全"); + } + PdmBiSubpackagerelation one = this.getOne(new QueryWrapper() + .eq("container_name", whereJson.getString("container_name"))); + if (one!=null){ + throw new BadRequestException("包装关系存在,请先在MES和LMS解绑包装关系"); + } + BstIvtBoxinfo bstIvtBoxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper() + .eq(BstIvtBoxinfo::getBox_no, box)); + if (bstIvtBoxinfo == null) { + throw new BadRequestException("请检查木箱信息不存在"); + } + JSONObject acsParam = new JSONObject(); + String height = "1"; + String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue(); + String heightLevel2 = iSysParamService.findByCode("height_level_2").getValue(); + String box_high = bstIvtBoxinfo.getBox_high(); + if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) { + height = "1"; + } else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) { + height = "2"; + } else { + height = "3"; + } + acsParam.put("device_code",deviceCode); + acsParam.put("sub_volume","BR"+box); + acsParam.put("height_level",height); + acsParam.put("product_area","BLK"); + AcsUtil.notifyAcsObject("api/wms/returnBox", acsParam); + } } diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/service/impl/BstIvtPackageinfoivtServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/service/impl/BstIvtPackageinfoivtServiceImpl.java index 899c0f8ab..903222654 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/service/impl/BstIvtPackageinfoivtServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/service/impl/BstIvtPackageinfoivtServiceImpl.java @@ -1017,7 +1017,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl() .eq("container_name", whereJson.getString("container_name"))); if (one!=null){ - throw new BadRequestException("包装关系存在,请先解绑包装关系"); + throw new BadRequestException("包装关系存在,请先解绑MES及LMS包装关系"); } } dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper().eq(BstIvtPackageinfoivt::getContainer_name, whereJson.getString("container_name"))); diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/TwoMoveBoxTask.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/TwoMoveBoxTask.java index f9186eb9b..bdd60665a 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/TwoMoveBoxTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/TwoMoveBoxTask.java @@ -187,7 +187,7 @@ public class TwoMoveBoxTask extends AbstractAcsTask { json.put("create_id", SecurityUtils.getCurrentUserId()); json.put("create_name", SecurityUtils.getCurrentUsername()); json.put("create_time", DateUtil.now()); - json.put("priority", "1"); + json.put("priority", "0"); json.put("acs_task_type", "7"); WQLObject.getWQLObject("SCH_BASE_Task").insert(json); diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/auto/AutoSendDjqToGzq.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/auto/AutoSendDjqToGzq.java index ad6614893..13b82b838 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/auto/AutoSendDjqToGzq.java +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/first_floor_area/auto/AutoSendDjqToGzq.java @@ -22,6 +22,7 @@ import org.redisson.api.RLock; import org.redisson.api.RedissonClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.util.*; @@ -71,9 +72,13 @@ public class AutoSendDjqToGzq extends Prun{ if (tryLock) { //待检区有管制品且过滤未完成任务 List djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("管制品"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), PackageInfoIvtEnum.TASK_TYPE.code("待检区->管制区")); - if (ObjectUtils.isEmpty(djqPackageinfoivtList)) { + List djqPackageinfoivtList2 = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("管制品"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), PackageInfoIvtEnum.TASK_TYPE.code("待检区->管制区")); + if (CollectionUtils.isEmpty(djqPackageinfoivtList)) { return; } + if (!CollectionUtils.isEmpty(djqPackageinfoivtList2)){ + djqPackageinfoivtList.addAll(djqPackageinfoivtList2); + } //管制区有空位且过滤未完成任务 List gzqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("管制区"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), PackageInfoIvtEnum.TASK_TYPE.code("待检区->管制区")); //todo 新增NG卷放置临时管制区135136,只取空不补空 diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/storage_manage/ios/service/iostorInv/util/impl/OutBoxManageServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/storage_manage/ios/service/iostorInv/util/impl/OutBoxManageServiceImpl.java index 2cc40bbe7..3409bdf8d 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/storage_manage/ios/service/iostorInv/util/impl/OutBoxManageServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/storage_manage/ios/service/iostorInv/util/impl/OutBoxManageServiceImpl.java @@ -720,7 +720,9 @@ public class OutBoxManageServiceImpl implements OutBoxManageService { TwoMoveBoxTask taskBan = new TwoMoveBoxTask(); taskBan.createTask(jsonTaskParam); taskBan.immediateNotifyAcs(null); - + try { + Thread.sleep(500); + }catch (Exception ex){} return jsonTaskParam.getString("task_group_id"); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index b90390416..84e7cbe54 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -2046,82 +2046,89 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { if (ObjectUtil.isEmpty(whereJson.getString("material_barcode"))) { throw new BadRequestException("子卷号不能为空!"); } - if (whereJson.getIntValue("weight") <= 0) { - throw new BadRequestException("上报的重量不能为0!"); - } - List errorMsg = new ArrayList<>(); - JSONObject jsonObject = ComPareUtil.CompareWhight(whereJson); - Boolean inbound = jsonObject.getBoolean("inbound"); - Boolean compaerResult = jsonObject.getBoolean("compaer_result"); - String box_no = jsonObject.getString("box_no"); - Integer box_weight = jsonObject.getIntValue("box_weight"); - Integer current_weight = jsonObject.getIntValue("current_weight"); - List containers = jsonObject.getObject("containers", List.class); - - int count = taskService.count(new QueryWrapper() - .eq("point_code1", whereJson.getString("device_code")) - .eq("vehicle_code2", whereJson.getString("vehicle_code")) - .eq("is_delete", "0") - .lt("task_status", TaskStatusEnum.EXECUTING.getCode())); - JSONObject jsonExt = WQLObject.getWQLObject("md_pb_storagevehicleext").query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(jsonExt)) { - errorMsg.add("载具无数据"+whereJson.getString("vehicle_code")); + // 5-木箱入库.木箱回库 + String materialBarcode = whereJson.getString("material_barcode"); + if (materialBarcode.contains("BRMX")){ + String brBox = Arrays.asList(materialBarcode.split(",")).get(0); + whereJson.put("box_no", brBox.replace("BR", "")); + inBoxManageService.inBox(whereJson); }else { - String pcsn = jsonExt.getString("pcsn"); - if (StringUtils.isNotEmpty(pcsn)){ - JSONArray stIvtStructattr = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + pcsn + "'").getResultJSONArray(0); - if (stIvtStructattr != null && stIvtStructattr.size() > 0) { - errorMsg.add("载具"+whereJson.getString("vehicle_code")+"已绑定"+pcsn); + if (whereJson.getIntValue("weight") <= 0) { + throw new BadRequestException("上报的重量不能为0!"); + } + List errorMsg = new ArrayList<>(); + JSONObject jsonObject = ComPareUtil.CompareWhight(whereJson); + Boolean inbound = jsonObject.getBoolean("inbound"); + Boolean compaerResult = jsonObject.getBoolean("compaer_result"); + String box_no = jsonObject.getString("box_no"); + Integer box_weight = jsonObject.getIntValue("box_weight"); + Integer current_weight = jsonObject.getIntValue("current_weight"); + List containers = jsonObject.getObject("containers", List.class); + int count = taskService.count(new QueryWrapper() + .eq("point_code1", whereJson.getString("device_code")) + .eq("vehicle_code2", whereJson.getString("vehicle_code")) + .eq("is_delete", "0") + .lt("task_status", TaskStatusEnum.EXECUTING.getCode())); + JSONObject jsonExt = WQLObject.getWQLObject("md_pb_storagevehicleext").query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(jsonExt)) { + errorMsg.add("载具无数据"+whereJson.getString("vehicle_code")); + }else { + String pcsn = jsonExt.getString("pcsn"); + if (StringUtils.isNotEmpty(pcsn)){ + JSONArray stIvtStructattr = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + pcsn + "'").getResultJSONArray(0); + if (stIvtStructattr != null && stIvtStructattr.size() > 0) { + errorMsg.add("载具"+whereJson.getString("vehicle_code")+"已绑定"+pcsn); + } } } - } - if (!compaerResult){ - errorMsg.add("称重"+current_weight+"不匹配"+box_weight); - } - if (!inbound){ - errorMsg.add("手动至异常口"); - } - if (count>0){ - errorMsg.add(whereJson.getString("vehicle_code")+"存在任务"); - } - //"material_barcode":"C1101,","device_code":"RK1018","weight":500.95,"vehicle_code":"B01401","type":"1" - if (CollectionUtils.isEmpty(errorMsg)) { - whereJson.put("bill_type", IOSEnum.IN_TYPE.code("生产入库")); - inBussManageService.inTask(whereJson); - PdmProductSpecServiceImpl.doRecord(SpecEnum.RK,null,Boolean.TRUE,null,containers); - } else { - iPdmBiContainerinboundService - .update(new UpdateWrapper() - .set("remark",JSONObject.toJSONString(errorMsg)) - .eq("box",box_no)); - //更新子卷入库备注信息 - JSONObject jsonTaskParam = new JSONObject(); - //创建异常任务去异常入库口 - //入库口 - jsonTaskParam.put("point_code1", "RK1018"); - //异常位 - jsonTaskParam.put("point_code2", "RK1003"); - jsonTaskParam.put("vehicle_code", jsonObject.getString("box_no")); - jsonTaskParam.put("vehicle_code2", whereJson.getString("vehicle_code")); - JSONObject request_param = new JSONObject(); - if (whereJson.getString("vehicle_code").startsWith("A")) { - request_param.put("containerType", "2"); - } else if (whereJson.getString("vehicle_code").startsWith("B")) { - request_param.put("containerType", "1"); - } else { - throw new BadRequestException("托盘号有误,无法找到对应的托盘类型!"); + if (!compaerResult){ + errorMsg.add("称重"+current_weight+"不匹配"+box_weight); } - // 更新子卷包装关系为生成 - JSONObject param = new JSONObject(); - param.put("status", IOSEnum.IS_NOTANDYES.code("否")); - WQLObject.getWQLObject("pdm_bi_subpackagerelation") - .update(param,"package_box_sn = '"+jsonObject.getString("box_no")+"'"); + if (!inbound){ + errorMsg.add("手动至异常口"); + } + if (count>0){ + errorMsg.add(whereJson.getString("vehicle_code")+"存在任务"); + } + //"material_barcode":"C1101,","device_code":"RK1018","weight":500.95,"vehicle_code":"B01401","type":"1" + if (CollectionUtils.isEmpty(errorMsg)) { + whereJson.put("bill_type", IOSEnum.IN_TYPE.code("生产入库")); + inBussManageService.inTask(whereJson); + PdmProductSpecServiceImpl.doRecord(SpecEnum.RK,null,Boolean.TRUE,null,containers); + } else { + iPdmBiContainerinboundService + .update(new UpdateWrapper() + .set("remark",JSONObject.toJSONString(errorMsg)) + .eq("box",box_no)); + //更新子卷入库备注信息 + JSONObject jsonTaskParam = new JSONObject(); + //创建异常任务去异常入库口 + //入库口 + jsonTaskParam.put("point_code1", "RK1018"); + //异常位 + jsonTaskParam.put("point_code2", "RK1003"); + jsonTaskParam.put("vehicle_code", jsonObject.getString("box_no")); + jsonTaskParam.put("vehicle_code2", whereJson.getString("vehicle_code")); + JSONObject request_param = new JSONObject(); + if (whereJson.getString("vehicle_code").startsWith("A")) { + request_param.put("containerType", "2"); + } else if (whereJson.getString("vehicle_code").startsWith("B")) { + request_param.put("containerType", "1"); + } else { + throw new BadRequestException("托盘号有误,无法找到对应的托盘类型!"); + } + // 更新子卷包装关系为生成 + JSONObject param = new JSONObject(); + param.put("status", IOSEnum.IS_NOTANDYES.code("否")); + WQLObject.getWQLObject("pdm_bi_subpackagerelation") + .update(param,"package_box_sn = '"+jsonObject.getString("box_no")+"'"); - jsonTaskParam.put("request_param", request_param); - TwoExceptionInTask bean = SpringContextHolder.getBean(TwoExceptionInTask.class); - bean.createTask(jsonTaskParam); - bean.immediateNotifyAcs(null); - PdmProductSpecServiceImpl.doRecord(SpecEnum.TYCK,null,Boolean.FALSE,errorMsg.toString(),containers); + jsonTaskParam.put("request_param", request_param); + TwoExceptionInTask bean = SpringContextHolder.getBean(TwoExceptionInTask.class); + bean.createTask(jsonTaskParam); + bean.immediateNotifyAcs(null); + PdmProductSpecServiceImpl.doRecord(SpecEnum.TYCK,null,Boolean.FALSE,errorMsg.toString(),containers); + } } } else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("空盘入库"))) { @@ -2545,11 +2552,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return param; } - public static void main(String[] args) { - String material_barcode = "123123-1"; - String split = material_barcode.split("-")[0]; - System.out.println(split); - } @Override public JSONObject getBoxInfo(JSONObject param) { String material_barcode = param.getString("material_barcode"); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/LmsToMesServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/LmsToMesServiceImpl.java index d50060b2b..a0314833f 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/LmsToMesServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/LmsToMesServiceImpl.java @@ -963,26 +963,25 @@ public class LmsToMesServiceImpl implements LmsToMesService { result = JSONObject.parseObject(resultMsg); IpdmBiSubpackagerelationService subpackagerelationService = SpringContextHolder.getBean(IpdmBiSubpackagerelationService.class); JSONArray array = result.getJSONArray("RTDAT"); + for (int i = 0; i < rows.size(); i++) { + JSONObject item = rows.getJSONObject(i); + String containerName = item.getString("ContainerName"); + list.add(containerName); + } if (ObjectUtil.isNotEmpty(array)) { for (int i = 0; i < array.size(); i++) { JSONObject row = array.getJSONObject(i); String ContainerName = row.getString("ContainerName"); - list.add(ContainerName); String AttributeValue = row.getString("AttributeValue"); subpackagerelationService.update(new LambdaUpdateWrapper().set(PdmBiSubpackagerelation::getNet_weight, AttributeValue).eq(PdmBiSubpackagerelation::getContainer_name, ContainerName)); } } log.info("momBoxPackageSubmit接口输出参数为:-------------------" + result.toString()); - - String RTYPE = result.getString("RTYPE"); if ("E".equals(RTYPE)) { - PdmProductSpecServiceImpl.doRecord(SpecEnum.BZ_MES,param,Boolean.FALSE,result.getString("RTMSG"),list); throw new BadRequestException(result.getString("RTMSG")); } PdmProductSpecServiceImpl.doRecord(SpecEnum.BZ_MES,param,Boolean.TRUE,null,list); - - } catch (Exception e) { PdmProductSpecServiceImpl.doRecord(SpecEnum.BZ_MES,param,Boolean.FALSE,e.getMessage(),list); throw new BadRequestException("MES提示错误:" + e.getMessage()); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/AcsUtil.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/AcsUtil.java index 6f94a8866..a58389621 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/AcsUtil.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/AcsUtil.java @@ -156,4 +156,37 @@ public class AcsUtil { } return result; } + public static JSONObject notifyAcsObject(String api, JSONObject param) { + //判断是否连接ACS系统 + String isConnect = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_connect_acs").getValue(); + JSONObject result = new JSONObject(); + if (StrUtil.equals("0", isConnect)) { + result.put("status", HttpStatus.OK.value()); + result.put("message", "下发成功,但未连接ACS!"); + result.put("data", new JSONObject()); + return result; + } + String product_area = param.getString("product_area"); + String acs_url = URLEnum.find(product_area); + if (StrUtil.isEmpty(acs_url)) { + log.info(product_area); + throw new BadRequestException("未查询到区域对应的acs地址!"); + } + String url = acs_url + api; + try { + String resultMsg = HttpRequest.post(url) + .body(JSONObject.toJSONString(param)) + .execute().body(); + result = JSONObject.parseObject(resultMsg); + log.info("ACS相应参数----------------------------------------+" + api + ",---" + result.toString()); + } catch (Exception e) { + result.put("status", HttpStatus.BAD_REQUEST); + result.put("message", "网络不通,操作失败!"); + result.put("data", new JSONObject()); + } + if (!StrUtil.equals(result.getString("status"), "200")) { + throw new BadRequestException(result.getString("message")); + } + return result; + } } diff --git a/lms/nladmin-ui/src/views/wms/pdm/bi/index.vue b/lms/nladmin-ui/src/views/wms/pdm/bi/index.vue index 139580530..8f8cf2288 100644 --- a/lms/nladmin-ui/src/views/wms/pdm/bi/index.vue +++ b/lms/nladmin-ui/src/views/wms/pdm/bi/index.vue @@ -798,14 +798,14 @@ export default { }) }, async syncMes(row) { - const url = 'http://10.1.3.16:8081/'+row.url + const url = 'http://10.1.3.36:8081/'+row.url const response = await fetch(url, { method: 'POST', // *GET, POST, PUT, DELETE, etc. headers: { 'Content-Type': 'application/json', // 'Content-Type': 'application/x-www-form-urlencoded', }, - body: JSON.stringify(row.param) // body 数据类型必须与“Content-Type”头匹配 + body: row.param // body 数据类型必须与“Content-Type”头匹配 }); const data = await response.json(); window.alert(JSON.stringify(data))