From 4c55edc6f53989beb03bf36aabb469d76470b517 Mon Sep 17 00:00:00 2001
From: lohir <3399054449@qq.com>
Date: 星期三, 23 十月 2024 15:43:48 +0800
Subject: [PATCH] 完成创建工单时对工单进行白名单判断
---
ycl-server/src/main/java/com/ycl/platform/controller/WorkOrderController.java | 86 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 81 insertions(+), 5 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/WorkOrderController.java b/ycl-server/src/main/java/com/ycl/platform/controller/WorkOrderController.java
index 33c678f..4b71e63 100644
--- a/ycl-server/src/main/java/com/ycl/platform/controller/WorkOrderController.java
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/WorkOrderController.java
@@ -1,16 +1,27 @@
package com.ycl.platform.controller;
+import annotation.Log;
+import com.ycl.platform.domain.entity.WorkOrderAuditingRecord;
+import com.ycl.platform.domain.entity.WorkOrderWhite;
import com.ycl.platform.domain.form.*;
import com.ycl.platform.domain.query.DistributeWorkOrderQuery;
+import com.ycl.platform.domain.query.WorkOrderExportQuery;
import com.ycl.platform.domain.query.WorkOrderQuery;
+import com.ycl.platform.domain.query.WorkOrderWhiteQuery;
import com.ycl.platform.domain.vo.DistributeWorkOrderVO;
+import com.ycl.platform.domain.vo.WorkOrderVO;
+import com.ycl.platform.domain.vo.WorkOrderYwConditionRecordVO;
import com.ycl.platform.service.WorkOrderService;
import com.ycl.system.Result;
+import com.ycl.system.controller.BaseController;
import com.ycl.system.domain.group.Add;
import com.ycl.system.domain.group.Update;
-import com.ycl.utils.PageUtils;
+import com.ycl.system.page.TableDataInfo;
+import com.ycl.utils.poi.ExcelUtil;
+import enumeration.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
+import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotEmpty;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -18,7 +29,6 @@
import org.springframework.web.bind.annotation.*;
import java.util.List;
-import java.util.Map;
/**
* 宸ュ崟 鍓嶇鎺у埗鍣�
@@ -31,7 +41,7 @@
@Api(value = "宸ュ崟", tags = "宸ュ崟绠$悊")
@RestController
@RequestMapping("/work-order")
-public class WorkOrderController {
+public class WorkOrderController extends BaseController {
private final WorkOrderService workOrderService;
@@ -109,9 +119,18 @@
return workOrderService.page(query);
}
+ @PostMapping("/export")
+ @ApiOperation(value = "瀵煎嚭", notes = "瀵煎嚭")
+ @Log(title = "瀵煎嚭宸ュ崟", businessType = BusinessType.EXPORT)
+ public void export(HttpServletResponse response, WorkOrderExportQuery query) {
+ List<WorkOrderVO> results = workOrderService.export(query);
+ ExcelUtil<WorkOrderVO> util = new ExcelUtil<>(WorkOrderVO.class);
+ util.exportExcel(response, results, "宸ュ崟");
+ }
+
@PostMapping("/distribute/page")
@ApiOperation(value = "涓嬪彂鍒嗛〉", notes = "涓嬪彂鍒嗛〉")
- @PreAuthorize("@ss.hasPermi('work:order:distribute')")
+ @PreAuthorize("@ss.hasPermi('work:order:distribute:page')")
public Result distributePage(@RequestBody DistributeWorkOrderQuery query) {
return workOrderService.distributePage(query);
}
@@ -132,7 +151,7 @@
@GetMapping("/{id}")
@ApiOperation(value = "璇︽儏", notes = "璇︽儏")
- @PreAuthorize("@ss.hasPermi('work:order:query')")
+ @PreAuthorize("@ss.hasPermi('work:order:detail')")
public Result detail(@PathVariable("id") String id) {
return workOrderService.detail(id);
}
@@ -143,4 +162,61 @@
public Result list() {
return workOrderService.all();
}
+
+ @GetMapping("/detail/info/{workOrderNo}")
+ @ApiOperation(value = "璇︽儏", notes = "璇︽儏")
+ @PreAuthorize("@ss.hasPermi('work:order:detail')")
+ public Result detailByNo(@PathVariable("workOrderNo") String workOrderNo) {
+ return workOrderService.detailByNo(workOrderNo);
+ }
+
+ @GetMapping("/yw-condition-list/{workOrderNo}")
+ @ApiOperation(value = "杩愮淮鎯呭喌璁板綍鍒楄〃", notes = "杩愮淮鎯呭喌璁板綍鍒楄〃")
+ public Result ywCondition(@PathVariable String workOrderNo) {
+ List<WorkOrderYwConditionRecordVO> data = workOrderService.selectYwConditionByYwId(workOrderNo);
+ return Result.ok().data(data);
+ }
+
+ @GetMapping("/yw-auditing-list/{workOrderNo}")
+ @ApiOperation(value = "杩愮淮瀹℃牳璁板綍", notes = "杩愮淮瀹℃牳璁板綍")
+ public Result ywAuditingByYwId(@PathVariable String workOrderNo) {
+ List<WorkOrderAuditingRecord> data = workOrderService.selectYwAuditingListByYwId(workOrderNo);
+ return Result.ok().data(data);
+ }
+
+ /**
+ * 宸ュ崟鐧藉悕鍗曞垪琛�
+ */
+ @PostMapping("/white/page")
+ @ApiOperation(value = "宸ュ崟鐧藉悕鍗曞垪琛�", notes = "宸ュ崟鐧藉悕鍗曞垪琛�")
+ public Result whitePage(@RequestBody WorkOrderWhiteQuery workOrderWhiteQuery)
+ {
+ return workOrderService.selectWorkOrderWhiteList(workOrderWhiteQuery);
+ }
+
+ /**
+ * 娣诲姞宸ュ崟鐧藉悕鍗�
+ *
+ * @param workOrderWhite 鐧借壊宸ュ崟
+ * @return {@link Result }
+ * @author
+ */
+ @PostMapping("/white/add")
+ @ApiOperation(value = "鏂板宸ュ崟鐧藉悕鍗�", notes = "鏂板宸ュ崟鐧藉悕鍗�")
+ public Result addWorkOrderWhite(@RequestBody WorkOrderWhite workOrderWhite) {
+ return workOrderService.addWorkOrderWhite(workOrderWhite);
+ }
+
+ /**
+ * 鎵归噺鍒犻櫎宸ュ崟鐧藉悕鍗�
+ *
+ * @param ids ids
+ * @return {@link Result }
+ * @author
+ */
+ @DeleteMapping("/white/batchDelete")
+ @ApiOperation(value = "鎵归噺鍒犻櫎宸ュ崟鐧藉悕鍗�", notes = "鎵归噺鍒犻櫎宸ュ崟鐧藉悕鍗�")
+ public Result batchDeleteWorkOrderWhite(@RequestBody List<String> ids) {
+ return workOrderService.batchDeleteWorkOrderWhite(ids);
+ }
}
--
Gitblit v1.8.0