From 8e5d71bf4bcf757918722cf377d03061b0291556 Mon Sep 17 00:00:00 2001 From: liuzhaotian Date: Wed, 26 Jun 2024 14:56:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E9=85=8D=E7=BD=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E4=BF=AE=E6=94=B9=EF=BC=8C=E7=A6=85=E9=81=93-?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=EF=BC=8C=E5=B7=A5=E5=BA=8FBug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/plan/PlanServiceImpl.java | 16 +++++++++-- .../resources/mapper/plate/PlateMapper.xml | 8 +++--- .../controller/admin/pack/PackController.java | 12 +++++---- .../admin/plate/PlateController.java | 24 +++++++++++------ .../controller/admin/dept/DeptController.java | 12 ++++++--- .../LabelTemplateController.java | 4 +-- .../admin/machine/MachineAuthController.java | 8 +++--- .../MachineTemplateAuthController.java | 8 +++--- .../machine/MachineTemplateController.java | 10 +++---- .../permission/PermissionController.java | 21 ++++++++++----- .../admin/permission/RoleController.java | 21 ++++++++++----- .../controller/admin/user/UserController.java | 27 ++++++++++++------- .../dal/mysql/process/ProcessMapper.java | 1 + .../mapper/process/ProcessMapper.xml | 1 + 14 files changed, 112 insertions(+), 61 deletions(-) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java index 5efdfdebe..03057dc2f 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java @@ -2,6 +2,7 @@ package com.cf.imes.module.executor.service.plan; import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -320,7 +321,7 @@ public class PlanServiceImpl implements PlanService { queryWrapperX .eq("a.organ_id",getUserOrganId()) .eq("a.status",OrderStatusEnum.NO_SORT.getStatus()) - .eqIfPresent("a.id", pageReqVO.getOrderId()) + .likeIfPresent("a.id", "%"+pageReqVO.getOrderId()+"%") .isNull("opi.item_id") .eqIfPresent("a.customer", pageReqVO.getConsignee()) .eqIfPresent("a.custom_order_no", pageReqVO.getDefaultId()) @@ -450,6 +451,7 @@ public class PlanServiceImpl implements PlanService { .betweenIfPresent("a.height", new BigDecimal[]{vo.getLongMinRang(), vo.getLongMaxRang()}) .inIfPresent("a.filter_type", filterTypes) .betweenIfPresent("f.delivery_date", new Date[]{vo.getBeginDate(), vo.getEndDate()}) + .orderByDesc("a.order_id") .orderByDesc("a.name"); PageDTO page = new PageDTO<>(vo.getPageNo(), vo.getPageSize()); IPage pageResult = plateMapper.selectPlateByPlanId(page, queryWrapperX); @@ -513,8 +515,18 @@ public class PlanServiceImpl implements PlanService { public List getPlateList(List planIds) { - return plateMapper.selectPlateListByPlanId(planIds,getUserOrganId()); + List plateResLists = plateMapper.selectPlateListByPlanId(planIds, getUserOrganId()); + Set bodyIds = plateResLists.stream().map(PlateResList::getBodyId).collect(Collectors.toSet()); + if (CollectionUtil.isNotEmpty(bodyIds)) { + List orderBodyDOS = orderBodyMapper.selectBatchIds(bodyIds); + for (PlateResList resList :plateResLists) { + resList.setBodyName(orderBodyDOS.stream().filter(e -> Objects.equals(e.getId(), resList.getBodyId())).map(OrderBodyDO::getName).findAny().orElse(null)); + resList.setRoomName(orderBodyDOS.stream().filter(e -> Objects.equals(e.getRoomId(), resList.getRoomId())).map(OrderBodyDO::getRoomName).findAny().orElse(null)); + } + } + + return plateResLists; } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml index 4f6980704..10d35340e 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml @@ -296,10 +296,10 @@ select distinct a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id - from order_plan_item p - left join order_item b on p.item_id = b.id and b.organ_id = p.organ_id - left join order_plate a on b.plate_id = a.id and b.order_id = a.order_id and b.organ_id = a.organ_id - left join order_goods e on a.goods_id = e.id and a.order_id = e.order_id and a.organ_id = e.organ_id + from order_plate a + LEFT JOIN order_item b ON a.id = b.plate_id AND a.order_id = b.order_id and a.organ_id = b.organ_id + LEFT JOIN order_goods e ON e.id = a.goods_id AND e.order_id = a.order_id and e.organ_id = a.organ_id + LEFT JOIN order_plan_item p ON b.id = p.item_id and b.organ_id = p.organ_id where p.organ_id = #{organId} and p.plan_id in diff --git a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/pack/PackController.java b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/pack/PackController.java index fea163b15..d7682d1a1 100644 --- a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/pack/PackController.java +++ b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/pack/PackController.java @@ -63,6 +63,7 @@ public class PackController { @GetMapping("/getOrderPlate") @Operation(summary = "查看生产订单对应的板材信息") @Parameter(name = "orderId", description = "生产单Id", required = true) + @PreAuthorize("@ss.hasPermission('manage:pack-palte:query')") public CommonResult> getOrderPlateList(@Valid @RequestParam("orderId") Long orderId) { return success(packService.getOrderPlateList(orderId)); @@ -72,6 +73,7 @@ public class PackController { @GetMapping("/getOrderPlateList") @Operation(summary = "查询多个生产单对应的板材信息") + @PreAuthorize("@ss.hasPermission('manage:pack-palte:query')") public CommonResult> getOrdersPlateList(@Valid @RequestParam List orderIds) { return success(packService.getOrdersPlateList(orderIds)); @@ -121,7 +123,7 @@ public class PackController { @GetMapping("/getParts") @Operation(summary = "查看配件列表分页") - @PreAuthorize("@ss.hasPermission('manage:pack:query')") + @PreAuthorize("@ss.hasPermission('manage:pack-parts:query')") public CommonResult> getParts(@Valid OrderPartsReqVO reqVO) { return success(packService.getPartsList(reqVO)); @@ -136,7 +138,7 @@ public class PackController { @PutMapping("/updatePack") @Operation(summary = "板材包裹更新-即封包") - @PreAuthorize("@ss.hasPermission('manage:pack:updatePack')") + @PreAuthorize("@ss.hasPermission('manage:pack:update')") public CommonResult updatePack(@Valid @RequestBody OrderPackReqVO packageVO) { return success(packService.updatePack(packageVO)); @@ -148,7 +150,7 @@ public class PackController { @PutMapping("/updateParts") @Operation(summary = "配件包裹更新-即封包") - @PreAuthorize("@ss.hasPermission('manage:pack:updateParts')") + @PreAuthorize("@ss.hasPermission('manage:pack:update')") public CommonResult updateParts(@Valid @RequestBody OrderPartsReqVO reqVO) { return success(packService.updateParts(reqVO)); @@ -162,7 +164,7 @@ public class PackController { @GetMapping("/selectPack") @Operation(summary = "查询包裹") @Parameter(name = "orderId", description = "生产单Id", required = true) - @PreAuthorize("@ss.hasPermission('manage:pack:update')") + @PreAuthorize("@ss.hasPermission('manage:pack:query')") public CommonResult> selectPack(@Valid @RequestParam("orderId") Long orderId) { return success(packService.selectPack(orderId)); @@ -186,7 +188,7 @@ public class PackController { @PutMapping("/unpacking") @Operation(summary = "拆包-更改包裹为未封包") - @PreAuthorize("@ss.hasPermission('manage:pack:unpacking')") + @PreAuthorize("@ss.hasPermission('manage:pack:update')") public CommonResult unpacking(@Valid @RequestBody PackingReqVO reqVO) { OrderPackRespVO unpacking = packService.unpacking(reqVO.getPackageId()); diff --git a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/plate/PlateController.java b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/plate/PlateController.java index 8dd95e393..30db06841 100644 --- a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/plate/PlateController.java +++ b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/plate/PlateController.java @@ -44,14 +44,16 @@ public class PlateController { @PostMapping("/create") @Operation(summary = "创建板材信息表 plate_{N}") - @PreAuthorize("@ss.hasPermission('manage:plate:create')") +// @PreAuthorize("@ss.hasPermission('manage:plate:create')") + @PreAuthorize("@ss.hasAnyPermissions('manage:plate:create','base:plate:create')") public CommonResult createPlate(@Valid @RequestBody PlateSaveReqVO createReqVO) { return success(plateService.createPlate(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新板材信息表 plate_{N}") - @PreAuthorize("@ss.hasPermission('manage:plate:update')") +// @PreAuthorize("@ss.hasPermission('manage:plate:update')") + @PreAuthorize("@ss.hasAnyPermissions('manage:plate:update','base:plate:update')") public CommonResult updatePlate(@Valid @RequestBody PlateSaveReqVO updateReqVO) { plateService.updatePlate(updateReqVO); return success(true); @@ -63,7 +65,8 @@ public class PlateController { @Parameter(name = "id", description = "编号", required = true), @Parameter(name = "organId", description = "板材所属组织ID") }) - @PreAuthorize("@ss.hasPermission('manage:plate:delete')") +// @PreAuthorize("@ss.hasPermission('manage:plate:delete')") + @PreAuthorize("@ss.hasAnyPermissions('manage:plate:delete','base:plate:delete')") public CommonResult deletePlate(@RequestParam("id") Long id, @RequestParam(value = "organId",required = false) Long organId) { plateService.deletePlate(id,organId); @@ -73,7 +76,8 @@ public class PlateController { @GetMapping("/get") @Operation(summary = "获得板材信息表 plate_{N}") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('manage:plate:query')") +// @PreAuthorize("@ss.hasPermission('manage:plate:query')") + @PreAuthorize("@ss.hasAnyPermissions('manage:plate:query','base:plate:query')") public CommonResult getPlate(@RequestParam("id") Long id) { PlateDO plate = plateService.getPlate(id); return success(BeanUtils.toBean(plate, PlateRespVO.class)); @@ -81,7 +85,8 @@ public class PlateController { @GetMapping("/page") @Operation(summary = "获得板材信息表 plate_{N}分页") - @PreAuthorize("@ss.hasPermission('manage:plate:query')") +// @PreAuthorize("@ss.hasPermission('manage:plate:query')") + @PreAuthorize("@ss.hasAnyPermissions('manage:plate:query','base:plate:query')") public CommonResult> getPlatePage(@Valid PlatePageReqVO pageReqVO) { PageResult pageResult = plateService.getPlatePage(pageReqVO); return success(BeanUtils.toBean(pageResult, PlateRespVO.class)); @@ -89,7 +94,8 @@ public class PlateController { @GetMapping("/export") @Operation(summary = "导出板材信息") - @PreAuthorize("@ss.hasPermission('manage:plate:export')") +// @PreAuthorize("@ss.hasPermission('manage:plate:export')") + @PreAuthorize("@ss.hasAnyPermissions('manage:plate:export','base:plate:export')") @OperateLog(type = EXPORT) public void exportPlateExcel(@Valid PlatePageReqVO pageReqVO, HttpServletResponse response) throws IOException { @@ -102,7 +108,8 @@ public class PlateController { @GetMapping("/get-import-template") @Operation(summary = "获得导入用户模板") - @PreAuthorize("@ss.hasPermission('manage:plate:export')") +// @PreAuthorize("@ss.hasPermission('manage:plate:export')") + @PreAuthorize("@ss.hasAnyPermissions('manage:plate:export','base:plate:export')") public void importTemplate(HttpServletResponse response) throws IOException { // 手动创建导出 demo List list = Arrays.asList( @@ -122,7 +129,8 @@ public class PlateController { @Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true"), @Parameter(name = "organId", description = "板材所属组织ID") }) - @PreAuthorize("@ss.hasPermission('manage:plate:import')") +// @PreAuthorize("@ss.hasPermission('manage:plate:import')") + @PreAuthorize("@ss.hasAnyPermissions('manage:plate:import','base:plate:import')") public void importExcel(@RequestParam("file") MultipartFile file, @RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport, @RequestParam(value = "organId") Long organId, diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/dept/DeptController.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/dept/DeptController.java index 1739bf031..85abe1f2c 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/dept/DeptController.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/dept/DeptController.java @@ -33,7 +33,8 @@ public class DeptController { @PostMapping("create") @Operation(summary = "创建部门") - @PreAuthorize("@ss.hasPermission('system:dept:create')") +// @PreAuthorize("@ss.hasPermission('system:dept:create')") + @PreAuthorize("@ss.hasAnyPermissions('system:dept:create','base:dept:create')") public CommonResult createDept(@Valid @RequestBody DeptSaveReqVO createReqVO) { Long deptId = deptService.createDept(createReqVO); return success(deptId); @@ -41,7 +42,8 @@ public class DeptController { @PutMapping("update") @Operation(summary = "更新部门") - @PreAuthorize("@ss.hasPermission('system:dept:update')") +// @PreAuthorize("@ss.hasPermission('system:dept:update')") + @PreAuthorize("@ss.hasAnyPermissions('system:dept:update','base:dept:update')") public CommonResult updateDept(@Valid @RequestBody DeptSaveReqVO updateReqVO) { deptService.updateDept(updateReqVO); return success(true); @@ -50,7 +52,8 @@ public class DeptController { @DeleteMapping("delete") @Operation(summary = "删除部门") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('system:dept:delete')") +// @PreAuthorize("@ss.hasPermission('system:dept:delete')") + @PreAuthorize("@ss.hasAnyPermissions('system:dept:delete','base:dept:delete')") public CommonResult deleteDept(@RequestParam("id") Long id) { deptService.deleteDept(id); return success(true); @@ -75,7 +78,8 @@ public class DeptController { @GetMapping("/get") @Operation(summary = "获得部门信息") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('system:dept:query')") +// @PreAuthorize("@ss.hasPermission('system:dept:query')") + @PreAuthorize("@ss.hasAnyPermissions('system:dept:query','base:dept:query')") public CommonResult getDept(@RequestParam("id") Long id) { DeptDO dept = deptService.getDept(id); return success(BeanUtils.toBean(dept, DeptRespVO.class)); diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/labeltemplate/LabelTemplateController.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/labeltemplate/LabelTemplateController.java index 44f5706a7..b70693f5a 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/labeltemplate/LabelTemplateController.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/labeltemplate/LabelTemplateController.java @@ -87,7 +87,7 @@ public class LabelTemplateController { @GetMapping("/getDefault") @Operation(summary = "获得默认标签模板") @Parameter(name = "type", description = "标签类型", required = true, example = "1024") - //@PreAuthorize("@ss.hasPermission('system:label-template:query')") + @PreAuthorize("@ss.hasPermission('system:label-template:query')") @OperateLog(enable = false) public CommonResult getDefaultLabelTemplate(@RequestParam("type") String type) { return success(labelTemplateService.getDefaultLabelTemplate(type)); @@ -95,7 +95,7 @@ public class LabelTemplateController { @GetMapping("/setDefaultTemplate") @Operation(summary = "设置默认标签模板") - @PreAuthorize("@ss.hasPermission('system:label-template:query')") + @PreAuthorize("@ss.hasPermission('system:label-template:update')") public CommonResult setDefaultTemplate(@RequestParam Long id) { return success(labelTemplateService.setDefaultTemplate(id)); } diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineAuthController.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineAuthController.java index 5a6bc0c42..a799b25fb 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineAuthController.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineAuthController.java @@ -31,21 +31,21 @@ public class MachineAuthController { @PostMapping("organ-auth") @Operation(summary = "组织机台授权") - @PreAuthorize("@ss.hasPermission('machine-template::query')") + @PreAuthorize("@ss.hasPermission('machine-auth::update')") public CommonResult auth(@RequestBody MachineOrgAuthReq vo) { return success(machineService.auth(vo)); } @GetMapping("organ-page") @Operation(summary = "组织机台授权分页列表") - @PreAuthorize("@ss.hasPermission('machine-template::query')") + @PreAuthorize("@ss.hasPermission('machine-auth::query')") public CommonResult> organTemplatePage(OrganMachinePage page) { return success(machineService.organMachinePage(page)); } @GetMapping("organ-by-organId") @Operation(summary = "根据组织id查询组织机台授权") - @PreAuthorize("@ss.hasPermission('machine-template::query')") + @PreAuthorize("@ss.hasPermission('machine-auth::query')") @Parameter(name = "organId", description = "组织id", required = true, example = "1") public CommonResult organTemplateByOrganId(@RequestParam Long organId ) { return success(machineService.organMachineByOrganId(organId)); @@ -53,7 +53,7 @@ public class MachineAuthController { @GetMapping("page-machine-auth") @Operation(summary = "授权机台分页") - @PreAuthorize("@ss.hasPermission('machine-template::query')") + @PreAuthorize("@ss.hasPermission('machine-auth::query')") public CommonResult> pageTemplateAuth(MachinePageReqVO pageParam) { PageResult page = machineService.page(pageParam); List list = page.getList().stream().map(e->MachineAuthResp.builder() diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineTemplateAuthController.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineTemplateAuthController.java index 09ba622d3..0e4e46f1a 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineTemplateAuthController.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineTemplateAuthController.java @@ -30,21 +30,21 @@ public class MachineTemplateAuthController { @PostMapping("organ-auth-template") @Operation(summary = "组织模板授权") - @PreAuthorize("@ss.hasPermission('machine-template::query')") + @PreAuthorize("@ss.hasPermission('machine-template-auth::update')") public CommonResult auth(@RequestBody MachineOrgAuthReq vo) { return success(machineTemplateService.auth(vo)); } @GetMapping("organ-template-page") @Operation(summary = "组织模板授权分页列表") - @PreAuthorize("@ss.hasPermission('machine-template::query')") + @PreAuthorize("@ss.hasPermission('machine-template-auth::query')") public CommonResult> organTemplatePage(OrganTemplatePage page) { return success(machineTemplateService.organTemplatePage(page)); } @GetMapping("organ-template-by-organId") @Operation(summary = "根据组织id查询组织模板授权") - @PreAuthorize("@ss.hasPermission('machine-template::query')") + @PreAuthorize("@ss.hasPermission('machine-template-auth:query')") @Parameter(name = "organId", description = "组织id", required = true, example = "1") public CommonResult organTemplateByOrganId(@RequestParam Long organId ) { return success(machineTemplateService.organTemplateByOrganId(organId)); @@ -52,7 +52,7 @@ public class MachineTemplateAuthController { @GetMapping("page-template-machine-auth") @Operation(summary = "授权机台模板分页") - @PreAuthorize("@ss.hasPermission('machine-template::query')") + @PreAuthorize("@ss.hasPermission('machine-template-auth::query')") public CommonResult> pageTemplateAuth(MachinePageReqVO pageParam) { PageResult page = machineTemplateService.page(pageParam); List list = page.getList().stream().map(e->TemplateAutoResp.builder() diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineTemplateController.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineTemplateController.java index 22d6ba3e3..854b5d798 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineTemplateController.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineTemplateController.java @@ -36,7 +36,7 @@ public class MachineTemplateController { @GetMapping("/setDefaultTemplate") @Operation(summary = "设置默认机台模板") - @PreAuthorize("@ss.hasPermission('machine-template::create')") + @PreAuthorize("@ss.hasPermission('machine-template::update')") public CommonResult setDefaultTemplate(@RequestParam Long id) { return success(machineTemplateService.setDefaultTemplate(id)); } @@ -57,7 +57,7 @@ public class MachineTemplateController { } - @PutMapping("cutting-machine") + @PutMapping("insert-template-machine") @Operation(summary = "新增机台模板配置") @PreAuthorize("@ss.hasPermission('machine-template::create')") @OperateLog(logArgs = false) @@ -65,7 +65,7 @@ public class MachineTemplateController { return success(machineTemplateService.createCuttingTemplate(reqVO)); } - @PostMapping("cutting-machine") + @PostMapping("update-template-machine") @Operation(summary = "修改机台模板配置") @PreAuthorize("@ss.hasPermission('machine-template::update')") @OperateLog(logArgs = false) @@ -73,14 +73,14 @@ public class MachineTemplateController { return success(machineTemplateService.updateCuttingTemplate(reqVO)); } - @GetMapping("cutting-machine") + @GetMapping("get-template-machine") @Operation(summary = "获取机台模板配置") @PreAuthorize("@ss.hasPermission('machine-template::query')") public CommonResult getCuttingTemplateById(@RequestParam("id") String id) { return success(machineTemplateService.getCuttingTemplateById(id)); } - @DeleteMapping("cutting-machine") + @DeleteMapping("delete-template-machine") @Operation(summary = "删除机台模板配置") @PreAuthorize("@ss.hasPermission('machine-template::delete')") public CommonResult deleteCutting(@RequestParam("id") Long id) { diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/permission/PermissionController.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/permission/PermissionController.java index 95655f945..e31514ec3 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/permission/PermissionController.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/permission/PermissionController.java @@ -45,14 +45,16 @@ public class PermissionController { @Operation(summary = "获得角色拥有的菜单编号") @Parameter(name = "roleId", description = "角色编号", required = true) @GetMapping("/list-role-menus") - @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')") +// @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')") + @PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-role-menu','base:permission:assign-role-menu')") public CommonResult> getRoleMenuList(Long roleId) { return success(permissionService.getRoleMenuListByRoleId(roleId)); } @PostMapping("/assign-role-menu") @Operation(summary = "赋予角色菜单") - @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')") +// @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')") + @PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-role-menu','base:permission:assign-role-menu')") public CommonResult assignRoleMenu(@Validated @RequestBody PermissionAssignRoleMenuReqVO reqVO) { LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); boolean isOrganRole = Objects.equals(reqVO.getRoleId(), InternalRoleConstants.ORGAN_ADMIN_ROLE_ID) || Objects.equals(reqVO.getRoleId(), InternalRoleConstants.ORGAN_STAFF_ROLE_ID); @@ -80,7 +82,8 @@ public class PermissionController { @PostMapping("/assign-role-data-scope") @Operation(summary = "赋予角色数据权限") - @PreAuthorize("@ss.hasPermission('system:permission:assign-role-data-scope')") +// @PreAuthorize("@ss.hasPermission('system:permission:assign-role-data-scope')") + @PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-role-data-scope','base:permission:assign-role-data-scope')") public CommonResult assignRoleDataScope(@Valid @RequestBody PermissionAssignRoleDataScopeReqVO reqVO) { permissionService.assignRoleDataScope(reqVO.getRoleId(), reqVO.getDataScope(), reqVO.getDataScopeDeptIds()); return success(true); @@ -89,14 +92,16 @@ public class PermissionController { @Operation(summary = "获得管理员拥有的角色编号列表") @Parameter(name = "userId", description = "用户编号", required = true) @GetMapping("/list-user-roles") - @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')") +// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')") + @PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')") public CommonResult> listAdminRoles(@RequestParam("userId") Long userId) { return success(permissionService.getUserRoleIdListByUserId(userId)); } @Operation(summary = "赋予用户角色") @PostMapping("/assign-user-role") - @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')") +// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')") + @PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')") public CommonResult assignUserRole(@Validated @RequestBody PermissionAssignUserRoleReqVO reqVO) { Long organId = reqVO.getOrganId() == null ? OrganContextHolder.getOrganId() : reqVO.getOrganId(); permissionService.assignUserRole(reqVO.getUserId(), reqVO.getRoleIds(), organId); @@ -105,7 +110,8 @@ public class PermissionController { @Operation(summary = "赋予多用户角色") @PostMapping("/bath-assign-user-role") - @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')") +// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')") + @PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')") public CommonResult bathAssignUserRole(@Validated @RequestBody PermissionAssignRoleUserReqVO reqVO) { permissionService.batchAssignRoleUsers(reqVO); return success(true); @@ -115,7 +121,8 @@ public class PermissionController { @Operation(summary = "获得拥有角色的用户列表") @Parameter(name = "roleId", description = "角色id", required = true) @GetMapping("/list-role-users") - @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')") +// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')") + @PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')") public CommonResult> listRoleUsers(@RequestParam("roleId") Long roleId, @RequestParam(value = "organId", required = false) Long organId) { return success(permissionService.getListRoleUsers(roleId, organId)); } diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/permission/RoleController.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/permission/RoleController.java index 6c68daa6b..f68b79dea 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/permission/RoleController.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/permission/RoleController.java @@ -48,7 +48,8 @@ public class RoleController { @PostMapping("/create") @Operation(summary = "创建角色") - @PreAuthorize("@ss.hasPermission('system:role:create')") +// @PreAuthorize("@ss.hasPermission('system:role:create')") + @PreAuthorize("@ss.hasAnyPermissions('system:role:create','base:role:create')") public CommonResult createRole(@Valid @RequestBody RoleSaveReqVO createReqVO) { if(Objects.isNull(createReqVO.getOrganId())) { createReqVO.setOrganId(OrganContextHolder.getOrganId()); @@ -59,7 +60,8 @@ public class RoleController { @PutMapping("/update") @Operation(summary = "修改角色") - @PreAuthorize("@ss.hasPermission('system:role:update')") +// @PreAuthorize("@ss.hasPermission('system:role:update')") + @PreAuthorize("@ss.hasAnyPermissions('system:role:update','base:role:update')") public CommonResult updateRole(@Valid @RequestBody RoleSaveReqVO updateReqVO) { if (Objects.equals(updateReqVO.getId(), InternalRoleConstants.ORGAN_ADMIN_ROLE_ID) || Objects.equals(updateReqVO.getId(), InternalRoleConstants.ORGAN_STAFF_ROLE_ID)) { throw new ServiceException(11541, "内置角色无法修改"); @@ -74,7 +76,8 @@ public class RoleController { @PutMapping("/update-status") @Operation(summary = "修改角色状态") - @PreAuthorize("@ss.hasPermission('system:role:update')") +// @PreAuthorize("@ss.hasPermission('system:role:update')") + @PreAuthorize("@ss.hasAnyPermissions('system:role:update','base:role:update')") public CommonResult updateRoleStatus(@Valid @RequestBody RoleUpdateStatusReqVO reqVO) { roleService.updateRoleStatus(reqVO.getId(), reqVO.getStatus()); return success(true); @@ -83,7 +86,8 @@ public class RoleController { @DeleteMapping("/delete") @Operation(summary = "删除角色") @Parameter(name = "id", description = "角色编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('system:role:delete')") +// @PreAuthorize("@ss.hasPermission('system:role:delete')") + @PreAuthorize("@ss.hasAnyPermissions('system:role:delete','base:role:delete')") public CommonResult deleteRole(@RequestParam("id") Long id) { roleService.deleteRole(id); return success(true); @@ -91,7 +95,8 @@ public class RoleController { @GetMapping("/get") @Operation(summary = "获得角色信息") - @PreAuthorize("@ss.hasPermission('system:role:query')") +// @PreAuthorize("@ss.hasPermission('system:role:query')") + @PreAuthorize("@ss.hasAnyPermissions('system:role:query','base:role:query')") public CommonResult getRole(@RequestParam("id") Long id) { RoleDO role = roleService.getRole(id); return success(BeanUtils.toBean(role, RoleRespVO.class)); @@ -99,7 +104,8 @@ public class RoleController { @GetMapping("/page") @Operation(summary = "获得角色分页") - @PreAuthorize("@ss.hasPermission('system:role:query')") +// @PreAuthorize("@ss.hasPermission('system:role:query')") + @PreAuthorize("@ss.hasAnyPermissions('system:role:query','base:role:query')") public CommonResult> getRolePage(RolePageReqVO pageReqVO) { PageResult pageResult = roleService.getRolePage(pageReqVO); return success(BeanUtils.toBean(pageResult, RoleRespVO.class)); @@ -117,7 +123,8 @@ public class RoleController { @GetMapping("/export-excel") @Operation(summary = "导出角色 Excel") @OperateLog(type = EXPORT) - @PreAuthorize("@ss.hasPermission('system:role:export')") +// @PreAuthorize("@ss.hasPermission('system:role:export')") + @PreAuthorize("@ss.hasAnyPermissions('system:role:export','base:role:export')") public void export(HttpServletResponse response, @Validated RolePageReqVO exportReqVO) throws IOException { exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); List list = roleService.getRolePage(exportReqVO).getList(); diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/user/UserController.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/user/UserController.java index 003db048f..7113f5c2b 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/user/UserController.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/user/UserController.java @@ -69,7 +69,8 @@ public class UserController { @PostMapping("/create") @Operation(summary = "新增用户") - @PreAuthorize("@ss.hasPermission('system:user:create')") +// @PreAuthorize("@ss.hasPermission('system:user:create')") + @PreAuthorize("@ss.hasAnyPermissions('system:user:create','base:user:create')") public CommonResult createUser(@Valid @RequestBody UserSaveReqVO reqVO) { Long id = userService.createUser(reqVO); return success(id); @@ -77,7 +78,8 @@ public class UserController { @PutMapping("update") @Operation(summary = "修改用户") - @PreAuthorize("@ss.hasPermission('system:user:update')") +// @PreAuthorize("@ss.hasPermission('system:user:update')") + @PreAuthorize("@ss.hasAnyPermissions('system:user:update','base:user:update')") public CommonResult updateUser(@Valid @RequestBody UserSaveReqVO reqVO) { userService.updateUser(reqVO); return success(true); @@ -86,7 +88,8 @@ public class UserController { @DeleteMapping("/delete") @Operation(summary = "删除用户") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('system:user:delete')") +// @PreAuthorize("@ss.hasPermission('system:user:delete')") + @PreAuthorize("@ss.hasAnyPermissions('system:user:delete','base:user:delete')") public CommonResult deleteUser(@RequestParam("id") Long id) { userService.deleteUser(id); return success(true); @@ -94,7 +97,8 @@ public class UserController { @PutMapping("/update-password") @Operation(summary = "重置用户密码") - @PreAuthorize("@ss.hasPermission('system:user:update-password')") +// @PreAuthorize("@ss.hasPermission('system:user:update-password')") + @PreAuthorize("@ss.hasAnyPermissions('system:user:update-password','base:user:update-password')") public CommonResult updateUserPassword(@Valid @RequestBody UserUpdatePasswordReqVO reqVO) { userService.updateUserPassword(reqVO.getId(), reqVO.getPassword()); return success(true); @@ -102,7 +106,8 @@ public class UserController { @PutMapping("/update-status") @Operation(summary = "修改用户状态") - @PreAuthorize("@ss.hasPermission('system:user:update')") +// @PreAuthorize("@ss.hasPermission('system:user:update')") + @PreAuthorize("@ss.hasAnyPermissions('system:user:update','base:user:update')") public CommonResult updateUserStatus(@Valid @RequestBody UserUpdateStatusReqVO reqVO) { userService.updateUserStatus(reqVO.getId(), reqVO.getStatus()); return success(true); @@ -110,7 +115,8 @@ public class UserController { @GetMapping("/page") @Operation(summary = "获得用户分页列表") - @PreAuthorize("@ss.hasPermission('system:user:list')") +// @PreAuthorize("@ss.hasPermission('system:user:list')") + @PreAuthorize("@ss.hasAnyPermissions('system:user:list','base:user:query')") public CommonResult> getUserPage(@Valid UserPageReqVO pageReqVO) { // 获得用户分页列表 PageResult pageResult = userService.getUserPage(pageReqVO); @@ -138,7 +144,8 @@ public class UserController { @GetMapping("/get") @Operation(summary = "获得用户详情") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('system:user:query')") +// @PreAuthorize("@ss.hasPermission('system:user:query')") + @PreAuthorize("@ss.hasAnyPermissions('system:user:query','base:user:query')") public CommonResult getUser(@RequestParam("id") Long id) { AdminUserDO user = userService.getUser(id); // 拼接数据 @@ -148,7 +155,8 @@ public class UserController { @GetMapping("/export") @Operation(summary = "导出用户") - @PreAuthorize("@ss.hasPermission('system:user:export')") +// @PreAuthorize("@ss.hasPermission('system:user:export')") + @PreAuthorize("@ss.hasAnyPermissions('system:user:export','base:user:export')") @OperateLog(type = EXPORT) public void exportUserList(@Validated UserPageReqVO exportReqVO, HttpServletResponse response) throws IOException { @@ -197,7 +205,8 @@ public class UserController { @Parameter(name = "file", description = "Excel 文件", required = true), @Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true") }) - @PreAuthorize("@ss.hasPermission('system:user:import')") +// @PreAuthorize("@ss.hasPermission('system:user:import')") + @PreAuthorize("@ss.hasAnyPermissions('system:user:import','base:user:import')") public CommonResult importExcel(@RequestParam("file") MultipartFile file, @RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport, @RequestParam(value = "organId", required = false) Long organId diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/dal/mysql/process/ProcessMapper.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/dal/mysql/process/ProcessMapper.java index 5ca78e84c..2307e445b 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/dal/mysql/process/ProcessMapper.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/dal/mysql/process/ProcessMapper.java @@ -61,6 +61,7 @@ public interface ProcessMapper extends BaseMapperX { .eq(ProcessDO::getOrganId, organId) .eq(ProcessDO::getIsEnabled,true) .selectAll(ProcessDO.class) + .orderByDesc(ProcessDO::getSort) .orderByDesc(ProcessDO::getId)); diff --git a/cf-module-system/cf-module-system-biz/src/main/resources/mapper/process/ProcessMapper.xml b/cf-module-system/cf-module-system-biz/src/main/resources/mapper/process/ProcessMapper.xml index 404234698..5a94a9a1d 100644 --- a/cf-module-system/cf-module-system-biz/src/main/resources/mapper/process/ProcessMapper.xml +++ b/cf-module-system/cf-module-system-biz/src/main/resources/mapper/process/ProcessMapper.xml @@ -41,6 +41,7 @@ and p.piece_type = #{vo.pieceType} + order by sort,id desc