feiyu02
2025-10-30 9cb8d7e0f4ffca386b14a15f8a0aca4d1db23252
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,
@@ -108,9 +122,9 @@
        @ApiParam("问题信息json") @RequestParam("problem") problem: String,
        @ApiParam("删除的问题图片id") @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 = "简化上传所需问题信息,将大部分操作交由后台完成")
@@ -126,8 +140,9 @@
        @ApiParam("问题id") @RequestParam problemId: String,
        @ApiParam("删除的整改图片id") @RequestParam("deleteImg") deleteImg: List<String>,
        @ApiParam("新增整改图片") @RequestPart("images") images: Array<MultipartFile>,
    ) = resPack { problemlistService.updateChange(problemId, deleteImg, images) }
    ) = problemlistService.updateChange(problemId, deleteImg, images)
    @IgnoreResponseAdvice
    @ApiOperation(value = "通过任务查找问题")
    @GetMapping("/subtask")
    fun getBySubTask(
@@ -140,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)
}