|
|
|
@ -127,6 +127,9 @@ public class SxRepairWorkService implements ISxRepairWorkService {
|
|
|
|
|
@Override
|
|
|
|
|
public ProduceSnExtModel getProduceSnFrozenBySn(String serialNumber, String organizeCode) {
|
|
|
|
|
|
|
|
|
|
// 是否为已过终检条码
|
|
|
|
|
boolean isFinalCheckAfterSn = false;
|
|
|
|
|
|
|
|
|
|
MesProduceSnMcRecord produceSnMcRecordDb = produceSnMcRecordService.getProduceSnMcRecordDb(organizeCode, serialNumber);
|
|
|
|
|
|
|
|
|
|
MesProduceSnExt produceSnExt = null;
|
|
|
|
@ -155,6 +158,8 @@ public class SxRepairWorkService implements ISxRepairWorkService {
|
|
|
|
|
|
|
|
|
|
produceSnExt = produceSnExtService.getProduceSnExtByProductSn(organizeCode, serialNumber);
|
|
|
|
|
|
|
|
|
|
isFinalCheckAfterSn = true;
|
|
|
|
|
|
|
|
|
|
if (produceSnExt == null) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES_PCN.getCode())
|
|
|
|
@ -230,6 +235,14 @@ public class SxRepairWorkService implements ISxRepairWorkService {
|
|
|
|
|
produceSnExtModel.setSerialNumber(produceSnExtModel.getProductSn());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// lastWorkOrderNo 为空 代表为试制上线管理码
|
|
|
|
|
List<MesBadCellDetail> badCellDetailList = getMesBadCellDetails(organizeCode, isFinalCheckAfterSn, produceSnMcRecordDb, produceSnExt, produceSnExt.getLastWorkOrderNo());
|
|
|
|
|
|
|
|
|
|
badCellDetailList = CollectionUtils.isEmpty(badCellDetailList) ? null :
|
|
|
|
|
badCellDetailList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getRepairStatus()) && MesPcnExtEnumUtil.MES_REPAIR_STATUS.NO_REPAIR.getValue() == o.getRepairStatus())).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isEmpty(badCellDetailList) && produceSnExt.getOperateType() == MesPcnExtEnumUtil.SN_OPERATE_TYPE.REPAIR.getValue()) produceSnExtModel.setIsRepairComplete(true);
|
|
|
|
|
else produceSnExtModel.setIsRepairComplete(false);
|
|
|
|
|
|
|
|
|
|
return produceSnExtModel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -800,7 +813,7 @@ public class SxRepairWorkService implements ISxRepairWorkService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateRepairComplete(String serialNumber, String organizeCode, String modifyUser) {
|
|
|
|
|
public String updateRepairComplete(String serialNumber, String organizeCode, String modifyUser) {
|
|
|
|
|
|
|
|
|
|
// 是否为已过终检条码
|
|
|
|
|
boolean isFinalCheckAfterSn = false;
|
|
|
|
@ -839,28 +852,7 @@ public class SxRepairWorkService implements ISxRepairWorkService {
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MesBadCellDetail> badCellDetailList;
|
|
|
|
|
|
|
|
|
|
// lastWorkOrderNo 为空 代表为试制上线管理码
|
|
|
|
|
if (StringUtils.isEmpty(produceSnExt.getLastWorkOrderNo())) {
|
|
|
|
|
badCellDetailList = badCellDetailRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.THIRD_PARTY_PID},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, StringUtils.isEmpty(produceSnMcRecordDb.getId())});
|
|
|
|
|
} else if (produceSnExt.getLastWorkOrderNo().equals(produceSnExt.getWorkOrderNo())){
|
|
|
|
|
if (isFinalCheckAfterSn) {
|
|
|
|
|
badCellDetailList = badCellDetailRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.PRODUCT_SN},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, produceSnExt.getProductSn()});
|
|
|
|
|
} else {
|
|
|
|
|
badCellDetailList = badCellDetailRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.SERIAL_NUMBER},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, produceSnExt.getSerialNumber()});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
badCellDetailList = badCellDetailRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.PRODUCT_SN},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, produceSnExt.getProductSn()});
|
|
|
|
|
}
|
|
|
|
|
List<MesBadCellDetail> badCellDetailList = getMesBadCellDetails(organizeCode, isFinalCheckAfterSn, produceSnMcRecordDb, produceSnExt, workOrderNo);
|
|
|
|
|
|
|
|
|
|
badCellDetailList = CollectionUtils.isEmpty(badCellDetailList) ? null :
|
|
|
|
|
badCellDetailList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getRepairStatus()) && MesPcnExtEnumUtil.MES_REPAIR_STATUS.NO_REPAIR.getValue() == o.getRepairStatus())).collect(Collectors.toList());
|
|
|
|
@ -872,6 +864,8 @@ public class SxRepairWorkService implements ISxRepairWorkService {
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((produceSnExt.getOperateType() == MesPcnExtEnumUtil.SN_OPERATE_TYPE.QUALIFIED.getValue()) || (produceSnMcRecordDb != null && produceSnMcRecordDb.getOperateType() == MesPcnExtEnumUtil.SN_OPERATE_TYPE.QUALIFIED.getValue())) return "该条码已完成返修,可上线";
|
|
|
|
|
|
|
|
|
|
MesWorkCenterExt workCenterExt = getMesWorkCenterExt(organizeCode, produceSnExt.getWorkCenterCode());
|
|
|
|
|
|
|
|
|
|
if (produceSnMcRecordDb != null) {
|
|
|
|
@ -933,6 +927,32 @@ public class SxRepairWorkService implements ISxRepairWorkService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.info("updateRepairComplete --- 解绑关键件结果:{}" , unbindKeyResult);
|
|
|
|
|
|
|
|
|
|
return "操作成功";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<MesBadCellDetail> getMesBadCellDetails(String organizeCode, boolean isFinalCheckAfterSn, MesProduceSnMcRecord produceSnMcRecordDb, MesProduceSnExt produceSnExt, String workOrderNo) {
|
|
|
|
|
List<MesBadCellDetail> badCellDetailList;
|
|
|
|
|
if (StringUtils.isEmpty(produceSnExt.getLastWorkOrderNo())) {
|
|
|
|
|
badCellDetailList = badCellDetailRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.THIRD_PARTY_PID},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, StringUtils.isEmpty(produceSnMcRecordDb.getId())});
|
|
|
|
|
} else if (produceSnExt.getLastWorkOrderNo().equals(produceSnExt.getWorkOrderNo())){
|
|
|
|
|
if (isFinalCheckAfterSn) {
|
|
|
|
|
badCellDetailList = badCellDetailRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.PRODUCT_SN},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, produceSnExt.getProductSn()});
|
|
|
|
|
} else {
|
|
|
|
|
badCellDetailList = badCellDetailRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.SERIAL_NUMBER},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, produceSnExt.getSerialNumber()});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
badCellDetailList = badCellDetailRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.PRODUCT_SN},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, produceSnExt.getProductSn()});
|
|
|
|
|
}
|
|
|
|
|
return badCellDetailList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|