feiyu02
2024-08-15 196bb14112448857a885e32dc4149e308e00b01a
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
@@ -3,6 +3,7 @@
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
@@ -20,7 +21,7 @@
    @ApiOperation(value = "上传一条评估总分记录")
    @PutMapping
    fun add(
        @ApiParam(value = "评估数据") @RequestBody evaluation: Evaluation
        @ApiParam(value = "评估数据") @RequestBody evaluation: Evaluation,
    ) = evaluationService.save(evaluation)
    @ApiOperation(value = "更新一条评估总分记录")
@@ -44,7 +45,7 @@
        @ApiParam(value = "结束时间") @RequestParam("endTime") endTime: String,
        @ApiParam(value = "场景类型id") @RequestParam("sceneTypeId", required = false) sceneTypeId: Int?,
        @ApiParam(value = "子任务id") @RequestParam("erGuid", required = false) erGuid: String?,
        @ApiParam(value = "评估信息主键id") @RequestParam("eId", required = false) eId: String?
        @ApiParam(value = "评估信息主键id") @RequestParam("eId", required = false) eId: String?,
    ) = evaluationService.getTotalPoints(userId, evaluatorType, startTime, endTime, sceneTypeId, erGuid, eId)
    @ApiOperation(value = "获取用户评估总分")
@@ -53,15 +54,24 @@
        @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?,
        response: HttpServletResponse
    ) = evaluationService.getHistoryPoint(userId, page, perPage, platform, response)
        @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(
        @ApiParam(value = "用户id") @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}")
@@ -70,14 +80,14 @@
        @ApiParam(value = "查询条件") @RequestBody condition: AssessmentSearchCondition,
        @ApiParam(value = "页码") @RequestParam(value = "page") page: Int,
        @ApiParam(value = "单页数据量") @RequestParam(value = "per_page") perPage: Int,
        response: HttpServletResponse
        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)
@@ -93,7 +103,16 @@
    @ApiOperation(value = "获取测评详情")
    @GetMapping("/detail")
    fun getDetail(
            @ApiParam(value = "用户id") @RequestParam("userId") userId: String,
            @ApiParam(value = "评分周期") @RequestParam("period") period: String,
        @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)
}