| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.common.log.BizLog |
| | | import cn.flightfeather.supervision.common.log.WorkStreamLogInfo |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import cn.flightfeather.supervision.lightshare.service.ProblemlistService |
| | | import cn.flightfeather.supervision.lightshare.service.SubtaskService |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | |
| | | @Api(tags = ["ProblemlistController"], description = "监管问题API接口") |
| | | @RestController |
| | | @RequestMapping("/problemlist") |
| | | class ProblemlistController(val problemlistService: ProblemlistService) { |
| | | class ProblemlistController( |
| | | val problemlistService: ProblemlistService, |
| | | val subtaskService: SubtaskService, private val bizLog: BizLog, |
| | | ) { |
| | | @GetMapping |
| | | fun getAll() = problemlistService.findAll() |
| | | |
| | |
| | | fun add(@RequestBody problemlist: Problemlist) = problemlistService.save(problemlist) |
| | | |
| | | @PostMapping |
| | | fun update(@RequestBody problemlist: Problemlist) = problemlistService.update(problemlist) |
| | | fun update(@RequestBody problemlist: Problemlist):Int{ |
| | | val res = problemlistService.update(problemlist) |
| | | problemlist.stguid?.let { |
| | | val subtask = subtaskService.findByID(it) |
| | | val event = "在${subtask.scensename}新增一个问题" |
| | | bizLog.info(WorkStreamLogInfo(subtask.executorguids, subtask.executorrealtimes, event)) |
| | | } |
| | | return res |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | fun getById(@PathVariable id: String) = problemlistService.findByID(id) |