Merge branch 'dev-temp-castle-2412200948-44429' into dev

dev-temp-nht-202502180000-customprint
王杰 5 months ago
commit 5c568266d8

@ -308,8 +308,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();
@ -351,7 +351,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
private void expendBomChild(String organizeCode, String partNo, String bomVersion, List<MesBom> bomData) {
List<MesBom> bomDetails = findMesBomByPartNoAndBomVersion(partNo, organizeCode, bomVersion);
if (org.springframework.util.CollectionUtils.isEmpty(bomDetails)) {
MesPcnException.throwMesBusiException("物料【%s】生产版本【%s】对应bom信息不存在", partNo, bomVersion);
throw new ImppBusiException(String.format("物料【%s】生产版本【%s】对应bom信息不存在", partNo, bomVersion));
}
for (MesBom item : bomDetails) {
MesBom newItem = new MesBom();
@ -446,8 +446,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);
}
}
@ -480,8 +479,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);
}
@ -546,7 +544,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());
@ -769,13 +767,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());
@ -1208,7 +1206,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