|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionCustomContextStepService;
|
|
|
|
|
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.*;
|
|
|
|
@ -7,11 +8,13 @@ import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesProductionRecord;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesProductionRecordRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import com.google.common.base.Objects;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -40,6 +43,12 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesProductionRecordRepository productionRecordRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesProductionRecordRepository mesProductionRecordRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesProductionCustomContextStepService productionCustomContextStepService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public StepResult execute(StationRequestBean reqBean) {
|
|
|
|
|
|
|
|
|
@ -50,6 +59,8 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
|
|
|
|
|
//获取上下文信息
|
|
|
|
|
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean);
|
|
|
|
|
|
|
|
|
|
MesWorkCell mesWorkCell = productionProcessContext.getWorkCell();
|
|
|
|
|
|
|
|
|
|
//配置错误 抛出异常
|
|
|
|
|
if (!productionProcessContext.getSuccess()) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), productionProcessContext.getMessage());
|
|
|
|
|
|
|
|
|
@ -82,6 +93,11 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
|
|
|
|
|
//保存上下文产品加工规则信息集合
|
|
|
|
|
productionDispatchContextStepService.saveProdRuleDataContext(reqBean, prodRuleContextList);
|
|
|
|
|
|
|
|
|
|
if (Objects.equal(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(),mesWorkCell.getIsCountFinish())) {
|
|
|
|
|
// 保存班次加工数量上下文
|
|
|
|
|
productionCustomContextStepService.addProductionStatisticsContext(reqBean,productionPsOutContextList.size());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "生成加工记录成功!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|