|
|
|
@ -95,7 +95,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//显示装配件信息
|
|
|
|
|
if (!showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList))
|
|
|
|
|
if (!showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList, false))
|
|
|
|
|
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "当前未查询到相关的装配件清单");
|
|
|
|
|
|
|
|
|
|
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "显示装配件扫描项成功!");
|
|
|
|
@ -110,9 +110,10 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//装配件清单列表标题
|
|
|
|
|
public List<AttrBean> dataAttrList(List<MesProdRuleContext> prodRuleContextList) {
|
|
|
|
|
private List<AttrBean> dataAttrList(List<MesProdRuleContext> prodRuleContextList, Boolean isNeedShowCell) {
|
|
|
|
|
List<AttrBean> attrBeanList = new ArrayList<>();
|
|
|
|
|
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.INDEX, "序号");
|
|
|
|
|
if (isNeedShowCell) PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.WORK_CELL_CODE, "工位代码");
|
|
|
|
|
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.MATCH_TYPE_NAME, "装配方式");
|
|
|
|
|
if (prodRuleContextList.size() > 1) PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.WORK_ORDER_NO, "生产工单编号");
|
|
|
|
|
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.PART_NO, "零件编码");
|
|
|
|
@ -124,8 +125,8 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//每个表格重新排序
|
|
|
|
|
public List<MesAssemblyShowContext> sortAssemblyShowContextList(List<MesAssemblyShowContext> assemblyShowContextList) {
|
|
|
|
|
return assemblyShowContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesAssemblyShowContext::getRouteSeq)).collect(Collectors.toList());
|
|
|
|
|
private List<MesAssemblyShowContext> sortAssemblyShowContextList(List<MesAssemblyShowContext> assemblyShowContextList) {
|
|
|
|
|
return assemblyShowContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesAssemblyShowContext::getProcessSeq).thenComparing(MesAssemblyShowContext::getRouteSeq)).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//查询排序线加工规则装配件数据信息
|
|
|
|
@ -156,10 +157,12 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList) {
|
|
|
|
|
public Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList, Boolean isNeedShowCell) {
|
|
|
|
|
|
|
|
|
|
List<AttrBean> attrBeanList = null;
|
|
|
|
|
|
|
|
|
|
if (isNeedShowCell) isNeedShowCell = checkIsNeedShowCell(reqBean, workCenter, prodRuleContextList);
|
|
|
|
|
|
|
|
|
|
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
|
|
|
|
|
|
|
|
|
|
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
|
|
|
|
@ -169,7 +172,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
|
|
|
|
|
if (CollectionUtils.isEmpty(assemblyShowContextList)) continue;
|
|
|
|
|
|
|
|
|
|
//装配件清单列表标题
|
|
|
|
|
if (CollectionUtils.isEmpty(attrBeanList)) attrBeanList = dataAttrList(prodRuleContextList);
|
|
|
|
|
if (CollectionUtils.isEmpty(attrBeanList)) attrBeanList = dataAttrList(prodRuleContextList, isNeedShowCell);
|
|
|
|
|
|
|
|
|
|
//封装多表格
|
|
|
|
|
resultBean.addStationResultBeans(new StationResultBean().dataType(MesPcnEnumUtil.STATION_DATA_TYPE.TABLE.getValue()).dataAttrList(attrBeanList).resultList(assemblyShowContextList));
|
|
|
|
@ -185,6 +188,15 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//验证是否需要演示工位代码列
|
|
|
|
|
private Boolean checkIsNeedShowCell(StationRequestBean reqBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList) {
|
|
|
|
|
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
|
|
|
|
|
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
|
|
|
|
|
if (!prodRuleContext.getAssemblyDataContext(workCenter).get(0).getWorkCellCode().equals(reqBean.getWorkCellCode())) return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//封装匹配当前设备的装配件信息
|
|
|
|
|
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblyContext> productionAssemblyContextList) {
|
|
|
|
|
if (CollectionUtils.isEmpty(productionAssemblyContextList)) return null;
|
|
|
|
@ -207,7 +219,11 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
|
|
|
|
|
private MesAssemblyShowContext assemblyShowContext(MesProductionAssemblyContext o) {
|
|
|
|
|
MesAssemblyShowContext assemblyShowContext = new MesAssemblyShowContext();
|
|
|
|
|
BeanUtils.copyProperties(o, assemblyShowContext);
|
|
|
|
|
assemblyShowContext.setMatchTypeName(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.valueOfDescription(assemblyShowContext.getMatchType()));
|
|
|
|
|
if (!MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedShowMatchRule(assemblyShowContext.getMatchType())) {
|
|
|
|
|
assemblyShowContext.setMatchTypeName(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.valueOfDescription(assemblyShowContext.getMatchType()));
|
|
|
|
|
} else {
|
|
|
|
|
assemblyShowContext.setMatchTypeName(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.valueOfDescription(assemblyShowContext.getMatchType()) + "【" + assemblyShowContext.getMatchRule() + "】");
|
|
|
|
|
}
|
|
|
|
|
assemblyShowContext.setAssemblyStatusName(MesExtEnumUtil.ASSEMBLY_STATUS.valueOfDescription(o.getAssemblyStatus()));
|
|
|
|
|
if (MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue() != assemblyShowContext.getAssemblyStatus())
|
|
|
|
|
assemblyShowContext.setColor(StringUtils.isEmpty(assemblyShowContext.getShowColor()) ? MesExtEnumUtil.COLOR.GREEN.getValue() : assemblyShowContext.getShowColor());
|
|
|
|
|