From 1a677d2b4a4bc615602f8c2a22bc07ec1356e5be Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 16 十月 2025 17:39:06 +0800
Subject: [PATCH] 2025.10.16 1. 根据全局响应增强器GlobalResponseAdvice,将原先的BaseResPack接口包装函数统一去除; 2. 新增三种类型的数据产品数据库实体 3. 新增典型问题场景清单中间数据产品接口
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt | 38 ++++++++++++++++++++++++++++++--------
1 files changed, 30 insertions(+), 8 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 8baf3fa..8db8d38 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
@@ -2,6 +2,7 @@
import cn.flightfeather.supervision.common.log.BizLog
import cn.flightfeather.supervision.common.log.WorkStreamLogInfo
+import cn.flightfeather.supervision.config.IgnoreResponseAdvice
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.lightshare.service.ProblemlistService
import cn.flightfeather.supervision.lightshare.service.SubtaskService
@@ -21,12 +22,15 @@
val problemlistService: ProblemlistService,
val subtaskService: SubtaskService, private val bizLog: BizLog,
) {
+ @IgnoreResponseAdvice
@GetMapping
fun getAll() = problemlistService.findAll()
+ @IgnoreResponseAdvice
@PutMapping
fun add(@RequestBody problemlist: Problemlist) = problemlistService.save(problemlist)
+ @IgnoreResponseAdvice
@PostMapping
fun update(@RequestBody problemlist: Problemlist):Int{
val res = problemlistService.update(problemlist)
@@ -38,46 +42,57 @@
return res
}
+ @IgnoreResponseAdvice
@GetMapping("/{id}")
fun getById(@PathVariable id: String) = problemlistService.findByID(id)
+ @IgnoreResponseAdvice
@DeleteMapping("/{id}")
fun delete(@PathVariable id: String) = problemlistService.delete(id)
+
@PostMapping("/{id}")
fun setDeleteStatus(@PathVariable id: String) = problemlistService.setDeleteStatus(id)
+ @IgnoreResponseAdvice
@PostMapping("/add")
fun addProblem(@RequestBody problemlistVo: ProblemListVo) {
problemlistService.addProblem(problemlistVo)
}
+ @IgnoreResponseAdvice
@PostMapping("/getbyarea")
fun getByArea(@RequestBody areaVo: AreaVo): List<ProblemListVo> = problemlistService.getByArea(areaVo)
+ @IgnoreResponseAdvice
@GetMapping("/getbytoptask")
fun getByTopTask(@RequestParam(value = "tguid", required = true) tguid: String): List<ProblemListVo> =
problemlistService.getByTopTask(tguid)
+ @IgnoreResponseAdvice
@PostMapping("/getStatisticalResult")
fun getStatisticalResult(@RequestBody areaVo: AreaVo): List<StatisticsVo> =
problemlistService.getStatisticalResult(areaVo)
+ @IgnoreResponseAdvice
@PostMapping("/getStatisticalResultById")
fun getStatisticalResult(
@RequestParam(value = "id", required = true) topTaskId: String,
@RequestParam(value = "curSceneTypeId", required = true) sceneTypeId: String,
): List<StatisticsVo> = problemlistService.getStatisticalResultById(topTaskId, sceneTypeId)
+ @IgnoreResponseAdvice
@PostMapping("/getChargeResult")
fun getChargeResult(@RequestBody areaVo: AreaVo): ChargeInfoVo = problemlistService.getChargeResult(areaVo)
+ @IgnoreResponseAdvice
@GetMapping("/getProblemsByScene")
fun getProblemsByScene(
@RequestParam(value = "sceneId", required = true) sceneId: String,
@RequestParam date: String,
): List<ProblemListVo> = problemlistService.getProblemByScene(sceneId, date)
+ @IgnoreResponseAdvice
@GetMapping("/month_anlysis")
fun getMonthProblemsById(
@RequestParam(value = "taskId", required = true) taskId: String,
@@ -88,8 +103,7 @@
@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 = "瀹℃牳鎿嶄綔, 0: 瀹℃牳閫氳繃锛�1: 瀹℃牳涓嶉�氳繃锛�2: 鏁存敼閫氳繃锛�3: 鏁存敼涓嶉�氳繃锛�4锛氶棶棰樺鏍告挙鍥烇紱5锛氭暣鏀瑰鏍告挙鍥�") @RequestParam("action") action: Byte,
@ApiParam(value = "瀹℃牳澶囨敞") @RequestParam("remark") remark: String,
@ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
@ApiParam(value = "鐢ㄦ埛鍚�") @RequestParam("userName") userName: String,
@@ -104,13 +118,13 @@
@ApiOperation("鏇存柊涓�涓棶棰�")
@PostMapping("/updateProblem")
- fun updateDeviceLocation(
+ fun updateProblem(
@ApiParam("闂淇℃伅json") @RequestParam("problem") problem: String,
@ApiParam("鍒犻櫎鐨勯棶棰樺浘鐗噄d") @RequestParam("deleteImg") deleteImg: List<String>,
@ApiParam("闂鍥剧墖") @RequestPart("images") images: Array<MultipartFile>,
- ) = resPack {
+ ): String {
val problemVo = ObjectMapper().readValue(problem, object : TypeReference<ProblemListVo>() {})
- problemlistService.updateProblem(problemVo, deleteImg, images)
+ return problemlistService.updateProblem(problemVo, deleteImg, images)
}
@ApiOperation(value = "鏁存敼涓�涓棶棰�", notes = "绠�鍖栦笂浼犳墍闇�闂淇℃伅锛屽皢澶ч儴鍒嗘搷浣滀氦鐢卞悗鍙板畬鎴�")
@@ -120,6 +134,15 @@
@RequestPart("images") files: Array<MultipartFile>,
) = problemlistService.changeProblem(problemId, files)
+ @ApiOperation("鏇存柊涓�涓棶棰樻暣鏀�")
+ @PostMapping("/updateChange")
+ fun updateChange(
+ @ApiParam("闂id") @RequestParam problemId: String,
+ @ApiParam("鍒犻櫎鐨勬暣鏀瑰浘鐗噄d") @RequestParam("deleteImg") deleteImg: List<String>,
+ @ApiParam("鏂板鏁存敼鍥剧墖") @RequestPart("images") images: Array<MultipartFile>,
+ ) = problemlistService.updateChange(problemId, deleteImg, images)
+
+ @IgnoreResponseAdvice
@ApiOperation(value = "閫氳繃浠诲姟鏌ユ壘闂")
@GetMapping("/subtask")
fun getBySubTask(
@@ -132,14 +155,13 @@
fun getSceneByProType(
@RequestBody areaVo: AreaVo,
@RequestParam pType: String,
- ) = resPack { problemlistService.getSceneByProType(areaVo, pType) }
+ ) = 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) }
+ ) = problemlistService.getSceneProSummary(areaVo, page, perPage)
}
\ No newline at end of file
--
Gitblit v1.9.3