@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl ;
import com.foreverwin.mesnac.common.constant.Constants ;
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.service.CommonService ;
import com.foreverwin.mesnac.common.service.InspectionTaskService ;
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService ;
import com.foreverwin.mesnac.common.util.ExceptionUtil ;
@ -18,7 +18,6 @@ import com.foreverwin.mesnac.meapi.service.RouterService;
import com.foreverwin.mesnac.meapi.service.RouterStepService ;
import com.foreverwin.mesnac.meapi.service.ShopOrderService ;
import com.foreverwin.mesnac.production.dto.SplitSfcDto ;
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper ;
import com.foreverwin.mesnac.production.mapper.SplitSfcMapper ;
import com.foreverwin.mesnac.production.model.SplitSfc ;
import com.foreverwin.mesnac.production.service.SplitSfcService ;
@ -65,7 +64,7 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
@Autowired
private RouterStepService routerStepService ;
@Autowired
private SfcCrossMapper sfcCrossMapper ;
private CommonService commonService ;
@Override
public IPage < SplitSfc > selectPage ( FrontPage < SplitSfc > frontPage , SplitSfc splitSfc ) {
QueryWrapper < SplitSfc > queryWrapper = new QueryWrapper < > ( ) ;
@ -186,16 +185,16 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
if ( sfcData = = null ) {
throw new BaseException ( "未找到产品条码信息" ) ;
}
//查询质量异常记录数量 处置工艺路线及不良代码
SplitSfcDto splitSfcDto = splitSfcMapper . getAbnormalQty ( site , sfc , operation , abnormalNo ) ;
SfcDispatchDto sfcDispatchDto = new SfcDispatchDto ( ) ;
sfcDispatchDto . setSite ( site ) ;
sfcDispatchDto . setSfc ( sfc ) ;
sfcDispatchDto . setStepId ( s fcData . getStepId ( ) ) ;
sfcDispatchDto . setStepId ( s plitSfcDto . getStepId ( ) ) ;
SfcDispatchDto sfcDispatchBySfc = sfcDispatchCommonService . findSfcDispatchBySfc ( sfcDispatchDto ) ;
if ( sfcDispatchBySfc .equals ( DispatchStatusEnum . CANCEL . getCode ( ) ) ) {
throw new BaseException ( " 产品已取消派工 ") ;
if ( sfcDispatchBySfc == null ) {
throw new BaseException ( " 未找到派工任务 ") ;
}
//查询质量异常记录数量 处置工艺路线及不良代码
SplitSfcDto splitSfcDto = splitSfcMapper . getAbnormalQty ( site , sfc , operation , abnormalNo ) ;
String routerBo = splitSfcDto . getRouterBo ( ) ;
String ncCode = splitSfcDto . getNcCode ( ) ;
String abnormalMethod = splitSfcDto . getAbnormalMethod ( ) ;
@ -236,10 +235,8 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
stepIdentifier . setStepId ( sfcData . getStepId ( ) ) ;
stepIdentifier . setOperationId ( sfcData . getOperation ( ) ) ;
productionContext . setStepIdentifier ( stepIdentifier ) ;
if ( StringUtil . isBlank ( sfcDispatchBySfc . getResrce ( ) ) ) {
throw new BaseException ( "未派工到设备" ) ;
}
productionContext . setResourceRef ( HandleEnum . RESOURCE . getHandle ( site , sfcDispatchBySfc . getResrce ( ) ) ) ;
String resrceBo = commonService . getResrceByOperation ( operation ) ;
productionContext . setResourceRef ( resrceBo ) ;
createNCRequest . setProdCtx ( productionContext ) ;
createNCRequest . setNcCodeRef ( HandleEnum . NC_CODE . getHandle ( site , splitNcCode [ 0 ] ) ) ;
ncProductionService . createNC ( createNCRequest ) ;
@ -266,7 +263,7 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
paramMap . put ( "SFC" , sfc ) ;
paramMap . put ( "SHOP_ORDER" , sfcDispatchBySfc . getShopOrder ( ) ) ;
paramMap . put ( "OPERATION" , sfcDispatchBySfc . getOperation ( ) ) ;
paramMap . put ( "STEP_ID" , sfcDispatchBySfc . getStepId ( ) ) ; ;
paramMap . put ( "STEP_ID" , sfcDispatchBySfc . getStepId ( ) ) ;
paramMap . put ( "WORK_CENTER" , sfcDispatchBySfc . getWorkCenter ( ) ) ;
paramMap . put ( "RESRCE" , sfcDispatchBySfc . getResrce ( ) ) ;
paramMap . put ( "SFC_DISPATCH_DETAIL_BO" , sfcDispatchBySfc . getHandle ( ) ) ;