From 196bb14112448857a885e32dc4149e308e00b01a Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 15 八月 2024 11:57:15 +0800
Subject: [PATCH] 2024.8.15 各项修正

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt |  104 ++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 77 insertions(+), 27 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
index 0fc9347..0324cb9 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
@@ -3,7 +3,10 @@
 import cn.flightfeather.supervision.domain.entity.Evaluation
 import cn.flightfeather.supervision.lightshare.service.EvaluationService
 import cn.flightfeather.supervision.lightshare.vo.AssessmentSearchCondition
+import cn.flightfeather.supervision.lightshare.vo.UserSearchCondition
 import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+import io.swagger.annotations.ApiParam
 import org.springframework.web.bind.annotation.*
 import javax.servlet.http.HttpServletResponse
 
@@ -11,58 +14,105 @@
 @RestController
 @RequestMapping("/evaluation")
 class EvaluationController(val evaluationService: EvaluationService) {
+    @ApiOperation(value = "鑾峰彇鎵�鏈夎瘎浼版�诲垎")
     @GetMapping
     fun getAll() = evaluationService.findAll()
 
+    @ApiOperation(value = "涓婁紶涓�鏉¤瘎浼版�诲垎璁板綍")
     @PutMapping
-    fun add(@RequestBody evaluation: Evaluation) = evaluationService.save(evaluation)
+    fun add(
+        @ApiParam(value = "璇勪及鏁版嵁") @RequestBody evaluation: Evaluation,
+    ) = evaluationService.save(evaluation)
 
+    @ApiOperation(value = "鏇存柊涓�鏉¤瘎浼版�诲垎璁板綍")
     @PostMapping
-    fun update(@RequestBody evaluation: Evaluation) = evaluationService.update(evaluation)
+    fun update(@ApiParam(value = "璇勪及鏁版嵁") @RequestBody evaluation: Evaluation) = evaluationService.update(evaluation)
 
+    @ApiOperation(value = "鏌ユ壘涓�鏉¤瘎浼版�诲垎璁板綍")
     @GetMapping("/{id}")
-    fun getById(@PathVariable id: String) = evaluationService.findOne(id)
+    fun getById(@ApiParam(value = "璇勪及淇℃伅涓婚敭id") @PathVariable id: String) = evaluationService.findOne(id)
 
+    @ApiOperation(value = "鍒犻櫎涓�鏉¤瘎浼版�诲垎璁板綍")
     @DeleteMapping("/{id}")
-    fun delete(@PathVariable id: String) = evaluationService.delete(id)
+    fun delete(@ApiParam(value = "璇勪及淇℃伅涓婚敭id") @PathVariable id: String) = evaluationService.delete(id)
 
+    @ApiOperation(value = "鏍规嵁鏉′欢鏌ヨ璇勪及鎬诲垎")
     @GetMapping("/totalPoint/{userId}")
     fun getT(
-            @PathVariable("userId") userId: String,
-            @RequestParam("evaluatorType") evaluatorType: Int,
-            @RequestParam("startTime") startTime: String,
-            @RequestParam("endTime") endTime: String,
-            @RequestParam("sceneTypeId", required = false) sceneTypeId: Int?,
-            @RequestParam("erGuid", required = false) erGuid: String?,
-            @RequestParam("eId", required = false) eId: String?
+        @ApiParam(value = "鐢ㄦ埛id") @PathVariable("userId") userId: String,
+        @ApiParam(value = "璇勪及绫诲瀷") @RequestParam("evaluatorType") evaluatorType: Int,
+        @ApiParam(value = "寮�濮嬫椂闂�") @RequestParam("startTime") startTime: String,
+        @ApiParam(value = "缁撴潫鏃堕棿") @RequestParam("endTime") endTime: String,
+        @ApiParam(value = "鍦烘櫙绫诲瀷id") @RequestParam("sceneTypeId", required = false) sceneTypeId: Int?,
+        @ApiParam(value = "瀛愪换鍔d") @RequestParam("erGuid", required = false) erGuid: String?,
+        @ApiParam(value = "璇勪及淇℃伅涓婚敭id") @RequestParam("eId", required = false) eId: String?,
     ) = evaluationService.getTotalPoints(userId, evaluatorType, startTime, endTime, sceneTypeId, erGuid, eId)
 
+    @ApiOperation(value = "鑾峰彇鐢ㄦ埛璇勪及鎬诲垎")
     @GetMapping("/historyPoint/{userId}")
     fun getHistoryPoint(
-            @PathVariable("userId") userId: String,
-            @RequestParam(value = "page") page: Int,
-            @RequestParam(value = "per_page") perPage: Int,
-            response: HttpServletResponse
-    ) = evaluationService.getHistoryPoint(userId, page, perPage, response)
+        @ApiParam(value = "鐢ㄦ埛id") @PathVariable("userId") userId: String,
+        @ApiParam(value = "椤电爜") @RequestParam(value = "page") page: Int,
+        @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int,
+        @ApiParam(value = "鍓嶇骞冲彴") @RequestParam("platform", required = false) platform: String?,
+        @ApiParam(value = "璇勫垎鍛ㄦ湡") @RequestParam("period", required = false) period: String?,
+        response: HttpServletResponse,
+    ) = evaluationService.getHistoryPoint(userId, page, perPage, platform, period, response)
 
+    @ApiOperation(value = "鑾峰彇淇$敤璇勪及缁撴灉")
     @GetMapping("/creditInfo")
     fun getCreditInfo(
-            @RequestParam("userId") userId: String
-    ) = evaluationService.getCreditInfo(userId)
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam(value = "鍛ㄦ湡") @RequestParam(value = "period", required = false) period: String?,
+    ) = evaluationService.getCreditInfo(userId, period)
 
+    @ApiOperation(value = "鑾峰彇淇$敤璇勪及缁撴灉")
+    @PostMapping("/credit/count")
+    fun getCreditCount(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam("鏌ヨ鏉′欢") @RequestBody condition: UserSearchCondition,
+    ) = evaluationService.getCreditCount(userId, condition)
+
+    @ApiOperation(value = "鑾峰彇鏌愪釜鐢ㄦ埛鐨勪俊鐢ㄨ瘎浼扮粨鏋�")
     @PostMapping("/search/{userId}")
     fun getAssessments(
-            @PathVariable("userId") userId: String,
-            @RequestBody condition: AssessmentSearchCondition,
-            @RequestParam(value = "page") page: Int,
-            @RequestParam(value = "per_page") perPage: Int,
-            response: HttpServletResponse
+        @ApiParam(value = "鐢ㄦ埛id") @PathVariable("userId") userId: String,
+        @ApiParam(value = "鏌ヨ鏉′欢") @RequestBody condition: AssessmentSearchCondition,
+        @ApiParam(value = "椤电爜") @RequestParam(value = "page") page: Int,
+        @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int,
+        response: HttpServletResponse,
     ) = evaluationService.getAssessments(userId, condition, page, perPage, response)
 
     fun autoScore(
-            @RequestParam(value = "year") year: Int,
-            @RequestParam(value = "month") month: Int,
-            @RequestParam("sceneType") sceneType: Int,
-            response: HttpServletResponse
+        @RequestParam(value = "year") year: Int,
+        @RequestParam(value = "month") month: Int,
+        @RequestParam("sceneType") sceneType: Int,
+        response: HttpServletResponse,
     ) = evaluationService.autoScore(year, month, sceneType, response)
+
+
+    @ApiOperation(value = "涓婁紶鑷瘎寰楀垎")
+    @PostMapping("/upload")
+    fun uploadScore(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam(value = "璇勫垎鍛ㄦ湡") @RequestParam("period") period: String,
+        @ApiParam(value = "璇勫垎瑙勫垯id") @RequestParam(value = "ruleId", required = false) ruleId: String?,
+        @ApiParam(value = "鍏蜂綋鎵e垎鏉$洰锛堝彧浼犳渶灏忕骇鍒殑璇勪及椤癸級") @RequestBody itemList: List<Pair<String, String>>,
+    ) = evaluationService.uploadScore(userId, period, ruleId, itemList)
+
+    @ApiOperation(value = "鑾峰彇娴嬭瘎璇︽儏")
+    @GetMapping("/detail")
+    fun getDetail(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam(value = "璇勫垎鍛ㄦ湡") @RequestParam("period") period: String,
+    ) = evaluationService.getDetail(userId, period)
+
+    @ApiOperation(value = "鑾峰彇鐢ㄦ埛璇勫垎淇℃伅锛岃嚜璇勬垨鐜舰鐮佽瘎浼�")
+    @PostMapping("/gradeList")
+    fun searchGradeList(
+        @ApiParam("鐢ㄦ埛id") @RequestParam("userId") userId: String,
+        @ApiParam("鏌ヨ鏉′欢") @RequestBody condition: UserSearchCondition,
+        @ApiParam("椤电爜") @RequestParam(value = "page") page: Int,
+        @ApiParam("鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int,
+    ) = evaluationService.searchGradeList(userId, condition, page, perPage)
 }
\ No newline at end of file

--
Gitblit v1.9.3