生产单管理中的@PreAuthorize权限串修改

This commit is contained in:
gaoqr
2024-06-19 11:52:39 +08:00
parent 58d84d5b7a
commit fbd71fd03a
@@ -70,14 +70,14 @@ public class OrderController {
@PostMapping("/create") @PostMapping("/create")
@Operation(summary = "创建生产单") @Operation(summary = "创建生产单")
@PreAuthorize("@ss.hasPermission('executor:order:create')") @PreAuthorize("@ss.hasPermission('production:manager-list:create')")
public CommonResult<Long> createOrder(@Valid @RequestBody OrderSaveReqVO createReqVO) { public CommonResult<Long> createOrder(@Valid @RequestBody OrderSaveReqVO createReqVO) {
return success(orderService.createOrder(createReqVO)); return success(orderService.createOrder(createReqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@Operation(summary = "更新生产单") @Operation(summary = "更新生产单")
@PreAuthorize("@ss.hasPermission('executor:order:update')") @PreAuthorize("@ss.hasPermission('production:manager-list:edit')")
public CommonResult<Boolean> updateOrder(@Valid @RequestBody OrderSaveReqVO updateReqVO) { public CommonResult<Boolean> updateOrder(@Valid @RequestBody OrderSaveReqVO updateReqVO) {
orderService.updateOrder(updateReqVO); orderService.updateOrder(updateReqVO);
return success(true); return success(true);
@@ -90,7 +90,7 @@ public class OrderController {
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024"), @Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024"),
@Parameter(name = "bodyIds", description = "柜体编号集合", required = true, example = "1,2") @Parameter(name = "bodyIds", description = "柜体编号集合", required = true, example = "1,2")
}) })
@PreAuthorize("@ss.hasPermission('executor:order:delete')") @PreAuthorize("@ss.hasPermission('production:manager-list:deleteCabinet')")
public CommonResult<Boolean> deleteBody(@RequestParam("orderId") Long orderId, @RequestParam("bodyIds") Set<Long> bodyIds) { public CommonResult<Boolean> deleteBody(@RequestParam("orderId") Long orderId, @RequestParam("bodyIds") Set<Long> bodyIds) {
orderService.deleteBodyByOrder(orderId, bodyIds); orderService.deleteBodyByOrder(orderId, bodyIds);
return success(true); return success(true);
@@ -99,7 +99,7 @@ public class OrderController {
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "作废") @Operation(summary = "作废")
@Parameter(name = "orderId", description = "生产单id", required = true, example = "1") @Parameter(name = "orderId", description = "生产单id", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('executor:order:delete')") @PreAuthorize("@ss.hasPermission('production:manager-list:nullify')")
public CommonResult<Boolean> deleteOrder(@RequestParam("orderId") Long orderId) { public CommonResult<Boolean> deleteOrder(@RequestParam("orderId") Long orderId) {
orderService.deleteOrder(orderId); orderService.deleteOrder(orderId);
return success(true); return success(true);
@@ -108,7 +108,7 @@ public class OrderController {
@PutMapping("/restore") @PutMapping("/restore")
@Operation(summary = "还原") @Operation(summary = "还原")
@Parameter(name = "orderId", description = "生产单id", required = true, example = "1") @Parameter(name = "orderId", description = "生产单id", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('executor:order:update')") @PreAuthorize("@ss.hasPermission('production:manager-list:backOrder')")
public CommonResult<Boolean> restoreOrder(@RequestBody JSONObject jsonObject) { public CommonResult<Boolean> restoreOrder(@RequestBody JSONObject jsonObject) {
Long orderId = jsonObject.getLong("orderId"); Long orderId = jsonObject.getLong("orderId");
orderService.restoreOrder(orderId); orderService.restoreOrder(orderId);
@@ -118,7 +118,7 @@ public class OrderController {
@GetMapping("/get") @GetMapping("/get")
@Operation(summary = "获得(单个)生产单") @Operation(summary = "获得(单个)生产单")
@Parameter(name = "id", description = "编号", required = true, example = "1024") @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('executor:order:query')") @PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<OrderRespVO> getOrder(@RequestParam("id") Long id) { public CommonResult<OrderRespVO> getOrder(@RequestParam("id") Long id) {
OrderDO order = orderService.getOrder(id); OrderDO order = orderService.getOrder(id);
return success(BeanUtils.toBean(order, OrderRespVO.class)); return success(BeanUtils.toBean(order, OrderRespVO.class));
@@ -126,7 +126,7 @@ public class OrderController {
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得生产单分页") @Operation(summary = "获得生产单分页")
@PreAuthorize("@ss.hasPermission('executor:order:query')") @PreAuthorize("@ss.hasPermission('productManager:List')")
public CommonResult<PageResult<OrderRespVO>> getOrderPage(@Valid OrderPageReqVO pageReqVO) { public CommonResult<PageResult<OrderRespVO>> getOrderPage(@Valid OrderPageReqVO pageReqVO) {
PageResult<OrderDO> pageResult = orderService.getOrderPage(pageReqVO); PageResult<OrderDO> pageResult = orderService.getOrderPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, OrderRespVO.class)); return success(BeanUtils.toBean(pageResult, OrderRespVO.class));
@@ -142,7 +142,7 @@ public class OrderController {
@GetMapping("/get-room") @GetMapping("/get-room")
@Operation(summary = "生产单详情-房间和柜体id") @Operation(summary = "生产单详情-房间和柜体id")
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024") @Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('executor:order:query')") @PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<List<OrderBodyRespVO>> getRoom(@RequestParam("orderId") Long orderId) { public CommonResult<List<OrderBodyRespVO>> getRoom(@RequestParam("orderId") Long orderId) {
List<OrderBodyRespVO> orderBodyMap = orderService.getOrderBody(orderId); List<OrderBodyRespVO> orderBodyMap = orderService.getOrderBody(orderId);
return success(orderBodyMap); return success(orderBodyMap);
@@ -151,7 +151,7 @@ public class OrderController {
@GetMapping("/get-module") @GetMapping("/get-module")
@Operation(summary = "生产单详情-数量信息") @Operation(summary = "生产单详情-数量信息")
@Parameter(name = "orderId", description = "生产单编号", example = "1024") @Parameter(name = "orderId", description = "生产单编号", example = "1024")
@PreAuthorize("@ss.hasPermission('executor:order:query')") @PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<Map<String,List<?>>> getModule(@RequestParam("orderId") Long orderId) { public CommonResult<Map<String,List<?>>> getModule(@RequestParam("orderId") Long orderId) {
Map<String,List<?>> moduleDOList = orderService.getModule(orderId); Map<String,List<?>> moduleDOList = orderService.getModule(orderId);
return success(moduleDOList); return success(moduleDOList);
@@ -166,7 +166,7 @@ public class OrderController {
@Parameter(name = "groupId", description = "加工组编号", example = "1024"), @Parameter(name = "groupId", description = "加工组编号", example = "1024"),
@Parameter(name = "groupName", description = "加工组名称", example = "弧形") @Parameter(name = "groupName", description = "加工组名称", example = "弧形")
}) })
@PreAuthorize("@ss.hasPermission('executor:order:query')") @PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<List<OrderPlatesDetailReqVO>> platesDetails(@RequestParam("orderId") Long orderId, public CommonResult<List<OrderPlatesDetailReqVO>> platesDetails(@RequestParam("orderId") Long orderId,
@RequestParam(value = "roomId", required = false) Long roomId, @RequestParam(value = "roomId", required = false) Long roomId,
@RequestParam(value = "bodyId", required = false) Long bodyId, @RequestParam(value = "bodyId", required = false) Long bodyId,
@@ -184,7 +184,7 @@ public class OrderController {
@Parameter(name = "bodyId", description = "柜体编号", example = "1024"), @Parameter(name = "bodyId", description = "柜体编号", example = "1024"),
@Parameter(name = "name", description = "配件名称", example = "1024") @Parameter(name = "name", description = "配件名称", example = "1024")
}) })
@PreAuthorize("@ss.hasPermission('executor:order:query')") @PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<List<OrderPartsRespVO>> partsDetails(@RequestParam("orderId") Long orderId, public CommonResult<List<OrderPartsRespVO>> partsDetails(@RequestParam("orderId") Long orderId,
@RequestParam(value = "roomId", required = false) Long roomId, @RequestParam(value = "roomId", required = false) Long roomId,
@RequestParam(value = "bodyId", required = false) Long bodyId, @RequestParam(value = "bodyId", required = false) Long bodyId,
@@ -197,14 +197,14 @@ public class OrderController {
@GetMapping("/get-body") @GetMapping("/get-body")
@Operation(summary = "生产单柜体数据获取") @Operation(summary = "生产单柜体数据获取")
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024") @Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('executor:order:query')") @PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<List<OrderBodyRespVO>> getBody(@RequestParam("orderId") Long orderId) { public CommonResult<List<OrderBodyRespVO>> getBody(@RequestParam("orderId") Long orderId) {
return success(BeanUtils.toBean(orderService.getBody(orderId), OrderBodyRespVO.class)); return success(BeanUtils.toBean(orderService.getBody(orderId), OrderBodyRespVO.class));
} }
@GetMapping("getApiData") @GetMapping("getApiData")
@Operation(summary = "生产单api数据导入新增") @Operation(summary = "生产单api数据导入新增")
@PreAuthorize("@ss.hasPermission('executor:order:getApiData')") @PreAuthorize("@ss.hasPermission('production:manager-list:create')")
public CommonResult<Long> test(@RequestParam(value = "orderNo", required = false, defaultValue = "20230809027818") String orderNo) public CommonResult<Long> test(@RequestParam(value = "orderNo", required = false, defaultValue = "20230809027818") String orderNo)
throws InterruptedException, ExecutionException { throws InterruptedException, ExecutionException {
// return success(orderService.importApiData(orderNo)); // return success(orderService.importApiData(orderNo));
@@ -235,7 +235,7 @@ public class OrderController {
@Parameter(name = "file", description = "文件", required = true), @Parameter(name = "file", description = "文件", required = true),
@Parameter(name = "type", description = "文件类型", required = true) @Parameter(name = "type", description = "文件类型", required = true)
}) })
@PreAuthorize("@ss.hasPermission('executor:order:importExcel')") @PreAuthorize("@ss.hasPermission('production:manager-list:create')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportTest(@RequestPart("file") MultipartFile file, public void exportTest(@RequestPart("file") MultipartFile file,
@RequestParam(value = "type", required = false, defaultValue = "true") Integer type, @RequestParam(value = "type", required = false, defaultValue = "true") Integer type,
@@ -274,7 +274,7 @@ public class OrderController {
@GetMapping("/get-goodsList") @GetMapping("/get-goodsList")
@Operation(summary = "生产单所用板材商品信息") @Operation(summary = "生产单所用板材商品信息")
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024") @Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('executor:order:query')") @PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<List<GoodsDO>> getGoodsList(@RequestParam("orderId") Long orderId) { public CommonResult<List<GoodsDO>> getGoodsList(@RequestParam("orderId") Long orderId) {
List<GoodsDO> goodsDOS = orderService.getGoodsList(orderId); List<GoodsDO> goodsDOS = orderService.getGoodsList(orderId);
return success(goodsDOS); return success(goodsDOS);
@@ -286,7 +286,7 @@ public class OrderController {
@Parameter(name = "file", description = "文件", required = true), @Parameter(name = "file", description = "文件", required = true),
@Parameter(name = "type", description = "是否强制上传", required = false) @Parameter(name = "type", description = "是否强制上传", required = false)
}) })
@PreAuthorize("@ss.hasPermission('executor:order:upload')") @PreAuthorize("@ss.hasPermission('production:manager-list:create')")
public CommonResult<String> uploadOrderType(@RequestPart("file") MultipartFile file, public CommonResult<String> uploadOrderType(@RequestPart("file") MultipartFile file,
@RequestParam(value = "type", required = false, defaultValue = "false") Boolean type) { @RequestParam(value = "type", required = false, defaultValue = "false") Boolean type) {
return success(orderService.importTemplate(file,type)); return success(orderService.importTemplate(file,type));
@@ -295,7 +295,7 @@ public class OrderController {
@GetMapping("/printing") @GetMapping("/printing")
@Operation(summary = "打印/导出 数据文件") @Operation(summary = "打印/导出 数据文件")
@Parameter(name = "type", description = "文件类型", required = true, example = "0") @Parameter(name = "type", description = "文件类型", required = true, example = "0")
@PreAuthorize("@ss.hasPermission('executor:order:query')") @PreAuthorize("@ss.hasPermission('production:manager-list:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public CommonResult<Map<String, Object>> getOrderPrintData( public CommonResult<Map<String, Object>> getOrderPrintData(
@RequestParam("orderId") Long orderId, @RequestParam("orderId") Long orderId,