Merge remote-tracking branch 'origin/dev' into dev

tags/yfai-pcn-ext-v1.0
administrator 11 months ago
commit 5c23d7827b

@ -85,7 +85,7 @@ public interface IMesProductionDispatchContextStepService {
Boolean saveProductionPartContext(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList);
@ApiOperation(value = "删除上下文产出零件信息")
void deleteProductionPartContext(StationRequestBean reqBean);
Boolean deleteProductionPartContext(StationRequestBean reqBean);
@ApiOperation(value = "获取上下文零件数据信息")
Map<String, MesPart> getPartDataContext(StationRequestBean reqBean);
@ -154,7 +154,7 @@ public interface IMesProductionDispatchContextStepService {
Boolean saveProductionPsInContext(StationRequestBean reqBean, List<MesProductionPsInContext> productionPsInContextList);
@ApiOperation(value = "删除进料主条码数据")
void deleteProductionPsInContext(StationRequestBean reqBean);
Boolean deleteProductionPsInContext(StationRequestBean reqBean);
@ApiOperation(value = "获取上下文产出条码数据信息集合")
List<MesProductionPsOutContext> getProductionPsOutContext(StationRequestBean reqBean);

@ -13,8 +13,8 @@ public interface IMesProductionRecordService {
/**
*
* @param sn
* @param prodRuleNoSortId
* @param serialNo
* @param sourceId
* @param dataSource ,,
*
* MesExtEnumUtil.TIME_DATA_SOURCE
@ -23,5 +23,5 @@ public interface IMesProductionRecordService {
* DATA_SOURCE30(30, "非排序装配件");
*
*/
Map<String,Object> checkSnTimeliness(String sn, Long prodRuleNoSortId , String organizeCode , Integer dataSource ,Boolean isAssembly);
Map<String, Object> checkSnTimeliness(String organizeCode, String serialNo, Long sourceId, Integer dataSource, Boolean isAssembly);
}

@ -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);
//inPartNo与inPartNos 带入条件必须互斥 , 此处查询时不作判断
DdlPreparedPack.getStringEqualPack(prodRuleContext.getInPartNo(), MesPcnExtConstWords.IN_PART_NO, packBean);
DdlPreparedPack.getInPackList(prodRuleContext.getInPartNoList(), MesPcnExtConstWords.IN_PART_NO, 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);

@ -39,7 +39,7 @@ import java.util.stream.Collectors;
* @Modify:
**/
@Service
public class MesProduceSnPrintServiceImpl implements IMesProduceSnPrintService {
public class MesProduceSnPrintService implements IMesProduceSnPrintService {
@Autowired
private MesPackingDefineDetailsRepository mesPackingDefineDetailsRDao;

@ -1,6 +1,7 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionRecordService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.MesProductionAssembly;
@ -27,7 +28,7 @@ import java.util.stream.Collectors;
* @Modify:
**/
@Service
public class MesProductionRecordServiceImpl implements IMesProductionRecordService {
public class MesProductionRecordService implements IMesProductionRecordService {
@Autowired
private MesTimeEfficientCfgRepository mesTimeEfficientCfgRao;
@ -55,20 +56,20 @@ public class MesProductionRecordServiceImpl implements IMesProductionRecordServi
* DATA_SOURCE20(20, "非排序加工规则"),
* DATA_SOURCE30(30, "非排序装配件");
*
* @param sn
* @param serialNo
* @param sourceId
* @param organizeCode
* @param isAssembly
* @return
*/
@Override
public Map<String, Object> checkSnTimeliness(String sn, Long sourceId ,String organizeCode ,Integer timeDataSource , Boolean isAssembly) {
public Map<String, Object> checkSnTimeliness(String organizeCode, String serialNo, Long sourceId, Integer dataSource, Boolean isAssembly) {
Map<String, Object> resultMap = new HashMap<>();
//校验成功
resultMap.put("result", true);
resultMap.put(MesPcnExtConstWords.RESULT, true);
//1.根据prodRuleNoSortId 获取 非排序加工规则的 时效性数据 --- 当前的条码需要完全匹配查询的规则
DdlPackBean timelinessPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(sourceId,"sourceId",timelinessPackBean);
DdlPreparedPack.getNumEqualPack(sourceId, MesPcnExtConstWords.SOURCE_ID, timelinessPackBean);
List<MesTimeEfficientCfg> timelinessList = mesTimeEfficientCfgRao.findByHqlWhere(timelinessPackBean);
//2.如果timelinessList为空 且 非装配件校验 直接返回true
@ -79,11 +80,11 @@ public class MesProductionRecordServiceImpl implements IMesProductionRecordServi
if (!isAssembly){
//3.根据条码获取生产加工记录结果
DdlPackBean recordPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(sn,"productSn",recordPackBean);
DdlPreparedPack.getStringEqualPack(serialNo, MesPcnExtConstWords.PRODUCT_SN, recordPackBean);
List<MesProductionRecord> recordList = mesProductionRecordRao.findByHqlWhere(recordPackBean);
boolean checkedResult = checkProductSn(recordList, timelinessList);
if (!checkedResult){
resultMap.put("result", false);
resultMap.put(MesPcnExtConstWords.RESULT, false);
return resultMap;
}
}
@ -93,7 +94,7 @@ public class MesProductionRecordServiceImpl implements IMesProductionRecordServi
for (MesTimeEfficientCfg timeliness : timelinessList) {
//需要查询装配件记录表 production_assembly mesProductionAssemblyRao
DdlPackBean assemblyPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(sn,"assemblySn",assemblyPackBean);
DdlPreparedPack.getStringEqualPack(serialNo,"assemblySn",assemblyPackBean);
DdlPreparedPack.getStringEqualPack(timeliness.getCraftCode(),"craftCode",assemblyPackBean);
List<MesProductionAssembly> productionAssemblyList = mesProductionAssemblyRao.findByHqlWhere(assemblyPackBean);

@ -11,7 +11,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*
*
*/
@Slf4j
@Service

@ -28,24 +28,24 @@ public class MesNumberRuleMatchDispatchService implements IMesNumberRuleMatchDis
List<Object> resultList = new ArrayList<>();
if (numberRuleList.get(0) instanceof MesProdRuleNosortCfg) numberRuleList.forEach(o -> matchNumberRule(organizeCode, sn, resultList, o, "mesNumberRuleMatchRegularExpressionService",o, ((MesProdRuleNosortCfg) o).getInPartNoRule()));
if (numberRuleList.get(0) instanceof MesProdRuleNosortCfg) numberRuleList.forEach(o -> matchNumberRule(organizeCode, sn, resultList, "mesNumberRuleMatchRegularExpressionService",o, ((MesProdRuleNosortCfg) o).getInPartNoRule()));
if (numberRuleList.get(0) instanceof MesProductionAssemblyNosortContext) numberRuleList.forEach(o -> matchNumberRule(organizeCode, sn, resultList, o, MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.valueOfStrategyClass(((MesProductionAssemblyNosortContext) o).getMatchType()),o, ((MesProductionAssemblyNosortContext) o).getMatchRule()));
if (numberRuleList.get(0) instanceof MesProductionAssemblyNosortContext) numberRuleList.forEach(o -> matchNumberRule(organizeCode, sn, resultList, MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.valueOfStrategyClass(((MesProductionAssemblyNosortContext) o).getMatchType()),o, ((MesProductionAssemblyNosortContext) o).getMatchRule()));
if (numberRuleList.get(0) instanceof MesProductionAssemblySortContext) numberRuleList.forEach(o -> matchNumberRule(organizeCode, sn, resultList, o, "mesNumberRuleMatchRegularExpressionService",o, ((MesProductionAssemblySortContext) o).getMatchRule()));
if (numberRuleList.get(0) instanceof MesProductionAssemblySortContext) numberRuleList.forEach(o -> matchNumberRule(organizeCode, sn, resultList, "mesNumberRuleMatchRegularExpressionService",o, ((MesProductionAssemblySortContext) o).getMatchRule()));
return resultList;
}
private void matchNumberRule(String organizeCode, String sn, List<Object> resultList, Object o, String strategyClass, Object... params) {
private void matchNumberRule(String organizeCode, String sn, List<Object> resultList, String strategyClass, Object... params) {
if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(sn) || StringUtils.isEmpty(strategyClass) || null == o) return;
if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(sn) || StringUtils.isEmpty(strategyClass) || null == params[0]) return;
Boolean result = ((IMesNumberRuleMatchDispatchService) SpringContextsUtil.getBean(strategyClass)).matchNumberRule(organizeCode, sn, params);
if (result) resultList.add(o);
if (result) resultList.add(params[0]);
}
}

@ -69,11 +69,11 @@ public class MesNumberRuleMatchSnService implements IMesNumberRuleMatchDispatchS
return false;
}
MesProductionAssemblyNosortContext context = (MesProductionAssemblyNosortContext) obj;
context.setProductSnId(mesProduceSn.getId());
if (!Objects.equal(context.getAssemblyPartNo(), mesProduceSn.getPartNo())) {
return false;
}
// 需要校验时效性
return true;
}
}

@ -17,6 +17,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.Date;
@ -84,26 +85,33 @@ public class WriteVariableService implements IWriteVariableService {
MesProductionPartContext mesProductionPartContext;
MesProductionPsOutContext productionPsOutSn;
MesProductionPartContext mesProductionPartContext = null;
MesProductionPsOutContext productionPsOutSn = null;
if (!Objects.isNull(foreignKey)) {
mesProductionPartContext = productionPartContextList.stream().filter(context -> Objects.equals(context.getForeignKey(), foreignKey)).findFirst().orElse(null);
productionPsOutSn = productionPsOutContexts.stream().filter(context -> Objects.equals(context.getForeignKey(), foreignKey)).findFirst().orElse(null);
String newValue = "";
if (!CollectionUtils.isEmpty(productionPartContextList)) {
mesProductionPartContext = productionPartContextList.stream().filter(context -> Objects.equals(context.getForeignKey(), foreignKey)).findFirst().orElse(null);
}
if (!CollectionUtils.isEmpty(productionPsOutContexts)) {
productionPsOutSn = productionPsOutContexts.stream().filter(context -> Objects.equals(context.getForeignKey(), foreignKey)).findFirst().orElse(null);
}
String newValue = "";
if (StringUtils.isEmpty(value)) {
return null;
}
if (mesProductionPartContext == null) {
mesProductionPartContext = new MesProductionPartContext();
}
if (productionPsOutSn == null) {
productionPsOutSn = new MesProductionPsOutContext();
}
switch (value.toUpperCase()) {
case "%RESULT%" : newValue = mesProductionPartContext.getPartNo(); break;
case "%PARAM%": newValue = mesProductionPartContext.getWorkOrderNo(); break;
case "%ORDERCODE%": newValue = mesProductionPartContext.getWorkOrderNo(); break;
case "%CUSTPARTNO%": newValue = mesProductionPartContext.getCustPartNo(); break;
case "%EMPLOYEENO%": newValue = reqBean.getUserInfo(); break;///当前操作员工号 用户名
case "%BARCODE%": newValue = productionPsOutContexts.get(0).getProductSn(); break;// 条码
case "%BARCODE%": newValue = productionPsOutSn.getProductSn(); break;// 条码
case "%BARCODE2%": newValue = productionPsOutContexts.get(1).getProductSn(); break;///条码
case "%BARCODE3%": newValue = productionPsOutContexts.get(2).getProductSn(); break;///条码
case "%BARCODE4%": newValue = productionPsOutContexts.get(3).getProductSn(); break;///条码
@ -131,7 +139,7 @@ public class WriteVariableService implements IWriteVariableService {
case "%PARTNO%": newValue = mesProductionPartContext.getPartNo(); break;///工单对应的零件号
//case "%VINCODE%": newValue = mesProductionPartContext.getv(); break;///工单对应的vincode
case "%SEQUENCE%": newValue = reqBean.getUserInfo(); break;///工单顺序号 不是生产顺序号
case "%CUSTBARCODE%": newValue = productionPsOutContexts.get(0).getCustSn(); break;///客户条码
case "%CUSTBARCODE%": newValue = productionPsOutSn.getCustSn(); break;///客户条码
case "%GETDATE%": newValue = DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN); break;///客户条码
default:

@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNumberRuleMatchDispatchService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionRecordService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
@ -45,6 +46,9 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
@Autowired
private MesAssemblyShowNosortStepService assemblyShowNosortStepService;
@Autowired
private IMesProductionRecordService productionRecordService;
@Override
public StepResult execute(StationRequestBean reqBean) {
@ -179,6 +183,10 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
//匹配失败
if (CollectionUtils.isEmpty(filterList)) continue;
//TODO 判断类型 提示信息
if (!(Boolean) productionRecordService.checkSnTimeliness(
reqBean.getOrganizeCode(), equipVariableCollectContext.getEquipVariableValue(), filterList.get(0).getSourceId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE30.getValue(), true).get(MesPcnExtConstWords.RESULT)) continue;
//匹配成功
equipVariableCollectContext.isConsume();
flag = true;

@ -1,9 +1,6 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNumberRuleMatchDispatchService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProdRuleCfgExtService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
@ -48,6 +45,9 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
@Autowired
private IMesNumberRuleMatchDispatchService numberRuleMatchDispatchService;
@Autowired
private IMesProductionRecordService productionRecordService;
@Override
public StepResult execute(StationRequestBean reqBean) {
@ -86,7 +86,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
//封装非排序加工规则
doHandleProdRuleData(reqBean, resultBean, stepResult, workCenter, productionProcessContext, cellEquipContext, prodRuleContextList, productionPartContextList, productionPsInContextList);
if (!stepResult.isCompleted()) return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, stepResult.getMsg());
if (!stepResult.isCompleted() && doBusiCheckToDelete(reqBean, productionPartContextList, productionPsInContextList)) return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, stepResult.getMsg());
if (prodRuleContextList.size() != initSize) {
//保存上下文产品加工规则信息集合
@ -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,8 +152,11 @@ 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(
"请检查非排序产品加工规则信息,根据设备[%s]产出零件[%s]进料零件[空]进料零件规则[空]查询到[%s]条加工规则配置信息,无法显示出装配件清单!", cellEquipContext.getEquipmentCode(), productionPartContext.getPartNo(), CollectionUtils.isEmpty(filterList) ? MesPcnExtConstWords.ZERO : filterList.size()));
if (CollectionUtils.isEmpty(filterList) || filterList.size() > 1) {
productionPartContext.busiCheckToDelete();
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format(
"请检查非排序产品加工规则信息,根据设备[%s]产出零件[%s]进料零件[空]进料零件规则[空]查询到[%s]条加工规则配置信息,无法显示出装配件清单!", cellEquipContext.getEquipmentCode(), productionPartContext.getPartNo(), CollectionUtils.isEmpty(filterList) ? MesPcnExtConstWords.ZERO : filterList.size()));
}
//【非排序线】获取产品加工规则对应的装配件信息
prodRuleContextList.add(prodRuleCfgExtService.getProdRuleNosortContext(new MesProdRuleContext(
@ -186,11 +189,18 @@ 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(
"请检查非排序产品加工规则信息,根据设备[%s]进料零件条码[%s]查询到[%s]条加工规则配置信息,无法显示出装配件清单!", cellEquipContext.getEquipmentCode(), productionPsInContext.getProductSn(), CollectionUtils.isEmpty(filterList) ? MesPcnExtConstWords.ZERO : filterList.size()));
if (CollectionUtils.isEmpty(filterList) || filterList.size() > 1) {
productionPsInContext.busiCheckToDelete();
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format(
"请检查非排序产品加工规则信息,根据设备[%s]进料零件条码[%s]查询到[%s]条加工规则配置信息,无法显示出装配件清单!", cellEquipContext.getEquipmentCode(), productionPsInContext.getProductSn(), CollectionUtils.isEmpty(filterList) ? MesPcnExtConstWords.ZERO : filterList.size()));
//TODO 验证时效性
//if (!StringUtils.isEmpty(productionPsInContext.getPartNo()) && !时效性接口(productionPsInContext.produceSn, filterList.get(0).getId))
}
if (!StringUtils.isEmpty(productionPsInContext.getPartNo()) && !(Boolean) productionRecordService.checkSnTimeliness(
reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), filterList.get(0).getId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE20.getValue(), false).get(MesPcnExtConstWords.RESULT)) {
productionPsInContext.busiCheckToDelete();
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("请检查进料主条码信息,进料主条码[%s]时效性验证不通过!", productionPsInContext.getProductSn()));
}
//【非排序线】获取产品加工规则对应的装配件信息
prodRuleContextList.add(prodRuleCfgExtService.getProdRuleNosortContext(new MesProdRuleContext(
@ -209,7 +219,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;
}
@ -249,8 +259,11 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
if (CollectionUtils.isEmpty(innerfilterList) || innerfilterList.size() > 1) continue;
//TODO 验证时效性
//if (!StringUtils.isEmpty(productionPsInContext.getPartNo()) && !checkTimeEfficientCfg(reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), filter.getId(), dataSource, stepResult).isComplete()) return stepResult;
if (!StringUtils.isEmpty(productionPsInContext.getPartNo()) && !(Boolean) productionRecordService.checkSnTimeliness(
reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), innerfilterList.get(0).getId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE20.getValue(), false).get(MesPcnExtConstWords.RESULT)) {
productionPsInContext.busiCheckToDelete();
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("请检查进料主条码信息,进料主条码[%s]时效性验证不通过!", productionPsInContext.getProductSn()));
}
productionPartContext.foreignKey(productionPsInContext.foreignKey(foreignKey += 1).getForeignKey());
@ -260,10 +273,18 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
}
if (CollectionUtils.isEmpty(innerfilterList) || innerfilterList.size() > 1) execExpSendMsgAndThrowEx(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()));
if (CollectionUtils.isEmpty(innerfilterList) || innerfilterList.size() > 1) {
productionPsInContextList.forEach(o -> {
if (StringUtils.isEmpty(o.getForeignKey()) || o.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) o.busiCheckToDelete();
});
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, 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()));
}
//【非排序线】获取产品加工规则对应的装配件信息
prodRuleContextList.add(prodRuleCfgExtService.getProdRuleNosortContext(new MesProdRuleContext(
@ -283,7 +304,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
//搜集进料零件规则有值的产品加工规则
private List<MesProdRuleNosortCfg> filterProdRuleNosortCfgList(List<MesProdRuleNosortCfg> prodRuleNosortCfgList) {
return CollectionUtils.isEmpty(prodRuleNosortCfgList) ? null : prodRuleNosortCfgList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getInPartNoRule()))).collect(Collectors.toList());
return CollectionUtils.isEmpty(prodRuleNosortCfgList) ? null : prodRuleNosortCfgList.stream().filter(o -> (null != o && StringUtils.isEmpty(o.getInPartNo()) && !StringUtils.isEmpty(o.getInPartNoRule()))).collect(Collectors.toList());
}
//根据产出零件分组数据
@ -367,4 +388,12 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
return attrBeanList;
}
private Boolean doBusiCheckToDelete(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> productionPsInContextList) {
if (!CollectionUtils.isEmpty(productionPsInContextList)) productionDispatchContextStepService.saveProductionPsInContext(reqBean,
productionPsInContextList.stream().filter(o -> (null != o && o.getBusiCheckToDelete().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).collect(Collectors.toList()));
else if (!CollectionUtils.isEmpty(productionPartContextList)) productionDispatchContextStepService.saveProductionPartContext(reqBean,
productionPartContextList.stream().filter(o -> (null != o && o.getBusiCheckToDelete().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).collect(Collectors.toList()));
return true;
}
}

@ -0,0 +1,402 @@
//package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
//
//import cn.estsh.i3plus.ext.mes.pcn.api.busi.*;
//import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
//import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
//import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
//import cn.estsh.i3plus.mes.pcn.util.PojoAttrUtil;
//import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
//import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
//import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleNosortCfg;
//import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter;
//import cn.estsh.i3plus.pojo.mes.model.AttrBean;
//import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
//import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
//import cn.estsh.i3plus.pojo.mes.model.StepResult;
//import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import org.springframework.util.CollectionUtils;
//import org.springframework.util.StringUtils;
//
//import java.util.*;
//import java.util.concurrent.atomic.AtomicReference;
//import java.util.stream.Collectors;
//
///**
// * @Description : 显示装配件扫描项工步【非排序】
// * @Author : wangjie
// **/
//@Slf4j
//@Service("mesAssemblyShowNosortStepServiceBak")
//public class MesAssemblyShowNosortStepServiceBak extends BaseStepService {
//
// @Autowired
// private IMesProductionProcessContextStepService productionProcessContextStepService;
//
// @Autowired
// private IMesProductionDispatchContextStepService productionDispatchContextStepService;
//
// @Autowired
// private IMesProdRuleCfgExtService prodRuleCfgExtService;
//
// @Autowired
// private IMesNumberRuleMatchDispatchService numberRuleMatchDispatchService;
//
// @Autowired
// private IMesProductionRecordService productionRecordService;
//
// @Override
// public StepResult execute(StationRequestBean reqBean) {
//
// StationResultBean resultBean = new StationResultBean();
//
// StepResult stepResult = StepResult.getSuccessComplete();
//
// //获取上下文信息
// MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean);
//
// //配置错误 抛出异常
// if (!productionProcessContext.getSuccess()) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), productionProcessContext.getMessage());
//
// //存储生产过程上下文对象
// productionProcessContextStepService.saveProductionProcessContext(reqBean, productionProcessContext);
//
// //从上下文中取出生产线对象
// MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
//
// //从上下文中取出生产线对象
// MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip();
//
// //获取上下文加工规则数据信息集合
// List<MesProdRuleContext> prodRuleContextList = productionDispatchContextStepService.getProdRuleDataContext(reqBean);
//
// //获取上下文产出零件数据信息集合
// List<MesProductionPartContext> productionPartContextList = productionDispatchContextStepService.getProductionPartContext(reqBean);
//
// //获取上下文进料零件条码信息集合
// List<MesProductionPsInContext> productionPsInContextList = productionDispatchContextStepService.getProductionPsInContext(reqBean);
//
// //根据现有数据【产出零件数据】【进料零件条码信息】比对上下文中已经存在的加工规则数据信息集合, 没有加工规则的数据进行查询
// if (CollectionUtils.isEmpty(prodRuleContextList)) prodRuleContextList = new ArrayList<>();
// Integer initSize = prodRuleContextList.size();
//
// //封装非排序加工规则
// doHandleProdRuleData(reqBean, resultBean, stepResult, workCenter, productionProcessContext, cellEquipContext, prodRuleContextList, productionPartContextList, productionPsInContextList);
//
// if (!stepResult.isCompleted() && doBusiCheckToDelete(reqBean, productionPartContextList, productionPsInContextList)) return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, stepResult.getMsg());
//
// if (prodRuleContextList.size() != initSize) {
// //保存上下文产品加工规则信息集合
// productionDispatchContextStepService.saveProdRuleDataContext(reqBean, prodRuleContextList);
// //保存上下文产出零件信息
// if (!CollectionUtils.isEmpty(productionPartContextList)) productionDispatchContextStepService.saveProductionPartContext(reqBean, productionPartContextList);
// //保存进料主条码数据
// if (!CollectionUtils.isEmpty(productionPsInContextList)) productionDispatchContextStepService.saveProductionPsInContext(reqBean, productionPsInContextList);
// }
//
// //显示装配件信息
// showProductionAssembly(reqBean, resultBean, workCenter, cellEquipContext, prodRuleContextList, productionPartContextList);
//
// return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "装配件扫描项已查询完毕,请查看!");
// }
//
// private StepResult doHandleProdRuleData(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesWorkCenter workCenter, MesProductionProcessContext productionProcessContext, MesCellEquipContext cellEquipContext,
// List<MesProdRuleContext> prodRuleContextList, List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> productionPsInContextList) {
// //没有【产出零件数据】【进料零件条码信息】,则直接跳过 【当前是生成零件号场景】
// if (CollectionUtils.isEmpty(productionPartContextList) && CollectionUtils.isEmpty(productionPsInContextList)) return stepResult;
//
// //根据进料条件获取匹配加工规则数据(只能查询到一条,否则报错)
// if (CollectionUtils.isEmpty(productionPartContextList)) return doHandleProdRuleDataByProductSn(reqBean, resultBean, stepResult, workCenter, productionProcessContext, cellEquipContext, prodRuleContextList, productionPsInContextList);
// //根据是否存在【产出零件数据】获取剩余待匹配的加工规则数据 (只能查询到一条,否则报错)
// else return doHandleProdRuleDataByProductionPart(reqBean, resultBean, stepResult, workCenter, productionProcessContext, cellEquipContext, prodRuleContextList, productionPartContextList, productionPsInContextList);
//
// }
//
// //根据是否存在【产出零件数据】获取剩余待匹配的加工规则数据 (只能查询到一条,否则报错)
// private StepResult doHandleProdRuleDataByProductionPart(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesWorkCenter workCenter, MesProductionProcessContext productionProcessContext,
// MesCellEquipContext cellEquipContext, List<MesProdRuleContext> prodRuleContextList, List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> productionPsInContextList) {
//
// //加工规则的数据已与产出零件的数量一致
// if (!CollectionUtils.isEmpty(prodRuleContextList) && prodRuleContextList.size() == productionPartContextList.size()) return stepResult;
//
// //拿到当前最大的foreignKey
// Optional<MesProductionPartContext> maxForeignKeyOptional = productionPartContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getForeignKey()))).max(Comparator.comparing(MesProductionPartContext::getForeignKey));
// Integer foreignKey = (null != maxForeignKeyOptional && maxForeignKeyOptional.isPresent()) ? maxForeignKeyOptional.get().getForeignKey() : MesPcnExtConstWords.ZERO;
//
// //搜集未匹配规则的产出零件
// List<String> outPartNoList = productionPartContextList.stream().filter(o -> (null != o && StringUtils.isEmpty(o.getForeignKey()) && !StringUtils.isEmpty(o.getPartNo()))).map(MesProductionPartContext::getPartNo).collect(Collectors.toList());
//
// //没有【进料零件条码信息】信息, 根据进料[NULL]条件获取匹配当前产出零件的加工规则数据(只能查询到一条,否则报错)
// if (CollectionUtils.isEmpty(productionPsInContextList)) return doHandleProdRuleDataByProductionPartAndEmptyProductSn(reqBean, resultBean, stepResult, workCenter, productionProcessContext, cellEquipContext, prodRuleContextList, productionPartContextList, outPartNoList, foreignKey);
// //存在【产出零件数据】信息, 存在【进料零件条码信息】 获取匹配当前产出零件的加工规则数据 (只能查询到一条,否则报错)
// else return doHandleProdRuleDataByProductionPartAndProductSn(reqBean, resultBean, stepResult, workCenter, productionProcessContext, cellEquipContext, prodRuleContextList, productionPartContextList, productionPsInContextList, outPartNoList, foreignKey);
//
// }
//
// //没有【进料零件条码信息】信息, 根据进料[NULL]条件获取匹配当前产出零件的加工规则数据(只能查询到一条,否则报错)
// private StepResult doHandleProdRuleDataByProductionPartAndEmptyProductSn(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesWorkCenter workCenter, MesProductionProcessContext productionProcessContext,
// 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(true));
// //根据产出零件分组数据
// Map<String, List<MesProdRuleNosortCfg>> prodRuleNosortCfgMap = groupProdRuleNosortCfgList(prodRuleNosortCfgList);
//
// for (MesProductionPartContext productionPartContext : productionPartContextList) {
//
// //foreignKey有值代表已经匹配过产品加工规则
// if (null == productionPartContext || productionPartContext.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0 || !StringUtils.isEmpty(productionPartContext.getForeignKey())) continue;
//
// List<MesProdRuleNosortCfg> filterList = !CollectionUtils.isEmpty(prodRuleNosortCfgMap) ? prodRuleNosortCfgMap.get(productionPartContext.getPartNo()) : null;
//
// if (CollectionUtils.isEmpty(filterList) || filterList.size() > 1) {
// if (productionPartContext.getMessageSource().compareTo(MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue()) == 0) productionPartContext.busiCheckToDelete();
// else productionPartContextList.forEach(o -> o.busiCheckToDelete());
// return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format(
// "请检查非排序产品加工规则信息,根据设备[%s]产出零件[%s]进料零件[空]查询到[%s]条加工规则配置信息,无法显示出装配件清单!", cellEquipContext.getEquipmentCode(), productionPartContext.getPartNo(), CollectionUtils.isEmpty(filterList) ? MesPcnExtConstWords.ZERO : filterList.size()));
// }
//
// //【非排序线】获取产品加工规则对应的装配件信息
// prodRuleContextList.add(prodRuleCfgExtService.getProdRuleNosortContext(new MesProdRuleContext(
// reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), reqBean.getProcessCode(), productionProcessContext.getCraftCode()).
// copy(prodRuleNosortCfgList.get(0)).workOrderNo(productionPartContext.getWorkOrderNo()).foreignKey(productionPartContext.foreignKey(foreignKey += 1).getForeignKey())));
//
// }
// return stepResult;
// }
//
// //没有【产出零件数据】信息 , 根据进料条件获取匹配加工规则数据(只能查询到一条,否则报错)
// private StepResult doHandleProdRuleDataByProductSn(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesWorkCenter workCenter, MesProductionProcessContext productionProcessContext,
// MesCellEquipContext cellEquipContext, List<MesProdRuleContext> prodRuleContextList, List<MesProductionPsInContext> productionPsInContextList) {
//
// //【非排序线】获取产品加工规则 ; 分别根据 进料零件有值 与 进料规则不为空 查询 再合并数据返回
// List<MesProdRuleNosortCfg> prodRuleNosortCfgList = getProdRuleNosortCfgList(reqBean, cellEquipContext, productionPsInContextList, null);
//
// //拿到当前最大的foreignKey
// Optional<MesProductionPsInContext> maxForeignKeyOptional = productionPsInContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getForeignKey()))).max(Comparator.comparing(MesProductionPsInContext::getForeignKey));
// Integer foreignKey = (null != maxForeignKeyOptional && maxForeignKeyOptional.isPresent()) ? maxForeignKeyOptional.get().getForeignKey() : MesPcnExtConstWords.ZERO;
//
// for (MesProductionPsInContext productionPsInContext : productionPsInContextList) {
//
// //foreignKey有值代表已经匹配过产品加工规则
// if (null == productionPsInContext || productionPsInContext.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0 || !StringUtils.isEmpty(productionPsInContext.getForeignKey())) continue;
//
// List<MesProdRuleNosortCfg> filterList;
// //搜集进料零件号匹配的产品加工规则
// if (!StringUtils.isEmpty(productionPsInContext.getPartNo())) filterList = filterProdRuleNosortCfgList(prodRuleNosortCfgList, productionPsInContext.getPartNo());
// //进料零件条码匹配进料零件规则
// else filterList = (List<MesProdRuleNosortCfg>) numberRuleMatchDispatchService.matchNumberRule(reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), filterProdRuleNosortCfgList(prodRuleNosortCfgList));
//
// if (CollectionUtils.isEmpty(filterList) || filterList.size() > 1) {
// productionPsInContext.busiCheckToDelete();
// if (productionPsInContext.getMessageSource().compareTo(MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue()) == 0) productionPsInContext.busiCheckToDelete();
// else productionPsInContextList.forEach(o -> o.busiCheckToDelete());
// return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format(
// "请检查非排序产品加工规则信息,根据设备[%s]进料零件条码[%s]查询到[%s]条加工规则配置信息,无法显示出装配件清单!", cellEquipContext.getEquipmentCode(), productionPsInContext.getProductSn(), CollectionUtils.isEmpty(filterList) ? MesPcnExtConstWords.ZERO : filterList.size()));
// }
//
// if (!StringUtils.isEmpty(productionPsInContext.getPartNo()) && !(Boolean) productionRecordService.checkSnTimeliness(
// reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), filterList.get(0).getId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE20.getValue(), false).get(MesPcnExtConstWords.RESULT)) {
// if (productionPsInContext.getMessageSource().compareTo(MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue()) == 0) productionPsInContext.busiCheckToDelete();
// else productionPsInContextList.forEach(o -> o.busiCheckToDelete());
// return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("请检查进料主条码信息,进料主条码[%s]时效性验证不通过!", productionPsInContext.getProductSn()));
// }
//
// //【非排序线】获取产品加工规则对应的装配件信息
// prodRuleContextList.add(prodRuleCfgExtService.getProdRuleNosortContext(new MesProdRuleContext(
// reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), reqBean.getProcessCode(), productionProcessContext.getCraftCode())
// .copy(prodRuleNosortCfgList.get(0)).productSn(productionPsInContext.getProductSn()).foreignKey(productionPsInContext.foreignKey(foreignKey += 1).getForeignKey())));
//
// }
//
// return stepResult;
//
// }
//
// private List<MesProdRuleNosortCfg> getProdRuleNosortCfgList(StationRequestBean reqBean, MesCellEquipContext cellEquipContext, List<MesProductionPsInContext> productionPsInContextList, List<String> outPartNoList) {
// //【非排序线】获取产品加工规则 ; 分别根据 进料零件有值 与 进料规则不为空 查询 再合并数据返回, 条件可能携带产出零件
// List<String> inPartNoList = productionPsInContextList.stream().filter(o -> (null != o && StringUtils.isEmpty(o.getForeignKey()) && !StringUtils.isEmpty(o.getPartNo()))).map(MesProductionPsInContext::getPartNo).collect(Collectors.toList());
// 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()).inPartIsEmpty(true).inPartRuleIsEmpty(false).outPartNos(outPartNoList) : null);
// return prodRuleNosortCfgList;
// }
//
// //存在【产出零件数据】信息, 存在【进料零件条码信息】 获取匹配当前产出零件的加工规则数据 (只能查询到一条,否则报错)
// private StepResult doHandleProdRuleDataByProductionPartAndProductSn(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesWorkCenter workCenter, MesProductionProcessContext productionProcessContext, MesCellEquipContext cellEquipContext,
// List<MesProdRuleContext> prodRuleContextList, List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> productionPsInContextList, List<String> outPartNoList, Integer foreignKey) {
//
// //【非排序线】获取产品加工规则 ; 分别根据 进料零件有值 与 进料规则不为空 查询 再合并数据返回, 条件携带产出零件
// List<MesProdRuleNosortCfg> prodRuleNosortCfgList = getProdRuleNosortCfgList(reqBean, cellEquipContext, productionPsInContextList, outPartNoList);
// //根据产出零件分组数据
// Map<String, List<MesProdRuleNosortCfg>> prodRuleNosortCfgMap = groupProdRuleNosortCfgList(prodRuleNosortCfgList);
//
// for (MesProductionPartContext productionPartContext : productionPartContextList) {
//
// //foreignKey有值代表已经匹配过产品加工规则
// if (null == productionPartContext || productionPartContext.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0 || !StringUtils.isEmpty(productionPartContext.getForeignKey())) continue;
//
// //获取匹配产出零件的所有加工规则
// List<MesProdRuleNosortCfg> outPartNoProdRuleList = !CollectionUtils.isEmpty(prodRuleNosortCfgMap) ? prodRuleNosortCfgMap.get(productionPartContext.getPartNo()) : null;
//
// String productSn = null;
//
// //判断是否还存在待匹配的主条码信息, 内部循环匹配成功会标记 foreignKey
// Optional<MesProductionPsInContext> optional = productionPsInContextList.stream().filter(o -> (null != o && StringUtils.isEmpty(o.getForeignKey()) && o.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
// if (null == optional || !optional.isPresent()) break;
//
// List<MesProdRuleNosortCfg> innerfilterList = null;
// for (MesProductionPsInContext productionPsInContext : productionPsInContextList) {
//
// //foreignKey有值代表已经匹配过产品加工规则
// if (null == productionPsInContext || productionPartContext.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0 || !StringUtils.isEmpty(productionPsInContext.getForeignKey())) continue;
//
// //搜集进料零件号匹配的产品加工规则
// if (!StringUtils.isEmpty(productionPsInContext.getPartNo())) innerfilterList = filterProdRuleNosortCfgList(outPartNoProdRuleList, productionPsInContext.getPartNo());
// //进料零件条码匹配进料零件规则
// else innerfilterList = (List<MesProdRuleNosortCfg>) numberRuleMatchDispatchService.matchNumberRule(reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), filterProdRuleNosortCfgList(outPartNoProdRuleList));
//
// if (CollectionUtils.isEmpty(innerfilterList) || innerfilterList.size() > 1) continue;
//
// if (!StringUtils.isEmpty(productionPsInContext.getPartNo()) && !(Boolean) productionRecordService.checkSnTimeliness(
// reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), innerfilterList.get(0).getId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE20.getValue(), false).get(MesPcnExtConstWords.RESULT)) {
// if (productionPsInContext.getMessageSource().compareTo(MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue()) == 0) productionPsInContext.busiCheckToDelete();
// else productionPsInContextList.forEach(o -> o.busiCheckToDelete());
// return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("请检查进料主条码信息,进料主条码[%s]时效性验证不通过!", productionPsInContext.getProductSn()));
// }
//
// productionPartContext.foreignKey(productionPsInContext.foreignKey(foreignKey += 1).getForeignKey());
//
// productSn = productionPsInContext.getProductSn();
//
// break;
//
// }
//
// if (CollectionUtils.isEmpty(innerfilterList) || innerfilterList.size() > 1) {
//
// if (productionPsInContext.getMessageSource().compareTo(MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue()) == 0) productionPsInContext.busiCheckToDelete();
// else productionPsInContextList.forEach(o -> o.busiCheckToDelete());
//
// return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, 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()));
//
// }
//
// //【非排序线】获取产品加工规则对应的装配件信息
// prodRuleContextList.add(prodRuleCfgExtService.getProdRuleNosortContext(new MesProdRuleContext(
// reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), reqBean.getProcessCode(), productionProcessContext.getCraftCode()).
// copy(innerfilterList.get(0)).workOrderNo(productionPartContext.getWorkOrderNo()).productSn(productSn)).foreignKey(productionPartContext.getForeignKey()));
//
// }
//
// return stepResult;
//
// }
//
// //搜集进料零件号匹配的产品加工规则
// private List<MesProdRuleNosortCfg> filterProdRuleNosortCfgList(List<MesProdRuleNosortCfg> prodRuleNosortCfgList, String partNo) {
// return CollectionUtils.isEmpty(prodRuleNosortCfgList) ? null : prodRuleNosortCfgList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getInPartNo()) && o.getInPartNo().equals(partNo))).collect(Collectors.toList());
// }
//
// //搜集进料零件规则有值的产品加工规则
// private List<MesProdRuleNosortCfg> filterProdRuleNosortCfgList(List<MesProdRuleNosortCfg> prodRuleNosortCfgList) {
// return CollectionUtils.isEmpty(prodRuleNosortCfgList) ? null : prodRuleNosortCfgList.stream().filter(o -> (null != o && StringUtils.isEmpty(o.getInPartNo()) && !StringUtils.isEmpty(o.getInPartNoRule()))).collect(Collectors.toList());
// }
//
// //根据产出零件分组数据
// private Map<String, List<MesProdRuleNosortCfg>> groupProdRuleNosortCfgList(List<MesProdRuleNosortCfg> prodRuleNosortCfgList) {
// return CollectionUtils.isEmpty(prodRuleNosortCfgList) ? null : prodRuleNosortCfgList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesProdRuleNosortCfg::getOutPartNo));
// }
//
// //显示装配件信息
// public Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, MesCellEquipContext cellEquipContext, List<MesProdRuleContext> prodRuleContextList, List<MesProductionPartContext> productionPartContextList) {
//
// Map<Integer, MesProductionPartContext> productionPartMap = productionPartContextList == null ? null : productionPartContextList.stream().filter(o -> null != o && o.getForeignKey() != null).collect(Collectors.toMap(MesProductionPartContext::getForeignKey, o -> o));
//
// for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
//
// if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
//
// String workOrderNo = getWorkOrderNo(productionPartMap, prodRuleContext.getForeignKey());
//
// //封装匹配当前设备的装配件信息
// List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(cellEquipContext, prodRuleContext.getAssemblyDataContext(workCenter), prodRuleContext, workOrderNo);
// if (CollectionUtils.isEmpty(assemblyShowContextList)) continue;
//
// //装配件清单列表标题
// List<AttrBean> attrBeanList = dataAttrList(workOrderNo);
//
// //封装多表格
// resultBean.addStationResultBeans(new StationResultBean().dataType(MesPcnEnumUtil.STATION_DATA_TYPE.TABLE.getValue()).dataAttrList(attrBeanList).resultList(assemblyShowContextList));
//
// }
//
// if (CollectionUtils.isEmpty(resultBean.getStationResultBeans())) return false;
//
// resultBean.busiType(MesPcnEnumUtil.STATION_BUSI_TYPE.STEP_CUSTOM_CONTENT.getValue()).dataType(MesPcnEnumUtil.STATION_DATA_TYPE.TABLES.getValue());
// this.sendMessage(reqBean, resultBean);
//
// return true;
//
// }
//
// private String getWorkOrderNo(Map<Integer, MesProductionPartContext> productionPartMap, Integer foreignKey) {
// return (!CollectionUtils.isEmpty(productionPartMap) && productionPartMap.containsKey(foreignKey)) ? productionPartMap.get(foreignKey).getWorkOrderNo() : null;
// }
//
// //封装匹配当前设备的装配件信息
// private List<MesAssemblyShowContext> getAssemblyShowContextList(MesCellEquipContext cellEquipContext, List<MesProductionAssemblyContext> productionAssemblyContextList, MesProdRuleContext prodRuleContext, String workOrderNo) {
// if (CollectionUtils.isEmpty(productionAssemblyContextList)) return null;
// List<MesAssemblyShowContext> assemblyShowContextList = new ArrayList<>();
// for (MesProductionAssemblyContext item : productionAssemblyContextList) {
// if (null == item) continue;
// assemblyShowContextList.add(assemblyShowContext(item, prodRuleContext, workOrderNo));
// }
//
// assemblyShowContextList = assemblyShowContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesAssemblyShowContext::getRouteSeq)).collect(Collectors.toList());
//
// AtomicReference<Integer> index = new AtomicReference<>(0);
// assemblyShowContextList.forEach(o -> o.index(index.updateAndGet(v -> v + 1)));
//
// return assemblyShowContextList;
// }
//
// //封装装配件信息
// private MesAssemblyShowContext assemblyShowContext(MesProductionAssemblyContext o, MesProdRuleContext prodRuleContext, String workOrderNo) {
// MesAssemblyShowContext assemblyShowContext = new MesAssemblyShowContext();
// BeanUtils.copyProperties(o, assemblyShowContext);
// assemblyShowContext.setAssemblyStatusName(MesExtEnumUtil.ASSEMBLY_STATUS.valueOfDescription(assemblyShowContext.getAssemblyStatus()));
// if (MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue() != assemblyShowContext.getAssemblyStatus())
// assemblyShowContext.setColor(StringUtils.isEmpty(assemblyShowContext.getShowColor()) ? MesExtEnumUtil.COLOR.GREEN.getValue() : assemblyShowContext.getShowColor());
// return assemblyShowContext;
// }
//
// //装配件清单列表标题
// private List<AttrBean> dataAttrList(String workOrderNo) {
// List<AttrBean> attrBeanList = new ArrayList<>();
// PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.INDEX, "序号");
// if (!StringUtils.isEmpty(workOrderNo)) PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.WORK_ORDER_NO, "生产工单编号");
// PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.PART_NO, "零件编码");
// PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.ASSEMBLY_PART_NO, "原料编码");
// PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.ASSEMBLY_PART_NAME, "原料名称");
// PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.ASSEMBLY_SN, "原料条码");
// PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.ASSEMBLY_STATUS_NAME, "装配状态");
// return attrBeanList;
// }
//
// private Boolean doBusiCheckToDelete(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> productionPsInContextList) {
// if (!CollectionUtils.isEmpty(productionPsInContextList)) productionDispatchContextStepService.saveProductionPsInContext(reqBean,
// productionPsInContextList.stream().filter(o -> (null != o && o.getBusiCheckToDelete().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).collect(Collectors.toList()));
// else if (!CollectionUtils.isEmpty(productionPartContextList)) productionDispatchContextStepService.saveProductionPartContext(reqBean,
// productionPartContextList.stream().filter(o -> (null != o && o.getBusiCheckToDelete().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).collect(Collectors.toList()));
// return true;
// }
//
//}

@ -4,22 +4,20 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepSer
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.mes.pcn.util.StationKvBeanUtil;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
import cn.estsh.i3plus.pojo.mes.bean.MesRawPartCharging;
import cn.estsh.i3plus.pojo.mes.model.StationKvBean;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.google.common.base.Objects;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;
@ -40,6 +38,7 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp
@Override
public void doFlushProductionDispatchContext(StationRequestBean reqBean) {
deleteFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean));
this.sendMessage(reqBean, new StationResultBean().busiType(MesPcnEnumUtil.STATION_BUSI_TYPE.STEP_CUSTOM_CONTENT.getValue()).dataType(MesPcnEnumUtil.STATION_DATA_TYPE.TABLES.getValue()));
}
//存储展示组件MODULE_CONTENT内容
@ -163,31 +162,32 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp
deleteFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.FIRST_MOULD_NO_CONTEXT);
}
//获取上下文一模多腔信息
//获取上下文产出零件信息
@Override
public List<MesProductionPartContext> getProductionPartContext(StationRequestBean reqBean) {
String productionPartJson = getFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PART_CONTEXT);
return !StringUtils.isEmpty(productionPartJson) ? JSONObject.parseArray(productionPartJson, MesProductionPartContext.class) : null;
}
//验证上下文一模多腔信息是否存在
//验证上下文产出零件信息是否存在
@Override
public Boolean checkProductionPartIsExistContext(StationRequestBean reqBean) {
String productionPartJson = getFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PART_CONTEXT);
return !StringUtils.isEmpty(productionPartJson) ? true : false;
}
//保存上下文一模多腔信息 [JSON]List<MesProductionPartContext>
//保存上下文产出零件信息 [JSON]List<MesProductionPartContext>
@Override
public Boolean saveProductionPartContext(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList) {
if (CollectionUtils.isEmpty(productionPartContextList)) return false;
if (CollectionUtils.isEmpty(productionPartContextList)) return deleteProductionPartContext(reqBean);
return saveFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PART_CONTEXT, JSONObject.toJSONString(productionPartContextList));
}
//删除上下文一模多腔信息
//删除上下文产出零件信息
@Override
public void deleteProductionPartContext(StationRequestBean reqBean) {
public Boolean deleteProductionPartContext(StationRequestBean reqBean) {
deleteFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PART_CONTEXT);
return true;
}
//获取上下文零件数据信息
@ -335,14 +335,15 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp
//保存上下文进料主条码数据信息集合 [JSON]List<MesProductionPsInContext>
@Override
public Boolean saveProductionPsInContext(StationRequestBean reqBean, List<MesProductionPsInContext> productionPsInContextList) {
if (CollectionUtils.isEmpty(productionPsInContextList)) return false;
if (CollectionUtils.isEmpty(productionPsInContextList)) return deleteProductionPsInContext(reqBean);
return saveFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PS_IN_CONTEXT, JSONObject.toJSONString(productionPsInContextList));
}
//删除上下文进料主条码数据信息集合
@Override
public void deleteProductionPsInContext(StationRequestBean reqBean) {
public Boolean deleteProductionPsInContext(StationRequestBean reqBean) {
deleteFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PS_IN_CONTEXT);
return true;
}
//获取上下文产出条码数据信息集合

@ -99,11 +99,11 @@ public class MesProdRuleContext implements Serializable {
//----------仅作为查询条件冗余-------------
@ApiParam(name = "进料零件号与规则是否均为空")
private Boolean inPartIsEmpty = false;
@ApiParam(name = "进料零件号是否有值")
private Boolean inPartIsEmpty;
@ApiParam(name = "进料规则是否有值")
private Boolean inPartRuleIsNotEmpty = false;
private Boolean inPartRuleIsEmpty;
@ApiParam(name = "进料零件号")
private String inPartNos;
@ -156,13 +156,13 @@ public class MesProdRuleContext implements Serializable {
return this;
}
public MesProdRuleContext inPartIsEmpty() {
this.inPartIsEmpty = true;
public MesProdRuleContext inPartIsEmpty(Boolean isEmpty) {
this.inPartIsEmpty = isEmpty;
return this;
}
public MesProdRuleContext inPartRuleIsNotEmpty() {
this.inPartRuleIsNotEmpty = true;
public MesProdRuleContext inPartRuleIsEmpty(Boolean isEmpty) {
this.inPartRuleIsEmpty = isEmpty;
return this;
}

@ -71,6 +71,10 @@ public class MesProductionPartContext implements Serializable {
@ApiParam("工单序号【用于发送设备加工参数】")
private String workOrderSeq;
//默认否
@ApiParam("业务验证之后需要清除的数据标志")
private Integer busiCheckToDelete = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
//根据一模多腔赋值
public MesProductionPartContext copyMouldMultiCavity(MesMouldMultiCavity mouldMultiCavity) {
BeanUtils.copyProperties(mouldMultiCavity, this, MesPcnExtConstWords.ID);
@ -102,4 +106,9 @@ public class MesProductionPartContext implements Serializable {
return this;
}
public MesProductionPartContext busiCheckToDelete() {
this.busiCheckToDelete = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
return this;
}
}

@ -7,7 +7,6 @@ import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
@ -64,6 +63,9 @@ public class MesProductionPsInContext implements Serializable {
@ApiParam("工艺跳过码")
private String craftJumpCode;
@ApiParam("信息来源")
private Integer messageSource;
//默认否
@ApiParam("是否空腔")
private Integer isFinishCode = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
@ -84,6 +86,10 @@ public class MesProductionPsInContext implements Serializable {
@ApiParam(name = "前道工艺防错结果")
private Integer checkCraftResult = MesPcnExtConstWords.ZERO;
//默认否
@ApiParam("业务验证之后需要清除的数据标志")
private Integer busiCheckToDelete = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
public MesProductionPsInContext() {}
public MesProductionPsInContext foreignKey(Integer foreignKey) {
@ -117,6 +123,11 @@ public class MesProductionPsInContext implements Serializable {
return this;
}
public MesProductionPsInContext messageSource(Integer messageSource) {
this.messageSource = messageSource;
return this;
}
public MesProductionPsInContext(String organizeCode, String productSn) {
this.organizeCode = organizeCode;
this.productSn = productSn;
@ -127,4 +138,9 @@ public class MesProductionPsInContext implements Serializable {
this.isCheck(workCell);
}
public MesProductionPsInContext busiCheckToDelete() {
this.busiCheckToDelete = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
return this;
}
}

@ -127,6 +127,8 @@ public class MesPcnExtConstWords {
public static final String QTY = "qty";
// 工位信息来源
public static final String CELL_MESSAGE_SOURCE = "cellMessageSource";
// 结果
public static final String RESULT = "result";
//设备数据变量读写访问配置

Loading…
Cancel
Save