|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCollectContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
|
|
|
@ -45,6 +47,9 @@ public class MesProductionReocrdGenerateStepService extends BaseStepService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesProductionRecordRepository mesProductionRecordRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService;
|
|
|
|
|
|
|
|
|
|
public static final String ORDER_NO_JIS_SORT = "ORDER_NO_JIS_SORT";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -52,12 +57,12 @@ public class MesProductionReocrdGenerateStepService extends BaseStepService {
|
|
|
|
|
public StepResult execute(StationRequestBean reqBean) {
|
|
|
|
|
|
|
|
|
|
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getEquipmentVariableList(reqBean, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue());
|
|
|
|
|
List<MesProduceSn> mesProduceSns = productionProcessContext.getProduceSnDataList();
|
|
|
|
|
List<MesProduceSn> mesProduceSns = mesProductionDispatchContextStepService.getOutProduceSnDataContext(reqBean);
|
|
|
|
|
|
|
|
|
|
List<MesProductionRecord> mesProductionRecords = new ArrayList<>();
|
|
|
|
|
mesProduceSns.forEach(mesProduceSn -> {
|
|
|
|
|
|
|
|
|
|
MesProductionRecord mesProductionRecord = getMesProductionRecord(productionProcessContext, mesProduceSn);
|
|
|
|
|
MesProductionRecord mesProductionRecord = getMesProductionRecord(productionProcessContext, mesProduceSn, reqBean);
|
|
|
|
|
mesProductionRecords.add(mesProductionRecord);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -66,7 +71,7 @@ public class MesProductionReocrdGenerateStepService extends BaseStepService {
|
|
|
|
|
return StepResult.getSuccessComplete();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MesProductionRecord getMesProductionRecord(MesProductionProcessContext productionProcessContext, MesProduceSn mesProduceSn) {
|
|
|
|
|
private MesProductionRecord getMesProductionRecord(MesProductionProcessContext productionProcessContext, MesProduceSn mesProduceSn, StationRequestBean reqBean) {
|
|
|
|
|
MesProductionRecord mesProductionRecord = new MesProductionRecord();
|
|
|
|
|
|
|
|
|
|
mesProductionRecord.setSerialNumber(mesProduceSn.getSerialNumber());
|
|
|
|
@ -80,10 +85,13 @@ public class MesProductionReocrdGenerateStepService extends BaseStepService {
|
|
|
|
|
mesProductionRecord.setEquipmentName(mesProduceSn.getEquipmentName());
|
|
|
|
|
|
|
|
|
|
String mouldNo = "";
|
|
|
|
|
if (productionProcessContext.getFirstMouldNo() != null) {
|
|
|
|
|
mouldNo = productionProcessContext.getFirstMouldNo().getEquipVariableValue();
|
|
|
|
|
}else if (productionProcessContext.getFirstMouldNo() == null && productionProcessContext.getMouldNo() != null){
|
|
|
|
|
mouldNo = productionProcessContext.getMouldNo().getEquipVariableValue();
|
|
|
|
|
MesEquipVariableCollectContext mesFirstMouldNoCollectContext = mesProductionDispatchContextStepService.getFirstMouldNoContext(reqBean);
|
|
|
|
|
MesEquipVariableCollectContext mesMouldNoCollectContext = mesProductionDispatchContextStepService.getMouldNoContext(reqBean);
|
|
|
|
|
|
|
|
|
|
if (mesFirstMouldNoCollectContext != null) {
|
|
|
|
|
mouldNo = mesFirstMouldNoCollectContext.getEquipVariableValue();
|
|
|
|
|
} else if (mesFirstMouldNoCollectContext == null && mesMouldNoCollectContext != null) {
|
|
|
|
|
mouldNo = mesMouldNoCollectContext.getEquipVariableValue();
|
|
|
|
|
}
|
|
|
|
|
mesProductionRecord.setMouldNo(mouldNo);
|
|
|
|
|
// todo
|
|
|
|
|