mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
已排单,生产排单权限修改,禅道 1437 修复
This commit is contained in:
+1
-1
@@ -54,7 +54,7 @@ public class RemainPlateManageController {
|
||||
|
||||
@PostMapping("/createMultiple")
|
||||
@Operation(summary = "创建生产单余料板表(多个)")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:remain-plate:create','placeorder:optimize')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:remain-plate:create','producePlan:optimize:remain-plate-store','placeorder:optimize:remain-plate-store')")
|
||||
public CommonResult<Boolean> createRemainPlateMultiple(@Valid @RequestBody Set<RemainPlateSaveReqVO> createReqVOS) {
|
||||
return success(remainPlateService.createRemainPlateMultiple(createReqVOS));
|
||||
}
|
||||
|
||||
+1
-1
@@ -446,7 +446,7 @@ public class OrderController {
|
||||
@GetMapping("/get-room-and-body")
|
||||
@Operation(summary = "获取柜体和房间信息")
|
||||
@Parameter(name = "planId", description = "排单ID", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('production:manager-list:detail','placeorder:optimize:manual-optimization','producePlan:optimize:manual-optimization')")
|
||||
public CommonResult<List<OrderRoomBodyRespVO>> getRoomAndBody(@RequestParam("planId") Long planId) {
|
||||
return success(orderService.getRoomAndBody(planId));
|
||||
}
|
||||
|
||||
+9
-9
@@ -39,7 +39,7 @@ public class OptimizePlanController {
|
||||
|
||||
@GetMapping("/getPlateListByPlanId")
|
||||
@Operation(summary = "根据排单id获取板材列表")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize','producePlan:optimize')")
|
||||
public CommonResult<List<PlateOptimize>> getPlateListByPlanId(@Schema(description = "排单id") @RequestParam("planId") Long planId) {
|
||||
return CommonResult.success(optimizePlanService.getPlateListByPlanId(planId));
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class OptimizePlanController {
|
||||
|
||||
@PostMapping("/addRemain")
|
||||
@Operation(summary = "添加余料板")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize','producePlan:optimize')")
|
||||
public CommonResult<Boolean> addRemain(@RequestBody @Valid AddRemainReqVO vo){
|
||||
return CommonResult.success(optimizePlanService.addRemain(vo));
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class OptimizePlanController {
|
||||
|
||||
@PutMapping("/updateCuttingStatus")
|
||||
@Operation(summary = "修改开料状态")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize:updateCuttingStatus','placeorder:optimize:cutting-materials')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize:updateCuttingStatus','placeorder:optimize:cutting-materials','producePlan:optimize:cutting-materials','producePlan:optimize:updateCuttingStatus')")
|
||||
public CommonResult<Boolean> updateCuttingStatus(@RequestBody CuttingStatusRespVO respVO) {
|
||||
optimizePlanService.updateCuttingStatus(respVO);
|
||||
return success(Boolean.TRUE);
|
||||
@@ -92,7 +92,7 @@ public class OptimizePlanController {
|
||||
|
||||
@GetMapping("/getOrderSource")
|
||||
@Operation(summary = "获取生产单源数据")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize','production:manager-list:calculate','manage:order-plan:process-scheme')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize','production:manager-list:calculate','manage:order-plan:process-scheme','producePlan:order-plan:process-scheme','producePlan:optimize')")
|
||||
public CommonResult<OrderSource> getOrderSource(@Schema(description = "生产单id") @RequestParam(required = false) Long orderId,
|
||||
@Schema(description = "排单id") @RequestParam(required = false) Long planId,
|
||||
@Schema(description = "机台Id") @RequestParam(required = false) Long machineId
|
||||
@@ -104,7 +104,7 @@ public class OptimizePlanController {
|
||||
|
||||
@GetMapping("/getLabelDataSourceValue")
|
||||
@Operation(summary = "获取标签数据源value")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize','producePlan:optimize')")
|
||||
public CommonResult<Map<String,Object>> getLabelDataSourceValue(@Valid GetSourceDataReq req ) {
|
||||
return CommonResult.success( optimizePlanService.getLabelDataSourceValue(req));
|
||||
|
||||
@@ -113,7 +113,7 @@ public class OptimizePlanController {
|
||||
|
||||
@PostMapping("/saveOptimizationResults")
|
||||
@Operation(summary = "保存优化生产后的数据")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize:save-optimize','placeorder:optimize:re-optimize','producePlan:optimize:re-optimize','producePlan:optimize:save-optimize')")
|
||||
public CommonResult<Boolean> saveOptimizationResults(@Valid @RequestBody SavePlanPlateResultReqVO req ) {
|
||||
|
||||
optimizePlanService.saveOptimizationResults(req);
|
||||
@@ -125,7 +125,7 @@ public class OptimizePlanController {
|
||||
|
||||
@PostMapping("/saveProcessSchemeResults")
|
||||
@Operation(summary = "保存方案组的优化信息")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize','manage:order-plan:process-scheme')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize','manage:order-plan:process-scheme','producePlan:order-plan:process-scheme','producePlan:optimize')")
|
||||
public CommonResult<Boolean> saveProcessSchemeResults(@RequestBody SaveProcessSchemeReqVO saveProcessSchemeReqVO) {
|
||||
|
||||
optimizePlanService.saveProcessSchemeResults(saveProcessSchemeReqVO);
|
||||
@@ -139,7 +139,7 @@ public class OptimizePlanController {
|
||||
@GetMapping("/getProcessSchemeConfig")
|
||||
@Operation(summary = "查询加工方案组对应的配置信息")
|
||||
@Parameter(name = "planId", description = "排单ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('manage:order-plan:process-scheme')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:order-plan:process-scheme','producePlan:order-plan:process-scheme')")
|
||||
public CommonResult<PlanProcessSchemeList> getProcessSchemeConfig(@Schema(description = "方案组ID") @NotNull(message = "方案组的ID不能为空") Long processId,
|
||||
@Schema(description = "排单id") @RequestParam Long planId) {
|
||||
|
||||
@@ -153,7 +153,7 @@ public class OptimizePlanController {
|
||||
|
||||
@PutMapping("/updateProcessScheme")
|
||||
@Operation(summary = "修改排单对应的方案组的是否锁单")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:optimize','producePlan:optimize')")
|
||||
public CommonResult<Boolean> updateProcessScheme(@RequestBody PlanProcessSchemeReqVO reqVO) {
|
||||
optimizePlanService.updateProcessScheme(reqVO);
|
||||
return success(true);
|
||||
|
||||
+4
-4
@@ -69,7 +69,7 @@ public class PlanController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得排单")
|
||||
@Parameter(name = "id", description = "排单id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:query','producePlan:query')")
|
||||
public CommonResult<PlanRespVO> getPlan(@RequestParam("id") @NotNull(message = "排单数据异常,请重新操作") Long id) {
|
||||
PlanRespVO plan = planService.getPlan(id);
|
||||
return success(BeanUtils.toBean(plan, PlanRespVO.class));
|
||||
@@ -77,21 +77,21 @@ public class PlanController {
|
||||
|
||||
@GetMapping("getPlateByPlanId")
|
||||
@Operation(summary = "根据排单id获取小板分页")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:query','producePlan:query')")
|
||||
public CommonResult<PageResult<PlateResList>> getPlateByPlanId(@Valid GetPlateByPlanIdVO vo) {
|
||||
return success(planService.getPlateByPlanId(vo));
|
||||
}
|
||||
|
||||
@GetMapping("getOrderByPlan")
|
||||
@Operation(summary = "根据排单获取生产单分页")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:query','placeorder:priority')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:query','placeorder:priority','producePlan:query')")
|
||||
public CommonResult<PageResult<OrderRespVO>> getOrderByPlanId(@Valid PlanOrderPageReqVO pageReqVO) {
|
||||
return success(planService.getOrderByPlanId(pageReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得排单分页")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:query','placeorder:priority')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('placeorder:query','placeorder:priority','producePlan:query')")
|
||||
public CommonResult<PageResult<PlanRespVO>> getPlanPage(@Valid PlanPageReqVO pageReqVO) {
|
||||
PageResult<PlanRespVO> pageResult = planService.getPlanPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlanRespVO.class));
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ public class PlateController {
|
||||
|
||||
@PostMapping("/insertPlate")
|
||||
@Operation(summary = "优化生产创建板材")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('executor:plate:create','placeorder:optimize')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('executor:plate:create','placeorder:optimize:manual-optimization','producePlan:optimize:manual-optimization')")
|
||||
public CommonResult<List<InsertPlateRespVO>> createNewPlate(@Valid @RequestBody List<OptimizationSavePlateReqVO> reqVO) {
|
||||
return success(plateService.createNewPlate(reqVO));
|
||||
}
|
||||
|
||||
+23
-5
@@ -676,6 +676,8 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
Long planId = boardModelDO.getPlanId();
|
||||
|
||||
Long processId = 1L;
|
||||
|
||||
|
||||
// // 延长操作用户的缓存时间
|
||||
// redisInsertPlanCreator(planId);
|
||||
@@ -688,6 +690,18 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
AssertUtils.notEmpty(planDO,ORDER_PLAN_DATE_ERROR);
|
||||
|
||||
if(planDO.getStatus().equals(PlanStatusEnum.OPENED.getStatus())){
|
||||
throw exception(THIS_PLAN_OPTIMIZE_DATA_ERROR);
|
||||
}
|
||||
|
||||
|
||||
// 兼容数据,后期可删除
|
||||
List<OptimizeBoardModelDO> document = esUtils.getEsDocument(FIELD_PLAN_ID, planId, ORDER_OPTIMIZE_PLATE_MODEL, OptimizeBoardModelDO.class);
|
||||
if(CollUtil.isNotEmpty(document)){
|
||||
OptimizeBoardModelDO optimizeBoardModelDO = document.get(0);
|
||||
processId = optimizeBoardModelDO.getProcessId();
|
||||
}
|
||||
|
||||
|
||||
if(req.getProcessId() != null){
|
||||
|
||||
@@ -698,15 +712,13 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
planDO.setProcessId(req.getProcessId());
|
||||
planMapper.updateById(planDO);
|
||||
|
||||
}
|
||||
|
||||
if(boardModelDO.getProcessId() == null) {
|
||||
esUtils.deleteEsDocument(FIELD_PLAN_ID, planId, ORDER_OPTIMIZE_PLATE_MODEL);
|
||||
esUtils.deleteEsDocument(FIELD_PLAN_ID, FIELD_PROCESS_ID, planId, req.getProcessId(), ORDER_OPTIMIZE_PLATE_MODEL);
|
||||
|
||||
}else {
|
||||
esUtils.deleteEsDocument(FIELD_PLAN_ID, FIELD_PROCESS_ID, planId, req.getProcessId(), ORDER_OPTIMIZE_PLATE_MODEL);
|
||||
esUtils.deleteEsDocument(FIELD_PLAN_ID, FIELD_PLAN_CONFIG_ID, planId, boardModelDO.getPlanConfigId(), ORDER_OPTIMIZE_PLATE_MODEL);
|
||||
}
|
||||
|
||||
|
||||
}else {
|
||||
|
||||
boardModelDO.setProcessId(planDO.getProcessId());
|
||||
@@ -740,6 +752,12 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
esUtils.refresh(ORDER_OPTIMIZE_PLATE_MODEL);
|
||||
|
||||
|
||||
if (processId == null) {
|
||||
|
||||
esUtils.deleteEsDocument(FIELD_PLAN_ID, planId, ORDER_OPTIMIZE_PLATE_MODEL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// List<OptimizeBoardModelDO> optimizeBoardModelDOS = esUtils.getEsDocument(FIELD_PLAN_CONFIG_ID,FIELD_PLAN_ID,req.getPlanConfigId(), planId, ORDER_OPTIMIZE_PLATE_MODEL, OptimizeBoardModelDO.class);
|
||||
|
||||
|
||||
+5
-2
@@ -261,8 +261,6 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
}else {
|
||||
|
||||
|
||||
|
||||
planDO.setIsScheduled(updateReqVO.getIsScheduled());
|
||||
planMapper.updateById(planDO);
|
||||
}
|
||||
@@ -968,6 +966,9 @@ public class PlanServiceImpl implements PlanService {
|
||||
grouped.forEach((key,value) ->{
|
||||
|
||||
List<GoodsRespVO> goodsRespVOS = goodsMapper.selectNoOrderPlanGoods(value, getUserOrganId());
|
||||
if(goodsRespVOS.size() == 1){
|
||||
return;
|
||||
}
|
||||
|
||||
planActualGoodsResps.add(
|
||||
PlanActualGoodsResp.builder()
|
||||
@@ -1513,8 +1514,10 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
if(CollUtil.isNotEmpty(planActualGoodsLists)) {
|
||||
|
||||
// 有选实际大板的小板加大板创建排单
|
||||
getCreatePlanMultipleGoodsList(planActualGoodsLists,planItemDOS,plateItemList,planActualGoodsModelDOS,planDOS,processId,loginUser);
|
||||
|
||||
// 没有选择实际大板的创建排单
|
||||
if(MixConfigTypeEnum.SAMEMATERIALANDTHICKNESS.equals(mixedType)){
|
||||
// 筛选出材质和厚度相同的大板
|
||||
grouped = groupByMaterialAndThicknessEqualToOne(goodsItemList);
|
||||
|
||||
-11
@@ -36,23 +36,12 @@ public class CuttingSaveReqVO {
|
||||
@NotNull(message = "标签id不能空")
|
||||
private Long labelId;
|
||||
|
||||
// // 新的机台逻辑需要删除
|
||||
// @Schema(description = "机台模板id")
|
||||
// @NotNull(groups = CreateGroup.class, message = "机台模板id不能空")
|
||||
// private Long templateId;
|
||||
|
||||
@Schema(description = "品牌ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "品牌ID不能为空")
|
||||
private Long brandId;
|
||||
|
||||
|
||||
// @Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// private String brand;
|
||||
|
||||
// @Schema(description = "型号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// private String model;
|
||||
|
||||
|
||||
@Schema(description = "机台的型号-机台的ID")
|
||||
@NotNull(message = "机台型号不能为空",groups = CreateGroup.class)
|
||||
private Long machineId;
|
||||
|
||||
-1
@@ -18,7 +18,6 @@ public class MachineConvert {
|
||||
.labelId(createReqVO.getLabelId())
|
||||
.setting(createReqVO.getMachineSettingDO().toJSONString())
|
||||
.brandId(createReqVO.getBrandId())
|
||||
// .model(createReqVO.getModel())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user