From 0392c333ed3d987cb2ab3dac4e1a972cff405f21 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 25 四月 2024 17:42:08 +0800
Subject: [PATCH] 1. 新增后台任务关联模块 2. 新增自动评分后台任务; 3. 修复部分bug

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt |   60 +++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
index c5d280a..de6e270 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
@@ -40,53 +40,79 @@
     fun getByArea(@RequestBody areaVo: AreaVo): List<ProblemlistVo> = problemlistService.getByArea(areaVo)
 
     @GetMapping("/getbytoptask")
-    fun getByTopTask(@RequestParam(value = "tguid", required = true) tguid: String): List<ProblemlistVo> = problemlistService.getByTopTask(tguid)
+    fun getByTopTask(@RequestParam(value = "tguid", required = true) tguid: String): List<ProblemlistVo> =
+        problemlistService.getByTopTask(tguid)
 
     @PostMapping("/getStatisticalResult")
-    fun getStatisticalResult(@RequestBody areaVo: AreaVo): List<StatisticsVo> = problemlistService.getStatisticalResult(areaVo)
+    fun getStatisticalResult(@RequestBody areaVo: AreaVo): List<StatisticsVo> =
+        problemlistService.getStatisticalResult(areaVo)
 
     @PostMapping("/getStatisticalResultById")
-    fun getStatisticalResult(@RequestParam(value = "id", required = true) topTaskId: String,
-                             @RequestParam(value = "curSceneTypeId", required = true) sceneTypeId: String): List<StatisticsVo> = problemlistService.getStatisticalResultById(topTaskId, sceneTypeId)
+    fun getStatisticalResult(
+        @RequestParam(value = "id", required = true) topTaskId: String,
+        @RequestParam(value = "curSceneTypeId", required = true) sceneTypeId: String,
+    ): List<StatisticsVo> = problemlistService.getStatisticalResultById(topTaskId, sceneTypeId)
 
     @PostMapping("/getChargeResult")
     fun getChargeResult(@RequestBody areaVo: AreaVo): ChargeInfoVo = problemlistService.getChargeResult(areaVo)
 
     @GetMapping("/getProblemsByScene")
-    fun getProblemsByScene(@RequestParam(value = "sceneId", required = true) sceneId: String, @RequestParam date: String): List<ProblemlistVo>
-    = problemlistService.getProblemByScene(sceneId, date)
+    fun getProblemsByScene(
+        @RequestParam(value = "sceneId", required = true) sceneId: String,
+        @RequestParam date: String,
+    ): List<ProblemlistVo> = problemlistService.getProblemByScene(sceneId, date)
 
     @GetMapping("/month_anlysis")
-    fun getMonthProblemsById(@RequestParam(value = "taskId", required = true) taskId: String,
-                             @RequestParam(value = "sceneType", required = false) sceneType: Int?): List<MonthProblemVo> = problemlistService.findMonthProblemById(taskId, sceneType)
+    fun getMonthProblemsById(
+        @RequestParam(value = "taskId", required = true) taskId: String,
+        @RequestParam(value = "sceneType", required = false) sceneType: Int?,
+    ): List<MonthProblemVo> = problemlistService.findMonthProblemById(taskId, sceneType)
 
     @ApiOperation(value = "瀵归棶棰樿繘琛屽鏍告搷浣�", notes = "鍖呮嫭闂鐨勬彁浜ゅ鏍稿拰鏁存敼瀹℃牳涓ょ")
     @PostMapping("/check")
     fun checkProblem(
-            @ApiParam(value = "闂id涓婚敭") @RequestParam("pId") pId: String,
-            @ApiParam(value = "瀹℃牳鎿嶄綔, 0: 瀹℃牳閫氳繃锛�1: 瀹℃牳涓嶉�氳繃锛�2: 鏁存敼閫氳繃锛�3: 鏁存敼涓嶉�氳繃", allowableValues = "0,1,2,3") @RequestParam("action") action: Byte,
-            @ApiParam(value = "瀹℃牳澶囨敞") @RequestParam("remark") remark: String,
-            @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
-            @ApiParam(value = "鐢ㄦ埛鍚�") @RequestParam("userName") userName: String
+        @ApiParam(value = "闂id涓婚敭") @RequestParam("pId") pId: String,
+        @ApiParam(value = "瀹℃牳鎿嶄綔, 0: 瀹℃牳閫氳繃锛�1: 瀹℃牳涓嶉�氳繃锛�2: 鏁存敼閫氳繃锛�3: 鏁存敼涓嶉�氳繃",
+            allowableValues = "0,1,2,3") @RequestParam("action") action: Byte,
+        @ApiParam(value = "瀹℃牳澶囨敞") @RequestParam("remark") remark: String,
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam(value = "鐢ㄦ埛鍚�") @RequestParam("userName") userName: String,
     ) = problemlistService.check(pId, action, remark, userId, userName)
 
     @ApiOperation(value = "鏂板涓�涓棶棰�", notes = "绠�鍖栦笂浼犳墍闇�闂淇℃伅锛屽皢澶ч儴鍒嗘搷浣滀氦鐢卞悗鍙板畬鎴�")
     @PostMapping("/newProblem")
     fun newProblem(
         @RequestParam("problemVo") problemVo: String,
-        @RequestPart("images") files: Array<MultipartFile>
+        @RequestPart("images") files: Array<MultipartFile>,
     ) = problemlistService.newProblem(problemVo, files)
 
     @ApiOperation(value = "鏁存敼涓�涓棶棰�", notes = "绠�鍖栦笂浼犳墍闇�闂淇℃伅锛屽皢澶ч儴鍒嗘搷浣滀氦鐢卞悗鍙板畬鎴�")
     @PostMapping("/changeProblem")
     fun changeProblem(
         @RequestParam("problemId") problemId: String,
-        @RequestPart("images") files: Array<MultipartFile>
+        @RequestPart("images") files: Array<MultipartFile>,
     ) = problemlistService.changeProblem(problemId, files)
 
-    @ApiOperation(value = "閫氳繃浠诲姟鏌ユ壘闂", notes = "绠�鍖栦笂浼犳墍闇�闂淇℃伅锛屽皢澶ч儴鍒嗘搷浣滀氦鐢卞悗鍙板畬鎴�")
+    @ApiOperation(value = "閫氳繃浠诲姟鏌ユ壘闂")
     @GetMapping("/subtask")
     fun getBySubTask(
         @RequestParam("stGuid") stGuid: String,
-    ) = problemlistService.getBySubTask(stGuid)
+        @ApiParam(value = "鏄惁鑾峰彇鏈鏍稿強瀹℃牳涓嶉�氳繃鐨勯棶棰�") @RequestParam(required = false) all:Boolean?
+    ) = problemlistService.getBySubTask(stGuid, all)
+
+    @ApiOperation(value = "鏌ユ壘鍙戠幇浜嗘煇绉嶉棶棰樼被鍨嬬殑鎵�鏈夊贰鏌ュ瓙浠诲姟")
+    @PostMapping("/type/subtask")
+    fun getSceneByProType(
+        @RequestBody areaVo: AreaVo,
+        @RequestParam pType: String,
+    ) = resPack { problemlistService.getSceneByProType(areaVo, pType) }
+
+    @ApiOperation(value = "鏌ヨ鏌愭�讳换鍔′笅鍚勫満鏅殑闂鏁伴噺缁熻")
+    @PostMapping("/summary/scene")
+    fun getSceneProSummary(
+        @RequestBody areaVo: AreaVo,
+        @ApiParam(value = "鎺掑簭瀛楁", allowableValues = "pro, changePer") @RequestParam sortBy: String,
+        @ApiParam(value = "椤电爜") @RequestParam(value = "page") page: Int,
+        @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int,
+    ) = resPack { problemlistService.getSceneProSummary(areaVo, sortBy, page, perPage) }
 }
\ No newline at end of file

--
Gitblit v1.9.3