forked from I3-YF/i3plus-mes-pcn-yfai
Merge remote-tracking branch 'origin/dev' into dev
commit
22ccbe7a7f
@ -0,0 +1,133 @@
|
|||||||
|
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.pojo.context.*;
|
||||||
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||||
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesProductionAssembly;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.repository.MesProductionAssemblyRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 保存装配记录工步 【非排序】
|
||||||
|
* @Author : wangjie
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service("mesAssemblySaveNosortStepService")
|
||||||
|
public class MesAssemblySaveNosortStepService extends BaseStepService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MesProductionAssemblyRepository productionAssemblyRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StepResult execute(StationRequestBean reqBean) {
|
||||||
|
|
||||||
|
StationResultBean resultBean = new StationResultBean();
|
||||||
|
|
||||||
|
StepResult stepResult = StepResult.getSuccessComplete();
|
||||||
|
|
||||||
|
//获取上下文信息
|
||||||
|
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean);
|
||||||
|
|
||||||
|
//配置错误 抛出异常
|
||||||
|
if (!productionProcessContext.getSuccess()) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), productionProcessContext.getMessage());
|
||||||
|
|
||||||
|
//存储生产过程上下文对象
|
||||||
|
productionProcessContextStepService.saveProductionProcessContext(reqBean, productionProcessContext);
|
||||||
|
|
||||||
|
//获取上下文产品加工规则数据信息集合
|
||||||
|
List<MesProdRuleContext> prodRuleContextList = productionDispatchContextStepService.getProdRuleDataContext(reqBean);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(prodRuleContextList)) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), "当前上下文中不存在非排序加工规则数据,请重置工序!");
|
||||||
|
|
||||||
|
//获取上下文产出条码数据信息集合
|
||||||
|
List<MesProductionPsOutContext> productionPsOutContextList = productionDispatchContextStepService.getProductionPsOutContext(reqBean);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(productionPsOutContextList)) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), "上下文中不存在产出零件条码信息,请重置工序解决!");
|
||||||
|
|
||||||
|
MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip();
|
||||||
|
|
||||||
|
Map<Integer, MesProductionPsOutContext> ppMap = CollectionUtils.isEmpty(productionPsOutContextList) ? null : productionPsOutContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getForeignKey()))).collect(Collectors.toMap(MesProductionPsOutContext::getForeignKey, o -> o));
|
||||||
|
|
||||||
|
prodRuleContextList.stream().filter(o -> null != o).forEach(o -> saveProductionAssemblyData(reqBean, resultBean, stepResult, productionProcessContext, o, ppMap, cellEquipContext));
|
||||||
|
|
||||||
|
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "保存装配记录成功!");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveProductionAssemblyData(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult,
|
||||||
|
MesProductionProcessContext productionProcessContext, MesProdRuleContext prodRuleContext, Map<Integer, MesProductionPsOutContext> ppMap, MesCellEquipContext cellEquipContext) {
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) return;
|
||||||
|
|
||||||
|
List<MesProductionAssemblyNosortContext> productionAssemblyNosortContextList = prodRuleContext.getNosortAssemblyDataContext();
|
||||||
|
|
||||||
|
MesProductionPsOutContext productionPsOutContext = CollectionUtils.isEmpty(ppMap) ? null : ppMap.get(prodRuleContext.getForeignKey());
|
||||||
|
|
||||||
|
for (MesProductionAssemblyNosortContext productionAssemblyNosortContext : productionAssemblyNosortContextList) {
|
||||||
|
|
||||||
|
if (null == productionAssemblyNosortContext) continue;
|
||||||
|
|
||||||
|
MesProductionAssembly productionAssembly = new MesProductionAssembly();
|
||||||
|
BeanUtils.copyProperties(productionAssemblyNosortContext, productionAssembly);
|
||||||
|
|
||||||
|
productionAssembly.setDataSource(MesExtEnumUtil.PRODUCTION_ASSEMBLY_DATA_SOURCE.NOSORT.getValue());
|
||||||
|
productionAssembly.setIsOrigSn(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
||||||
|
|
||||||
|
productionAssembly.setAreaCode(reqBean.getWorkCenterCode());
|
||||||
|
productionAssembly.setWorkCenterCode(reqBean.getWorkCenterCode());
|
||||||
|
productionAssembly.setWorkCellCode(reqBean.getWorkCellCode());
|
||||||
|
productionAssembly.setProcessCode(reqBean.getProcessCode());
|
||||||
|
|
||||||
|
productionAssembly.setProcessName(productionProcessContext.getProcessName());
|
||||||
|
productionAssembly.setCraftCode(productionProcessContext.getCraftCode());
|
||||||
|
productionAssembly.setCraftName(productionProcessContext.getCraftName());
|
||||||
|
|
||||||
|
productionAssembly.setEquipmentCode(cellEquipContext.getEquipmentCode());
|
||||||
|
|
||||||
|
productionAssembly.setProductionRecordId(prodRuleContext.getProductionRecordId());
|
||||||
|
productionAssembly.setMouldNo(prodRuleContext.getMouldNo());
|
||||||
|
|
||||||
|
if (null != productionPsOutContext) {
|
||||||
|
productionAssembly.setPartNo(productionPsOutContext.getPartNo());
|
||||||
|
productionAssembly.setPartName(productionPsOutContext.getPartName());
|
||||||
|
productionAssembly.setSerialNumber(productionPsOutContext.getSerialNumber());
|
||||||
|
productionAssembly.setProductSn(productionPsOutContext.getProductSn());
|
||||||
|
productionAssembly.setCustSn(productionPsOutContext.getCustSn());
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO 赋开模记录ID
|
||||||
|
//productionAssembly.setMouldRecordId();
|
||||||
|
|
||||||
|
productionAssembly.setOrganizeCode(reqBean.getOrganizeCode());
|
||||||
|
ConvertBean.serviceModelInitialize(productionAssembly, reqBean.getUserInfo());
|
||||||
|
|
||||||
|
productionAssemblyRepository.insert(productionAssembly);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
||||||
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||||
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IStepService;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
||||||
|
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 保存装配记录工步
|
||||||
|
* @Author : wangjie
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service("mesAssemblySaveStepService")
|
||||||
|
public class MesAssemblySaveStepService extends BaseStepService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StepResult execute(StationRequestBean reqBean) {
|
||||||
|
|
||||||
|
StationResultBean resultBean = new StationResultBean();
|
||||||
|
|
||||||
|
StepResult stepResult = StepResult.getSuccessComplete();
|
||||||
|
|
||||||
|
//获取上下文信息
|
||||||
|
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean);
|
||||||
|
|
||||||
|
//配置错误 抛出异常
|
||||||
|
if (!productionProcessContext.getSuccess()) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), productionProcessContext.getMessage());
|
||||||
|
|
||||||
|
//存储生产过程上下文对象
|
||||||
|
productionProcessContextStepService.saveProductionProcessContext(reqBean, productionProcessContext);
|
||||||
|
|
||||||
|
//从上下文中取出生产线对象
|
||||||
|
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
|
||||||
|
|
||||||
|
//排序线 保存装配记录工步
|
||||||
|
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesAssemblySaveSortStepService")).execute(reqBean);
|
||||||
|
|
||||||
|
//非排序线 保存装配记录工步
|
||||||
|
return ((IStepService) SpringContextsUtil.getBean("mesAssemblySaveNosortStepService")).execute(reqBean);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,118 @@
|
|||||||
|
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.pojo.context.*;
|
||||||
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||||
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesProductionRecord;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.repository.MesProductionRecordRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 生成加工记录工步
|
||||||
|
* @Author : wangjie
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service("mesProductionRecordGenerateStepService")
|
||||||
|
public class MesProductionRecordGenerateStepService extends BaseStepService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MesProductionRecordRepository productionRecordRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StepResult execute(StationRequestBean reqBean) {
|
||||||
|
|
||||||
|
StationResultBean resultBean = new StationResultBean();
|
||||||
|
|
||||||
|
StepResult stepResult = StepResult.getSuccessComplete();
|
||||||
|
|
||||||
|
//获取上下文信息
|
||||||
|
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean);
|
||||||
|
|
||||||
|
//配置错误 抛出异常
|
||||||
|
if (!productionProcessContext.getSuccess()) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), productionProcessContext.getMessage());
|
||||||
|
|
||||||
|
//存储生产过程上下文对象
|
||||||
|
productionProcessContextStepService.saveProductionProcessContext(reqBean, productionProcessContext);
|
||||||
|
|
||||||
|
//获取上下文产品加工规则数据信息集合
|
||||||
|
List<MesProdRuleContext> prodRuleContextList = productionDispatchContextStepService.getProdRuleDataContext(reqBean);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(prodRuleContextList)) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), "当前上下文中不存在非排序加工规则数据,请重置工序!");
|
||||||
|
|
||||||
|
//获取上下文产出条码数据信息集合
|
||||||
|
List<MesProductionPsOutContext> productionPsOutContextList = productionDispatchContextStepService.getProductionPsOutContext(reqBean);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(productionPsOutContextList)) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), "上下文中不存在产出零件条码信息,请重置工序解决!");
|
||||||
|
|
||||||
|
MesEquipVariableCollectContext equipVariableCollectContext = productionDispatchContextStepService.getFirstMouldNoContext(reqBean);
|
||||||
|
if (null == equipVariableCollectContext) equipVariableCollectContext = productionDispatchContextStepService.getMouldNoContext(reqBean);
|
||||||
|
|
||||||
|
MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip();
|
||||||
|
|
||||||
|
Map<Integer, MesProdRuleContext> prMap = CollectionUtils.isEmpty(prodRuleContextList) ? null : prodRuleContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getForeignKey()))).collect(Collectors.toMap(MesProdRuleContext::getForeignKey, o -> o));
|
||||||
|
|
||||||
|
String mouldNo = null != equipVariableCollectContext ? equipVariableCollectContext.getEquipVariableValue() : null;
|
||||||
|
productionPsOutContextList.stream().filter(o -> null != o).forEach(o -> saveProductionRecordData(reqBean, resultBean, stepResult, mouldNo, productionProcessContext, o, prMap, cellEquipContext));
|
||||||
|
|
||||||
|
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "保存装配记录成功!");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveProductionRecordData(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, String mouldNo,
|
||||||
|
MesProductionProcessContext productionProcessContext, MesProductionPsOutContext productionPsOutContext, Map<Integer, MesProdRuleContext> prMap, MesCellEquipContext cellEquipContext) {
|
||||||
|
|
||||||
|
MesProdRuleContext prodRuleContext = CollectionUtils.isEmpty(prMap) ? null : prMap.get(productionPsOutContext.getForeignKey());
|
||||||
|
|
||||||
|
MesProductionRecord productionRecord = new MesProductionRecord();
|
||||||
|
BeanUtils.copyProperties(productionPsOutContext, productionRecord);
|
||||||
|
|
||||||
|
productionRecord.setMouldNo(mouldNo);
|
||||||
|
productionRecord.setEquipmentCode(cellEquipContext.getEquipmentCode());
|
||||||
|
productionRecord.setEquipmentName(cellEquipContext.getEquipmentName());
|
||||||
|
|
||||||
|
productionRecord.setReportType(!StringUtils.isEmpty(prodRuleContext.getReportType()) ? prodRuleContext.getReportType() : MesExtEnumUtil.NOSORT_REPORT_TYPE.NO_REPORT.getValue());
|
||||||
|
if (MesExtEnumUtil.NOSORT_REPORT_TYPE.NO_REPORT.getValue() != productionRecord.getReportType()) productionRecord.setReportPartNo(productionPsOutContext.getPartNo());
|
||||||
|
productionRecord.setReportStatus(MesExtEnumUtil.NOSORT_REPORT_TYPE.NO_REPORT.getValue() != productionRecord.getReportType() ? MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue() : MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue());
|
||||||
|
|
||||||
|
productionRecord.setModuleStatisticsStatus(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
||||||
|
|
||||||
|
//TODO 赋开模记录ID
|
||||||
|
//productionRecord.setMouldRecordId();
|
||||||
|
//TODO 工序开始时间
|
||||||
|
//productionRecord.setStartDateTime();
|
||||||
|
|
||||||
|
productionRecord.setIsComplete(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
||||||
|
|
||||||
|
productionRecord.setOrganizeCode(reqBean.getOrganizeCode());
|
||||||
|
ConvertBean.serviceModelInitialize(productionRecord, reqBean.getUserInfo());
|
||||||
|
productionRecord.setCompleteDateTime(productionRecord.getModifyDatetime());
|
||||||
|
|
||||||
|
productionRecordRepository.insert(productionRecord);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
15
modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionReocrdGenerateStepService.java → modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionReocrdGenerateStepServiceBak.java
15
modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionReocrdGenerateStepService.java → modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionReocrdGenerateStepServiceBak.java
@ -1,105 +0,0 @@
|
|||||||
/*
|
|
||||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
|
||||||
|
|
||||||
import akka.actor.ActorRef;
|
|
||||||
import akka.actor.ActorSystem;
|
|
||||||
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.pojo.context.MesProductionProcessContext;
|
|
||||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsOutContext;
|
|
||||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
|
||||||
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
||||||
import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker;
|
|
||||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesProductionRecord;
|
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
|
||||||
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
||||||
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
|
||||||
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
|
||||||
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* @Description : 保存装配件
|
|
||||||
* @Author : zxw
|
|
||||||
**//*
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class MesSaveAssemblyStepService extends BaseStepService {
|
|
||||||
@Autowired
|
|
||||||
private SnowflakeIdMaker snowflakeIdMaker;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ActorSystem actorSystem;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MesVariableWhenFinishedReadStepService mesVariableWhenFinishedReadStepService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MesMouldRecordGenerateStepService mesMouldRecordGenerateStepService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MesProductSnSaveStepService MesProductSnSaveStepService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MesProductionReocrdGenerateStepService mesProductionReocrdGenerateStepService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MesProductResultErrorHandleStepService mesProductResultErrorHandleStepService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MesReportGenerateStepService mesReportGenerateStepService;
|
|
||||||
|
|
||||||
public static final String ORDER_NO_JIS_SORT = "ORDER_NO_JIS_SORT";
|
|
||||||
|
|
||||||
private static final Map<String, ActorRef> refMap = new ConcurrentHashMap<>(200);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public StepResult execute(StationRequestBean reqBean) {
|
|
||||||
StationResultBean resultBean = new StationResultBean();
|
|
||||||
|
|
||||||
StepResult stepResult = StepResult.getSuccessComplete();
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 获取上下文
|
|
||||||
*//*
|
|
||||||
|
|
||||||
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getEquipmentVariableList(reqBean, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue());
|
|
||||||
MesWorkCell mesWorkCell = productionProcessContext.getWorkCell();
|
|
||||||
|
|
||||||
List<MesProductionPsOutContext> mesProduceSnContexts = mesProductionDispatchContextStepService.getProductionPsOutContext(reqBean);
|
|
||||||
|
|
||||||
List<MesProductionRecord> mesProductionRecords = new ArrayList<>();
|
|
||||||
mesProduceSnContexts.forEach(mesProductionPsOutContext -> {
|
|
||||||
|
|
||||||
MesProductionRecord mesProductionRecord = getMesProductionRecord(productionProcessContext, mesProductionPsOutContext, reqBean);
|
|
||||||
ConvertBean.serviceModelInitialize(mesProductionRecord, reqBean.getUserInfo());
|
|
||||||
mesProductionRecords.add(mesProductionRecord);
|
|
||||||
});
|
|
||||||
|
|
||||||
mesProductionRecordRepository.saveAll(mesProductionRecords);
|
|
||||||
if (Objects.equal(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(),mesWorkCell.getIsCountFinish())) {
|
|
||||||
// 保存班次加工数量上下文
|
|
||||||
productionCustomContextStepService.addProductionStatisticsContext(reqBean,mesProduceSnContexts.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, "生成加工记录成功");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
Loading…
Reference in New Issue