feiyu02
2025-07-30 f75ff7a0fc566dc18b60987b3fa2e65cae4665da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package cn.flightfeather.supervision.lightshare.web
 
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2
import cn.flightfeather.supervision.lightshare.service.EvaluationsubruleService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
 
@Api(tags = ["EvaluationsubruleController"], description = "评分子规则API接口")
@RestController
@RequestMapping("/evaluationsubrule")
class EvaluationsubruleController(val evaluationsubruleService: EvaluationsubruleService) {
    @GetMapping
    fun getAll() = evaluationsubruleService.findAll()
 
    @PutMapping
    fun add(@RequestBody evaluationsubrule: Evaluationsubrule2) = evaluationsubruleService.save(evaluationsubrule)
 
    @PostMapping
    fun update(@RequestBody evaluationsubrule: Evaluationsubrule2) = evaluationsubruleService.update(evaluationsubrule)
 
    @GetMapping("/{id}")
    fun getById(@PathVariable id: String) = evaluationsubruleService.findOne(id)
 
    @DeleteMapping("/{id}")
    fun delete(@PathVariable id: String) = evaluationsubruleService.delete(id)
 
    @ApiOperation("根据评估总规则查询下属的子规则")
    @GetMapping("/byRule")
    fun getByBaseRule(
        @ApiParam("评估总规则主键id") @RequestParam id: String
    ) = resPack { evaluationsubruleService.findByRuleId(id) }
 
    @ApiOperation("根据区县和场景类型查询评分子规则")
    @GetMapping("/search")
    fun search(
            @ApiParam("区县行政编号") @RequestParam("districtCode") districtCode: String,
            @ApiParam("场景类型id") @RequestParam("sceneTypeId") sceneTypeId: String,
            @ApiParam(value = "评分表版本, 格式 yyyy-MM, 默认获取最新版本") @RequestParam("version") version: String?
    ) = evaluationsubruleService.search(districtCode, sceneTypeId, version)
 
    @ApiOperation(value = "查找巡查任务自动评估的评分细节")
    @GetMapping("/score")
    fun getAutoScore(
        @ApiParam(value = "巡查任务id") @RequestParam subTaskId: String,
    ) = resPack { evaluationsubruleService.getAutoScore(subTaskId) }
}