feiyu02
2024-04-25 0392c333ed3d987cb2ab3dac4e1a972cff405f21
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) }
}