|
|
|
@ -10,7 +10,6 @@ import com.foreverwin.mesnac.common.util.StringUtil;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.dto.RouterStepDto;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.dto.SfcDto;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.model.Router;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.model.WorkCenter;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.service.RouterService;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.service.RouterStepService;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.service.ShopOrderService;
|
|
|
|
@ -22,7 +21,6 @@ import com.foreverwin.mesnac.production.model.SplitSfc;
|
|
|
|
|
import com.foreverwin.mesnac.production.model.StepOperation;
|
|
|
|
|
import com.foreverwin.mesnac.production.service.SplitSfcService;
|
|
|
|
|
import com.foreverwin.modular.core.exception.BaseException;
|
|
|
|
|
import com.foreverwin.modular.core.exception.BusinessException;
|
|
|
|
|
import com.foreverwin.modular.core.meext.MEServices;
|
|
|
|
|
import com.foreverwin.modular.core.util.CommonMethods;
|
|
|
|
|
import com.foreverwin.modular.core.util.FrontPage;
|
|
|
|
@ -159,19 +157,8 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
|
|
|
|
|
splitSfc.setCreateUser(CommonMethods.getUser());
|
|
|
|
|
splitSfc.setCreatedDateTime(LocalDateTime.now());
|
|
|
|
|
save(splitSfc);
|
|
|
|
|
String workCenter = null;
|
|
|
|
|
if (operation.contains("_")) {
|
|
|
|
|
workCenter = operation.split("_")[0];
|
|
|
|
|
} else {
|
|
|
|
|
workCenter = operation;
|
|
|
|
|
}
|
|
|
|
|
String workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter);
|
|
|
|
|
WorkCenter workCenterModel = workCenterService.getById(workCenterBo);
|
|
|
|
|
if (workCenterModel == null) {
|
|
|
|
|
throw BusinessException.build("生产车间【" +workCenter+ "】不存在");
|
|
|
|
|
}
|
|
|
|
|
Router routerBySfcBo = routerService.getRouterBySfcBo(HandleEnum.SFC.getHandle(site, sfc));
|
|
|
|
|
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),workCenter,newSfc, sfcData.getShopOrder(),routerBySfcBo.getHandle());
|
|
|
|
|
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),null,newSfc, sfcData.getShopOrder(),routerBySfcBo.getHandle());
|
|
|
|
|
return splitSfc;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
ExceptionUtil.throwException(e);
|
|
|
|
@ -257,23 +244,11 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
|
|
|
|
|
dispositionSfcsRequest.setDispositionSelection(dispositionSelection);
|
|
|
|
|
dispositionSfcsRequest.setProdCtx(new ProductionContext());
|
|
|
|
|
ncProductionService.dispositionMultipleSfcs(dispositionSfcsRequest);
|
|
|
|
|
String workCenter;
|
|
|
|
|
List<RouterStepDto> routerOperationByRouterBo = routerStepService.findRouterOperationByRouterBo(site, maxRevisionRouter.getHandle());
|
|
|
|
|
if (routerOperationByRouterBo.isEmpty()){
|
|
|
|
|
throw new BaseException("处置工艺路线没有步骤");
|
|
|
|
|
}
|
|
|
|
|
String routerOperation = routerOperationByRouterBo.get(0).getOperation();
|
|
|
|
|
if (routerOperation.contains("_")) {
|
|
|
|
|
workCenter = routerOperation.split("_")[0];
|
|
|
|
|
} else {
|
|
|
|
|
workCenter = routerOperation;
|
|
|
|
|
}
|
|
|
|
|
String workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter);
|
|
|
|
|
WorkCenter workCenterModel = workCenterService.getById(workCenterBo);
|
|
|
|
|
if (workCenterModel == null) {
|
|
|
|
|
throw BusinessException.build("生产车间【" +workCenter+ "】不存在");
|
|
|
|
|
}
|
|
|
|
|
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),workCenter,newSfc, sfcData.getShopOrder(),maxRevisionRouter.getHandle());
|
|
|
|
|
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),null,newSfc, sfcData.getShopOrder(),maxRevisionRouter.getHandle());
|
|
|
|
|
}
|
|
|
|
|
SplitSfc splitSfc=new SplitSfc();
|
|
|
|
|
splitSfc.setHandle(HandleEnum.SPLIT_SFC.getHandle(site,newSfc));
|
|
|
|
|