|
|
@ -1,77 +0,0 @@
|
|
|
|
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.MesProductionPsOutContext;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
|
|
|
|
|
|
|
|
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.MesProduceSnRepository;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
|
|
|
import com.google.common.base.Objects;
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @Description : 保存零件条码信息工步
|
|
|
|
|
|
|
|
* @Author : zxw
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
|
|
|
public class MesProductSnSaveStepServiceBak extends BaseStepService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private MesProduceSnRepository mesProduceSnRepository;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final String ORDER_NO_JIS_SORT = "ORDER_NO_JIS_SORT";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public StepResult execute(StationRequestBean reqBean) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StationResultBean resultBean = new StationResultBean();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StepResult stepResult = StepResult.getSuccessComplete();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取加工结果
|
|
|
|
|
|
|
|
String result = mesProductionDispatchContextStepService.getProductResultContext(reqBean);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<MesProductionPsOutContext> mesProduceSnContexts = mesProductionDispatchContextStepService.getProductionPsOutContext(reqBean);
|
|
|
|
|
|
|
|
List<MesProduceSn> mesProduceSns = new ArrayList<>();
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(mesProduceSnContexts)) {
|
|
|
|
|
|
|
|
foundExThrow(reqBean, "条码信息不能为空");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mesProduceSnContexts.forEach(mesProduceSnContext -> {
|
|
|
|
|
|
|
|
MesProduceSn mesProduceSn = new MesProduceSn();
|
|
|
|
|
|
|
|
//todo 要根据不同的加工结果,返回不同的结果 要分排序和非排序, 排序只保存工单对应的装配件、非排序要保存主条码和装配件记录。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果是报废或者可疑,需要编辑条码状态为不合格、并且nc判定需要新增一条记录
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(result) || Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_OK.getValue(), result)) {
|
|
|
|
|
|
|
|
mesProduceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
|
|
|
|
} else if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) {
|
|
|
|
|
|
|
|
mesProduceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue());
|
|
|
|
|
|
|
|
} else if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SUSPICIOUS.getValue(), result)) {
|
|
|
|
|
|
|
|
mesProduceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mesProduceSn.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mesProduceSns.add(mesProduceSn);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
mesProduceSnRepository.saveAll(mesProduceSns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "保存零件条码信息工步");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|