| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.web_site.AlarmInspectionResult; |
| | | import com.whyc.service.AlarmInspectionService; |
| | | import com.whyc.util.CommonUtil; |
| | | import com.whyc.util.JsonUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 要实现告警巡检单,创建巡检工单表. |
| | | * 在发生告警的情况下,加入到实时巡检工单表中 |
| | | * 在点击某个站点的时候,能列出所有未处理过的实时巡检工单 |
| | | * 进行巡检结果提交的时候,选中已处理的巡检工单,对选中的告警进行是否已经消失的校验(还存在则无法提交巡检处理结果),将实时巡检工单的相关记录移入到巡检工单处理表,并删除实时工单内相关内容 |
| | | * TODO 有两个定时任务:1.告警产生,加入到巡检实时表,2.告警是否消失,同步到巡检实时表 |
| | | * 有两个定时任务:1.告警产生,加入到巡检实时表,2.告警是否消失,同步到巡检实时表 |
| | | */ |
| | | |
| | | @RestController |
| | |
| | | @Autowired |
| | | private AlarmInspectionService service; |
| | | |
| | | @ApiOperation("查询站点对应的巡检单") |
| | | @GetMapping("") |
| | | public Response getList(@RequestParam Integer stationId){ |
| | | return service.getList(stationId); |
| | | @ApiOperation(value = "查询站点对应的巡检单",notes = "inspectionType=1表示告警级别为1的故障工单,inspectionType=2表示告警级别不为1的巡检备忘录") |
| | | @GetMapping("getList") |
| | | public Response getList(@RequestParam int stationId,@RequestParam int inspectionType){ |
| | | return service.getList(stationId,inspectionType); |
| | | } |
| | | |
| | | @PostMapping("submitInspection") |
| | | @ApiOperation(value = "提交巡检结果",notes = "alarmInspectionResultJsonStr填json字符串,字段包含stationId,stationName,inspectionType,inspectionResult,finishSuggestion") |
| | | public Response submitInspection(@RequestPart(value = "file",required = false) List<MultipartFile> file, @RequestParam String alarmInspectionResultJsonStr) throws IOException { |
| | | AlarmInspectionResult result = JsonUtil.getGson().fromJson(alarmInspectionResultJsonStr,AlarmInspectionResult.class); |
| | | return service.submitInspection(result,file); |
| | | } |
| | | |
| | | |