| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Inspection |
| | | import cn.flightfeather.supervision.lightshare.service.InspectionService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import io.swagger.annotations.ApiParam |
| | |
| | | @Api(tags = ["InspectionController"], description = "巡查信息API接口") |
| | | @RestController |
| | | @RequestMapping("/inspection") |
| | | class InspectionController (val inspectionService: InspectionService){ |
| | | class InspectionController(val inspectionService: InspectionService) { |
| | | @GetMapping |
| | | fun getAll() = inspectionService.findAll() |
| | | |
| | |
| | | fun update(@RequestBody inspection: Inspection) = inspectionService.update(inspection) |
| | | |
| | | @GetMapping("/{id}") |
| | | fun getById(@PathVariable id:String) = inspectionService.findByID(id) |
| | | fun getById(@PathVariable id: String) = inspectionService.findByID(id) |
| | | |
| | | @GetMapping("/{id}/problemlist") |
| | | fun findProblemListById(@PathVariable id:String) = inspectionService.findProblemListById(id) |
| | | fun findProblemListById(@PathVariable id: String) = inspectionService.findProblemListById(id) |
| | | |
| | | @GetMapping("/{id}/gitlist") |
| | | fun findGitListById(@PathVariable id:String) = inspectionService.findGitListById(id) |
| | | fun findGitListById(@PathVariable id: String) = inspectionService.findGitListById(id) |
| | | |
| | | @GetMapping("/{id}/{date}/lastproblemlist") |
| | | fun findLastProblemListById(@PathVariable id:String,@PathVariable date:String) = inspectionService.findLastProblemListBySenceId(id,date) |
| | | fun findLastProblemListById(@PathVariable id: String, @PathVariable date: String) = |
| | | inspectionService.findLastProblemListBySenceId(id, date) |
| | | |
| | | @GetMapping("/find/{id}") |
| | | fun findBySubTaskID(@PathVariable id:String) = inspectionService.findBySubTaskID(id) |
| | | fun findBySubTaskID(@PathVariable id: String) = inspectionService.findBySubTaskID(id) |
| | | |
| | | @DeleteMapping("/{id}") |
| | | fun delete (@PathVariable id: String) = inspectionService.delete(id) |
| | | fun delete(@PathVariable id: String) = inspectionService.delete(id) |
| | | |
| | | @GetMapping("/getInspectionInfoByScene") |
| | | fun getInspectionInfoByScene(@RequestParam(value = "sceneId", required = true)sceneId:String, @RequestParam(value = "topTaskId", required = true)topTaskId:String) |
| | | = inspectionService.getInspectionInfoByScene(sceneId, topTaskId) |
| | | fun getInspectionInfoByScene( |
| | | @RequestParam(value = "sceneId", required = true) sceneId: String, |
| | | @RequestParam(value = "topTaskId", required = true) topTaskId: String, |
| | | ) = inspectionService.getInspectionInfoByScene(sceneId, topTaskId) |
| | | |
| | | @ApiOperation(value = "获取某个总任务下某场景的统计信息", notes = "包括场景基本信息、评分、具体问题等") |
| | | @GetMapping("/statistic") |
| | | @PostMapping("/statistic") |
| | | fun getStatistic( |
| | | @ApiParam("总任务id") @RequestParam("topTaskId") topTaskId: String, |
| | | @ApiParam("场景类型id") @RequestParam("sceneTypeId") sceneTypeId: String |
| | | ) = inspectionService.getStatistic(topTaskId, sceneTypeId) |
| | | @ApiParam("总任务id") @RequestParam(required = false) topTaskId: String?, |
| | | @ApiParam("场景类型id") @RequestParam(required = false) sceneTypeId: String?, |
| | | @ApiParam("区域条件") @RequestBody(required = false) areaVo: AreaVo?, |
| | | ): BaseResponse<Any> { |
| | | return resPack { |
| | | if (topTaskId != null && sceneTypeId != null) { |
| | | inspectionService.getStatistic(topTaskId, sceneTypeId) |
| | | } else if (areaVo != null) { |
| | | inspectionService.getStatistic(areaVo) |
| | | } else { |
| | | throw BizException("缺失总任务id和区域条件,请选择传输其中一种参数") |
| | | } |
| | | } |
| | | } |
| | | } |