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

tags/yfai-pcn-ext-v2.3
jun 7 months ago
commit 428a3d8884

@ -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);

@ -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));
}

@ -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;
}

@ -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()); }
}

Loading…
Cancel
Save