fix bug 44817 离线生成的装配件数据缺少

tags/yfai-mes-ext-v2.8
臧学普 4 months ago
parent 6a90f0f54d
commit 1b61155d64

@ -230,7 +230,9 @@ public class MesBomService extends BaseMesService<MesBom> implements IMesBomServ
public MesBom findBom(String organizeCode, String bomVersion, String partNo) {
DdlPackBean bomPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(partNo, MesExtConstWords.PART_NO, bomPackBean);
if (bomVersion != null){
DdlPreparedPack.getStringEqualPack(bomVersion, MesExtConstWords.BOM_VERSION, bomPackBean);
}
DdlPreparedPack.getOrderBy(MesExtConstWords.EFF_START_TIME, CommonEnumUtil.ASC_OR_DESC.DESC.getValue(), bomPackBean);
List<MesBom> bomList = this.baseRDao.findByHqlTopWhere(bomPackBean,1);
return bomList.isEmpty() ? null : bomList.get(0);

@ -92,9 +92,15 @@ public class MesSortRuleCfgOfflineServiceImpl implements IMesSortRuleCfgOfflineS
if (count > 0){
return;
}
MesProductVersion mesProductVersion = getMesProductVersion(productPartNo, organizeCode);
MesProductVersion mesProductVersion= null;
if (mesPartProdGroup.getEnableBomVersion() == CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()){
mesProductVersion = getMesProductVersion(productPartNo, organizeCode);
}
//4.总成零件号打散bom
String bomVersion = mesProductVersion.getAlternativePartList();
String bomVersion = null;
if (mesProductVersion != null){
bomVersion = mesProductVersion.getAlternativePartList();
}
MesBom bom = mesBomService.findBom(organizeCode, bomVersion, productPartNo);
if (bom == null) {
return;
@ -109,6 +115,9 @@ public class MesSortRuleCfgOfflineServiceImpl implements IMesSortRuleCfgOfflineS
}
//5.打散的bom 获取排序加工规则
List<MesWorkOrderPart> workOrderPartList = dismantleBom(productPartNo, 1, TimeTool.getNowTime(true), bom.getBomCode(), organizeCode, detail.getWorkCellCode());
if (workOrderPartList.isEmpty()){
return;
}
//6.装配件获取的三种条件
String custCode = mesCustomerPart.getCustCode();
MesCustomerCarModel mesCustomerCarModel = getMesCustomerCarModel(custPartNo, organizeCode, custCode);
@ -257,7 +266,7 @@ public class MesSortRuleCfgOfflineServiceImpl implements IMesSortRuleCfgOfflineS
ddlPackBean.setOrderByStr(" order by createDatetime desc ");
List<MesProductVersion> mesProductVersionList = mesProductVersionRDao.findByHqlTopWhere(ddlPackBean, 1);
if (Objects.isNull(mesProductVersionList) || mesProductVersionList.isEmpty()) {
MesException.throwMesBusiException("物料【%s】对应的生产版本信息不存在", partNo);
return null;
}
return mesProductVersionList.get(0);
}

Loading…
Cancel
Save