| | |
| | | import cn.flightfeather.supervision.lightshare.service.EvaluationService |
| | | import cn.flightfeather.supervision.lightshare.vo.AssessmentSearchCondition |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import io.swagger.annotations.ApiParam |
| | | import org.springframework.web.bind.annotation.* |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | |
| | | @RestController |
| | | @RequestMapping("/evaluation") |
| | | class EvaluationController(val evaluationService: EvaluationService) { |
| | | @ApiOperation(value = "获取所有评估总分") |
| | | @GetMapping |
| | | fun getAll() = evaluationService.findAll() |
| | | |
| | | @ApiOperation(value = "上传一条评估总分记录") |
| | | @PutMapping |
| | | fun add(@RequestBody evaluation: Evaluation) = evaluationService.save(evaluation) |
| | | fun add( |
| | | @ApiParam(value = "评估数据") @RequestBody evaluation: Evaluation |
| | | ) = evaluationService.save(evaluation) |
| | | |
| | | @ApiOperation(value = "更新一条评估总分记录") |
| | | @PostMapping |
| | | fun update(@RequestBody evaluation: Evaluation) = evaluationService.update(evaluation) |
| | | fun update(@ApiParam(value = "评估数据") @RequestBody evaluation: Evaluation) = evaluationService.update(evaluation) |
| | | |
| | | @ApiOperation(value = "查找一条评估总分记录") |
| | | @GetMapping("/{id}") |
| | | fun getById(@PathVariable id: String) = evaluationService.findOne(id) |
| | | fun getById(@ApiParam(value = "评估信息主键id") @PathVariable id: String) = evaluationService.findOne(id) |
| | | |
| | | @ApiOperation(value = "删除一条评估总分记录") |
| | | @DeleteMapping("/{id}") |
| | | fun delete(@PathVariable id: String) = evaluationService.delete(id) |
| | | fun delete(@ApiParam(value = "评估信息主键id") @PathVariable id: String) = evaluationService.delete(id) |
| | | |
| | | @ApiOperation(value = "根据条件查询评估总分") |
| | | @GetMapping("/totalPoint/{userId}") |
| | | fun getT( |
| | | @PathVariable("userId") userId: String, |
| | | @RequestParam("evaluatorType") evaluatorType: Int, |
| | | @RequestParam("startTime") startTime: String, |
| | | @RequestParam("endTime") endTime: String, |
| | | @RequestParam("sceneTypeId", required = false) sceneTypeId: Int?, |
| | | @RequestParam("erGuid", required = false) erGuid: String?, |
| | | @RequestParam("eId", required = false) eId: String? |
| | | @ApiParam(value = "用户id") @PathVariable("userId") userId: String, |
| | | @ApiParam(value = "评估类型") @RequestParam("evaluatorType") evaluatorType: Int, |
| | | @ApiParam(value = "开始时间") @RequestParam("startTime") startTime: String, |
| | | @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? |
| | | ) = evaluationService.getTotalPoints(userId, evaluatorType, startTime, endTime, sceneTypeId, erGuid, eId) |
| | | |
| | | @ApiOperation(value = "获取用户评估总分") |
| | | @GetMapping("/historyPoint/{userId}") |
| | | fun getHistoryPoint( |
| | | @PathVariable("userId") userId: String, |
| | | @RequestParam(value = "page") page: Int, |
| | | @RequestParam(value = "per_page") perPage: Int, |
| | | response: HttpServletResponse |
| | | @ApiParam(value = "用户id") @PathVariable("userId") userId: String, |
| | | @ApiParam(value = "页码") @RequestParam(value = "page") page: Int, |
| | | @ApiParam(value = "单页数据量") @RequestParam(value = "per_page") perPage: Int, |
| | | response: HttpServletResponse |
| | | ) = evaluationService.getHistoryPoint(userId, page, perPage, response) |
| | | |
| | | @ApiOperation(value = "获取信用评估结果") |
| | | @GetMapping("/creditInfo") |
| | | fun getCreditInfo( |
| | | @RequestParam("userId") userId: String |
| | | @ApiParam(value = "用户id") @RequestParam("userId") userId: String |
| | | ) = evaluationService.getCreditInfo(userId) |
| | | |
| | | @ApiOperation(value = "获取某个用户的信用评估结果") |
| | | @PostMapping("/search/{userId}") |
| | | fun getAssessments( |
| | | @PathVariable("userId") userId: String, |
| | | @RequestBody condition: AssessmentSearchCondition, |
| | | @RequestParam(value = "page") page: Int, |
| | | @RequestParam(value = "per_page") perPage: Int, |
| | | response: HttpServletResponse |
| | | @ApiParam(value = "用户id") @PathVariable("userId") userId: String, |
| | | @ApiParam(value = "查询条件") @RequestBody condition: AssessmentSearchCondition, |
| | | @ApiParam(value = "页码") @RequestParam(value = "page") page: Int, |
| | | @ApiParam(value = "单页数据量") @RequestParam(value = "per_page") perPage: Int, |
| | | response: HttpServletResponse |
| | | ) = evaluationService.getAssessments(userId, condition, page, perPage, response) |
| | | |
| | | fun autoScore( |