tags/yfai-pcn-ext-v1.0
王杰 11 months ago
parent f64efdb8a5
commit 83e887f7af

@ -8,7 +8,6 @@ import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleNosortCfg;
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
import cn.estsh.i3plus.pojo.mes.repository.MesProdRuleNoSortCfgRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@ -41,16 +40,20 @@ public class MesProdRuleCfgExtService implements IMesProdRuleCfgExtService {
DdlPreparedPack.getStringEqualPack(prodRuleContext.getOutPartNo(), MesPcnExtConstWords.OUT_PART_NO, packBean);
DdlPreparedPack.getInPackList(prodRuleContext.getOutPartNoList(), MesPcnExtConstWords.OUT_PART_NO, packBean);
if (prodRuleContext.getInPartIsEmpty()) {
//进料为NULL
DdlPreparedPack.getIsNull(MesPcnExtConstWords.IN_PART_NO, packBean);
DdlPreparedPack.getIsNull(MesPcnExtConstWords.IN_PART_NO_RULE, packBean);
} else {
//inPartNo与inPartNos 带入条件必须互斥 , 此处查询时不作判断
DdlPreparedPack.getStringEqualPack(prodRuleContext.getInPartNo(), MesPcnExtConstWords.IN_PART_NO, packBean);
DdlPreparedPack.getInPackList(prodRuleContext.getInPartNoList(), MesPcnExtConstWords.IN_PART_NO, packBean);
//进料规则有值
if (prodRuleContext.getInPartRuleIsNotEmpty()) DdlPreparedPack.getIsNotNull(MesPcnExtConstWords.IN_PART_NO_RULE, packBean);
//进料是否为NULL
if (!StringUtils.isEmpty(prodRuleContext.getInPartIsEmpty())) {
if (prodRuleContext.getInPartIsEmpty()) DdlPreparedPack.getIsNull(MesPcnExtConstWords.IN_PART_NO, packBean);
else DdlPreparedPack.getIsNotNull(MesPcnExtConstWords.IN_PART_NO, packBean);
}
//进料规则是否为NULL
if (!StringUtils.isEmpty(prodRuleContext.getInPartRuleIsEmpty())) {
if (prodRuleContext.getInPartRuleIsEmpty()) DdlPreparedPack.getIsNull(MesPcnExtConstWords.IN_PART_NO_RULE, packBean);
else DdlPreparedPack.getIsNotNull(MesPcnExtConstWords.IN_PART_NO_RULE, packBean);
}
return prodRuleNoSortCfgRepository.findByHqlWhere(packBean);

@ -141,7 +141,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
MesCellEquipContext cellEquipContext, List<MesProdRuleContext> prodRuleContextList, List<MesProductionPartContext> productionPartContextList, List<String> outPartNoList, Integer foreignKey) {
//【非排序线】获取产品加工规则 ; 条件进料[NULL]
List<MesProdRuleNosortCfg> prodRuleNosortCfgList = prodRuleCfgExtService.getProdRuleNosortCfgList(new MesProdRuleContext(reqBean.getOrganizeCode()).equipmentCode(cellEquipContext.getEquipmentCode()).outPartNos(outPartNoList).inPartIsEmpty());
List<MesProdRuleNosortCfg> prodRuleNosortCfgList = prodRuleCfgExtService.getProdRuleNosortCfgList(new MesProdRuleContext(reqBean.getOrganizeCode()).equipmentCode(cellEquipContext.getEquipmentCode()).outPartNos(outPartNoList).inPartIsEmpty(true).inPartRuleIsEmpty(true));
//根据产出零件分组数据
Map<String, List<MesProdRuleNosortCfg>> prodRuleNosortCfgMap = groupProdRuleNosortCfgList(prodRuleNosortCfgList);
@ -152,7 +152,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
List<MesProdRuleNosortCfg> filterList = !CollectionUtils.isEmpty(prodRuleNosortCfgMap) ? prodRuleNosortCfgMap.get(productionPartContext.getPartNo()) : null;
if (CollectionUtils.isEmpty(filterList) || filterList.size() > 1) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format(
if (CollectionUtils.isEmpty(filterList) || filterList.size() > 1) return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), String.format(
"请检查非排序产品加工规则信息,根据设备[%s]产出零件[%s]进料零件[空]进料零件规则[空]查询到[%s]条加工规则配置信息,无法显示出装配件清单!", cellEquipContext.getEquipmentCode(), productionPartContext.getPartNo(), CollectionUtils.isEmpty(filterList) ? MesPcnExtConstWords.ZERO : filterList.size()));
//【非排序线】获取产品加工规则对应的装配件信息
@ -186,7 +186,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
//进料零件条码匹配进料零件规则
else filterList = (List<MesProdRuleNosortCfg>) numberRuleMatchDispatchService.matchNumberRule(reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), filterProdRuleNosortCfgList(prodRuleNosortCfgList));
if (CollectionUtils.isEmpty(filterList) || filterList.size() > 1) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format(
if (CollectionUtils.isEmpty(filterList) || filterList.size() > 1) return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), String.format(
"请检查非排序产品加工规则信息,根据设备[%s]进料零件条码[%s]查询到[%s]条加工规则配置信息,无法显示出装配件清单!", cellEquipContext.getEquipmentCode(), productionPsInContext.getProductSn(), CollectionUtils.isEmpty(filterList) ? MesPcnExtConstWords.ZERO : filterList.size()));
//TODO 验证时效性
@ -209,7 +209,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
Optional<MesProductionPsInContext> optional = productionPsInContextList.stream().filter(o -> (null != o && StringUtils.isEmpty(o.getForeignKey()) && o.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0 && StringUtils.isEmpty(o.getPartNo()))).findFirst();
List<MesProdRuleNosortCfg> prodRuleNosortCfgList = prodRuleCfgExtService.getProdRuleNosortCfgList(
!CollectionUtils.isEmpty(inPartNoList) ? new MesProdRuleContext(reqBean.getOrganizeCode()).equipmentCode(cellEquipContext.getEquipmentCode()).inPartNos(inPartNoList).outPartNos(outPartNoList) : null,
(null != optional && optional.isPresent()) ? new MesProdRuleContext(reqBean.getOrganizeCode()).equipmentCode(cellEquipContext.getEquipmentCode()).inPartRuleIsNotEmpty().outPartNos(outPartNoList) : null);
(null != optional && optional.isPresent()) ? new MesProdRuleContext(reqBean.getOrganizeCode()).equipmentCode(cellEquipContext.getEquipmentCode()).inPartIsEmpty(true).inPartRuleIsEmpty(false).outPartNos(outPartNoList) : null);
return prodRuleNosortCfgList;
}
@ -260,7 +260,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
}
if (CollectionUtils.isEmpty(innerfilterList) || innerfilterList.size() > 1) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format(
if (CollectionUtils.isEmpty(innerfilterList) || innerfilterList.size() > 1) return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), String.format(
"请检查非排序产品加工规则信息,根据设备[%s]产出零件[%s]匹配任意一个主条码%s查询到[%s]条加工规则配置信息,无法显示出装配件清单!", cellEquipContext.getEquipmentCode(), productionPartContext.getPartNo(),
productionPsInContextList.stream().filter(o -> (null != o && StringUtils.isEmpty(o.getForeignKey()) && o.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).map(MesProductionPsInContext::getProductSn).collect(Collectors.toList()).toString(),
CollectionUtils.isEmpty(innerfilterList) ? MesPcnExtConstWords.ZERO : innerfilterList.size()));

Loading…
Cancel
Save