Leon 3 years ago
commit 47e0df5c43

@ -8,7 +8,7 @@ spring:
driver-class-name: com.sap.db.jdbc.Driver driver-class-name: com.sap.db.jdbc.Driver
jndi-name: jdbc/jts/wipPool jndi-name: jdbc/jts/wipPool
activemq: activemq:
enabled: false enabled: true
brokerUrl: tcp://172.16.251.166:61616?wireFormat.maxInactivityDuration=0 brokerUrl: tcp://172.16.251.166:61616?wireFormat.maxInactivityDuration=0
password: admin password: admin
user: admin user: admin

@ -3,6 +3,8 @@ package com.foreverwin.mesnac.production.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.enums.DispatchStatusEnum;
import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService; import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.mesnac.common.util.ExceptionUtil; import com.foreverwin.mesnac.common.util.ExceptionUtil;
@ -18,7 +20,6 @@ import com.foreverwin.mesnac.production.dto.SplitSfcDto;
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper; import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
import com.foreverwin.mesnac.production.mapper.SplitSfcMapper; import com.foreverwin.mesnac.production.mapper.SplitSfcMapper;
import com.foreverwin.mesnac.production.model.SplitSfc; import com.foreverwin.mesnac.production.model.SplitSfc;
import com.foreverwin.mesnac.production.model.StepOperation;
import com.foreverwin.mesnac.production.service.SplitSfcService; import com.foreverwin.mesnac.production.service.SplitSfcService;
import com.foreverwin.modular.core.exception.BaseException; import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.meext.MEServices; import com.foreverwin.modular.core.meext.MEServices;
@ -182,6 +183,14 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
if (sfcData==null){ if (sfcData==null){
throw new BaseException("未找到产品条码信息"); throw new BaseException("未找到产品条码信息");
} }
SfcDispatchDto sfcDispatchDto = new SfcDispatchDto();
sfcDispatchDto.setSite(site);
sfcDispatchDto.setSfc(sfc);
sfcDispatchDto.setStepId(sfcData.getStepId());
SfcDispatchDto sfcDispatchBySfc = sfcDispatchCommonService.findSfcDispatchBySfc(sfcDispatchDto);
if (sfcDispatchBySfc.equals(DispatchStatusEnum.CANCEL.getCode())){
throw new BaseException("产品已取消派工");
}
//查询质量异常记录数量 处置工艺路线及不良代码 //查询质量异常记录数量 处置工艺路线及不良代码
SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation, abnormalNo); SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation, abnormalNo);
String routerBo = splitSfcDto.getRouterBo(); String routerBo = splitSfcDto.getRouterBo();
@ -224,11 +233,10 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
stepIdentifier.setStepId(sfcData.getStepId()); stepIdentifier.setStepId(sfcData.getStepId());
stepIdentifier.setOperationId(sfcData.getOperation()); stepIdentifier.setOperationId(sfcData.getOperation());
productionContext.setStepIdentifier(stepIdentifier); productionContext.setStepIdentifier(stepIdentifier);
List<StepOperation> resourceBySfc = sfcCrossMapper.getResourceBySfc(site, sfc); if (StringUtil.isBlank(sfcDispatchBySfc.getResrce())){
if (resourceBySfc.isEmpty()){ throw new BaseException("未派工到设备");
throw new BaseException("产品不在工作中");
} }
productionContext.setResourceRef(resourceBySfc.get(0).getResourceBo()); productionContext.setResourceRef(sfcDispatchBySfc.getResrce());
createNCRequest.setProdCtx(productionContext); createNCRequest.setProdCtx(productionContext);
createNCRequest.setNcCodeRef(HandleEnum.NC_CODE.getHandle(site,splitNcCode[0])); createNCRequest.setNcCodeRef(HandleEnum.NC_CODE.getHandle(site,splitNcCode[0]));
ncProductionService.createNC(createNCRequest); ncProductionService.createNC(createNCRequest);

Loading…
Cancel
Save