@ -177,15 +177,12 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
SplitSfcDto splitSfcDto = splitSfcMapper . getAbnormalQty ( site , sfc , operation , abnormalNo ) ;
SplitSfcDto splitSfcDto = splitSfcMapper . getAbnormalQty ( site , sfc , operation , abnormalNo ) ;
String routerBo = splitSfcDto . getRouterBo ( ) ;
String routerBo = splitSfcDto . getRouterBo ( ) ;
String ncCode = splitSfcDto . getNcCode ( ) ;
String ncCode = splitSfcDto . getNcCode ( ) ;
if ( StringUtil . isBlank ( routerBo ) ) {
throw new BaseException ( "异常处置未选择处置工艺路线" ) ;
}
if ( StringUtil . isBlank ( ncCode ) ) {
if ( StringUtil . isBlank ( ncCode ) ) {
throw new BaseException ( "异常处置未选择不良代码" ) ;
throw new BaseException ( "异常处置未选择不良代码" ) ;
}
}
BigDecimal sfcQty = new BigDecimal ( sfcData . getQty ( ) ) ;
BigDecimal sfcQty = new BigDecimal ( sfcData . getQty ( ) ) ;
if ( new BigDecimal ( splitSfcDto . getNcQty ( ) ) . compareTo ( sfcQty ) > = 0 ) {
if ( new BigDecimal ( splitSfcDto . getNcQty ( ) ) . compareTo ( sfcQty ) > = 0 ) {
throw new BaseException ( "质量异常数量 不小 于于产品条码的数量,不能拆分") ;
throw new BaseException ( "质量异常数量 大于等 于于产品条码的数量,不能拆分") ;
}
}
if ( splitQty . compareTo ( new BigDecimal ( splitSfcDto . getNcQty ( ) ) ) > 0 ) {
if ( splitQty . compareTo ( new BigDecimal ( splitSfcDto . getNcQty ( ) ) ) > 0 ) {
throw new BaseException ( "拆分数量大于质量异常数量的数量,不能拆分" ) ;
throw new BaseException ( "拆分数量大于质量异常数量的数量,不能拆分" ) ;
@ -206,6 +203,9 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
Collection < SplitSfcResponse > splitSfcResponses = splitService . splitSfc ( splitSfcRequest ) ;
Collection < SplitSfcResponse > splitSfcResponses = splitService . splitSfc ( splitSfcRequest ) ;
SplitSfcResponse splitSfcResponse = splitSfcResponses . iterator ( ) . next ( ) ;
SplitSfcResponse splitSfcResponse = splitSfcResponses . iterator ( ) . next ( ) ;
String newSfcRef = splitSfcResponse . getNewSfcRef ( ) ;
String newSfcRef = splitSfcResponse . getNewSfcRef ( ) ;
String newSfc = StringUtil . trimHandle ( newSfcRef ) ;
if ( StringUtil . notBlank ( routerBo ) ) {
//记录不合格
//记录不合格
CreateNCRequest createNCRequest = new CreateNCRequest ( ) ;
CreateNCRequest createNCRequest = new CreateNCRequest ( ) ;
createNCRequest . setQty ( splitQty ) ;
createNCRequest . setQty ( splitQty ) ;
@ -235,8 +235,10 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
dispositionSfcsRequest . setDispositionSelection ( dispositionSelection ) ;
dispositionSfcsRequest . setDispositionSelection ( dispositionSelection ) ;
dispositionSfcsRequest . setProdCtx ( new ProductionContext ( ) ) ;
dispositionSfcsRequest . setProdCtx ( new ProductionContext ( ) ) ;
ncProductionService . dispositionMultipleSfcs ( dispositionSfcsRequest ) ;
ncProductionService . dispositionMultipleSfcs ( dispositionSfcsRequest ) ;
String workCenterBo = shopOrderService . getById ( HandleEnum . SHOP_ORDER . getHandle ( site , sfcData . getShopOrder ( ) ) ) . getPlannedWorkCenterBo ( ) ;
sfcDispatchCommonService . saveSfcDispatch ( site , CommonMethods . getUser ( ) , StringUtil . trimHandle ( workCenterBo ) , newSfc , sfcData . getShopOrder ( ) , maxRevisionRouter . getHandle ( ) ) ;
}
SplitSfc splitSfc = new SplitSfc ( ) ;
SplitSfc splitSfc = new SplitSfc ( ) ;
String newSfc = StringUtil . trimHandle ( newSfcRef ) ;
splitSfc . setHandle ( HandleEnum . SPLIT_SFC . getHandle ( site , newSfc ) ) ;
splitSfc . setHandle ( HandleEnum . SPLIT_SFC . getHandle ( site , newSfc ) ) ;
splitSfc . setSite ( site ) ;
splitSfc . setSite ( site ) ;
splitSfc . setSfc ( sfc ) ;
splitSfc . setSfc ( sfc ) ;
@ -246,8 +248,6 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
splitSfc . setCreateUser ( CommonMethods . getUser ( ) ) ;
splitSfc . setCreateUser ( CommonMethods . getUser ( ) ) ;
splitSfc . setCreatedDateTime ( LocalDateTime . now ( ) ) ;
splitSfc . setCreatedDateTime ( LocalDateTime . now ( ) ) ;
save ( splitSfc ) ;
save ( splitSfc ) ;
String workCenterBo = shopOrderService . getById ( HandleEnum . SHOP_ORDER . getHandle ( site , sfcData . getShopOrder ( ) ) ) . getPlannedWorkCenterBo ( ) ;
sfcDispatchCommonService . saveSfcDispatch ( site , CommonMethods . getUser ( ) , StringUtil . trimHandle ( workCenterBo ) , newSfc , sfcData . getShopOrder ( ) , maxRevisionRouter . getHandle ( ) ) ;
return splitSfc ;
return splitSfc ;
} catch ( Exception e ) {
} catch ( Exception e ) {
ExceptionUtil . throwException ( e ) ;
ExceptionUtil . throwException ( e ) ;