|
|
@ -26,6 +26,7 @@ import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.List; |
|
|
|
import java.util.concurrent.CopyOnWriteArrayList; |
|
|
|
import java.util.stream.Collectors; |
|
|
@ -111,32 +112,32 @@ 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); |
|
|
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
SchBasePoint basePoint = pointService.getById(workorder.getPoint_code()); |
|
|
|
MesProductDataDto mesProductDataDto = new MesProductDataDto(); |
|
|
|
mesProductDataDto.setMSGID(IdUtil.simpleUUID()); |
|
|
|
mesProductDataDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr()); |
|
|
|
mesProductDataDto.setFORDER_NO(mesWorkOrderDto.getFORDER_NO()); |
|
|
|
mesProductDataDto.setPWORKSCHE_ID(mesWorkOrderDto.getPWORKSCHE_ID()); |
|
|
|
mesProductDataDto.setFPRODUCT_MATERIAL_ID(mesWorkOrderDto.getFPRODUCT_MATERIAL_ID()); |
|
|
|
mesProductDataDto.setFPRODUCT_MATERIAL_NAME(mesWorkOrderDto.getFPRODUCT_MATERIAL_NAME()); |
|
|
|
mesProductDataDto.setFMATSPEC(mesProductDataDto.getFMATSPEC()); |
|
|
|
mesProductDataDto.setFMATMODEL(mesProductDataDto.getFMATMODEL()); |
|
|
|
mesProductDataDto.setFMATSPEC(mesWorkOrderDto.getFMATSPEC()); |
|
|
|
mesProductDataDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); |
|
|
|
mesProductDataDto.setBATCHNO(workorder.getBatch_no()); |
|
|
|
mesProductDataDto.setPRESSUNIT(basePoint.getExt_point_code()); |
|
|
|
mesProductDataDto.setFTEAM(workorder.getTeam()); |
|
|
|
mesProductDataDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code()); |
|
|
|
mesProductDataDto.setPRO_SUBNUM(String.valueOf(vehiclematerialgroup.getMaterial_qty()));// 数量
|
|
|
|
mesProductDataDto.setPRO_SUBNUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty()));// 数量
|
|
|
|
mesProductDataDto.setPRO_SUBUNIT("块"); |
|
|
|
mesProductDataDto.setCHECKERIN_TIM(DateUtil.now()); |
|
|
|
mesProductDataDto.setPRODATE(workorder.getProduce_date()); |
|
|
|
mesProductDataDto.setCREATE_TM(DateUtil.now()); |
|
|
|
mesProductDataDto.setOP_FLAG(GeneralDefinition.NO); |
|
|
|
log.info("返给MES的数据:{}", mesProductDataDto); |
|
|
|
log.info("压机产出返给MES的数据:{}", mesProductDataDto); |
|
|
|
// 插入mes数据库
|
|
|
|
try { |
|
|
|
mesRequestMapper.insertProductData(mesProductDataDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("反馈压机产出插入mes数据库失败:{}", workorder); |
|
|
|
log.error("反馈压机产出插入mes数据库失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("反馈压机产出插入mes数据库失败", "压机产出"+mesProductDataDto.getMSGID(), |
|
|
|
NoticeTypeEnum.EXCEPTION.getCode()); |
|
|
@ -153,9 +154,9 @@ 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); |
|
|
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
MesSemiProductionInfoInDto semiProductionInfoInDto = new MesSemiProductionInfoInDto(); |
|
|
|
semiProductionInfoInDto.setMSGID(IdUtil.simpleUUID()); |
|
|
|
semiProductionInfoInDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr()); |
|
|
|
semiProductionInfoInDto.setFORDER_NO(mesWorkOrderDto.getFORDER_NO()); |
|
|
|
semiProductionInfoInDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT()); |
|
|
|
semiProductionInfoInDto.setFSCHEDULE_ID(mesWorkOrderDto.getFSCHEDULE_ID()); |
|
|
@ -167,7 +168,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
semiProductionInfoInDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT()); |
|
|
|
semiProductionInfoInDto.setFTEAM(workorder.getTeam()); |
|
|
|
semiProductionInfoInDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code()); |
|
|
|
semiProductionInfoInDto.setPRO_SUBNUM(String.valueOf(vehiclematerialgroup.getMaterial_qty()));// 数量
|
|
|
|
semiProductionInfoInDto.setPRO_SUBNUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty()));// 数量
|
|
|
|
semiProductionInfoInDto.setPRO_SUBUNIT("块"); |
|
|
|
semiProductionInfoInDto.setCHECKERIN_TIM(DateUtil.now()); |
|
|
|
semiProductionInfoInDto.setPRODATE(workorder.getProduce_date()); |
|
|
@ -178,7 +179,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
try { |
|
|
|
mesRequestMapper.insertSemiProductInfo(semiProductionInfoInDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("入滚筒线插入mes数据库失败:{}", workorder); |
|
|
|
log.error("入滚筒线插入mes数据库失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("入滚筒线插入mes数据库失败", "入滚筒线" + semiProductionInfoInDto.getMSGID(), |
|
|
|
NoticeTypeEnum.EXCEPTION.getCode()); |
|
|
@ -195,16 +196,16 @@ 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); |
|
|
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
MesSemiProductionInfoOutDto semiProductionInfoOutDto = new MesSemiProductionInfoOutDto(); |
|
|
|
semiProductionInfoOutDto.setMSGID(IdUtil.simpleUUID()); |
|
|
|
semiProductionInfoOutDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr()); |
|
|
|
semiProductionInfoOutDto.setSEMIPRODUCT_BATCHNO(workorder.getBatch_no()); |
|
|
|
semiProductionInfoOutDto.setPRODUCT_BATCHNO(workorder.getBatch_no()); |
|
|
|
semiProductionInfoOutDto.setFPRODUCT_MATERIAL_ID(mesWorkOrderDto.getFPRODUCT_MATERIAL_ID()); |
|
|
|
semiProductionInfoOutDto.setFPRODUCT_MATERIAL_NAME(mesWorkOrderDto.getFPRODUCT_MATERIAL_NAME()); |
|
|
|
semiProductionInfoOutDto.setFMATSPEC(mesWorkOrderDto.getFMATSPEC()); |
|
|
|
semiProductionInfoOutDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); |
|
|
|
semiProductionInfoOutDto.setPRO_NUM(String.valueOf(vehiclematerialgroup.getMaterial_qty())); |
|
|
|
semiProductionInfoOutDto.setPRO_NUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty())); |
|
|
|
semiProductionInfoOutDto.setPRO_UNIT("块"); |
|
|
|
semiProductionInfoOutDto.setSTOCK("未知"); |
|
|
|
semiProductionInfoOutDto.setSTOCK_NAME("未知"); |
|
|
@ -217,7 +218,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
try { |
|
|
|
mesRequestMapper.insertSemiProductOutInfo(semiProductionInfoOutDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("出滚筒线插入mes数据库失败:{}", workorder); |
|
|
|
log.error("出滚筒线插入mes数据库失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("入滚筒线插入mes数据库失败", "入滚筒线" + semiProductionInfoOutDto.getMSGID(), |
|
|
|
NoticeTypeEnum.EXCEPTION.getCode()); |
|
|
@ -234,9 +235,9 @@ 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); |
|
|
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
MesGdyMaterialInDto gdyMaterialInDto = new MesGdyMaterialInDto(); |
|
|
|
gdyMaterialInDto.setMSGID(IdUtil.simpleUUID()); |
|
|
|
gdyMaterialInDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr()); |
|
|
|
gdyMaterialInDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code()); |
|
|
|
gdyMaterialInDto.setFPRODUCT_MATERIAL_ID(mesWorkOrderDto.getFPRODUCT_MATERIAL_ID()); |
|
|
|
gdyMaterialInDto.setFPRODUCT_MATERIAL_NAME(mesWorkOrderDto.getFPRODUCT_MATERIAL_NAME()); |
|
|
@ -257,7 +258,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
try { |
|
|
|
mesRequestMapper.insertGdyMaterialIn(gdyMaterialInDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("入窑插入mes数据库失败:{}", workorder); |
|
|
|
log.error("入窑插入mes数据库失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("入窑插入mes数据库失败", "入窑" + gdyMaterialInDto.getMSGID(), |
|
|
|
NoticeTypeEnum.EXCEPTION.getCode()); |
|
|
@ -274,9 +275,9 @@ 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); |
|
|
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto); |
|
|
|
MesGdyMaterialOutDto gdyMaterialOutDto = new MesGdyMaterialOutDto(); |
|
|
|
gdyMaterialOutDto.setMSGID(IdUtil.simpleUUID()); |
|
|
|
gdyMaterialOutDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr()); |
|
|
|
gdyMaterialOutDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code()); |
|
|
|
gdyMaterialOutDto.setFPRODUCT_MATERIAL_ID(mesWorkOrderDto.getFPRODUCT_MATERIAL_ID()); |
|
|
|
gdyMaterialOutDto.setFPRODUCT_MATERIAL_NAME(mesWorkOrderDto.getFPRODUCT_MATERIAL_NAME()); |
|
|
@ -297,7 +298,7 @@ public class WmsToMesServiceImpl implements WmsToMesService { |
|
|
|
try { |
|
|
|
mesRequestMapper.insertGdyMaterialOut(gdyMaterialOutDto); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("出窑插入mes数据库失败:{}", workorder); |
|
|
|
log.error("出窑插入mes数据库失败:{}", e.getMessage()); |
|
|
|
// todo:发送通知
|
|
|
|
noticeService.createNotice("出窑插入mes数据库失败", "出窑" + gdyMaterialOutDto.getMSGID(), |
|
|
|
NoticeTypeEnum.EXCEPTION.getCode()); |
|
|
|