排序 显示前道所有装配件扫描项

tags/yfai-pcn-ext-v2.3
王杰 8 months ago
parent e9d2615935
commit 8f3dd7bc9b

@ -16,11 +16,14 @@ public interface IMesAssemblyExtService {
@ApiOperation(value = "【排序线】获取生产工单装配件绑定记录")
List<MesProductionAssemblySortContext> getProductionAssemblySortContextList(MesProdRuleContext prodRuleContext);
@ApiOperation(value = "【排序线】获取生产工单装配件绑定记录 [前道所有装配件]")
List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext);
@ApiOperation(value = "【排序线】获取生产工单装配件清单")
List<MesWorkOrderAssembly> getWorkOrderAssemblyList(MesProdRuleContext prodRuleContext);
@ApiOperation(value = "获取装配件绑定记录")
List<MesProductionAssembly> getProductionAssemblyList(String organizeCode, Integer dataSource, List<Long> sourceIdList);
@ApiOperation(value = "获取装配件绑定记录【排序】")
List<MesProductionAssembly> getProductionAssemblySortList(String organizeCode, String productSn);
@ApiOperation(value = "获取装配件绑定记录")
List<MesProductionAssembly> getProductionAssemblyList(String organizeCode, String assemblySn);

@ -23,6 +23,9 @@ public interface IMesProdRuleCfgExtService {
@ApiOperation(value = "【排序线】获取产品加工规则(条码对应的装配件绑定记录,目前条码等同工单)")
MesProdRuleContext getProdRuleSortContext(MesProdRuleContext prodRuleContext);
@ApiOperation(value = "【排序线】获取产品加工规则 [前道所有装配件]")
MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext);
@ApiOperation(value = "【非排序线】获取产品加工规则 【根据PID获取】")
MesProdRuleNosortCfg getProdRuleNosortCfg(String organizeCode, Long id);

@ -11,6 +11,7 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.*;
import cn.estsh.i3plus.pojo.mes.repository.*;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -54,11 +55,11 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
StringUtils.isEmpty(prodRuleContext.getWorkCellCode()) || StringUtils.isEmpty(prodRuleContext.getProcessCode()) || StringUtils.isEmpty(prodRuleContext.getProductSn())) return null;
//【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext);
List<MesWorkOrderAssembly> workOrderAssemblyList = filterWorkOrderAssemblyList(getWorkOrderAssemblyList(prodRuleContext), prodRuleContext.getEquipmentCode());
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;
//获取排序FILE文件URL
//获取排序FILE文件URL 【显示前道所有工序装配件工步不需要获取文件】
Map<Long, String> fileMap = getFileMap(prodRuleContext.getOrganizeCode(), filterSortFileIdList(workOrderAssemblyList));
List<MesProductionAssemblySortContext> productionAssemblySortContextList = new ArrayList<>();
@ -68,6 +69,40 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
return productionAssemblySortContextList;
}
//【排序线】获取生产工单装配件绑定记录 [前道所有装配件]
@Override
public List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext) {
if (null == prodRuleContext) 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 = filterWorkOrderAssemblyList(getWorkOrderAssemblyList(prodRuleContext), prodRuleContext.getEquipmentCode());
// 显示前道所有工序装配件工步: 不携带工位
workOrderAssemblyList = !StringUtils.isEmpty(prodRuleContext.getWorkCellCode()) ? workOrderAssemblyList :
workOrderAssemblyList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList());
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;
//获取装配件绑定记录
Map<Long, List<MesProductionAssembly>> productionAssemblyMap = groupProductionAssembly(getProductionAssemblyList(prodRuleContext.getOrganizeCode(), prodRuleContext.getProductSn()));
List<MesProductionAssemblySortContext> productionAssemblySortContextList = new ArrayList<>();
workOrderAssemblyList.forEach(o -> productionAssemblySortContextList.add(new MesProductionAssemblySortContext().copy(o, getProductionAssembly(productionAssemblyMap, o.getId()))));
return productionAssemblySortContextList;
}
//搜集匹配当前设备的装配件信息
private List<MesWorkOrderAssembly> filterWorkOrderAssemblyList(List<MesWorkOrderAssembly> workOrderAssemblyList, String equipmentCode) {
return CollectionUtils.isEmpty(workOrderAssemblyList) ? null :
workOrderAssemblyList.stream().filter(o -> (null != o && o.getEquipmentCode().equals(equipmentCode))).collect(Collectors.toList());
}
//【排序线】获取生产工单装配件清单
@Override
public List<MesWorkOrderAssembly> getWorkOrderAssemblyList(MesProdRuleContext prodRuleContext) {
@ -87,16 +122,14 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
}
//获取装配件绑定记录
//获取装配件绑定记录【排序】
@Override
public List<MesProductionAssembly> getProductionAssemblyList(String organizeCode, Integer dataSource, List<Long> sourceIdList) {
public List<MesProductionAssembly> getProductionAssemblySortList(String organizeCode, String productSn) {
if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(dataSource) || CollectionUtils.isEmpty(sourceIdList)) return null;
if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(productSn)) return null;
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(dataSource, MesPcnExtConstWords.DATD_SOURCE, packBean);
if (sourceIdList.size() == 1) DdlPreparedPack.getNumEqualPack(sourceIdList.get(0), MesPcnExtConstWords.SOURCE_ID, packBean);
else DdlPreparedPack.getInPackList(sourceIdList, MesPcnExtConstWords.SOURCE_ID, packBean);
DdlPreparedPack.getStringEqualPack(productSn, MesPcnExtConstWords.PRODUCT_SN, packBean);
return productionAssemblyRepository.findByHqlWhere(packBean);
@ -237,4 +270,14 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
return CollectionUtils.isEmpty(fileIdList) ? null : fileDbList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getFileUrl()))).collect(Collectors.toMap(MesFile::getId, MesFile::getFileUrl));
}
//根据生产工单装配件清单ID分组
private Map<Long, List<MesProductionAssembly>> groupProductionAssembly(List<MesProductionAssembly> productionAssemblyList) {
return CollectionUtils.isEmpty(productionAssemblyList) ? null : productionAssemblyList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) >= 0)).collect(Collectors.groupingBy(MesProductionAssembly::getSourceId));
}
//根据装配件清单ID获取装配件绑定记录
private MesProductionAssembly getProductionAssembly(Map<Long, List<MesProductionAssembly>> productionAssemblyMap, Long id) {
return CollectionUtils.isEmpty(productionAssemblyMap) ? null : productionAssemblyMap.get(id).get(0);
}
}

@ -113,5 +113,11 @@ public class MesProdRuleCfgExtService implements IMesProdRuleCfgExtService {
return prodRuleContext.assemblyDataJson(assemblyExtService.getProductionAssemblySortContextList(prodRuleContext));
}
//【排序线】获取产品加工规则 [前道所有装配件]
@Override
public MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext) {
return prodRuleContext.assemblyDataJson(assemblyExtService.getProductionAssemblySortPreCraftContextList(prodRuleContext));
}
}

@ -0,0 +1,57 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
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.util.PojoAttrUtil;
import cn.estsh.i3plus.pojo.mes.model.AttrBean;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.model.StepResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description :
* @Author : wangjie
**/
@Slf4j
@Service("mesAssemblyShowSortPreCraftStepService")
public class MesAssemblyShowSortPreCraftStepService extends MesAssemblyShowSortStepService {
@Override
public StepResult execute(StationRequestBean reqBean) {
return super.execute(reqBean);
}
public MesProdRuleContext getProdRuleSortContext(StationRequestBean reqBean, MesProductionProcessContext productionProcessContext, MesCellEquipContext cellEquipContext, MesProductionPsInContext productionPsInContext) {
//不携带工位工序条件
MesProdRuleContext prodRuleContext = new MesProdRuleContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode())
.equipmentCode(cellEquipContext.getEquipmentCode()).workOrderNo(productionPsInContext.getWorkOrderNo()).productSn(productionPsInContext.getProductSn()).foreignKey(productionPsInContext.getForeignKey());
return prodRuleCfgExtService.getProdRuleSortPreCraftContext(prodRuleContext);
}
//装配件清单列表标题
public List<AttrBean> dataAttrList(List<MesProdRuleContext> prodRuleContextList) {
List<AttrBean> attrBeanList = new ArrayList<>();
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.INDEX, "序号");
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, "零件编码");
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;
}
//每个表格重新排序
public List<MesAssemblyShowContext> sortAssemblyShowContextList(List<MesAssemblyShowContext> assemblyShowContextList) {
return assemblyShowContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesAssemblyShowContext::getProcessSeq).thenComparing(MesAssemblyShowContext::getRouteSeq)).collect(Collectors.toList());
}
}

@ -38,13 +38,13 @@ import java.util.stream.Collectors;
public class MesAssemblyShowSortStepService extends BaseStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
public IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
public IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesProdRuleCfgExtService prodRuleCfgExtService;
public IMesProdRuleCfgExtService prodRuleCfgExtService;
@Override
public StepResult execute(StationRequestBean reqBean) {
@ -82,7 +82,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
Integer initSize = prodRuleContextList.size();
//封装排序加工规则
doHandleProdRuleData(reqBean, resultBean, productionProcessContext, prodRuleContextList, productionPartContextList, productionPsInContextList);
doHandleProdRuleData(reqBean, resultBean, productionProcessContext, cellEquipContext, prodRuleContextList, productionPartContextList, productionPsInContextList);
if (prodRuleContextList.size() != initSize) {
//保存上下文产品加工规则信息集合
@ -94,15 +94,41 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
//显示装配件信息
if (!showProductionAssembly(reqBean, resultBean, workCenter, cellEquipContext, prodRuleContextList))
if (!showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList))
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, "显示装配件扫描项成功!");
}
public MesProdRuleContext getProdRuleSortContext(StationRequestBean reqBean, MesProductionProcessContext productionProcessContext, MesCellEquipContext cellEquipContext, MesProductionPsInContext productionPsInContext) {
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.getProdRuleSortContext(prodRuleContext);
}
//装配件清单列表标题
public List<AttrBean> dataAttrList(List<MesProdRuleContext> prodRuleContextList) {
List<AttrBean> attrBeanList = new ArrayList<>();
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.INDEX, "序号");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.MATCH_TYPE_NAME, "装配方式");
if (prodRuleContextList.size() > 1) 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;
}
//每个表格重新排序
public List<MesAssemblyShowContext> sortAssemblyShowContextList(List<MesAssemblyShowContext> assemblyShowContextList) {
return assemblyShowContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesAssemblyShowContext::getRouteSeq)).collect(Collectors.toList());
}
//查询排序线加工规则装配件数据信息
private void doHandleProdRuleData(StationRequestBean reqBean, StationResultBean resultBean, MesProductionProcessContext productionProcessContext,
private void doHandleProdRuleData(StationRequestBean reqBean, StationResultBean resultBean, MesProductionProcessContext productionProcessContext, MesCellEquipContext cellEquipContext,
List<MesProdRuleContext> prodRuleContextList, List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> productionPsInContextList) {
//上下文中不存在进料主条码数据信息
@ -119,15 +145,15 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
if (null == productionPsInContext || productionPsInContext.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0 || !StringUtils.isEmpty(productionPsInContext.getForeignKey())) continue;
//【排序线】获取产品加工规则(条码对应的装配件绑定记录,目前条码等同工单)
prodRuleContextList.add(prodRuleCfgExtService.getProdRuleSortContext(
new MesProdRuleContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), reqBean.getProcessCode(), productionProcessContext.getCraftCode()).workOrderNo(productionPsInContext.getWorkOrderNo()).productSn(productionPsInContext.getProductSn()).foreignKey(
productionPartContextList.stream().filter(o -> (null != o && o.getWorkOrderNo().equals(productionPsInContext.getWorkOrderNo()))).findFirst().get().foreignKey(productionPsInContext.foreignKey(foreignKey += 1).getForeignKey()).getForeignKey())));
productionPartContextList.stream().filter(o -> (null != o && o.getWorkOrderNo().equals(productionPsInContext.getWorkOrderNo()))).findFirst().get().foreignKey(productionPsInContext.foreignKey(foreignKey += 1).getForeignKey());
prodRuleContextList.add(getProdRuleSortContext(reqBean, productionProcessContext, cellEquipContext, productionPsInContext));
}
}
private Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, MesCellEquipContext cellEquipContext, List<MesProdRuleContext> prodRuleContextList) {
private Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList) {
List<AttrBean> attrBeanList = null;
@ -136,7 +162,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
//封装匹配当前设备的装配件信息
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(cellEquipContext, prodRuleContext.getAssemblyDataContext(workCenter));
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getAssemblyDataContext(workCenter));
if (CollectionUtils.isEmpty(assemblyShowContextList)) continue;
//装配件清单列表标题
@ -157,8 +183,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
//封装匹配当前设备的装配件信息
private List<MesAssemblyShowContext> getAssemblyShowContextList(MesCellEquipContext cellEquipContext, List<MesProductionAssemblyContext> productionAssemblyContextList) {
productionAssemblyContextList = filterProductionAssemblyContextList(cellEquipContext, productionAssemblyContextList);
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblyContext> productionAssemblyContextList) {
if (CollectionUtils.isEmpty(productionAssemblyContextList)) return null;
List<MesAssemblyShowContext> assemblyShowContextList = new ArrayList<>();
for (MesProductionAssemblyContext item : productionAssemblyContextList) {
@ -166,7 +191,8 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
if (null == item || MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNoShow(item.getMatchType())) continue;
assemblyShowContextList.add(assemblyShowContext(item));
}
assemblyShowContextList = assemblyShowContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesAssemblyShowContext::getRouteSeq)).collect(Collectors.toList());
assemblyShowContextList = sortAssemblyShowContextList(assemblyShowContextList);
AtomicReference<Integer> index = new AtomicReference<>(0);
assemblyShowContextList.forEach(o -> o.index(index.updateAndGet(v -> v + 1)));
@ -174,11 +200,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
return assemblyShowContextList;
}
//搜集匹配当前设备的装配件信息
private List<MesProductionAssemblyContext> filterProductionAssemblyContextList(MesCellEquipContext cellEquipContext, List<MesProductionAssemblyContext> productionAssemblyContextList) {
return CollectionUtils.isEmpty(productionAssemblyContextList) ? null :
productionAssemblyContextList.stream().filter(o -> (null != o && o.getEquipmentCode().equals(cellEquipContext.getEquipmentCode()))).collect(Collectors.toList());
}
//封装装配件信息
private MesAssemblyShowContext assemblyShowContext(MesProductionAssemblyContext o) {
@ -191,18 +213,4 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
return assemblyShowContext;
}
//装配件清单列表标题
private List<AttrBean> dataAttrList(List<MesProdRuleContext> prodRuleContextList) {
List<AttrBean> attrBeanList = new ArrayList<>();
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.INDEX, "序号");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.MATCH_TYPE_NAME, "装配方式");
if (prodRuleContextList.size() > 1) 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;
}
}

@ -1,8 +1,6 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesAssemblyExtService;
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.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsInContext;
@ -34,12 +32,6 @@ import java.util.stream.Collectors;
public class MesProdCraftRouteCheckNosortStepService extends MesProdCraftRouteCheckStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesProductionRecordService productionRecordService;
@Autowired

@ -1,8 +1,6 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesAssemblyExtService;
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.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsInContext;
@ -33,12 +31,6 @@ import java.util.stream.Collectors;
public class MesProdCraftRouteCheckSortStepService extends MesProdCraftRouteCheckStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesProductionRecordService productionRecordService;
@Autowired

@ -33,10 +33,10 @@ import java.util.Optional;
public class MesProdCraftRouteCheckStepService extends BaseStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
public IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
public IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IFsmRouteDataService fsmRouteDataService;

@ -1,6 +1,8 @@
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.api.busi.IMesAssemblyExtService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesWorkOrderExtService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPartContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
@ -31,12 +33,6 @@ import java.util.stream.Collectors;
public class MesProduceSeqCheckCustOrderNoStepService extends MesProduceSeqCheckStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesWorkOrderExtService workOrderExtService;
@Autowired

@ -1,6 +1,8 @@
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.api.busi.IMesAssemblyExtService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesWorkOrderExtService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPartContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
@ -32,12 +34,6 @@ import java.util.stream.Collectors;
public class MesProduceSeqCheckNosortStepService extends MesProduceSeqCheckStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesWorkOrderExtService workOrderExtService;
@Autowired

@ -1,6 +1,8 @@
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.api.busi.IMesAssemblyExtService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesWorkOrderExtService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPartContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
@ -34,12 +36,6 @@ import java.util.stream.Collectors;
public class MesProduceSeqCheckSortStepService extends MesProduceSeqCheckStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesWorkOrderExtService workOrderExtService;
@Autowired

@ -29,10 +29,10 @@ import java.util.Optional;
public class MesProduceSeqCheckStepService extends BaseStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
public IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
public IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Override
public StepResult execute(StationRequestBean reqBean) {

@ -1,7 +1,5 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
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.IMesWorkOrderExtService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCollectContext;
@ -38,12 +36,6 @@ import java.util.stream.Collectors;
public class MesWorkOrderCheckNosortStepService extends MesWorkOrderCheckStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesWorkOrderExtService workOrderExtService;
@Autowired

@ -1,7 +1,5 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
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.IMesWorkOrderExtService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
@ -37,12 +35,6 @@ import java.util.stream.Collectors;
public class MesWorkOrderCheckSortStepService extends MesWorkOrderCheckStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Autowired
private IMesWorkOrderExtService workOrderExtService;
@Autowired

@ -29,10 +29,10 @@ import java.util.stream.Collectors;
public class MesWorkOrderCheckStepService extends BaseStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
public IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
public IMesProductionDispatchContextStepService productionDispatchContextStepService;
@Override
public StepResult execute(StationRequestBean reqBean) {

@ -49,6 +49,12 @@ public class MesAssemblyShowContext implements Serializable {
@ApiParam("装配件条码确认方式")
private String matchTypeName;
@ApiParam("工位代码")
public String workCellCode;
@ApiParam(value = "工艺顺序号")
private Integer processSeq;
@ApiParam("序号")
private Integer index;

@ -124,6 +124,11 @@ 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();

@ -35,11 +35,8 @@ public class MesProductionAssemblyContext implements Serializable {
@ApiParam("装配零件状态")
public Integer assemblyStatus;
@ApiParam(name = "任意装配件扫描错误判断工位isResetScan后是否重新扫描")
public Integer isResetScan = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
@ApiParam("是否跳过")
public Integer isSkip;
public Integer isSkip = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
@ApiParam("装配件条码确认方式")
public Integer matchType;

@ -31,6 +31,9 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon
@ApiParam(value = "是否可复用条码是否写入上下文进行复用")
private Integer isRepeat2Cache = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
@ApiParam(name = "任意装配件扫描错误判断工位isResetScan后是否重新扫描")
public Integer isResetScan = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
@ApiParam(value = "是否忽略回车")
private Integer isIgnoreEntry;
@ -56,8 +59,6 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();
this.isSkip = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
if (!MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType)) this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();
if (!StringUtils.isEmpty(assemblySn)) {

@ -103,20 +103,54 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
@ApiParam(value = "生产组代码")
private String productGroupCode;
@ApiParam(value = "装配件记录表ID")
public Long id;
@ApiParam(value = "装配件记录表创建时间")
public String createDatetime;
@ApiParam(value = "装配件记录表创建人")
public String createUser;
public MesProductionAssemblySortContext() {}
public MesProductionAssemblySortContext copy(MesWorkOrderAssembly workOrderAssembly) {
if (null != workOrderAssembly) BeanUtils.copyProperties(workOrderAssembly, this);
if (null != workOrderAssembly) {
BeanUtils.copyProperties(workOrderAssembly, this, MesPcnExtConstWords.BASE_BEAN_FIELDS);
this.sourceId = workOrderAssembly.getId();
}
if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO;
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType))
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) != 0) this.isResetScan = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
return this;
}
public MesProductionAssemblySortContext copy(MesWorkOrderAssembly workOrderAssembly, MesProductionAssembly productionAssembly) {
if (null != workOrderAssembly) {
BeanUtils.copyProperties(workOrderAssembly, this, MesPcnExtConstWords.BASE_BEAN_FIELDS);
this.sourceId = workOrderAssembly.getId();
}
this.isSkip = this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_40.getValue()) != 0 ? CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue() : CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
if (null != workOrderAssembly) {
this.id = productionAssembly.getId();
this.createDatetime = productionAssembly.getCreateDatetime();
this.createUser = productionAssembly.getCreateUser();
}
if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO;
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType))
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_40.getValue()) == 0)
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();
return this;
}
@ -145,17 +179,13 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
public MesProductionAssemblySortContext copy(MesProductionAssembly productionAssembly) {
if (null != productionAssembly) BeanUtils.copyProperties(productionAssembly, this);
if (null != productionAssembly) BeanUtils.copyProperties(productionAssembly, this, MesPcnExtConstWords.BASE_BEAN_FIELDS);
if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.isSkip)) this.isSkip = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType))
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) != 0) this.isResetScan = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
return this;
}

@ -189,6 +189,12 @@ public class MesPcnExtConstWords {
public static final String PACKAGE_TYPE_CODE = "packageTypeCode";
//零件生产组代码
public static final String PART_PROD_GROUP_CODE = "partProdGroupCode";
//描述
public static final String DESCRIPTION = "description";
//描述
public static final String REMARK = "remark";
//BaseBean字段不包含工厂, 用于对象复制剔除属性BeanUtils.copyProperties(Object source, Object target, String... ignoreProperties)
public static final String[] BASE_BEAN_FIELDS = {ID, IS_DELETED, IS_VALID, CREATE_DATE_TIME, CREATE_USER, MODIFY_DATE_TIME, MODIFY_USER, DESCRIPTION, REMARK, SYSTEM_SYNC_DATE_TIME, SYSTEM_SYNC_STATUS};
// 客制化条码长度:通用

Loading…
Cancel
Save