|
|
|
@ -5,6 +5,7 @@ import com.xydl.cac.entity.Warning;
|
|
|
|
|
import com.xydl.cac.exception.BusinessException;
|
|
|
|
|
import com.xydl.cac.model.ConditionModel;
|
|
|
|
|
import com.xydl.cac.model.Response;
|
|
|
|
|
import com.xydl.cac.service.DataService;
|
|
|
|
|
import com.xydl.cac.service.ReportService;
|
|
|
|
|
import com.xydl.cac.service.WarningService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
@ -28,6 +29,9 @@ public class WarningController extends BasicController {
|
|
|
|
|
@Resource
|
|
|
|
|
WarningService service;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DataService dataService;
|
|
|
|
|
|
|
|
|
|
@GetMapping("list")
|
|
|
|
|
@ApiOperation("查询列表")
|
|
|
|
|
public Response<Page<Warning>> list(@Validated ConditionModel condition) throws Exception {
|
|
|
|
@ -65,13 +69,20 @@ public class WarningController extends BasicController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Boolean isFlat = false;
|
|
|
|
|
|
|
|
|
|
@PostMapping("oneKeyUpdateState")
|
|
|
|
|
@ApiOperation("一键修改处理状态")
|
|
|
|
|
public Response<String> oneKeyUpdateState() throws Exception {
|
|
|
|
|
ConditionModel condition = new ConditionModel();
|
|
|
|
|
condition.setState("1");
|
|
|
|
|
List<Warning> warnings = service.listAll(condition);
|
|
|
|
|
service.oneKeyUpdateState(warnings);
|
|
|
|
|
return Response.success("OK");
|
|
|
|
|
try {
|
|
|
|
|
if (isFlat) {
|
|
|
|
|
throw new BusinessException("相同请求正在处理中, 请勿重复处理");
|
|
|
|
|
}
|
|
|
|
|
isFlat = true;
|
|
|
|
|
dataService.updateWarningState("warning" , "0" , "1");
|
|
|
|
|
return Response.success("OK");
|
|
|
|
|
} finally {
|
|
|
|
|
isFlat = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|