|
|
|
@ -322,12 +322,13 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
|
|
|
|
|
mesProductionRepeatAssembly.setFid(UUID .randomUUID().toString());
|
|
|
|
|
|
|
|
|
|
mesProductionAssembly.setRepeatAssemblySn(sn);
|
|
|
|
|
|
|
|
|
|
mesProduceSn.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.ASSEMBLY_BACK.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(mesProduceSn, mesProduceSn.getCreateUser());
|
|
|
|
|
mesProduceSnRepository.update(mesProduceSn);
|
|
|
|
|
// 更新新替换得条码为已装配
|
|
|
|
|
updateNewSn(mesProduceSn);
|
|
|
|
|
// 更新原条码状态为已拆解
|
|
|
|
|
updateOldSn(mesProductionAssembly);
|
|
|
|
|
// 原装配件记录为已解绑
|
|
|
|
|
mesProductionAssemblyRepository.update(mesProductionAssembly);
|
|
|
|
|
|
|
|
|
|
// 新装配件记录为已装配
|
|
|
|
|
mesProductionAssemblyRepository.save(mesProductionRepeatAssembly);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
@ -343,6 +344,27 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void updateNewSn(MesProduceSn mesProduceSn) {
|
|
|
|
|
mesProduceSn.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.ASSEMBLY.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(mesProduceSn, mesProduceSn.getCreateUser());
|
|
|
|
|
mesProduceSnRepository.update(mesProduceSn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void updateOldSn(MesProductionAssembly mesProductionAssembly) {
|
|
|
|
|
DdlPackBean oldSnPackBean = DdlPackBean.getDdlPackBean();
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(mesProductionAssembly.getProductSn(), "productSn", oldSnPackBean);
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, oldSnPackBean);
|
|
|
|
|
|
|
|
|
|
MesProduceSn oldProduceSn = mesProduceSnRepository.getByProperty(oldSnPackBean);
|
|
|
|
|
if (oldProduceSn == null) {
|
|
|
|
|
MesPcnException.throwFlowException(String.format("原条码信息不存在【%s】", mesProductionAssembly.getProductSn()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
oldProduceSn.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.ASSEMBLY_BACK.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(oldProduceSn, oldProduceSn.getCreateUser());
|
|
|
|
|
mesProduceSnRepository.update(oldProduceSn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private MesPartInspection getMesPartInspection(MesReworkTask mesReworkTask) {
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesReworkTask.getOrganizeCode());
|
|
|
|
|