Merge branch 'dev-wuhan' into dev-wuhan-temp

tags/yfai-pcn-ext-v2.3
王杰 7 months ago
commit 5bfb403b48

@ -15,7 +15,7 @@ public interface IMesAssemblyExtService {
List<MesProductionAssemblySortContext> getProductionAssemblySortContextList(MesProdRuleContext prodRuleContext);
@ApiOperation(value = "【排序线】获取生产工单装配件绑定记录 [前道所有装配件]")
List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, String workCellCode);
List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap);
@ApiOperation(value = "【排序线】获取生产工单装配件清单")
List<MesWorkOrderAssembly> getWorkOrderAssemblyList(MesProdRuleContext prodRuleContext, Boolean isShowAll);

@ -26,7 +26,7 @@ public interface IMesProdRuleCfgExtService {
MesProdRuleContext getProdRuleSortContext(MesProdRuleContext prodRuleContext);
@ApiOperation(value = "【排序线】获取产品加工规则 [前道所有装配件]")
MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, String workCellCode);
MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap);
@ApiOperation(value = "【非排序线】获取产品加工规则 【根据PID获取】")
MesProdRuleNosortCfg getProdRuleNosortCfg(String organizeCode, Long id);

@ -60,8 +60,9 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
//【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, false);
//搜集匹配当前设备的装配件信息
workOrderAssemblyList = CollectionUtils.isEmpty(workOrderAssemblyList) ? null : workOrderAssemblyList.stream().filter(o -> (null != o && o.getEquipmentCode().equals(prodRuleContext.getEquipmentCode()))).collect(Collectors.toList());
// 搜集待装配的数据
workOrderAssemblyList = CollectionUtils.isEmpty(workOrderAssemblyList) ? null : workOrderAssemblyList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0)).collect(Collectors.toList());
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;
@ -77,18 +78,16 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
//【排序线】获取生产工单装配件绑定记录 [前道所有装配件,无爆炸图与音频文件逻辑]
@Override
public List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, String workCellCode) {
public List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap) {
if (null == prodRuleContext) return null;
if (StringUtils.isEmpty(prodRuleContext.getOrganizeCode()) || StringUtils.isEmpty(prodRuleContext.getWorkCenterCode()) || StringUtils.isEmpty(prodRuleContext.getProductSn())) return null;
if (StringUtils.isEmpty(prodRuleContext.getOrganizeCode()) || StringUtils.isEmpty(prodRuleContext.getWorkCenterCode()) ||
StringUtils.isEmpty(prodRuleContext.getWorkCellCode()) || StringUtils.isEmpty(prodRuleContext.getProcessCode()) || StringUtils.isEmpty(prodRuleContext.getProductSn())) return null;
//【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, true);
//搜集匹配当前工位设备及其他工位的的装配件信息
workOrderAssemblyList = CollectionUtils.isEmpty(workOrderAssemblyList) ? null : workOrderAssemblyList.stream().filter(o -> (null != o && (!o.getWorkCellCode().equals(workCellCode) || (o.getWorkCellCode().equals(workCellCode) && o.getEquipmentCode().equals(prodRuleContext.getEquipmentCode()))))).collect(Collectors.toList());
// 搜集非已装配的数据
workOrderAssemblyList = CollectionUtils.isEmpty(workOrderAssemblyList) ? null : workOrderAssemblyList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList());
@ -116,9 +115,11 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(prodRuleContext.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(prodRuleContext.getWorkCenterCode(), MesPcnExtConstWords.WORK_CENTER_CODE, packBean);
DdlPreparedPack.getStringEqualPack(prodRuleContext.getWorkCellCode(), MesPcnExtConstWords.WORK_CELL_CODE, packBean);
DdlPreparedPack.getStringEqualPack(prodRuleContext.getProcessCode(), MesPcnExtConstWords.PROCESS_CODE, packBean);
DdlPreparedPack.getStringEqualPack(prodRuleContext.getProductSn(), MesPcnExtConstWords.PRODUCT_SN, packBean);
if (!isShowAll) {
DdlPreparedPack.getStringEqualPack(prodRuleContext.getWorkCellCode(), MesPcnExtConstWords.WORK_CELL_CODE, packBean);
DdlPreparedPack.getStringEqualPack(prodRuleContext.getProcessCode(), MesPcnExtConstWords.PROCESS_CODE, packBean);
}
return workOrderAssemblyRepository.findByHqlWhere(packBean);

@ -4,6 +4,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEarlyWarningService;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.MesEarlyWarningKanBan;
import cn.estsh.i3plus.pojo.mes.model.MesEarlyWarningKanBanModel;
import cn.estsh.i3plus.pojo.mes.repository.MesEarlyWarningKanBanRepository;
@ -66,6 +67,29 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService {
@Override
public void getData(Long id, String organizeCode) {
DdlPackBean earlyWarningKanBanPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(id,"id",earlyWarningKanBanPackBean);
List<MesEarlyWarningKanBan> list = earlyWarningKanBanRao.findByHqlTopWhere(earlyWarningKanBanPackBean, 1);
if (list.isEmpty()){
//todo return;
}
MesEarlyWarningKanBan kanBan = list.get(0);
//1.获取最近的20条v107信息
DdlPackBean v107PackBean = DdlPackBean.getDdlPackBean(organizeCode);
// DdlPreparedPack.
//2.获取最新的一条报文信息
//3.获取最新的一条报文信息
//4.获取最新工位单号
//5.获取最新下线工单
//6.查询报警产量
//7.获取开班起始时间
//8.根据条件获取工单的数量
}
}

@ -117,8 +117,8 @@ public class MesProdRuleCfgExtService implements IMesProdRuleCfgExtService {
//【排序线】获取产品加工规则 [前道所有装配件]
@Override
public MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, String workCellCode) {
return prodRuleContext.assemblyDataJson(assemblyExtService.getProductionAssemblySortPreCraftContextList(prodRuleContext, workCellMap, workCellCode));
public MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap) {
return prodRuleContext.assemblyDataJson(assemblyExtService.getProductionAssemblySortPreCraftContextList(prodRuleContext, workCellMap));
}

@ -716,6 +716,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
private MesProductOffLine getMesProductOffLine(MesProductionRecord productionRecord, String userName, MesWorkOrder oldMesWorkOrder, MesProductVersion mesProductVersion, MesBom mesBom,String reportSn,boolean isItemReport) {
MesProductOffLine newMesProductOffLine = new MesProductOffLine();
BeanUtils.copyProperties(mesBom, newMesProductOffLine, MesPcnExtConstWords.BASE_BEAN_FIELDS);
newMesProductOffLine.setReportPartNo(mesBom.getPartNo());
newMesProductOffLine.setReportPartNameRdd(mesBom.getPartName());
newMesProductOffLine.setAlort(mesProductVersion.getReceiveInventoryPoint());
@ -725,6 +726,10 @@ public class MesWorkOrderService implements IMesWorkOrderService {
if (mesBom.getPartNo().equals(oldMesWorkOrder.getPartNo())) {
newMesProductOffLine.setReportPartNo(mesBom.getItemPartNo());
newMesProductOffLine.setReportPartNameRdd(mesBom.getItemPartName());
newMesProductOffLine.setItemPartNo(MesPcnExtConstWords.EMPTY);
newMesProductOffLine.setItemPartName(MesPcnExtConstWords.EMPTY);
newMesProductOffLine.setItemUnit(MesPcnExtConstWords.EMPTY);
newMesProductOffLine.setItemQty(0d);
}
newMesProductOffLine.setReportSn(reportSn);
newMesProductOffLine.setSerialNumber(reportSn);
@ -732,14 +737,10 @@ public class MesWorkOrderService implements IMesWorkOrderService {
newMesProductOffLine.setReportSn(productionRecord.getProductSn());
newMesProductOffLine.setSerialNumber(productionRecord.getSerialNumber());
}
newMesProductOffLine.setItemPartNo(mesBom.getItemPartNo());
newMesProductOffLine.setItemPartName(mesBom.getItemPartName());
newMesProductOffLine.setItemQty(mesBom.getItemQty());
newMesProductOffLine.setQty(1d);
newMesProductOffLine.setBomVersion(oldMesWorkOrder.getProductVersion());
newMesProductOffLine.setUnit(mesBom.getUnit());
newMesProductOffLine.setBomCode(mesBom.getBomCode());
newMesProductOffLine.setItemUnit(mesBom.getItemUnit());
newMesProductOffLine.setWorkOrderNo(oldMesWorkOrder.getWorkOrderNo());
newMesProductOffLine.setWorkOrderType(oldMesWorkOrder.getWorkOrderType());
newMesProductOffLine.setWorkCenterCode(oldMesWorkOrder.getWorkCenterCode());

@ -106,7 +106,7 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
//匹配成功 【result=true 代表单次扫描匹配成功; hasUnBindAssembly=false 代表浑腔模式全部匹配成功】
if (result || !hasUnBindAssembly) {
productionDispatchContextStepService.dispatchProdRuleDataContext(reqBean, prodRuleContextList);
((MesAssemblyShowSortStepService) SpringContextsUtil.getBean("mesAssemblyShowSortStepService")).showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), prodRuleContextList, true);
((MesAssemblyShowSortStepService) SpringContextsUtil.getBean("mesAssemblyShowSortStepService")).showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), prodRuleContextList, true, true);
suffix = (isSkip || isCavitySkip) ? stepResult.getMsg() : String.format("装配件条码%s匹配成功!", assemblySn);
}

@ -122,7 +122,7 @@ public class MesAssemblySaveStepService extends BaseStepService {
MesProductionAssembly productionAssembly = new MesProductionAssembly();
BeanUtils.copyProperties(productionAssemblyContext, productionAssembly);
productionAssembly.setDataSource(MesExtEnumUtil.PRODUCTION_ASSEMBLY_DATA_SOURCE.NOSORT.getValue());
productionAssembly.setDataSource(workCenter.getCenterType());
productionAssembly.setIsOrigSn(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
productionAssembly.setAreaCode(reqBean.getWorkCenterCode());
@ -151,11 +151,15 @@ public class MesAssemblySaveStepService extends BaseStepService {
if (null != scanMonitorContext) productionAssembly.setMouldRecordId(scanMonitorContext.getMouldRecordId());
productionAssembly.setOrganizeCode(reqBean.getOrganizeCode());
ConvertBean.serviceModelInitialize(productionAssembly, reqBean.getUserInfo());
productionAssembly.setFid(UUID.randomUUID().toString());
productionAssembly = productionAssemblyRepository.insert(productionAssembly);
if (StringUtils.isEmpty(productionAssembly.getId())) {
ConvertBean.serviceModelInitialize(productionAssembly, reqBean.getUserInfo());
productionAssembly.setFid(UUID.randomUUID().toString());
productionAssembly = productionAssemblyRepository.insert(productionAssembly);
} else {
ConvertBean.serviceModelUpdate(productionAssembly, reqBean.getUserInfo());
productionAssemblyRepository.update(productionAssembly);
}
if (productionAssemblyContext.getMatchType().compareTo(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.MATCH_TYPE_30.getValue()) == 0) saveProductionAssemblyUnique(productionAssembly);
@ -171,6 +175,7 @@ public class MesAssemblySaveStepService extends BaseStepService {
}
private void saveProductionAssemblyUnique(MesProductionAssembly productionAssembly) {
if (productionAssembly.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0) return;
MesProductionAssemblyUnique productionAssemblyUnique = new MesProductionAssemblyUnique();
BeanUtils.copyProperties(productionAssembly, productionAssemblyUnique, MesPcnExtConstWords.ID);
productionAssemblyUnique.setPid(productionAssembly.getId());

@ -434,9 +434,25 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
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, List<MesProdRuleContext> prodRuleContextList) {
//用于获取前端置顶ID
List<MesProductionAssemblyNosortContext> allAssemblyList = new ArrayList<>();
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
List<MesProductionAssemblyNosortContext> productionAssemblyNosortContextList = prodRuleContext.getNosortAssemblyDataContext();
allAssemblyList.addAll(productionAssemblyNosortContextList);
}
//获取前端置顶ID
Long sourceId = getTopSourceId(allAssemblyList);
Boolean isNeedShowMatchRule = checkIsNeedShowMatchRule(reqBean);
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
@ -444,7 +460,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
//封装匹配当前设备的装配件信息
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getAssemblyDataContext(workCenter), isNeedShowMatchRule);
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getAssemblyDataContext(workCenter), isNeedShowMatchRule, sourceId);
if (CollectionUtils.isEmpty(assemblyShowContextList)) continue;
//装配件清单列表标题
@ -464,6 +480,13 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
}
//获取前端置顶ID
private Long getTopSourceId(List<MesProductionAssemblyNosortContext> allAssemblyList) {
if (CollectionUtils.isEmpty(allAssemblyList)) return null;
allAssemblyList = allAssemblyList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getMatchDatetime()))).sorted(Comparator.comparing(MesProductionAssemblyNosortContext::getMatchDatetime).reversed()).collect(Collectors.toList());
return CollectionUtils.isEmpty(allAssemblyList) ? null : allAssemblyList.get(0).getSourceId();
}
//未知腔数配置【工位参数】
private Boolean checkIsNeedShowMatchRule(StationRequestBean reqBean) {
String assemblyShowMrCfg = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ASSEMBLY_SHOW_MR_CFG);
@ -475,13 +498,13 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
}
//封装匹配当前设备的装配件信息
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblyContext> productionAssemblyContextList, Boolean isNeedShowMatchRule) {
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblyContext> productionAssemblyContextList, Boolean isNeedShowMatchRule, Long sourceId) {
if (CollectionUtils.isEmpty(productionAssemblyContextList)) return null;
List<MesAssemblyShowContext> assemblyShowContextList = new ArrayList<>();
for (MesProductionAssemblyContext item : productionAssemblyContextList) {
//不显示且不扫描/仅目视的不显示出来
if (null == item || MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNoShow(item.getMatchType())) continue;
assemblyShowContextList.add(assemblyShowContext(item, isNeedShowMatchRule));
assemblyShowContextList.add(assemblyShowContext(item, isNeedShowMatchRule, sourceId));
}
assemblyShowContextList = assemblyShowContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesAssemblyShowContext::getRouteSeq)).collect(Collectors.toList());
@ -493,13 +516,14 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
}
//封装装配件信息
private MesAssemblyShowContext assemblyShowContext(MesProductionAssemblyContext productionAssemblyContext, Boolean isNeedShowMatchRule) {
private MesAssemblyShowContext assemblyShowContext(MesProductionAssemblyContext productionAssemblyContext, Boolean isNeedShowMatchRule, Long sourceId) {
MesAssemblyShowContext assemblyShowContext = new MesAssemblyShowContext();
BeanUtils.copyProperties(productionAssemblyContext, assemblyShowContext);
if (isNeedShowMatchRule) assemblyShowContext.setMatchTypeName(showMatchRule(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());
if (!StringUtils.isEmpty(sourceId) && !StringUtils.isEmpty(productionAssemblyContext.getSourceId()) && sourceId.compareTo(productionAssemblyContext.getSourceId()) == 0) assemblyShowContext.isTop();
return assemblyShowContext;
}

@ -30,14 +30,13 @@ public class MesAssemblyShowSortPreCraftStepService extends MesAssemblyShowSortS
public MesProdRuleContext getProdRuleSortContext(StationRequestBean reqBean, MesProductionProcessContext productionProcessContext, MesCellEquipContext cellEquipContext, MesProductionPsInContext productionPsInContext) {
Map<String, MesWorkCell> workCellMap = productionProcessContextStepService.dispatchWorkCellMap(reqBean);
//不携带工位工序条件
MesProdRuleContext prodRuleContext = new MesProdRuleContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode())
MesProdRuleContext prodRuleContext = new MesProdRuleContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), reqBean.getProcessCode(), productionProcessContext.getCraftCode())
.equipmentCode(cellEquipContext.getEquipmentCode()).workOrderNo(productionPsInContext.getWorkOrderNo()).productSn(productionPsInContext.getProductSn()).foreignKey(productionPsInContext.getForeignKey());
return prodRuleCfgExtService.getProdRuleSortPreCraftContext(prodRuleContext, workCellMap, reqBean.getWorkCellCode());
return prodRuleCfgExtService.getProdRuleSortPreCraftContext(prodRuleContext, workCellMap);
}
public Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList) {
return showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList, true);
return showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList, true, false);
}
}

@ -163,24 +163,50 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
//显示装配件信息(子类进行重写)
public Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList) {
return showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList, false);
return showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList, false, false);
}
public Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList, Boolean isNeedShowCell) {
//显示或者匹配装配件信息 公共调用
public Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList, Boolean isNeedCheckShowCell, Boolean isNeedCalcTop) {
List<AttrBean> attrBeanList = null;
//用于获取前端置顶ID
List<MesProductionAssemblySortContext> allAssemblyList = null;
//验证是否需要显示工位代码列
Boolean isNeedShowCell = false;
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
List<MesProductionAssemblySortContext> productionAssemblySortContextList = prodRuleContext.getSortAssemblyDataContext();
if (isNeedShowCell) isNeedShowCell = checkIsNeedShowCell(reqBean, prodRuleContextList);
//存在其他工位的装配件的时候需要显示出工位代码列
if (isNeedCheckShowCell && !isNeedShowCell && !productionAssemblySortContextList.get(0).getWorkCellCode().equals(reqBean.getWorkCellCode())) isNeedShowCell = true;
if (isNeedCalcTop) {
if (CollectionUtils.isEmpty(allAssemblyList)) allAssemblyList = new ArrayList<>();
allAssemblyList.addAll(productionAssemblySortContextList);
}
}
//获取前端置顶ID
Long sourceId = getTopSourceId(allAssemblyList);
//装配件显示规则配置
Boolean isNeedShowMatchRule = checkIsNeedShowMatchRule(reqBean);
//列名集合
List<AttrBean> attrBeanList = null;
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
//封装匹配当前设备的装配件信息
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getAssemblyDataContext(workCenter), isNeedShowMatchRule);
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getAssemblyDataContext(workCenter), isNeedShowMatchRule, sourceId);
if (CollectionUtils.isEmpty(assemblyShowContextList)) continue;
//装配件清单列表标题
@ -200,29 +226,27 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
//验证是否需要演示工位代码列
private Boolean checkIsNeedShowCell(StationRequestBean reqBean, List<MesProdRuleContext> prodRuleContextList) {
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
if (!prodRuleContext.getSortAssemblyDataContext().get(0).getWorkCellCode().equals(reqBean.getWorkCellCode())) return true;
}
return false;
//获取前端置顶ID
private Long getTopSourceId(List<MesProductionAssemblySortContext> allAssemblyList) {
if (CollectionUtils.isEmpty(allAssemblyList)) return null;
allAssemblyList = allAssemblyList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getMatchDatetime()))).sorted(Comparator.comparing(MesProductionAssemblySortContext::getMatchDatetime).reversed()).collect(Collectors.toList());
return CollectionUtils.isEmpty(allAssemblyList) ? null : allAssemblyList.get(0).getSourceId();
}
//未知腔数配置【工位参数】
//装配件显示规则配置【工位参数】
private Boolean checkIsNeedShowMatchRule(StationRequestBean reqBean) {
String assemblyShowMrCfg = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ASSEMBLY_SHOW_MR_CFG);
return (!StringUtils.isEmpty(assemblyShowMrCfg) && assemblyShowMrCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? true : false;
}
//封装匹配当前设备的装配件信息
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblyContext> productionAssemblyContextList, Boolean isNeedShowMatchRule) {
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblyContext> productionAssemblyContextList, Boolean isNeedShowMatchRule, Long sourceId) {
if (CollectionUtils.isEmpty(productionAssemblyContextList)) return null;
List<MesAssemblyShowContext> assemblyShowContextList = new ArrayList<>();
for (MesProductionAssemblyContext item : productionAssemblyContextList) {
//不显示且不扫描/仅目视的不显示出来
if (null == item || MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNoShow(item.getMatchType())) continue;
assemblyShowContextList.add(assemblyShowContext(item, isNeedShowMatchRule));
assemblyShowContextList.add(assemblyShowContext(item, isNeedShowMatchRule, sourceId));
}
assemblyShowContextList = sortAssemblyShowContextList(assemblyShowContextList);
@ -234,13 +258,14 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
//封装装配件信息
private MesAssemblyShowContext assemblyShowContext(MesProductionAssemblyContext productionAssemblyContext, Boolean isNeedShowMatchRule) {
private MesAssemblyShowContext assemblyShowContext(MesProductionAssemblyContext productionAssemblyContext, Boolean isNeedShowMatchRule, Long sourceId) {
MesAssemblyShowContext assemblyShowContext = new MesAssemblyShowContext();
BeanUtils.copyProperties(productionAssemblyContext, assemblyShowContext);
if (isNeedShowMatchRule) assemblyShowContext.setMatchTypeName(showMatchRule(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());
if (!StringUtils.isEmpty(sourceId) && !StringUtils.isEmpty(productionAssemblyContext.getSourceId()) && sourceId.compareTo(productionAssemblyContext.getSourceId()) == 0) assemblyShowContext.isTop();
return assemblyShowContext;
}

@ -3,17 +3,16 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService;
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.recyclablepackage.IMesRecyclablePackageBindingLogService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.recyclablepackage.IMesRecyclablePackageBindingService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCollectContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsInContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionRecyclablePackageContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.actor.shipping.dispatch.IFsmCommonService;
import cn.estsh.i3plus.mes.pcn.api.iservice.base.IConfigService;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.pojo.mes.bean.MesConfig;
import cn.estsh.i3plus.pojo.mes.bean.MesProdRouteOptParam;
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
import cn.estsh.i3plus.pojo.mes.bean.recyclablepackage.MesRecyclablePackageBinding;
@ -57,9 +56,6 @@ public class MesProcessMethodSourceBoxInOutStepService extends BaseStepService {
@Autowired
private IConfigService configService;
@Autowired
private IFsmCommonService fsmCommonService;
@Override
public StepResult execute(StationRequestBean reqBean) {
@ -152,9 +148,9 @@ public class MesProcessMethodSourceBoxInOutStepService extends BaseStepService {
createProductionPsInContext(reqBean, stepResult, workCell, equipVariableCollectContextList.iterator().next(), produceSnMap.get(bindingDetail.getProductSn()), productionPsInContextList);
}
}
//没有单独扣减工步时在本工步扣减
Map<String, String> wcpcMap = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean);
if (wcpcMap.containsKey(MesPcnExtConstWords.CONTEXT_UNBINDING_STEP) && !Boolean.parseBoolean(wcpcMap.get(MesPcnExtConstWords.CONTEXT_UNBINDING_STEP))) {
//流程包含解绑工步[工步参数]
Optional<Map<String, MesProdRouteOptParam>> stepParamMap = getStepParams(reqBean);
if ((null != stepParamMap && stepParamMap.isPresent() && stepParamMap.get().containsKey(MesPcnExtConstWords.CONTEXT_UNBINDING_STEP)) && !Boolean.parseBoolean(stepParamMap.get().get(MesPcnExtConstWords.CONTEXT_UNBINDING_STEP).getParamValue())) {
mesRecyclablePackageBindingService.doMesRecyclablePackageUnBinding(recyclablePackageBinding, bindingDetailList, reqBean.getUserInfo());
}
return stepResult;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.ext.mes.pcn.pojo.context;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -61,9 +62,17 @@ public class MesAssemblyShowContext implements Serializable {
@ApiParam("序号")
private Integer index;
@ApiParam(value = "是否置顶")
private Integer isTop = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
public MesAssemblyShowContext index(Integer index){
this.index = index;
return this;
}
public MesAssemblyShowContext isTop(){
this.isTop = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
return this;
}
}

@ -124,11 +124,6 @@ public class MesProdRuleContext implements Serializable {
this.craftCode = craftCode;
}
public MesProdRuleContext(String organizeCode, String workCenterCode) {
this.organizeCode = organizeCode;
this.workCenterCode = workCenterCode;
}
public MesProdRuleContext copy(MesProdRuleNosortCfg prodRuleNosortCfg) {
BeanUtils.copyProperties(prodRuleNosortCfg, this);
this.pid = prodRuleNosortCfg.getId();

@ -116,4 +116,7 @@ public class MesProductionAssemblyContext implements Serializable {
@ApiParam(value = "是否可复用条码是否写入上下文进行复用")
public Integer isRepeat2Cache = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
@ApiParam("匹配时间")
public String matchDatetime;
}

@ -12,6 +12,8 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
/**
@ -78,18 +80,21 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon
public MesProductionAssemblyNosortContext assemblyStatus(String assemblySn) {
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();
this.assemblySn = assemblySn;
matchDatetime();
return this;
}
public MesProductionAssemblyNosortContext assemblySkip() {
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_40.getValue();
this.isSkip = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
matchDatetime();
return this;
}
public MesProductionAssemblyNosortContext assemblyStatusReset() {
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();
this.assemblySn = null;
this.matchDatetime = null;
this.isSkip = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
return this;
}
@ -129,4 +134,6 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon
return this;
}
private void matchDatetime() { this.matchDatetime = (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()); }
}

@ -13,6 +13,8 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
/**
@ -173,12 +175,14 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
public MesProductionAssemblySortContext assemblyStatus(String assemblySn) {
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();
this.assemblySn = assemblySn;
matchDatetime();
return this;
}
public MesProductionAssemblySortContext assemblySkip() {
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_40.getValue();
this.isSkip = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
matchDatetime();
return this;
}
@ -211,4 +215,6 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
return this;
}
private void matchDatetime() { this.matchDatetime = (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()); }
}

@ -307,6 +307,8 @@ public class MesPcnExtConstWords {
public static final Integer MAX_RETRY_TIMES_DEFAULT = 10;
// 非排序需要验证主条码是否是自制件[工步参数]
public static final String NEED_CHECK_IS_PS = "NEED_CHECK_IS_PS";
// 流程包含解绑工步[工步参数]
public static final String CONTEXT_UNBINDING_STEP = "CONTEXT_UNBINDING_STEP";
// 装配件显示规则配置[工位参数]
public static final String ASSEMBLY_SHOW_MR_CFG = "ASSEMBLY_SHOW_MR_CFG";
@ -326,8 +328,6 @@ public class MesPcnExtConstWords {
public static final String ENDLESS_LOOP_READ_TIMES = "ENDLESS_LOOP_READ_TIMES";
// 死循环读取默认默认次数
public static final String ENDLESS_LOOP_READ_TIMES_DEFAULT = "10";
// 流程包含解绑工步
public static final String CONTEXT_UNBINDING_STEP = "CONTEXT_UNBINDING_STEP";
// 工位/工步 参数按钮事件
public static final String FUNCTION_CMD = "FUNCTION_CMD";
@ -529,8 +529,6 @@ public class MesPcnExtConstWords {
//发运解析条码最大长度
public static final String MAX_SHIPPING_BARCODE_LENGTH = "MAX_SHIPPING_BARCODE_LENGTH";
//拆解目标库位
public static final String DISASSEMBLY_DEST_LOCATE = "DISASSEMBLY_DEST_LOCATE";
//裁片工单号
public static final String CUT_WORK_ORDER_NO = "cutWorkOrderNo";
// 条码

Loading…
Cancel
Save