fix bug 44429,报工异常保存到加工结果报表中

dev-temp-nht-202502180000-customprint
臧学普 5 months ago
parent b775ab0fa1
commit 600ca579b3

@ -295,8 +295,8 @@ public class MesWorkOrderService implements IMesWorkOrderService {
// 递归展开 BOM
expendBomChild(organizeCode, mesPart.getPartNo(), bomVersion, bomData);
if (bomData.size() == 0) {
MesPcnException.throwMesBusiException("零件号 %s 没找找到 ERP 同步的原始 BOM 数据,请检查接口是否正常!", mesPart.getPartNo());
if (bomData.isEmpty()) {
throw new ImppBusiException(String.format("零件号 %s 没找找到 ERP 同步的原始 BOM 数据,请检查接口是否正常!",mesPart.getPartNo()));
}
Iterator<MesBom> iterator = bomData.iterator();
@ -426,8 +426,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
if (e instanceof ImppBusiException) {
msg = ((ImppBusiException) e).getErrorMsg();
}
e.printStackTrace();
LOGGER.error("条码:{}报工失败", productionRecord.getProductSn(), e);
LOGGER.error("条码:{}报工失败,{}", productionRecord.getProductSn(), e.getMessage());
productionRecordService.updateProductionRecord(organizeCode, userName, productionRecord.getId(), msg);
}
}
@ -460,8 +459,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
if (e instanceof ImppBusiException) {
msg = ((ImppBusiException) e).getErrorMsg();
}
e.printStackTrace();
LOGGER.error("条码:{}报工失败", productionRecord.getProductSn(), e);
LOGGER.error(String.format("条码:【%s】报工失败原因:[%s]", productionRecord.getProductSn(), e.getMessage()));
productionRecordService.updateProductionRecord(organizeCode, userName, productionRecord.getId(), msg);
}
@ -526,7 +524,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
DdlPreparedPack.getStringEqualPack(productionRecord.getPartNo(), "partNo", ddlPackBeanPart);
MesPart mesPart = mesPartRDao.getByProperty(ddlPackBeanPart);
if (null == mesPart) {
MesPcnException.throwMesBusiException("物料【%s】信息不存在", productionRecord.getPartNo());
throw new ImppBusiException(String.format("物料【%s】信息不存在", productionRecord.getPartNo()));
}
List<MesBom> mesBoms = findBomList(organizeCode, mesPart, mesProductVersion.getAlternativePartList());
@ -697,13 +695,13 @@ public class MesWorkOrderService implements IMesWorkOrderService {
DdlPreparedPack.getStringEqualPack(workCenterCode, "workCenterCode", ddlPackBean);
MesWorkCenter mesWorkCenter = mesWorkCenterRDao.getByProperty(ddlPackBean);
if (Objects.isNull(mesWorkCenter)) {
MesPcnException.throwMesBusiException("产线【%s】不存在", workCenterCode);
throw new ImppBusiException(String.format("产线【%s】不存在",workCenterCode));
}
List<MesShift> shiftList = mesShiftService.queryMesShift(organizeCode, workCenterCode);
// 如果当前班次是早班
if (CollectionUtils.isEmpty(shiftList)) {
MesPcnException.throwFlowException(String.format("班次信息未维护,产线=%s"), workCenterCode);
throw new ImppBusiException(String.format("班次信息未维护,产线=%s",workCenterCode));
}
List<MesShift> shifts = shiftList.stream().filter(mesShift -> Objects.equals(mesShift.getWorkCenterCode(), workCenterCode)).collect(Collectors.toList());
@ -1132,7 +1130,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
private MesProductVersion getProductVersion(String organizeCode,String partNo,String productVersion) {
MesProductVersion mesProductVersion = mesProductVersionService.getMesProductVersion(organizeCode,partNo,productVersion);
if (null == mesProductVersion) {
MesPcnException.throwMesBusiException("物料【%s】生产版本【%s】信息不存在", partNo, productVersion);
throw new ImppBusiException(String.format("物料【%s】生产版本【%s】信息不存在", partNo, productVersion));
}
return mesProductVersion;
}

Loading…
Cancel
Save