hcong
2024-11-19 0674dea7dd0e75199c0c200e6a41070c25677082
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
@@ -6,6 +6,8 @@
import cn.flightfeather.supervision.lightshare.service.ProblemlistService
import cn.flightfeather.supervision.lightshare.service.SubtaskService
import cn.flightfeather.supervision.lightshare.vo.*
import com.fasterxml.jackson.core.type.TypeReference
import com.fasterxml.jackson.databind.ObjectMapper
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
@@ -46,15 +48,15 @@
    fun setDeleteStatus(@PathVariable id: String) = problemlistService.setDeleteStatus(id)
    @PostMapping("/add")
    fun addProblem(@RequestBody problemlistVo: ProblemlistVo) {
    fun addProblem(@RequestBody problemlistVo: ProblemListVo) {
        problemlistService.addProblem(problemlistVo)
    }
    @PostMapping("/getbyarea")
    fun getByArea(@RequestBody areaVo: AreaVo): List<ProblemlistVo> = problemlistService.getByArea(areaVo)
    fun getByArea(@RequestBody areaVo: AreaVo): List<ProblemListVo> = problemlistService.getByArea(areaVo)
    @GetMapping("/getbytoptask")
    fun getByTopTask(@RequestParam(value = "tguid", required = true) tguid: String): List<ProblemlistVo> =
    fun getByTopTask(@RequestParam(value = "tguid", required = true) tguid: String): List<ProblemListVo> =
        problemlistService.getByTopTask(tguid)
    @PostMapping("/getStatisticalResult")
@@ -74,7 +76,7 @@
    fun getProblemsByScene(
        @RequestParam(value = "sceneId", required = true) sceneId: String,
        @RequestParam date: String,
    ): List<ProblemlistVo> = problemlistService.getProblemByScene(sceneId, date)
    ): List<ProblemListVo> = problemlistService.getProblemByScene(sceneId, date)
    @GetMapping("/month_anlysis")
    fun getMonthProblemsById(
@@ -86,8 +88,8 @@
    @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:整改审核撤回",
            allowableValues = "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,
@@ -96,9 +98,20 @@
    @ApiOperation(value = "新增一个问题", notes = "简化上传所需问题信息,将大部分操作交由后台完成")
    @PostMapping("/newProblem")
    fun newProblem(
        @RequestParam("problemVo") problemVo: String,
        @RequestPart("images") files: Array<MultipartFile>,
        @ApiParam("问题信息json") @RequestParam("problemVo") problemVo: String,
        @ApiParam("问题图片") @RequestPart("images") files: Array<MultipartFile>,
    ) = problemlistService.newProblem(problemVo, files)
    @ApiOperation("更新一个问题")
    @PostMapping("/updateProblem")
    fun updateProblem(
        @ApiParam("问题信息json") @RequestParam("problem") problem: String,
        @ApiParam("删除的问题图片id") @RequestParam("deleteImg") deleteImg: List<String>,
        @ApiParam("问题图片") @RequestPart("images") images: Array<MultipartFile>,
    ) = resPack {
        val problemVo = ObjectMapper().readValue(problem, object : TypeReference<ProblemListVo>() {})
        problemlistService.updateProblem(problemVo, deleteImg, images)
    }
    @ApiOperation(value = "整改一个问题", notes = "简化上传所需问题信息,将大部分操作交由后台完成")
    @PostMapping("/changeProblem")
@@ -107,6 +120,14 @@
        @RequestPart("images") files: Array<MultipartFile>,
    ) = problemlistService.changeProblem(problemId, files)
    @ApiOperation("更新一个问题整改")
    @PostMapping("/updateChange")
    fun updateChange(
        @ApiParam("问题id") @RequestParam problemId: String,
        @ApiParam("删除的整改图片id") @RequestParam("deleteImg") deleteImg: List<String>,
        @ApiParam("新增整改图片") @RequestPart("images") images: Array<MultipartFile>,
    ) = resPack { problemlistService.updateChange(problemId, deleteImg, images) }
    @ApiOperation(value = "通过任务查找问题")
    @GetMapping("/subtask")
    fun getBySubTask(