forked from I3-YF/i3plus-mes-pcn-yfai
step
parent
d1da64585a
commit
64547892d0
@ -0,0 +1,73 @@
|
||||
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.IMesProdRuleCfgExtService;
|
||||
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.MesCellEquipContext;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyContext;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description : 显示装配件扫描项工步【非排序】
|
||||
* @Author : wangjie
|
||||
**/
|
||||
@Slf4j
|
||||
@Service("mesAssemblyShowNosortStepService")
|
||||
public class MesAssemblyShowNosortStepService extends BaseStepService {
|
||||
|
||||
@Autowired
|
||||
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||
|
||||
@Autowired
|
||||
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
|
||||
|
||||
@Autowired
|
||||
private IMesProdRuleCfgExtService prodRuleCfgExtService;
|
||||
|
||||
@Autowired
|
||||
private IMesAssemblyExtService assemblyExtService;
|
||||
|
||||
@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());
|
||||
|
||||
//从上下文中取出生产线对象
|
||||
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
|
||||
|
||||
//从上下文中取出生产线对象
|
||||
MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip();
|
||||
|
||||
//获取上下文装配件数据信息集合
|
||||
List<MesProductionAssemblyContext> productionAssemblyContextList = productionDispatchContextStepService.getAssemblyDataContext(reqBean, workCenter);
|
||||
|
||||
|
||||
|
||||
|
||||
return stepResult;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,102 +1,52 @@
|
||||
//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.IMesProdRuleCfgExtService;
|
||||
//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.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 lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//import org.springframework.util.CollectionUtils;
|
||||
//
|
||||
//import java.util.List;
|
||||
//import java.util.stream.Collectors;
|
||||
//
|
||||
///**
|
||||
// * @Description : 显示装配件扫描项工步
|
||||
// * @Author : wangjie
|
||||
// **/
|
||||
//@Slf4j
|
||||
//@Service("mesAssemblyShowStepService")
|
||||
//public class MesAssemblyShowStepService extends BaseStepService {
|
||||
//
|
||||
// @Autowired
|
||||
// private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||
//
|
||||
// @Autowired
|
||||
// private IMesProductionDispatchContextStepService productionDispatchContextStepService;
|
||||
//
|
||||
// @Autowired
|
||||
// private IMesProdRuleCfgExtService prodRuleCfgExtService;
|
||||
//
|
||||
// @Autowired
|
||||
// private IMesAssemblyExtService assemblyExtService;
|
||||
//
|
||||
// @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());
|
||||
//
|
||||
// //从上下文中取出生产线对象
|
||||
// MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
|
||||
//
|
||||
// //从上下文中取出生产线对象
|
||||
// MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip();
|
||||
//
|
||||
// //获取排序线的装配件清单
|
||||
// if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return doAssemblyShow2Sort(reqBean, resultBean, stepResult, productionProcessContext, workCenter, cellEquipContext);
|
||||
//
|
||||
// //验证上下文是否存在装配件数据信息集合
|
||||
// List<MesProductionAssemblyContext> productionAssemblyContextList = productionDispatchContextStepService.getAssemblyDataList(workCenter);
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// //获取非排序线的装配件清单
|
||||
// return doAssemblyShow2Nosort(reqBean, resultBean, stepResult, productionProcessContext, workCenter, cellEquipContext);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// //获取排序线的装配件清单
|
||||
// private StepResult doAssemblyShow2Sort(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesProductionProcessContext productionProcessContext, MesWorkCenter workCenter, MesCellEquipContext cellEquipContext) {
|
||||
//
|
||||
// //从上下文中取出生产工单数据信息集合
|
||||
// List<MesWorkOrderContext> workOrderContextList =
|
||||
//
|
||||
// //上下文中不存在生产工单数据信息集合
|
||||
// if (CollectionUtils.isEmpty(workOrderContextList)) return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("生产线[%s]工位[%s]的上下文中已不存在生产工单数据信息,请重新扫描加工单!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()));
|
||||
//
|
||||
// List<MesProductionAssemblyContext> productionAssemblyContextList = assemblyExtService.getProductionAssemblySortContextList(
|
||||
// new MesProductionAssemblySortContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), reqBean.getProcessCode()), workOrderContextList.stream().filter(o -> null != o).map(MesWorkOrderContext::getWorkOrderNo).collect(Collectors.toList()));
|
||||
//
|
||||
// if (CollectionUtils.isEmpty(productionAssemblyContextList)) return stepResult;
|
||||
//
|
||||
// //设备
|
||||
//
|
||||
//
|
||||
// return stepResult;
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
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("mesAssemblyShowStepService")
|
||||
public class MesAssemblyShowStepService 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());
|
||||
|
||||
//从上下文中取出生产线对象
|
||||
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
|
||||
|
||||
//获取排序线的装配件清单
|
||||
if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == workCenter.getCenterType()) return ((IStepService) SpringContextsUtil.getBean("mesAssemblyShowSortStepService")).execute(reqBean);
|
||||
|
||||
//获取非排序线的装配件清单
|
||||
return ((IStepService) SpringContextsUtil.getBean("mesAssemblyShowNosortStepService")).execute(reqBean);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.pojo.context;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 生产过程上下文对象-装配件清单信息
|
||||
*/
|
||||
@Data
|
||||
public class MesAssemblyShowContext implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3650546953572889323L;
|
||||
|
||||
@ApiParam("零件编码")
|
||||
private String partNo;
|
||||
|
||||
@ApiParam("装配件零件编码")
|
||||
private String assemblyPartNo;
|
||||
|
||||
@ApiParam("装配件零件名称")
|
||||
private String assemblyPartName;
|
||||
|
||||
@ApiParam("装配件条码")
|
||||
private String assemblySn;
|
||||
|
||||
@ApiParam(value = "装备序号")
|
||||
private Integer routeSeq;
|
||||
|
||||
@ApiParam("显示颜色")
|
||||
private String color;
|
||||
|
||||
@ApiParam(value = "显示颜色(配置)")
|
||||
private String showColor;
|
||||
|
||||
@ApiParam("装配零件状态")
|
||||
private Integer assemblyStatus;
|
||||
|
||||
@ApiParam("装配件条码确认方式")
|
||||
private String matchType;
|
||||
|
||||
@ApiParam("装配零件状态")
|
||||
private String assemblyStatusName;
|
||||
|
||||
}
|
Loading…
Reference in New Issue