|
|
@ -59,11 +59,11 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void reportMudConsumption(MesMudConsumptionDto mudObject) { |
|
|
|
log.info("上报mes消耗泥料记录的信息: {}", mudObject); |
|
|
|
// 请求mes插入mes数据库
|
|
|
|
try { |
|
|
|
mesRequestMapper.insertMudConsumptionInfo(mudObject); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("上报mes消耗泥料记录的数据:{}", mudObject); |
|
|
|
log.error("上报mes消耗泥料记录失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("上报mes消耗泥料数据失败", "消耗泥料数据" + mudObject.getPWORKSCHE_ID(), |
|
|
@ -117,7 +117,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
@Override |
|
|
|
// @DSTransactional
|
|
|
|
public void reportProductData(String groupId) { |
|
|
|
log.info("压机产出数据记录"); |
|
|
|
// 获取组盘信息
|
|
|
|
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); |
|
|
|
String workorderCode = vehiclematerialgroup.getWorkorder_code(); |
|
|
@ -125,7 +124,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode); |
|
|
|
String extData = workorder.getExt_data(); |
|
|
|
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); |
|
|
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
|
|
|
|
SchBasePoint basePoint = pointService.getById(workorder.getPoint_code()); |
|
|
|
MesProductDataDto mesProductDataDto = new MesProductDataDto(); |
|
|
|
mesProductDataDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
@ -146,11 +145,13 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
? workorder.getProduce_date() : DateUtil.now()); |
|
|
|
mesProductDataDto.setCREATE_TM(DateUtil.now()); |
|
|
|
mesProductDataDto.setOP_FLAG(GeneralDefinition.NO); |
|
|
|
log.info("压机产出返给MES的数据:{}", mesProductDataDto); |
|
|
|
|
|
|
|
// 插入mes数据库
|
|
|
|
try { |
|
|
|
mesRequestMapper.insertProductData(mesProductDataDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("压机产出-获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
log.error("压机产出返给MES的数据:{}", mesProductDataDto); |
|
|
|
log.error("反馈压机产出插入mes数据库失败:{}", e.getMessage()); |
|
|
|
// 发送通知
|
|
|
|
noticeService.createNotice("反馈压机产出插入mes数据库失败", "压机产出" |
|
|
@ -168,7 +169,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode); |
|
|
|
String extData = workorder.getExt_data(); |
|
|
|
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); |
|
|
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
|
|
|
|
MesSemiProductionInfoInDto semiProductionInfoInDto = new MesSemiProductionInfoInDto(); |
|
|
|
semiProductionInfoInDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
|
semiProductionInfoInDto.setFORDER_NO(mesWorkOrderDto.getFORDER_NO()); |
|
|
@ -188,11 +189,13 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
semiProductionInfoInDto.setPRODATE(workorder.getProduce_date()); |
|
|
|
semiProductionInfoInDto.setCREATE_TM(DateUtil.now()); |
|
|
|
semiProductionInfoInDto.setOP_FLAG(GeneralDefinition.NO); |
|
|
|
log.info("半成品入库返给MES的数据:{}", semiProductionInfoInDto); |
|
|
|
|
|
|
|
// 插入mes数据库
|
|
|
|
try { |
|
|
|
mesRequestMapper.insertSemiProductInfo(semiProductionInfoInDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("半成品入库-获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
log.error("半成品入库返给MES的数据:{}", semiProductionInfoInDto); |
|
|
|
log.error("半成品入库插入mes数据库失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("半成品入库插入mes数据库失败", "半成品入库" |
|
|
@ -202,7 +205,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void reportSemiProductionInfoOut(String groupId) { |
|
|
|
log.info("半成品出库"); |
|
|
|
// 获取组盘信息
|
|
|
|
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); |
|
|
|
String workorderCode = vehiclematerialgroup.getWorkorder_code(); |
|
|
@ -213,7 +215,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
if (ObjectUtil.isNotEmpty(extData)) { |
|
|
|
mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); |
|
|
|
} |
|
|
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
|
|
|
|
MesSemiProductionInfoOutDto semiProductionInfoOutDto = new MesSemiProductionInfoOutDto(); |
|
|
|
semiProductionInfoOutDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
|
semiProductionInfoOutDto.setSEMIPRODUCT_BATCHNO(workorder.getBatch_no()); |
|
|
@ -230,11 +232,13 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
semiProductionInfoOutDto.setOUTTYPE("成品出库"); |
|
|
|
semiProductionInfoOutDto.setCREATE_TM(DateUtil.now()); |
|
|
|
semiProductionInfoOutDto.setOP_FLAG(GeneralDefinition.NO); |
|
|
|
log.info("半成品出库返给MES的数据:{}", semiProductionInfoOutDto); |
|
|
|
|
|
|
|
// 插入mes数据库
|
|
|
|
try { |
|
|
|
mesRequestMapper.insertSemiProductOutInfo(semiProductionInfoOutDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("半成品出库-获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
log.error("半成品出库返给MES的数据:{}", semiProductionInfoOutDto); |
|
|
|
log.error("半成品出库插入mes数据库失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("半成品出库插入mes数据库失败", "半成品出库" + semiProductionInfoOutDto.getMSGID(), |
|
|
@ -244,7 +248,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void reportGdyMaterialInfoIn(String groupId) { |
|
|
|
log.info("物料入窑"); |
|
|
|
// 获取组盘信息
|
|
|
|
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); |
|
|
|
String workorderCode = vehiclematerialgroup.getWorkorder_code(); |
|
|
@ -252,7 +255,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode); |
|
|
|
String extData = workorder.getExt_data(); |
|
|
|
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); |
|
|
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
|
|
|
|
MesGdyMaterialInDto gdyMaterialInDto = new MesGdyMaterialInDto(); |
|
|
|
gdyMaterialInDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
|
gdyMaterialInDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code()); |
|
|
@ -270,11 +273,13 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
gdyMaterialInDto.setIN_DATE(vehiclematerialgroup.getInto_kiln_time()); |
|
|
|
gdyMaterialInDto.setCREATE_TM(DateUtil.now()); |
|
|
|
gdyMaterialInDto.setOP_FLAG(GeneralDefinition.NO); |
|
|
|
log.info("入窑返给MES的数据:{}", gdyMaterialInDto); |
|
|
|
|
|
|
|
// 插入mes数据库
|
|
|
|
try { |
|
|
|
mesRequestMapper.insertGdyMaterialIn(gdyMaterialInDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("入窑-获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
log.error("入窑返给MES的数据:{}", gdyMaterialInDto); |
|
|
|
log.error("入窑插入mes数据库失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("入窑插入mes数据库失败", "入窑" + gdyMaterialInDto.getMSGID(), |
|
|
@ -284,7 +289,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void reportGdyMaterialInfoOut(String groupId) { |
|
|
|
log.info("物料出窑"); |
|
|
|
// 获取组盘信息
|
|
|
|
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); |
|
|
|
String workorderCode = vehiclematerialgroup.getWorkorder_code(); |
|
|
@ -292,7 +296,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode); |
|
|
|
String extData = workorder.getExt_data(); |
|
|
|
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); |
|
|
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
|
|
|
|
MesGdyMaterialOutDto gdyMaterialOutDto = new MesGdyMaterialOutDto(); |
|
|
|
gdyMaterialOutDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
|
gdyMaterialOutDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code()); |
|
|
@ -310,11 +314,13 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
gdyMaterialOutDto.setOUT_DATE(vehiclematerialgroup.getOut_kiln_time()); |
|
|
|
gdyMaterialOutDto.setCREATE_TM(DateUtil.now()); |
|
|
|
gdyMaterialOutDto.setOP_FLAG(GeneralDefinition.NO); |
|
|
|
log.info("出窑返给MES的数据:{}", gdyMaterialOutDto); |
|
|
|
|
|
|
|
// 插入mes数据库
|
|
|
|
try { |
|
|
|
mesRequestMapper.insertGdyMaterialOut(gdyMaterialOutDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("出窑-获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
log.error("出窑返给MES的数据:{}", gdyMaterialOutDto); |
|
|
|
log.error("出窑插入mes数据库失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("出窑插入mes数据库失败", "出窑" + gdyMaterialOutDto.getMSGID(), |
|
|
@ -343,7 +349,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
int number = mesRequestMapper.countFPNumber(orderObj.getWorkorder_code(), orderObj.getPoint_code()); |
|
|
|
MdBaseMaterial material = mdBaseMaterialService.getById(orderObj.getMaterial_id()); |
|
|
|
SchBasePoint basePoint = pointService.getById(orderObj.getPoint_code()); |
|
|
|
log.info("统计到设备:{} 不合格砖数:{}", orderObj.getPoint_name(), number); |
|
|
|
|
|
|
|
// 设置字段值
|
|
|
|
MesUnusedDto mesUnusedDto = new MesUnusedDto(); |
|
|
|
mesUnusedDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
@ -361,11 +367,13 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
mesUnusedDto.setPRODATE(orderObj.getProduce_date()); |
|
|
|
mesUnusedDto.setCREATE_TM(DateUtil.now()); |
|
|
|
mesUnusedDto.setOP_FLAG(GeneralDefinition.NO); |
|
|
|
log.info("插入mes机口判废数据库的数据:{}", mesUnusedDto); |
|
|
|
|
|
|
|
// 存入mes数据库
|
|
|
|
try { |
|
|
|
mesRequestMapper.insertMesUnusedInfo(mesUnusedDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("统计到设备:{} 不合格砖数:{}", orderObj.getPoint_name(), number); |
|
|
|
log.error("插入mes机口判废数据库的数据:{}", mesUnusedDto); |
|
|
|
log.error("插入机口判废失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("机口判废插入mes数据库失败", "机口判废" + mesUnusedDto.getMSGID(), |
|
|
@ -386,6 +394,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
try { |
|
|
|
mesRequestMapper.insertQSPressMonitorData(mesQSPressMonitorData); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("插入压机检测数据:{}", mesQSPressMonitorData); |
|
|
|
log.error("插入压机检测失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("压机检测插入mes数据库失败", "压机检测" |
|
|
|