|
|
|
@ -4,6 +4,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdOrgExtService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesConfigService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesInputDefectRecordService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesPartInspectionInputModel;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesPartInspectionViewModel;
|
|
|
|
@ -28,6 +29,8 @@ import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import com.codepoetics.protonpack.collectors.CollectorUtils;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -97,6 +100,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesProductVersionRepository productVersionRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesProduceSnLogRepository produceSnLogRepository;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesPartInspectionViewModel queryPartInspection(MesPartInspectionInputModel inputModel, String org) {
|
|
|
|
|
|
|
|
|
@ -902,4 +908,42 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "客退品查询")
|
|
|
|
|
public MesProduceSn customerBack(String organizeCode, String sn, String userName) {
|
|
|
|
|
List<MesProduceSn> produceSnList = produceSnExtService.getProduceSnList(organizeCode, sn);
|
|
|
|
|
if (CollectionUtils.isEmpty(produceSnList)) {
|
|
|
|
|
MesPcnException.throwFlowException("条码不存在");
|
|
|
|
|
}
|
|
|
|
|
MesProduceSn mesProduceSn = produceSnList.get(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return mesProduceSn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "客退品提交")
|
|
|
|
|
public void customerBackCommit(String organizeCode, String sn, String userName) {
|
|
|
|
|
|
|
|
|
|
List<MesProduceSn> produceSnList = produceSnExtService.getProduceSnList(organizeCode, sn);
|
|
|
|
|
if (CollectionUtils.isEmpty(produceSnList)) {
|
|
|
|
|
MesPcnException.throwFlowException("条码不存在");
|
|
|
|
|
}
|
|
|
|
|
MesProduceSn produceSn = produceSnList.get(0);
|
|
|
|
|
|
|
|
|
|
MesProduceSnLog produceSnLog = new MesProduceSnLog();
|
|
|
|
|
|
|
|
|
|
if (Objects.equals(produceSn.getSnStatus(), MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue())) {
|
|
|
|
|
MesPcnException.throwFlowException("条码状态不为已发运");
|
|
|
|
|
}
|
|
|
|
|
produceSn.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(produceSn, userName);
|
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
|
|
|
|
|
|
|
produceSnLog.setProductSn(produceSn.getProductSn());
|
|
|
|
|
produceSnLog.setCustSn(produceSn.getCustSn());
|
|
|
|
|
produceSnLog.setOriProductSn(null);
|
|
|
|
|
produceSnLog.setBeforeSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.SHIPPED.getValue());
|
|
|
|
|
produceSnLog.setAfterSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue());
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSnLog, userName);
|
|
|
|
|
produceSnLogRepository.save(produceSnLog);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|