forked from I3-YF/i3plus-mes-pcn-yfai
Merge branch 'dev-wuhan' of http://git.estsh.com/I3-YF/i3plus-mes-pcn-yfai into dev-wuhan
commit
c8895560b5
@ -1,15 +0,0 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.processmethod;
|
||||
|
||||
import groovy.util.logging.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* @Description : 原箱进原箱出
|
||||
* @Reference :
|
||||
* @Author : junsheng.li
|
||||
* @CreateDate 2024/9/12 21:24
|
||||
* @Modify:
|
||||
**/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MesProcessMethodSourceBoxInOutServiceImpl {
|
||||
}
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
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.api.busi.IMesStationService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext;
|
||||
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.MesProdRouteOptParam;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesStation;
|
||||
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;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @Description : 回用包装加工模式
|
||||
* @Reference :
|
||||
* @Author : junsheng.li
|
||||
* @CreateDate 2024/9/12 11:20
|
||||
* @Modify:
|
||||
**/
|
||||
@Slf4j
|
||||
@Service("mesProcessMethodStepService")
|
||||
public class MesProcessMethodStepService extends BaseStepService {
|
||||
|
||||
@Autowired
|
||||
private IMesStationService mesStationService;
|
||||
|
||||
@Autowired
|
||||
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||
|
||||
@Override
|
||||
public StepResult execute(StationRequestBean reqBean) {
|
||||
StationResultBean resultBean = new StationResultBean();
|
||||
|
||||
StepResult stepResult = StepResult.getSuccessComplete();
|
||||
|
||||
//获取工步参数
|
||||
Optional<Map<String, MesProdRouteOptParam>> stepParamMap = getStepParams(reqBean);
|
||||
|
||||
//获取上下文信息
|
||||
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.dispatchCurCellEquipment(reqBean, stepParamMap);
|
||||
|
||||
//当前工位使用的设备
|
||||
MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip();
|
||||
|
||||
//根据设备代码获取点位信息
|
||||
MesStation station = mesStationService.getMesStationByEquipmentCode(reqBean.getOrganizeCode(), cellEquipContext.getEquipmentCode());
|
||||
|
||||
if (Objects.isNull(station) || Objects.isNull(station.getProcessMethod())){
|
||||
return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("设备[%s]站点信息未维护", cellEquipContext.getEquipmentCode()));
|
||||
}
|
||||
|
||||
return ((IStepService) SpringContextsUtil.getBean(MesExtEnumUtil.STATION_PROCESS_METHOD.valueOfStrategyClass(station.getProcessMethod()))).executeInState(reqBean);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
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.recyclablepackage.IMesRecyclablePackageBindingService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionRecyclablePackageContext;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.recyclablepackage.MesRecyclablePackageBinding;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.recyclablepackage.MesRecyclablePackageBindingDetail;
|
||||
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.Objects;
|
||||
|
||||
/**
|
||||
* @Description : 包装零件解绑
|
||||
* @Reference :
|
||||
* @Author : junsheng.li
|
||||
* @CreateDate 2024/9/13 18:08
|
||||
* @Modify:
|
||||
**/
|
||||
@Slf4j
|
||||
@Service("mesRecyclablePackageUnBindingStepService")
|
||||
public class MesRecyclablePackageUnBindingStepService extends BaseStepService {
|
||||
|
||||
@Autowired
|
||||
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
|
||||
|
||||
@Autowired
|
||||
private IMesRecyclablePackageBindingService mesRecyclablePackageBindingService;
|
||||
|
||||
@Override
|
||||
public StepResult execute(StationRequestBean reqBean) {
|
||||
|
||||
StationResultBean resultBean = new StationResultBean();
|
||||
|
||||
StepResult stepResult = StepResult.getSuccessComplete();
|
||||
//验证进料可回用包装是否存在
|
||||
if (!productionDispatchContextStepService.checkProductionRecyclablePackageContextIsExist(reqBean)){
|
||||
return stepResult;
|
||||
}
|
||||
//获取进料可回用包装信息
|
||||
List<MesProductionRecyclablePackageContext> productionRecyclablePackageContext = productionDispatchContextStepService.getProductionRecyclablePackageContext(reqBean);
|
||||
//获取包装绑定主表
|
||||
MesRecyclablePackageBinding recyclablePackageBinding = mesRecyclablePackageBindingService.getMesRecyclablePackageBindingByPackageSn(reqBean.getOrganizeCode(), productionRecyclablePackageContext.iterator().next().getPackageSn());
|
||||
if (Objects.isNull(recyclablePackageBinding)) {
|
||||
return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("回收包装绑定[%s]信息不存在", productionRecyclablePackageContext.iterator().next().getPackageSn()));
|
||||
}
|
||||
//校验状态
|
||||
if (MesExtEnumUtil.RECYCLABLE_PACKAGE_PACKAGE_BINDING_STATUS.CLOSED.getValue() != recyclablePackageBinding.getStatus()) {
|
||||
return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("回收包装绑定[%s]状态不为[已关箱]", productionRecyclablePackageContext.iterator().next().getPackageSn()));
|
||||
}
|
||||
//获取绑定明细信息
|
||||
List<MesRecyclablePackageBindingDetail> bindingDetailList = mesRecyclablePackageBindingService.findMesRecyclablePackageBindingDetailByPid(reqBean.getOrganizeCode(), recyclablePackageBinding.getId());
|
||||
if (CollectionUtils.isEmpty(bindingDetailList)) {
|
||||
return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("回收包装绑定[%s]明细信息不存在", productionRecyclablePackageContext.iterator().next().getPackageSn()));
|
||||
}
|
||||
//解绑
|
||||
mesRecyclablePackageBindingService.doMesRecyclablePackageUnBinding(recyclablePackageBinding, bindingDetailList, reqBean.getUserInfo());
|
||||
|
||||
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("可回用包装条码%s解绑成功!", productionRecyclablePackageContext.iterator().next().getPackageSn()));
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue