Compare commits
4 Commits
74ca877664
...
eddb6d85c7
| Author | SHA1 | Date |
|---|---|---|
|
|
eddb6d85c7 | |
|
|
a6e17a5154 | |
|
|
2641ac9282 | |
|
|
392f17b857 |
|
|
@ -16,7 +16,7 @@ import org.springframework.cache.annotation.EnableCaching;
|
||||||
description = "本地测试环境"
|
description = "本地测试环境"
|
||||||
),
|
),
|
||||||
@Server(
|
@Server(
|
||||||
url = "http://local.gunshiiot.com:18083/gunshiApp/ss",
|
url = "http://223.75.53.141:83/gunshiApp/ss",
|
||||||
description = "线上测试环境"
|
description = "线上测试环境"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,16 @@ public class OpenApiConfig {
|
||||||
@Bean
|
@Bean
|
||||||
public GroupedOpenApi openApi() {
|
public GroupedOpenApi openApi() {
|
||||||
String[] packagesToScan = {
|
String[] packagesToScan = {
|
||||||
"com.gunshi.project.hsz.controller",
|
"com.gunshi.project.ss.controller",
|
||||||
|
};
|
||||||
|
String[] pathsToMatch = {
|
||||||
|
"/impactZoneInfo/**",
|
||||||
|
"/auditProcess/**",
|
||||||
|
"/warningRule/**"
|
||||||
};
|
};
|
||||||
return GroupedOpenApi.builder()
|
return GroupedOpenApi.builder()
|
||||||
.group("hsz")
|
.group("ss")
|
||||||
|
.pathsToMatch(pathsToMatch)
|
||||||
.packagesToScan(packagesToScan)
|
.packagesToScan(packagesToScan)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.gunshi.project.ss.controller;
|
||||||
|
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.ss.common.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.ss.common.validate.markers.Update;
|
||||||
|
import com.gunshi.project.ss.model.AuditProcess;
|
||||||
|
import com.gunshi.project.ss.service.AuditProcessService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Tag(name = "审批流程配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value="/auditProcess")
|
||||||
|
public class AuditProcessController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AuditProcessService service;
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "新增")
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public R<AuditProcess> insert(@Validated(Insert.class) @RequestBody AuditProcess dto) {
|
||||||
|
if (dto.getWarningLevel() != null){
|
||||||
|
if (service.lambdaQuery().eq(AuditProcess::getWarningLevel,dto.getAuditLevel()).count() > 0) {
|
||||||
|
throw new IllegalArgumentException("当前预警级别的审批流程已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean result = service.save(dto);
|
||||||
|
return R.ok(result ? dto : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
@PostMapping("/update")
|
||||||
|
public R<AuditProcess> update(@Validated(Update.class) @RequestBody AuditProcess dto) {
|
||||||
|
if (Objects.isNull(service.getById(dto.getId()))) {
|
||||||
|
throw new IllegalArgumentException("当前数据不存在");
|
||||||
|
}
|
||||||
|
boolean result = service.updateById(dto);
|
||||||
|
return R.ok(result ? dto : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
@GetMapping("/del/{id}")
|
||||||
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||||
|
if (Objects.isNull(service.getById(id))) {
|
||||||
|
throw new IllegalArgumentException("当前数据不存在");
|
||||||
|
}
|
||||||
|
boolean data = service.removeById(id);
|
||||||
|
|
||||||
|
return R.ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "列表")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public R<List<AuditProcess>> list(@RequestParam(value = "warningLevel",required = false) @Parameter(description = "预警级别") Integer warningLevel) {
|
||||||
|
if (warningLevel != null){
|
||||||
|
return R.ok(service.lambdaQuery().eq(AuditProcess::getWarningLevel,warningLevel).list());
|
||||||
|
}
|
||||||
|
return R.ok(service.lambdaQuery().list());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -4,12 +4,12 @@ package com.gunshi.project.ss.controller;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
import com.gunshi.project.ss.entity.so.FundBudgetPageSo;
|
import com.gunshi.project.ss.entity.so.FundBudgetPageSo;
|
||||||
import com.gunshi.project.ss.mapper.FundBudgetMapper;
|
|
||||||
import com.gunshi.project.ss.model.FileAssociations;
|
import com.gunshi.project.ss.model.FileAssociations;
|
||||||
import com.gunshi.project.ss.model.FundBudget;
|
import com.gunshi.project.ss.model.FundBudget;
|
||||||
import com.gunshi.project.ss.service.FileAssociationsService;
|
import com.gunshi.project.ss.service.FileAssociationsService;
|
||||||
import com.gunshi.project.ss.service.FundBudgetService;
|
import com.gunshi.project.ss.service.FundBudgetService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -49,6 +49,12 @@ public class FundBudgetController extends AbstractCommonFileController {
|
||||||
return R.ok(page);
|
return R.ok(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(description = "统计")
|
||||||
|
@GetMapping("stat")
|
||||||
|
public R<FundBudget> stat(@RequestParam(value = "year",required = false) @Parameter(description = "年份") Integer year){
|
||||||
|
FundBudget res = fundBudgetService.stat(year);
|
||||||
|
return R.ok(res);
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(description = "新增")
|
@Operation(description = "新增")
|
||||||
@PostMapping("/insert")
|
@PostMapping("/insert")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.gunshi.project.ss.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.ss.common.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.ss.common.validate.markers.Update;
|
||||||
|
import com.gunshi.project.ss.entity.so.IaCFlrvvlgPageSo;
|
||||||
|
import com.gunshi.project.ss.model.ImpactZoneInfo;
|
||||||
|
import com.gunshi.project.ss.service.ImpactZoneInfoService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Tag(name = "影响区联络信息管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value="/impactZoneInfo")
|
||||||
|
public class ImpactZoneInfoController{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ImpactZoneInfoService service;
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "新增")
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public R<ImpactZoneInfo> insert(@Validated(Insert.class) @RequestBody ImpactZoneInfo dto) {
|
||||||
|
if (StringUtils.isNotBlank(dto.getName())){
|
||||||
|
if (service.lambdaQuery().eq(ImpactZoneInfo::getName,dto.getName()).count() > 0) {
|
||||||
|
throw new IllegalArgumentException("当前名称已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean result = service.save(dto);
|
||||||
|
return R.ok(result ? dto : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
@PostMapping("/update")
|
||||||
|
public R<ImpactZoneInfo> update(@Validated(Update.class) @RequestBody ImpactZoneInfo dto) {
|
||||||
|
if (Objects.isNull(service.getById(dto.getId()))) {
|
||||||
|
throw new IllegalArgumentException("当前数据不存在");
|
||||||
|
}
|
||||||
|
boolean result = service.updateById(dto);
|
||||||
|
return R.ok(result ? dto : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
@GetMapping("/del/{id}")
|
||||||
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||||
|
if (Objects.isNull(service.getById(id))) {
|
||||||
|
throw new IllegalArgumentException("当前数据不存在");
|
||||||
|
}
|
||||||
|
boolean data = service.removeById(id);
|
||||||
|
|
||||||
|
return R.ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "列表")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R<List<ImpactZoneInfo>> list() {
|
||||||
|
return R.ok(service.lambdaQuery().list());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "分页")
|
||||||
|
@PostMapping("/page")
|
||||||
|
public R<Page<ImpactZoneInfo>> page(@RequestBody IaCFlrvvlgPageSo pageSo) {
|
||||||
|
Page<ImpactZoneInfo> page = service.pageInfo(pageSo);
|
||||||
|
return R.ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -97,6 +97,9 @@ public class ResPlanBController extends AbstractCommonFileController{
|
||||||
if (StringUtils.isNotBlank(so.getType())){
|
if (StringUtils.isNotBlank(so.getType())){
|
||||||
query.eq(ResPlanB::getType, so.getType());
|
query.eq(ResPlanB::getType, so.getType());
|
||||||
}
|
}
|
||||||
|
if (so.getIsAvailable() != null){
|
||||||
|
query.eq(ResPlanB::getIsAvailable, so.getIsAvailable());
|
||||||
|
}
|
||||||
query.orderByDesc(ResPlanB::getModitime);
|
query.orderByDesc(ResPlanB::getModitime);
|
||||||
List<ResPlanB> list = query.list();
|
List<ResPlanB> list = query.list();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import java.util.Map;
|
||||||
|
|
||||||
@Tag(name = "维护养护-日常养护记录")
|
@Tag(name = "维护养护-日常养护记录")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value="/screen/mfr")
|
@RequestMapping(value="/screen/mfr")
|
||||||
public class ScreenMfrController {
|
public class ScreenMfrController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,8 @@ package com.gunshi.project.ss.controller;
|
||||||
|
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
import com.gunshi.project.ss.entity.vo.ScreenPositionTrainingVo;
|
import com.gunshi.project.ss.entity.vo.ScreenPositionTrainingVo;
|
||||||
import com.gunshi.project.ss.model.FileAssociations;
|
|
||||||
import com.gunshi.project.ss.model.ResPerson;
|
import com.gunshi.project.ss.model.ResPerson;
|
||||||
import com.gunshi.project.ss.service.FileAssociationsService;
|
import com.gunshi.project.ss.service.FileAssociationsService;
|
||||||
import com.gunshi.project.ss.service.PersonnelPlanService;
|
|
||||||
import com.gunshi.project.ss.service.ScreenResponsibilityService;
|
import com.gunshi.project.ss.service.ScreenResponsibilityService;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -24,8 +22,6 @@ public class ScreenResponsibilityController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ScreenResponsibilityService screenResponsibilityService;
|
private ScreenResponsibilityService screenResponsibilityService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileAssociationsService fileService;
|
private FileAssociationsService fileService;
|
||||||
|
|
||||||
|
|
@ -45,9 +41,9 @@ public class ScreenResponsibilityController {
|
||||||
@GetMapping("/getTraining")
|
@GetMapping("/getTraining")
|
||||||
public R<ScreenPositionTrainingVo> getTraining(){
|
public R<ScreenPositionTrainingVo> getTraining(){
|
||||||
ScreenPositionTrainingVo vo = screenResponsibilityService.getTraining();
|
ScreenPositionTrainingVo vo = screenResponsibilityService.getTraining();
|
||||||
if(vo.getLatestPersonnelPlan() != null){
|
if(vo.getLatestPersonnelLog() != null){
|
||||||
List<FileAssociations> files = fileService.getFiles(getGroupId(), vo.getLatestPersonnelPlan().getId().toString());
|
vo.getLatestPersonnelLog().setFiles1(fileService.getFiles(getGroupId(),vo.getLatestPersonnelLog().getId().toString(),"1"));
|
||||||
vo.getLatestPersonnelPlan().setFiles(files);
|
vo.getLatestPersonnelLog().setFiles2(fileService.getFiles(getGroupId(),vo.getLatestPersonnelLog().getId().toString(),"2"));
|
||||||
}
|
}
|
||||||
return R.ok(vo);
|
return R.ok(vo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,12 @@ import com.gunshi.project.ss.common.validate.markers.Update;
|
||||||
import com.gunshi.project.ss.entity.so.WarningRulePageSo;
|
import com.gunshi.project.ss.entity.so.WarningRulePageSo;
|
||||||
import com.gunshi.project.ss.model.WarningRule;
|
import com.gunshi.project.ss.model.WarningRule;
|
||||||
import com.gunshi.project.ss.model.WarningRuleInfo;
|
import com.gunshi.project.ss.model.WarningRuleInfo;
|
||||||
import com.gunshi.project.ss.service.HisWaterDataService;
|
|
||||||
import com.gunshi.project.ss.service.StStbprpBService;
|
import com.gunshi.project.ss.service.StStbprpBService;
|
||||||
import com.gunshi.project.ss.service.WarningRuleInfoService;
|
import com.gunshi.project.ss.service.WarningRuleInfoService;
|
||||||
import com.gunshi.project.ss.service.WarningRuleService;
|
import com.gunshi.project.ss.service.WarningRuleService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -26,12 +24,20 @@ import java.util.List;
|
||||||
@Tag(name = "预警规则")
|
@Tag(name = "预警规则")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value="/warningRule")
|
@RequestMapping(value="/warningRule")
|
||||||
public class WarningRuleController extends AbstractCommonFileController {
|
public class WarningRuleController{
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WarningRuleService warningRuleService;
|
private WarningRuleService warningRuleService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StStbprpBService stStbprpBService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WarningRuleInfoService warningRuleInfoService;
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "分页")
|
@Operation(summary = "分页")
|
||||||
@PostMapping("/page")
|
@PostMapping("/page")
|
||||||
public R<Page<WarningRule>> page(@RequestBody @Validated WarningRulePageSo page) {
|
public R<Page<WarningRule>> page(@RequestBody @Validated WarningRulePageSo page) {
|
||||||
|
|
@ -41,13 +47,7 @@ public class WarningRuleController extends AbstractCommonFileController {
|
||||||
|
|
||||||
@Operation(summary = "新增")
|
@Operation(summary = "新增")
|
||||||
@PostMapping("/insert")
|
@PostMapping("/insert")
|
||||||
public R<WarningRule> insert(@RequestBody @Validated WarningRule dto, HttpServletRequest request) {
|
public R<WarningRule> insert(@RequestBody @Validated WarningRule dto) {
|
||||||
// SessionUser sessionUser = checkLogin(request);
|
|
||||||
// if(sessionUser == null){
|
|
||||||
// throw new IllegalArgumentException("未登录");
|
|
||||||
// }
|
|
||||||
// Long userId = sessionUser.getUserId();
|
|
||||||
// dto.setCreateName(userId.toString());
|
|
||||||
return R.ok(warningRuleService.saveData(dto));
|
return R.ok(warningRuleService.saveData(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,10 +66,6 @@ public class WarningRuleController extends AbstractCommonFileController {
|
||||||
return R.ok(b);
|
return R.ok(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private WarningRuleInfoService warningRuleInfoService;
|
|
||||||
|
|
||||||
@Operation(summary = "预警信息分页")
|
@Operation(summary = "预警信息分页")
|
||||||
@PostMapping("/info/page")
|
@PostMapping("/info/page")
|
||||||
public R<Page<WarningRuleInfo>> infoPage(@RequestBody @Validated WarningRulePageSo page) {
|
public R<Page<WarningRuleInfo>> infoPage(@RequestBody @Validated WarningRulePageSo page) {
|
||||||
|
|
@ -84,27 +80,17 @@ public class WarningRuleController extends AbstractCommonFileController {
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取降雨量测点
|
//获取降雨量测点
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StStbprpBService stStbprpBService;
|
|
||||||
|
|
||||||
@Operation(summary = "获取降雨量测点")
|
@Operation(summary = "获取降雨量测点")
|
||||||
@GetMapping("/getRainStcd")
|
@GetMapping("/getRainStcd")
|
||||||
public R<List<StStbprpB>> gerRainStcd(){
|
public R<List<StStbprpB>> getRainStcd(){
|
||||||
return R.ok(stStbprpBService.getPptnStations());
|
return R.ok(stStbprpBService.getPptnStations());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
@Operation(summary = "获取流量测点")
|
||||||
private HisWaterDataService hisWaterDataService;
|
@GetMapping("/getFlowStcd")
|
||||||
|
public R<List<StStbprpB>> getFlowStcd(){
|
||||||
@Operation(summary = "获取年份")
|
return R.ok(stStbprpBService.getFlowStations());
|
||||||
@GetMapping("/getYear")
|
|
||||||
public R<List<Integer>> getYear(){
|
|
||||||
return R.ok(hisWaterDataService.getYearList());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getGroupId() {
|
|
||||||
return "warningRule";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,7 @@ public class IaCFlrvvlgPageSo {
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description="状态(0启用 1停用)")
|
||||||
|
private Integer status;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.gunshi.project.ss.entity.so;
|
package com.gunshi.project.ss.entity.so;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.gunshi.db.dto.DateTimeRangeSo;
|
import com.gunshi.db.dto.DateTimeRangeSo;
|
||||||
import com.gunshi.db.dto.PageSo;
|
import com.gunshi.db.dto.PageSo;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
@ -14,9 +15,25 @@ public class WarningRulePageSo {
|
||||||
@Schema(description = "分页参数")
|
@Schema(description = "分页参数")
|
||||||
private PageSo pageSo;
|
private PageSo pageSo;
|
||||||
|
|
||||||
private String ruleName;
|
/**
|
||||||
|
* 预警类型:MONITOR-监测预警,FORE-预报预警
|
||||||
|
*/
|
||||||
|
@Schema(description="预警类型:MONITOR-监测预警,FORE-预报预警")
|
||||||
private String warningType;
|
private String warningType;
|
||||||
|
|
||||||
private DateTimeRangeSo dateTimeRangeSo;
|
|
||||||
|
/**
|
||||||
|
* 预警对象(1-库水位 2-累计雨量 3-出入库流量 4-位移 5-渗压 5-渗流 6-预报最高库水位 7-预报累计雨量 8-预报入库洪峰流量 9-预报渗压)
|
||||||
|
*/
|
||||||
|
@Schema(description="预警对象(1-库水位 2-累计雨量 3-出入库流量 4-位移 5-渗压 5-渗流 6-预报最高库水位 7-预报累计雨量 8-预报入库洪峰流量 9-预报渗压)")
|
||||||
|
private Integer warningObj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警级别(1蓝色 2黄色 3橙色 4红色)
|
||||||
|
*/
|
||||||
|
@Schema(description="预警级别(1蓝色 2黄色 3橙色 4红色)")
|
||||||
|
private Integer warningLevel;
|
||||||
|
|
||||||
|
@Schema(description="状态:0-未启用,1-启用")
|
||||||
|
private Integer status;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.gunshi.project.ss.entity.vo;
|
package com.gunshi.project.ss.entity.vo;
|
||||||
|
|
||||||
|
|
||||||
import com.gunshi.project.ss.model.PersonnelPlan;
|
import com.gunshi.project.ss.model.PersonnelPlanLog;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|
@ -9,7 +9,7 @@ public class ScreenPositionTrainingVo {
|
||||||
|
|
||||||
|
|
||||||
//培训计划数量
|
//培训计划数量
|
||||||
private Long trainingCount;
|
private Integer trainingCount;
|
||||||
|
|
||||||
//已开展
|
//已开展
|
||||||
private Long hasTraining;
|
private Long hasTraining;
|
||||||
|
|
@ -18,9 +18,9 @@ public class ScreenPositionTrainingVo {
|
||||||
private Long hasNoTraining;
|
private Long hasNoTraining;
|
||||||
|
|
||||||
//参训总人次
|
//参训总人次
|
||||||
private Long totalTraining;
|
private Integer totalTraining;
|
||||||
|
|
||||||
|
|
||||||
//最新培训内容
|
//最新培训内容
|
||||||
private PersonnelPlan latestPersonnelPlan;
|
private PersonnelPlanLog latestPersonnelLog;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.gunshi.project.ss.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.gunshi.project.ss.model.AuditProcess;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface AuditProcessMapper extends BaseMapper<AuditProcess> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.gunshi.project.ss.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.gunshi.project.ss.model.ImpactZoneInfo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ImpactZoneInfoMapper extends BaseMapper<ImpactZoneInfo> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.gunshi.project.ss.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.gunshi.project.ss.common.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description="审批流程配置")
|
||||||
|
@Data
|
||||||
|
@TableName("public.audit_process")
|
||||||
|
public class AuditProcess implements Serializable {
|
||||||
|
|
||||||
|
public final static String thisTableName = "AuditProcess";
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value="id", type= IdType.AUTO)
|
||||||
|
@Schema(description="主键")
|
||||||
|
@NotNull(message = "id不能为空",groups = { Update.class})
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警级别(1蓝色 2黄色 3橙色 4红色)
|
||||||
|
*/
|
||||||
|
@TableField(value="warning_level")
|
||||||
|
@Schema(description="预警级别(1蓝色 2黄色 3橙色 4红色)")
|
||||||
|
private Integer warningLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批层级(1一级 2二级)
|
||||||
|
*/
|
||||||
|
@TableField(value="audit_level")
|
||||||
|
@Schema(description="审批层级(1一级 2二级)")
|
||||||
|
private Integer auditLevel;
|
||||||
|
|
||||||
|
@TableField(value="first_audit_user_id")
|
||||||
|
@Schema(description="一级审批人id")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long firstAuditUserId;
|
||||||
|
|
||||||
|
@TableField(value="first_audit_user_name")
|
||||||
|
@Schema(description="一级审批人")
|
||||||
|
private String firstAuditUserName;
|
||||||
|
|
||||||
|
@TableField(value="second_audit_user_id")
|
||||||
|
@Schema(description="二级审批人id")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long secondAuditUserId;
|
||||||
|
|
||||||
|
@TableField(value="second_audit_user_name")
|
||||||
|
@Schema(description="二级审批人")
|
||||||
|
private String secondAuditUserName;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField("update_time")
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.gunshi.project.ss.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.gunshi.project.ss.common.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description="影响区联络信息管理")
|
||||||
|
@Data
|
||||||
|
@TableName("public.impact_zone_info")
|
||||||
|
public class ImpactZoneInfo implements Serializable {
|
||||||
|
|
||||||
|
public final static String thisTableName = "ImpactZoneInfo";
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value="id", type= IdType.AUTO)
|
||||||
|
@Schema(description="主键")
|
||||||
|
@NotNull(message = "id不能为空",groups = { Update.class})
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
@TableField(value="name")
|
||||||
|
@Schema(description="姓名")
|
||||||
|
@Size(max = 100,message = "姓名最大长度要小于 100")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@TableField(value="org_name")
|
||||||
|
@Schema(description="单位")
|
||||||
|
@Size(max = 100,message = "单位最大长度要小于 100")
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职务
|
||||||
|
*/
|
||||||
|
@TableField(value="post_name")
|
||||||
|
@Schema(description="职务")
|
||||||
|
@Size(max = 100,message = "职务最大长度要小于 100")
|
||||||
|
private String postName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系方式
|
||||||
|
*/
|
||||||
|
@TableField(value="tel")
|
||||||
|
@Schema(description="联系方式")
|
||||||
|
private String tel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联影响区
|
||||||
|
*/
|
||||||
|
@TableField(value="ass_impact_zone")
|
||||||
|
@Schema(description="关联影响区")
|
||||||
|
@Size(max = 500,message = "关联影响区最大长度要小于 500")
|
||||||
|
private String assImpactZone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主要职责
|
||||||
|
*/
|
||||||
|
@TableField(value="main_duty")
|
||||||
|
@Schema(description="主要职责")
|
||||||
|
@Size(max = 500,message = "主要职责最大长度要小于 500")
|
||||||
|
private String mainDuty;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0启用 1停用)
|
||||||
|
*/
|
||||||
|
@TableField(value="status")
|
||||||
|
@Schema(description="状态(0启用 1停用)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@TableField("create_time")
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
}
|
||||||
|
|
@ -49,10 +49,10 @@ public class ResPerson extends CommUpdate implements Serializable {
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型,0:行政,1:主管部门,2:管理单位,3:巡查,4:技术
|
* 类型,1:行政,2:主管部门,3:管理单位,4:巡查,5:技术
|
||||||
*/
|
*/
|
||||||
@TableField(value="type")
|
@TableField(value="type")
|
||||||
@Schema(description="类型,0:行政,1:主管部门,2:管理单位,3:巡查,4:技术")
|
@Schema(description="类型,1:行政,2:主管部门,3:管理单位,4:巡查,5:技术")
|
||||||
@NotNull(message = "责任类型不能为空")
|
@NotNull(message = "责任类型不能为空")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,6 @@ public class ResPlanB implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value="prep_time")
|
@TableField(value="prep_time")
|
||||||
@Schema(description="编制时间")
|
@Schema(description="编制时间")
|
||||||
// @Size(max = 0,message = "编制时间最大长度要小于 0")
|
|
||||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
private Date prepTime;
|
private Date prepTime;
|
||||||
|
|
||||||
|
|
@ -81,7 +80,6 @@ public class ResPlanB implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value="appr_time")
|
@TableField(value="appr_time")
|
||||||
@Schema(description="批复时间")
|
@Schema(description="批复时间")
|
||||||
// @Size(max = 0,message = "批复时间最大长度要小于 0")
|
|
||||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
private Date apprTime;
|
private Date apprTime;
|
||||||
|
|
||||||
|
|
@ -98,7 +96,6 @@ public class ResPlanB implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value="file_id")
|
@TableField(value="file_id")
|
||||||
@Schema(description="文件id")
|
@Schema(description="文件id")
|
||||||
// @Size(max = 0,message = "文件id最大长度要小于 0")
|
|
||||||
private Long fileId;
|
private Long fileId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -106,7 +103,6 @@ public class ResPlanB implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value="type")
|
@TableField(value="type")
|
||||||
@Schema(description="类型(1防汛预案 2调度规程)")
|
@Schema(description="类型(1防汛预案 2调度规程)")
|
||||||
// @Size(max = 0,message = "类型(1防汛预案 2调度规程)最大长度要小于 0")
|
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -114,7 +110,6 @@ public class ResPlanB implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value="moditime")
|
@TableField(value="moditime")
|
||||||
@Schema(description="时间戳")
|
@Schema(description="时间戳")
|
||||||
// @Size(max = 0,message = "时间戳最大长度要小于 0")
|
|
||||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
private Date moditime;
|
private Date moditime;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public class ReservoirDemarcationInfo {
|
||||||
|
|
||||||
@TableField("management_scope_area_explain")
|
@TableField("management_scope_area_explain")
|
||||||
@Schema(description = "管理范围(km²)说明")
|
@Schema(description = "管理范围(km²)说明")
|
||||||
private BigDecimal managementScopeAreaExplain;
|
private String managementScopeAreaExplain;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@Schema(description = "管理范围(km²)文件")
|
@Schema(description = "管理范围(km²)文件")
|
||||||
|
|
@ -40,7 +40,7 @@ public class ReservoirDemarcationInfo {
|
||||||
|
|
||||||
@TableField("protection_scope_area_explain")
|
@TableField("protection_scope_area_explain")
|
||||||
@Schema(description = "保护范围(km²)说明")
|
@Schema(description = "保护范围(km²)说明")
|
||||||
private BigDecimal protectionScopeAreaExplain;
|
private String protectionScopeAreaExplain;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@Schema(description = "保护范围(km²)文件")
|
@Schema(description = "保护范围(km²)文件")
|
||||||
|
|
@ -53,7 +53,7 @@ public class ReservoirDemarcationInfo {
|
||||||
|
|
||||||
@TableField("total_use_area_explain")
|
@TableField("total_use_area_explain")
|
||||||
@Schema(description = "用地总面积(万亩)说明")
|
@Schema(description = "用地总面积(万亩)说明")
|
||||||
private BigDecimal totalUseAreaExplain;
|
private String totalUseAreaExplain;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@Schema(description = "用地总面积(万亩)文件")
|
@Schema(description = "用地总面积(万亩)文件")
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,14 @@
|
||||||
package com.gunshi.project.ss.model;
|
package com.gunshi.project.ss.model;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -15,12 +22,16 @@ public class WarningCondition {
|
||||||
* 主键ID
|
* 主键ID
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
|
@Schema(description="主键")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规则ID
|
* 规则ID
|
||||||
*/
|
*/
|
||||||
@TableField("rule_id")
|
@TableField("rule_id")
|
||||||
|
@Schema(description="规则ID")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long ruleId;
|
private Long ruleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,46 +40,34 @@ public class WarningCondition {
|
||||||
@TableField("_order")
|
@TableField("_order")
|
||||||
private Integer order;
|
private Integer order;
|
||||||
|
|
||||||
/**
|
|
||||||
* 预警指标类型
|
|
||||||
* 实时水位 REAL_WATER_LEVEL
|
|
||||||
* 预报洪峰流量 PEAK_FLOW
|
|
||||||
* 降雨量 RAINFALL
|
|
||||||
* 蓄水量 WATER_STORAGE
|
|
||||||
* 预报降雨量 FORECAST_RAINFALL
|
|
||||||
*/
|
|
||||||
@TableField("indicator_type")
|
|
||||||
private String indicatorType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预警类型:FLOOD-洪水预警,DROUGHT-干旱预警
|
|
||||||
*/
|
|
||||||
@TableField("warning_type")
|
|
||||||
private String warningType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测点编码
|
|
||||||
*/
|
|
||||||
@TableField("stcd")
|
|
||||||
private String stcd;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 比较运算符
|
* 比较运算符
|
||||||
*/
|
*/
|
||||||
@TableField("_operator")
|
@TableField("_operator")
|
||||||
|
@Schema(description="比较运算符")
|
||||||
private String operator;
|
private String operator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 阈值
|
* 阈值
|
||||||
*/
|
*/
|
||||||
@TableField("threshold_value")
|
@TableField("threshold_value")
|
||||||
|
@Schema(description="阈值")
|
||||||
private BigDecimal thresholdValue;
|
private BigDecimal thresholdValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 时长/时段(小时)
|
* 预报时长
|
||||||
*/
|
*/
|
||||||
@TableField("duration_hours")
|
@TableField("duration_hours")
|
||||||
|
@Schema(description="预报时长")
|
||||||
private Integer durationHours;
|
private Integer durationHours;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 位移方向
|
||||||
|
*/
|
||||||
|
@TableField("direction")
|
||||||
|
@Schema(description="位移方向")
|
||||||
|
private String direction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 与前一个条件的关系:AND-且,OR-或(最后一个条件为空)
|
* 与前一个条件的关系:AND-且,OR-或(最后一个条件为空)
|
||||||
|
|
@ -76,12 +75,6 @@ public class WarningCondition {
|
||||||
@TableField("relation_type")
|
@TableField("relation_type")
|
||||||
private String relationType;
|
private String relationType;
|
||||||
|
|
||||||
@TableField("warning_level")
|
|
||||||
private Integer warningLevel;
|
|
||||||
|
|
||||||
@TableField("year")
|
|
||||||
private String year;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Boolean isEnjoy = false;//该预警规则是否满足条件,默认不满足
|
private Boolean isEnjoy = false;//该预警规则是否满足条件,默认不满足
|
||||||
}
|
}
|
||||||
|
|
@ -2,6 +2,11 @@ package com.gunshi.project.ss.model;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.gunshi.project.ss.common.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -16,45 +21,65 @@ public class WarningRule {
|
||||||
/**
|
/**
|
||||||
* 主键ID
|
* 主键ID
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(value="id", type= IdType.AUTO)
|
||||||
|
@Schema(description="主键")
|
||||||
|
@NotNull(message = "id不能为空",groups = { Update.class})
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规则名称
|
* 预警类型:MONITOR-监测预警,FORE-预报预警
|
||||||
*/
|
|
||||||
@TableField("rule_name")
|
|
||||||
private String ruleName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预警类型:FLOOD-洪水预警,DROUGHT-干旱预警
|
|
||||||
*/
|
*/
|
||||||
@TableField("warning_type")
|
@TableField("warning_type")
|
||||||
|
@Schema(description="预警类型:MONITOR-监测预警,FORE-预报预警")
|
||||||
private String warningType;
|
private String warningType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警对象(1-库水位 2-累计雨量 3-出入库流量 4-位移 5-渗压 5-渗流 6-预报最高库水位 7-预报累计雨量 8-预报入库洪峰流量 9-预报渗压)
|
||||||
|
*/
|
||||||
|
@TableField("warning_obj")
|
||||||
|
@Schema(description="预警对象(1-库水位 2-累计雨量 3-出入库流量 4-位移 5-渗压 5-渗流 6-预报最高库水位 7-预报累计雨量 8-预报入库洪峰流量 9-预报渗压)")
|
||||||
|
private Integer warningObj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警级别(1蓝色 2黄色 3橙色 4红色)
|
||||||
|
*/
|
||||||
|
@TableField("warning_level")
|
||||||
|
@Schema(description="预警级别(1蓝色 2黄色 3橙色 4红色)")
|
||||||
|
private Integer warningLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联测点
|
||||||
|
*/
|
||||||
|
@TableField("rel_stcd")
|
||||||
|
@Schema(description="关联测点")
|
||||||
|
private String relStcd;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态:0-未启用,1-启用
|
* 状态:0-未启用,1-启用
|
||||||
*/
|
*/
|
||||||
@TableField("status")
|
@TableField("status")
|
||||||
|
@Schema(description="状态:0-未启用,1-启用")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人
|
* 应对措施
|
||||||
*/
|
*/
|
||||||
@TableField("create_name")
|
@TableField("solution")
|
||||||
private String createName;
|
@Schema(description="应对措施")
|
||||||
|
private String solution;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@TableField("create_time")
|
@TableField("create_time")
|
||||||
|
@Schema(description="创建时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|
||||||
@TableField("warning_level")
|
|
||||||
private Integer warningLevel;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预警条件列表
|
* 预警条件列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,11 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.gunshi.project.ss.common.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
@ -19,29 +24,42 @@ public class WarningRuleInfo {
|
||||||
* 主键ID
|
* 主键ID
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
|
@Schema(description="主键")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@TableField("rule_id")
|
@TableField("rule_id")
|
||||||
|
@Schema(description="规则主键")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long ruleId;
|
private Long ruleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规则名称
|
* 预警类型:MONITOR-监测预警,FORE-预报预警
|
||||||
*/
|
|
||||||
@TableField("rule_name")
|
|
||||||
private String ruleName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预警类型:FLOOD-洪水预警,DROUGHT-干旱预警
|
|
||||||
*/
|
*/
|
||||||
@TableField("warning_type")
|
@TableField("warning_type")
|
||||||
|
@Schema(description="预警类型:MONITOR-监测预警,FORE-预报预警")
|
||||||
private String warningType;
|
private String warningType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警对象(1-库水位 2-累计雨量 3-出入库流量 4-位移 5-渗压 5-渗流 6-预报最高库水位 7-预报累计雨量 8-预报入库洪峰流量 9-预报渗压)
|
||||||
|
*/
|
||||||
|
@TableField("warning_obj")
|
||||||
|
@Schema(description="预警对象(1-库水位 2-累计雨量 3-出入库流量 4-位移 5-渗压 5-渗流 6-预报最高库水位 7-预报累计雨量 8-预报入库洪峰流量 9-预报渗压)")
|
||||||
|
private Integer warningObj;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人
|
* 预警级别(1蓝色 2黄色 3橙色 4红色)
|
||||||
*/
|
*/
|
||||||
@TableField("create_name")
|
@TableField("warning_level")
|
||||||
private String createName;
|
@Schema(description="预警级别(1蓝色 2黄色 3橙色 4红色)")
|
||||||
|
private Integer warningLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联测点
|
||||||
|
*/
|
||||||
|
@TableField("rel_stcd")
|
||||||
|
@Schema(description="关联测点")
|
||||||
|
private String relStcd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
|
|
@ -53,15 +71,12 @@ public class WarningRuleInfo {
|
||||||
@TableField("rule_info")
|
@TableField("rule_info")
|
||||||
private String ruleInfo;
|
private String ruleInfo;
|
||||||
|
|
||||||
@TableField("warning_level")
|
@TableField("status")
|
||||||
private Integer warningLevel;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预警条件列表
|
* 预警条件列表
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<WarningCondition> conditions;
|
private List<WarningCondition> conditions;
|
||||||
|
|
||||||
@TableField("status")
|
|
||||||
private Integer status;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.gunshi.project.ss.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gunshi.project.ss.mapper.AuditProcessMapper;
|
||||||
|
import com.gunshi.project.ss.model.AuditProcess;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class AuditProcessService extends ServiceImpl<AuditProcessMapper, AuditProcess>
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gunshi.project.ss.entity.so.FundBudgetPageSo;
|
import com.gunshi.project.ss.entity.so.FundBudgetPageSo;
|
||||||
import com.gunshi.project.ss.mapper.FundBudgetMapper;
|
import com.gunshi.project.ss.mapper.FundBudgetMapper;
|
||||||
import com.gunshi.project.ss.model.FundBudget;
|
import com.gunshi.project.ss.model.FundBudget;
|
||||||
|
import io.jsonwebtoken.lang.Collections;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
@ -24,6 +26,7 @@ public class FundBudgetService extends ServiceImpl<FundBudgetMapper, FundBudget
|
||||||
if(pageSo.getBudgetYear() != null){
|
if(pageSo.getBudgetYear() != null){
|
||||||
queryWrapper.eq(FundBudget::getBudgetYear, pageSo.getBudgetYear());
|
queryWrapper.eq(FundBudget::getBudgetYear, pageSo.getBudgetYear());
|
||||||
}
|
}
|
||||||
|
queryWrapper.orderByDesc(FundBudget::getBudgetYear);
|
||||||
Page<FundBudget> fundBudgetPage = baseMapper.selectPage(pageSo.getPageSo().toPage(), queryWrapper);
|
Page<FundBudget> fundBudgetPage = baseMapper.selectPage(pageSo.getPageSo().toPage(), queryWrapper);
|
||||||
return fundBudgetPage;
|
return fundBudgetPage;
|
||||||
}
|
}
|
||||||
|
|
@ -67,4 +70,20 @@ public class FundBudgetService extends ServiceImpl<FundBudgetMapper, FundBudget
|
||||||
FundBudget one = baseMapper.selectOne(queryWrapper);
|
FundBudget one = baseMapper.selectOne(queryWrapper);
|
||||||
return one;
|
return one;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FundBudget stat(Integer year) {
|
||||||
|
FundBudget fundBudget = new FundBudget();
|
||||||
|
LambdaQueryWrapper<FundBudget> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
if(year != null){
|
||||||
|
queryWrapper.eq(FundBudget::getBudgetYear, year);
|
||||||
|
}
|
||||||
|
List<FundBudget> list = baseMapper.selectList(queryWrapper);
|
||||||
|
if (Collections.isEmpty(list)){
|
||||||
|
return fundBudget;
|
||||||
|
}
|
||||||
|
fundBudget.setAnnualIncomeBudget(list.stream().map(FundBudget::getAnnualIncomeBudget).reduce(BigDecimal.ZERO,BigDecimal::add));
|
||||||
|
fundBudget.setAnnualExpenditureBudget(list.stream().map(FundBudget::getAnnualExpenditureBudget).reduce(BigDecimal.ZERO,BigDecimal::add));
|
||||||
|
fundBudget.setBudgetBalance(list.stream().map(FundBudget::getBudgetBalance).reduce(BigDecimal.ZERO,BigDecimal::add));
|
||||||
|
return fundBudget;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.gunshi.project.ss.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gunshi.project.ss.entity.so.IaCFlrvvlgPageSo;
|
||||||
|
import com.gunshi.project.ss.entity.vo.HomeIaCBsnssinfoVo;
|
||||||
|
import com.gunshi.project.ss.mapper.IaCBsnssinfoMapper;
|
||||||
|
import com.gunshi.project.ss.mapper.ImpactZoneInfoMapper;
|
||||||
|
import com.gunshi.project.ss.model.IaCBsnssinfo;
|
||||||
|
import com.gunshi.project.ss.model.ImpactZoneInfo;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class ImpactZoneInfoService extends ServiceImpl<ImpactZoneInfoMapper, ImpactZoneInfo>
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public Page<ImpactZoneInfo> pageInfo(IaCFlrvvlgPageSo pageSo) {
|
||||||
|
LambdaQueryWrapper<ImpactZoneInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
if(!StringUtils.isEmpty(pageSo.getName())){
|
||||||
|
queryWrapper.like(ImpactZoneInfo::getName, pageSo.getName());
|
||||||
|
}
|
||||||
|
if(pageSo.getStatus() != null){
|
||||||
|
queryWrapper.eq(ImpactZoneInfo::getStatus, pageSo.getStatus());
|
||||||
|
}
|
||||||
|
queryWrapper.orderByDesc(ImpactZoneInfo::getCreateTime);
|
||||||
|
return this.baseMapper.selectPage(pageSo.getPageSo().toPage(), queryWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.gunshi.project.ss.service;
|
package com.gunshi.project.ss.service;
|
||||||
|
|
||||||
|
|
||||||
import com.gunshi.core.result.R;
|
|
||||||
import com.gunshi.project.ss.model.ResPlanB;
|
import com.gunshi.project.ss.model.ResPlanB;
|
||||||
import com.gunshi.project.ss.model.RotaB;
|
import com.gunshi.project.ss.model.RotaB;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -29,42 +28,36 @@ public class ScreenResponsibilityService {
|
||||||
public ScreenPositionTrainingVo getTraining() {
|
public ScreenPositionTrainingVo getTraining() {
|
||||||
ScreenPositionTrainingVo vo = new ScreenPositionTrainingVo();
|
ScreenPositionTrainingVo vo = new ScreenPositionTrainingVo();
|
||||||
List<PersonnelPlan> list = personnelPlanService.lambdaQuery().orderByDesc(PersonnelPlan::getCreateTime).list();
|
List<PersonnelPlan> list = personnelPlanService.lambdaQuery().orderByDesc(PersonnelPlan::getCreateTime).list();
|
||||||
vo.setTrainingCount(Long.valueOf(list.size()));
|
vo.setTrainingCount(list.size());
|
||||||
|
|
||||||
//已开展
|
List<Long> ids = list.stream().map(PersonnelPlan::getId).toList();
|
||||||
List<Long> ids = list.stream().map(o -> o.getId()).collect(Collectors.toList());
|
|
||||||
Long hasTraining = 0l;
|
List<PersonnelPlanLog> logs = personnelPlanLogService.lambdaQuery().orderByDesc(PersonnelPlanLog::getCreateTime).list();
|
||||||
Long hasNoTraining = 0l;
|
if(logs.isEmpty()){
|
||||||
Long totalTraining = 0L;
|
vo.setTotalTraining(0);
|
||||||
//TODO 这里N+1问题自己去解决一下吧,我懒得改了。
|
vo.setHasTraining(0L);
|
||||||
for (Long id : ids) {
|
vo.setHasNoTraining(0L);
|
||||||
List<PersonnelPlanLog> logs = personnelPlanLogService.lambdaQuery().eq(PersonnelPlanLog::getPlanId, id).list();
|
return vo;
|
||||||
if(logs.isEmpty()){
|
|
||||||
hasNoTraining++;
|
|
||||||
}else{
|
|
||||||
hasTraining++;
|
|
||||||
totalTraining += logs.stream().mapToLong(o -> o.getNumPeople()).sum();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
vo.setLatestPersonnelLog(logs.getFirst());
|
||||||
|
vo.setTotalTraining(logs.stream().mapToInt(PersonnelPlanLog::getNumPeople).sum());
|
||||||
|
|
||||||
|
//已开展数量
|
||||||
|
Long hasTraining = logs.stream().map(PersonnelPlanLog::getPlanId).filter(planId ->ids.contains(planId)).distinct().count();
|
||||||
vo.setHasTraining(hasTraining);
|
vo.setHasTraining(hasTraining);
|
||||||
vo.setHasNoTraining(hasNoTraining);
|
vo.setHasNoTraining(vo.getTrainingCount() - hasTraining);
|
||||||
vo.setTotalTraining(totalTraining);
|
|
||||||
if(!list.isEmpty()){
|
|
||||||
PersonnelPlan personnelPlan = list.get(0);
|
|
||||||
vo.setLatestPersonnelPlan(personnelPlan);
|
|
||||||
}
|
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ResPerson> getPerson() {
|
public List<ResPerson> getPerson() {
|
||||||
List<ResPerson> list = resPersonService.lambdaQuery().in(ResPerson::getType, Arrays.asList(0, 1, 2))
|
List<ResPerson> list = resPersonService.lambdaQuery().in(ResPerson::getType, Arrays.asList(1, 2, 3))
|
||||||
.orderByDesc(ResPerson::getCreateTime)
|
.orderByDesc(ResPerson::getCreateTime)
|
||||||
.list();
|
.list();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ResPerson> getFxPerson() {
|
public List<ResPerson> getFxPerson() {
|
||||||
List<ResPerson> list = resPersonService.lambdaQuery().in(ResPerson::getType, Arrays.asList(0, 3, 4))
|
List<ResPerson> list = resPersonService.lambdaQuery().in(ResPerson::getType, Arrays.asList(1, 4, 5))
|
||||||
.orderByDesc(ResPerson::getCreateTime)
|
.orderByDesc(ResPerson::getCreateTime)
|
||||||
.list();
|
.list();
|
||||||
return list;
|
return list;
|
||||||
|
|
|
||||||
|
|
@ -31,18 +31,6 @@ public class WarningConditionService extends ServiceImpl<WarningConditionMapper,
|
||||||
if(dto.getId() != null){
|
if(dto.getId() != null){
|
||||||
queryWrapper.ne(WarningCondition::getId, dto.getId());
|
queryWrapper.ne(WarningCondition::getId, dto.getId());
|
||||||
}
|
}
|
||||||
if(dto.getIndicatorType() != null){
|
|
||||||
//预警指标类型
|
|
||||||
queryWrapper.eq(WarningCondition::getIndicatorType,dto.getIndicatorType());
|
|
||||||
}
|
|
||||||
if(dto.getWarningLevel() != null){
|
|
||||||
//预警等级
|
|
||||||
queryWrapper.eq(WarningCondition::getWarningLevel,dto.getWarningLevel());
|
|
||||||
}
|
|
||||||
if(dto.getWarningType() != null){
|
|
||||||
//预警类型
|
|
||||||
queryWrapper.eq(WarningCondition::getWarningType,dto.getWarningType());
|
|
||||||
}
|
|
||||||
if(dto.getOperator() != null){
|
if(dto.getOperator() != null){
|
||||||
//比较符
|
//比较符
|
||||||
queryWrapper.eq(WarningCondition::getOperator,dto.getOperator());
|
queryWrapper.eq(WarningCondition::getOperator,dto.getOperator());
|
||||||
|
|
|
||||||
|
|
@ -26,16 +26,16 @@ public class WarningRuleInfoService extends ServiceImpl<WarningRuleInfoMapper,Wa
|
||||||
|
|
||||||
public Page<WarningRuleInfo> pageQuery(WarningRulePageSo page) {
|
public Page<WarningRuleInfo> pageQuery(WarningRulePageSo page) {
|
||||||
LambdaQueryWrapper<WarningRuleInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<WarningRuleInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
if(!StringUtils.isBlank(page.getRuleName())){
|
// if(!StringUtils.isBlank(page.getRuleName())){
|
||||||
queryWrapper.like(WarningRuleInfo::getRuleName, page.getRuleName());
|
// queryWrapper.like(WarningRuleInfo::getRuleName, page.getRuleName());
|
||||||
}
|
// }
|
||||||
if(!StringUtils.isBlank(page.getWarningType())){
|
if(!StringUtils.isBlank(page.getWarningType())){
|
||||||
queryWrapper.eq(WarningRuleInfo::getWarningType, page.getWarningType());
|
queryWrapper.eq(WarningRuleInfo::getWarningType, page.getWarningType());
|
||||||
}
|
}
|
||||||
if(page.getDateTimeRangeSo() != null){
|
// if(page.getDateTimeRangeSo() != null){
|
||||||
queryWrapper.ge(WarningRuleInfo::getCreateTime,page.getDateTimeRangeSo().getStart());
|
// queryWrapper.ge(WarningRuleInfo::getCreateTime,page.getDateTimeRangeSo().getStart());
|
||||||
queryWrapper.le(WarningRuleInfo::getCreateTime,page.getDateTimeRangeSo().getEnd());
|
// queryWrapper.le(WarningRuleInfo::getCreateTime,page.getDateTimeRangeSo().getEnd());
|
||||||
}
|
// }
|
||||||
queryWrapper.orderByDesc(WarningRuleInfo::getCreateTime);
|
queryWrapper.orderByDesc(WarningRuleInfo::getCreateTime);
|
||||||
Page<WarningRuleInfo> warningRuleInfoPage = this.baseMapper.selectPage(page.getPageSo().toPage(), queryWrapper);
|
Page<WarningRuleInfo> warningRuleInfoPage = this.baseMapper.selectPage(page.getPageSo().toPage(), queryWrapper);
|
||||||
List<WarningRuleInfo> records = warningRuleInfoPage.getRecords();
|
List<WarningRuleInfo> records = warningRuleInfoPage.getRecords();
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,18 @@ public class WarningRuleService extends ServiceImpl<WarningRuleMapper, WarningRu
|
||||||
|
|
||||||
public Page<WarningRule> pageQuery(WarningRulePageSo page) {
|
public Page<WarningRule> pageQuery(WarningRulePageSo page) {
|
||||||
LambdaQueryWrapper<WarningRule> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<WarningRule> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
if(!StringUtils.isBlank(page.getRuleName())){
|
|
||||||
queryWrapper.like(WarningRule::getRuleName, page.getRuleName());
|
|
||||||
}
|
|
||||||
if(!StringUtils.isBlank(page.getWarningType())){
|
if(!StringUtils.isBlank(page.getWarningType())){
|
||||||
queryWrapper.eq(WarningRule::getWarningType, page.getWarningType());
|
queryWrapper.eq(WarningRule::getWarningType, page.getWarningType());
|
||||||
}
|
}
|
||||||
|
if(page.getWarningObj() != null){
|
||||||
|
queryWrapper.eq(WarningRule::getWarningObj, page.getWarningObj());
|
||||||
|
}
|
||||||
|
if(page.getWarningLevel() != null){
|
||||||
|
queryWrapper.eq(WarningRule::getWarningLevel, page.getWarningLevel());
|
||||||
|
}
|
||||||
|
if(page.getStatus() != null){
|
||||||
|
queryWrapper.eq(WarningRule::getStatus, page.getStatus());
|
||||||
|
}
|
||||||
queryWrapper.orderByDesc(WarningRule::getCreateTime);
|
queryWrapper.orderByDesc(WarningRule::getCreateTime);
|
||||||
Page<WarningRule> warningRulePage = this.baseMapper.selectPage(page.getPageSo().toPage(), queryWrapper);
|
Page<WarningRule> warningRulePage = this.baseMapper.selectPage(page.getPageSo().toPage(), queryWrapper);
|
||||||
|
|
||||||
|
|
@ -62,13 +68,7 @@ public class WarningRuleService extends ServiceImpl<WarningRuleMapper, WarningRu
|
||||||
save(dto);
|
save(dto);
|
||||||
List<WarningCondition> conditions = dto.getConditions();
|
List<WarningCondition> conditions = dto.getConditions();
|
||||||
for (WarningCondition condition : conditions) {
|
for (WarningCondition condition : conditions) {
|
||||||
// WarningCondition warningCondition = warningConditionService.checkConditionExists(condition);
|
|
||||||
// if(warningCondition != null){
|
|
||||||
// throw new IllegalArgumentException("对不起,该预警规则已配置");
|
|
||||||
// }
|
|
||||||
condition.setRuleId(dto.getId());
|
condition.setRuleId(dto.getId());
|
||||||
condition.setWarningType(dto.getWarningType());
|
|
||||||
condition.setWarningLevel(dto.getWarningLevel());
|
|
||||||
}
|
}
|
||||||
warningConditionService.saveBatch(conditions);
|
warningConditionService.saveBatch(conditions);
|
||||||
return dto;
|
return dto;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
package com.gunshi.project.ss.service;
|
package com.gunshi.project.ss.service;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.gunshi.project.ss.entity.vo.ScreenSecurityCheckVo;
|
import com.gunshi.project.ss.entity.vo.ScreenSecurityCheckVo;
|
||||||
import com.gunshi.project.ss.entity.vo.WholeCycleVo;
|
import com.gunshi.project.ss.entity.vo.WholeCycleVo;
|
||||||
import com.gunshi.project.ss.model.*;
|
import com.gunshi.project.ss.model.*;
|
||||||
|
|
|
||||||
|
|
@ -96,15 +96,15 @@ public class WarningRuleTask {
|
||||||
|
|
||||||
// 这里可以根据 isRuleSatisfied 进行后续处理,比如触发预警等
|
// 这里可以根据 isRuleSatisfied 进行后续处理,比如触发预警等
|
||||||
if (isRuleSatisfied) {
|
if (isRuleSatisfied) {
|
||||||
log.info("预警规则 {} 满足条件,触发预警", warningRule.getRuleName());
|
log.info("预警规则 {} 满足条件,触发预警", warningRule.getId());
|
||||||
|
|
||||||
// 生成规则信息
|
// 生成规则信息
|
||||||
String ruleInfo = generateRuleInfo(conditions);
|
String ruleInfo = generateRuleInfo(conditions);
|
||||||
|
|
||||||
WarningRuleInfo warningRuleInfo = new WarningRuleInfo();
|
WarningRuleInfo warningRuleInfo = new WarningRuleInfo();
|
||||||
warningRuleInfo.setCreateName(warningRule.getCreateName());
|
// warningRuleInfo.setCreateName(warningRule.getCreateName());
|
||||||
warningRuleInfo.setRuleId(warningRule.getId());
|
warningRuleInfo.setRuleId(warningRule.getId());
|
||||||
warningRuleInfo.setRuleName(warningRule.getRuleName());
|
// warningRuleInfo.setRuleName(warningRule.getRuleName());
|
||||||
warningRuleInfo.setConditions(conditions);
|
warningRuleInfo.setConditions(conditions);
|
||||||
warningRuleInfo.setCreateTime(LocalDateTime.now());
|
warningRuleInfo.setCreateTime(LocalDateTime.now());
|
||||||
warningRuleInfo.setRuleInfo(ruleInfo);
|
warningRuleInfo.setRuleInfo(ruleInfo);
|
||||||
|
|
@ -141,8 +141,10 @@ public class WarningRuleTask {
|
||||||
* 生成单个条件的描述信息 - 修改格式
|
* 生成单个条件的描述信息 - 修改格式
|
||||||
*/
|
*/
|
||||||
private String generateSingleConditionInfo(WarningCondition condition) {
|
private String generateSingleConditionInfo(WarningCondition condition) {
|
||||||
String indicatorType = condition.getIndicatorType();
|
// String indicatorType = condition.getIndicatorType();
|
||||||
String stcd = condition.getStcd();
|
// String stcd = condition.getStcd();
|
||||||
|
String indicatorType = null;
|
||||||
|
String stcd = null;
|
||||||
String stnm="";
|
String stnm="";
|
||||||
List<StStbprpB> stStbprpBS = stStbprpBService.lambdaQuery().eq(StStbprpB::getStcd, stcd).last("limit 1").list();
|
List<StStbprpB> stStbprpBS = stStbprpBService.lambdaQuery().eq(StStbprpB::getStcd, stcd).last("limit 1").list();
|
||||||
if(stStbprpBS != null && !stStbprpBS.isEmpty()){
|
if(stStbprpBS != null && !stStbprpBS.isEmpty()){
|
||||||
|
|
@ -167,10 +169,10 @@ public class WarningRuleTask {
|
||||||
stnm, durationHours != null ? durationHours : 24,
|
stnm, durationHours != null ? durationHours : 24,
|
||||||
currentRainfall, condition.getOperator(), thresholdValue);
|
currentRainfall, condition.getOperator(), thresholdValue);
|
||||||
|
|
||||||
case "WATER_STORAGE":
|
// case "WATER_STORAGE":
|
||||||
BigDecimal currentStoragePercent = getWaterStorage(condition.getYear());
|
// BigDecimal currentStoragePercent = getWaterStorage(condition.getYear());
|
||||||
return String.format("蓄水量 %s 同期%s%%",
|
// return String.format("蓄水量 %s 同期%s%%",
|
||||||
condition.getOperator(), thresholdValue);
|
// condition.getOperator(), thresholdValue);
|
||||||
|
|
||||||
case "FORECAST_RAINFALL":
|
case "FORECAST_RAINFALL":
|
||||||
return String.format("%s测点未来%dh降雨量 %s %smm",
|
return String.format("%s测点未来%dh降雨量 %s %smm",
|
||||||
|
|
@ -186,8 +188,10 @@ public class WarningRuleTask {
|
||||||
* 计算条件的实际值
|
* 计算条件的实际值
|
||||||
*/
|
*/
|
||||||
private BigDecimal calculateActualValue(WarningCondition condition, String warningType) {
|
private BigDecimal calculateActualValue(WarningCondition condition, String warningType) {
|
||||||
String indicatorType = condition.getIndicatorType();
|
// String indicatorType = condition.getIndicatorType();
|
||||||
String stcd = condition.getStcd();
|
// String stcd = condition.getStcd();
|
||||||
|
String indicatorType = null;
|
||||||
|
String stcd = null;
|
||||||
Integer durationHours = condition.getDurationHours();
|
Integer durationHours = condition.getDurationHours();
|
||||||
|
|
||||||
switch (indicatorType) {
|
switch (indicatorType) {
|
||||||
|
|
@ -198,7 +202,7 @@ public class WarningRuleTask {
|
||||||
case "RAINFALL":
|
case "RAINFALL":
|
||||||
return getRealRainFall(stcd, durationHours);
|
return getRealRainFall(stcd, durationHours);
|
||||||
case "WATER_STORAGE":
|
case "WATER_STORAGE":
|
||||||
return getWaterStorage(condition.getYear());
|
// return getWaterStorage(condition.getYear());
|
||||||
case "FORECAST_RAINFALL":
|
case "FORECAST_RAINFALL":
|
||||||
return getForecastRainFall(stcd, durationHours);
|
return getForecastRainFall(stcd, durationHours);
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,25 @@
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: local
|
||||||
datasource:
|
datasource:
|
||||||
dynamic:
|
dynamic:
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
url: jdbc:postgresql://localhost:5432/ss?stringtype=unspecified
|
url: jdbc:postgresql://10.0.41.112:5432/ss?stringtype=unspecified
|
||||||
username: postgres
|
username: gunshiiot
|
||||||
password: postgres
|
password: 1234567a
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
access-logging:
|
access-logging:
|
||||||
url: jdbc:postgresql://localhost:5432/ss
|
url: jdbc:postgresql://10.0.41.112:5432/ss
|
||||||
username: postgres
|
username: gunshiiot
|
||||||
password: postgres
|
password: 1234567a
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
host: localhost
|
host: r-wz9168ab2f2f7ec4pd.redis.rds.aliyuncs.com
|
||||||
port: 6379
|
port: 6379
|
||||||
#password: 1234567a
|
password: CoWR1111
|
||||||
database: 0
|
database: 9
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
|
@ -38,10 +38,32 @@ gunshi:
|
||||||
# 洪水预测数据库连接信息
|
# 洪水预测数据库连接信息
|
||||||
algorithem:
|
algorithem:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:postgresql://localhost:5432/ss?stringtype=unspecified
|
url: jdbc:postgresql://10.0.41.112:5432/ss?stringtype=unspecified
|
||||||
username: postgres
|
username: gunshiiot
|
||||||
password: postgres
|
password: 1234567a
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
|
|
||||||
jcskPath: http://64.97.142.113:8002/shareddata/api/v1/monitdata
|
jcskPath: http://64.97.142.113:8002/shareddata/api/v1/monitdata
|
||||||
jcskToken: FB1EE57468E0CB9A51306F9056A534776A505E95AB687866AD05EA91C61B1444D210FF3E3033E268869C0C0D788770D4DE62078895538CF5BA652F6F1C751D24
|
jcskToken: FB1EE57468E0CB9A51306F9056A534776A505E95AB687866AD05EA91C61B1444D210FF3E3033E268869C0C0D788770D4DE62078895538CF5BA652F6F1C751D24
|
||||||
|
|
||||||
|
knife4j:
|
||||||
|
enable: true
|
||||||
|
setting:
|
||||||
|
language: zh-CN
|
||||||
|
enable-swagger-models: true
|
||||||
|
swagger-model-name: OpenAPI 3.0 Models
|
||||||
|
|
||||||
|
cache:
|
||||||
|
enabled: true # 启用缓存
|
||||||
|
max-size: 1000 # 缓存最大数量
|
||||||
|
expire-after-write: 10m # 写入后过期时间
|
||||||
|
|
||||||
|
basic:
|
||||||
|
enable: false # 不需要basic认证可以关闭
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
|
||||||
|
response:
|
||||||
|
cache:
|
||||||
|
enabled: true
|
||||||
|
max-age: 3600
|
||||||
Loading…
Reference in New Issue