From 043962f14bddb97c103062e2697f73a27c894c36 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Fri, 13 Oct 2023 14:44:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20mes=E5=8E=8B=E6=9C=BA=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=89=A9=E6=96=99=E7=AD=89=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=20private=20String=20MATERIAL=5FID;=20=20=20=20=20private=20St?= =?UTF-8?q?ring=20MATERIAL=5FNAME;=20=20=20=20=20private=20String=20MATERI?= =?UTF-8?q?AL=5FSPEC;=20=20=20=20=20private=20String=20MATERIAL=5FMODEL;?= =?UTF-8?q?=20=20=20=20=20private=20String=20MACHINE=5FWET;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dao/mapper/MesRequestMapper.xml | 6 +++-- .../service/dto/MesQSPressMonitorData.java | 5 +++++ .../mes/service/impl/WmsToMesServiceImpl.java | 22 +++++++++++++++---- .../main/java/org/nl/wms/util/PointUtils.java | 1 + .../src/test/java/org/nl/point/test.java | 3 ++- .../src/views/wms/sch/group/index.vue | 2 +- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml index 74366f7..96a9189 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml @@ -73,9 +73,11 @@ INSERT INTO "LMSTELCOM"."RECEIVE_QS_PRESS_MONITORDATA"(BRICK_ID, GET_STATION, PUT_STATION, IS_QUALIFIED, LASER_MARKING_CODE , WEIGHT, HEIGHT1, HEIGHT2, HEIGHT3, HEIGHT4, WIDTH1, WIDTH2, LEN, VOLUME, FLATNESS, UNQUALIFIED_QTY, WORKORDER_CODE - , CREATE_TM, OP_FLAG) VALUES (#{BRICK_ID}, #{GET_STATION}, #{PUT_STATION}, #{IS_QUALIFIED}, #{LASER_MARKING_CODE} + , CREATE_TM, OP_FLAG, MATERIAL_ID, MATERIAL_NAME, MATERIAL_SPEC, MATERIAL_MODEL, MACHINE_WET) VALUES + (#{BRICK_ID}, #{GET_STATION}, #{PUT_STATION}, #{IS_QUALIFIED}, #{LASER_MARKING_CODE} , #{WEIGHT}, #{HEIGHT1}, #{HEIGHT2}, #{HEIGHT3}, #{HEIGHT4}, #{WIDTH1}, #{WIDTH2}, #{LEN}, #{VOLUME}, #{FLATNESS} - , #{UNQUALIFIED_QTY}, #{WORKORDER_CODE}, #{CREATE_TM}, #{OP_FLAG}) + , #{UNQUALIFIED_QTY}, #{WORKORDER_CODE}, #{CREATE_TM}, #{OP_FLAG}, #{MATERIAL_ID}, #{MATERIAL_NAME} + , #{MATERIAL_SPEC}, #{MATERIAL_MODEL}, #{MACHINE_WET}) INSERT INTO "LMSTELCOM"."RECEIVE_LMS_BINSTA"(MSGID, SEND_TM, GROUP_ID, VEHICLE_TYPE, VEHICLE_CODE, MATERIAL_ID diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/MesQSPressMonitorData.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/MesQSPressMonitorData.java index bdba2c2..6023b7f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/MesQSPressMonitorData.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/MesQSPressMonitorData.java @@ -49,5 +49,10 @@ public class MesQSPressMonitorData { private String CREATE_TM; private String OP_FLAG; private String OP_TM; + private String MATERIAL_ID; + private String MATERIAL_NAME; + private String MATERIAL_SPEC; + private String MATERIAL_MODEL; + private String MACHINE_WET; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java index 1566a40..109194b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java @@ -155,7 +155,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { log.error("反馈压机产出插入mes数据库失败:{}", e.getMessage()); // 发送通知 noticeService.createNotice("反馈压机产出插入mes数据库失败", "压机产出" - + mesProductDataDto.getPRESSUNIT(), NoticeTypeEnum.EXCEPTION.getCode()); + + mesProductDataDto.getPRESSUNIT(), NoticeTypeEnum.EXCEPTION.getCode()); } } @@ -199,7 +199,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { log.error("半成品入库插入mes数据库失败:{}", e.getMessage()); // todo:发送通知 noticeService.createNotice("半成品入库插入mes数据库失败", "半成品入库" - + semiProductionInfoInDto.getMSGID(), NoticeTypeEnum.EXCEPTION.getCode()); + + semiProductionInfoInDto.getMSGID(), NoticeTypeEnum.EXCEPTION.getCode()); } } @@ -398,7 +398,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { log.error("插入压机检测失败:{}", e.getMessage()); // todo:发送通知 noticeService.createNotice("压机检测插入mes数据库失败", "压机检测" - + mesQSPressMonitorData.getBRICK_ID(), NoticeTypeEnum.EXCEPTION.getCode()); + + mesQSPressMonitorData.getBRICK_ID(), NoticeTypeEnum.EXCEPTION.getCode()); } } @@ -414,12 +414,20 @@ public class WmsToMesServiceImpl implements WmsToMesService { /** * 转换 + * * @param brickInfo:lms的砖块检测信息 * @return 上报mes的砖块检测信息 */ private MesQSPressMonitorData toPressMonitorMapper(MdBaseBrickInfo brickInfo) { // 获取mes的设备 SchBasePoint device = pointService.getById(brickInfo.getGet_station()); + // 获取工单 + PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(brickInfo.getWorkorder_code()); + MdBaseMaterial material = mdBaseMaterialService.getById(workorder.getMaterial_id()); + String singleWeight = material.getSingle_weight(); + String volume = brickInfo.getVolume(); + double w = Double.parseDouble(singleWeight); + double v = Double.parseDouble(volume); MesQSPressMonitorData monitorData = new MesQSPressMonitorData(); monitorData.setBRICK_ID(brickInfo.getBrick_id()); monitorData.setGET_STATION(device.getExt_point_code()); @@ -434,8 +442,13 @@ public class WmsToMesServiceImpl implements WmsToMesService { monitorData.setWIDTH1(brickInfo.getWidth1()); monitorData.setWIDTH2(brickInfo.getWidth2()); monitorData.setLEN(brickInfo.getLen()); - monitorData.setVOLUME(brickInfo.getVolume()); + monitorData.setVOLUME(volume); monitorData.setFLATNESS(brickInfo.getFlatness()); + monitorData.setMATERIAL_ID(material.getMaterial_id()); + monitorData.setMATERIAL_NAME(material.getMaterial_name()); + monitorData.setMATERIAL_SPEC(material.getMaterial_spec()); + monitorData.setMATERIAL_MODEL(material.getMaterial_model()); + monitorData.setMACHINE_WET(String.valueOf(v == 0 ? "0" : (w / v))); monitorData.setUNQUALIFIED_QTY(brickInfo.getUnqualified_qty()); monitorData.setWORKORDER_CODE(brickInfo.getWorkorder_code()); monitorData.setCREATE_TM(DateUtil.now()); @@ -445,6 +458,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { /** * 转换 + * * @param mesWorkOrderInfos: mes的工单 * @return lms工单 */ diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/PointUtils.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/PointUtils.java index dc34c7c..b722dad 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/PointUtils.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/PointUtils.java @@ -74,6 +74,7 @@ public class PointUtils { point.setVehicle_qty(point.getVehicle_qty() + 1); if (basePoint.getVehicle_qty() == 5) { // 等到新的点执行第一托的时候,才判断另一个点满足5个托盘的时候就清空 basePoint.setVehicle_qty(0); + basePoint.setUpdate_time(DateUtil.now()); pointService.updateById(basePoint); } point.setUpdate_time(DateUtil.now()); diff --git a/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java b/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java index eeaa7d3..e14074c 100644 --- a/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java +++ b/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java @@ -117,7 +117,8 @@ public class test { // System.out.println(f.substring(0, 12)); // System.out.println(f.substring(18, f.length())); - System.out.println(5%3); +// System.out.println(5%3); + System.out.println(Double.parseDouble("0.0")); } } diff --git a/lms/nladmin-ui/src/views/wms/sch/group/index.vue b/lms/nladmin-ui/src/views/wms/sch/group/index.vue index 52988ec..a0cce1c 100644 --- a/lms/nladmin-ui/src/views/wms/sch/group/index.vue +++ b/lms/nladmin-ui/src/views/wms/sch/group/index.vue @@ -249,7 +249,7 @@ - +