Merge branch 'main' into dev-lilin
# Conflicts: # backend/src/main/java/com/yfd/platform/config/SecurityConfig.java
This commit is contained in:
commit
f3a54bc4eb
@ -45,7 +45,8 @@ public interface MicroservicDynamicSQLMapper<T> {
|
||||
default <R> List<R> getAllListWithResultType(String sql,
|
||||
Map<String, Object> map,
|
||||
Class<R> resultType) {
|
||||
return convertList(getAllList(sql, map), resultType);
|
||||
List<Map<String, Object>> allList = getAllList(sql, map);
|
||||
return convertList(allList, resultType);
|
||||
}
|
||||
|
||||
@Select({"select count(1) count from ${sql} and ${ew.sqlSegment}"})
|
||||
|
||||
@ -61,17 +61,22 @@ public class SecurityConfig {
|
||||
.requestMatchers("/tempFile/**").permitAll()
|
||||
.requestMatchers("/system/user/auditUser").permitAll()
|
||||
.requestMatchers("/register/accessToken").permitAll()
|
||||
// .requestMatchers("/eng/**").permitAll()
|
||||
// .requestMatchers("/eq/**").permitAll()
|
||||
// .requestMatchers("/env/**").permitAll()
|
||||
// .requestMatchers("/wt/**").permitAll()
|
||||
// .requestMatchers("/fb/**").permitAll()
|
||||
// .requestMatchers("/zq/**").permitAll()
|
||||
// .requestMatchers("/wq/**").permitAll()
|
||||
// .requestMatchers("/vd/**").permitAll()
|
||||
// .requestMatchers("/fp/**").permitAll()
|
||||
// .requestMatchers("/fh/**").permitAll()
|
||||
// .requestMatchers("/data/**").permitAll()
|
||||
.requestMatchers("/eng/**").permitAll()
|
||||
.requestMatchers("/eq/**").permitAll()
|
||||
.requestMatchers("/env/**").permitAll()
|
||||
.requestMatchers("/warn/**").permitAll()
|
||||
.requestMatchers("/overview/**").permitAll()
|
||||
.requestMatchers("/wt/**").permitAll()
|
||||
.requestMatchers("/fb/**").permitAll()
|
||||
.requestMatchers("/zq/**").permitAll()
|
||||
.requestMatchers("/wq/**").permitAll()
|
||||
.requestMatchers("/wte/**").permitAll()
|
||||
.requestMatchers("/vd/**").permitAll()
|
||||
.requestMatchers("/vap/**").permitAll()
|
||||
.requestMatchers("/fp/**").permitAll()
|
||||
.requestMatchers("/fpr/**").permitAll()
|
||||
.requestMatchers("/fh/**").permitAll()
|
||||
.requestMatchers("/data/**").permitAll()
|
||||
.requestMatchers("/mapLayer/**").permitAll()
|
||||
.requestMatchers("/mapmodule/**").permitAll()
|
||||
.requestMatchers("/mapLegend/**").permitAll()
|
||||
|
||||
@ -64,14 +64,14 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvWTApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.1 全过程-生态环保数据服务-水温监测")
|
||||
.group("3.1 全过程-生态环保数据服务-水温监测(wt)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.wt.controller")
|
||||
.build();
|
||||
}
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvWQApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.2 全过程-生态环保数据服务-水质监测")
|
||||
.group("3.2 全过程-生态环保数据服务-水质监测(wq)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.wq.controller")
|
||||
.build();
|
||||
}
|
||||
@ -79,7 +79,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvFPApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.3 全过程-生态环保数据服务-过鱼设施")
|
||||
.group("3.3 全过程-生态环保数据服务-过鱼设施(fp)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.fp.controller")
|
||||
.build();
|
||||
}
|
||||
@ -87,7 +87,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvVDApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.3.1 全过程-生态环保数据服务-过鱼设施-过鱼监测(VD视频模块)")
|
||||
.group("3.3.1 全过程-生态环保数据服务-过鱼设施-过鱼监测(vd视频模块)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.vd.controller")
|
||||
.build();
|
||||
}
|
||||
@ -97,7 +97,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvFHApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.4 全过程-生态环保数据服务-栖息地")
|
||||
.group("3.4 全过程-生态环保数据服务-栖息地(fh)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.fh.controller")
|
||||
.build();
|
||||
}
|
||||
@ -105,7 +105,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvZQApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.4.1 全过程-生态环保数据服务-栖息地-水文模块")
|
||||
.group("3.4.1 全过程-生态环保数据服务-栖息地-水文模块(zq)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.zq.controller")
|
||||
.build();
|
||||
}
|
||||
@ -114,7 +114,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvVapApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.5 全过程-生态环保数据服务-珍稀动植物")
|
||||
.group("3.5 全过程-生态环保数据服务-珍稀动植物(vap)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.vap.controller")
|
||||
.build();
|
||||
}
|
||||
@ -122,7 +122,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvFprApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.6 全过程-生态环保数据服务-鱼类调查")
|
||||
.group("3.6 全过程-生态环保数据服务-鱼类调查(fpr)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.fpr.controller")
|
||||
.build();
|
||||
}
|
||||
@ -130,11 +130,38 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvFbApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.7 全过程-生态环保数据服务-增殖放流")
|
||||
.group("3.7 全过程-生态环保数据服务-增殖放流(fb)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.fb.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvWarnApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.8 全过程-生态环保数据服务-智能告警(warn)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.warn.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvWteApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.9 全过程-生态环保数据服务-生态调查(wte)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.wte.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvOverviewApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.10 全过程-生态环保数据服务-首页(overview)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.overview.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -150,7 +177,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEngEqApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("4.1. 全过程-常规水电数据服务-生态流量")
|
||||
.group("4.1. 全过程-常规水电数据服务-生态流量(eq)")
|
||||
.packagesToScan("com.yfd.platform.qgc_eng.eq.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ public class Constant {
|
||||
public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
public static final String CODE_KEY = "code-key-";
|
||||
public static final long CODE_EXPIRATION_TIME = 1000 * 60;
|
||||
public static final long CODE_EXPIRATION_TIME = 1000 * 60 * 2;
|
||||
/**
|
||||
* 用于IP定位转换
|
||||
*/
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
package com.yfd.platform.qgc_base.controller;
|
||||
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.domain.SdAddvcdDicDropdownRequest;
|
||||
import com.yfd.platform.qgc_base.service.ISdAddvcdDicService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/env/addvcd")
|
||||
@Tag(name = "行政区管理")
|
||||
public class SdAddvcdDicController {
|
||||
|
||||
@Resource
|
||||
private ISdAddvcdDicService addvcdDicService;
|
||||
|
||||
@PostMapping("/selectForDropdown")
|
||||
@Operation(summary = "根据级别和父级行政区编码查询行政区下拉")
|
||||
public ResponseResult selectForDropdown(@RequestBody SdAddvcdDicDropdownRequest request) {
|
||||
return ResponseResult.successData(addvcdDicService.selectForDropdown(request.getGrd(), request.getPaddvcd()));
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,12 @@
|
||||
package com.yfd.platform.qgc_base.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.yfd.platform.annotation.Log;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBH;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBHOperateRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBHRequest;
|
||||
import com.yfd.platform.qgc_base.service.ISdEngInfoBHService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -23,6 +25,9 @@ import jakarta.annotation.Resource;
|
||||
@Tag(name = "电站管理")
|
||||
public class SdEngInfoBHController {
|
||||
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Resource
|
||||
private ISdEngInfoBHService engInfoBHService;
|
||||
|
||||
@ -88,27 +93,38 @@ public class SdEngInfoBHController {
|
||||
return ResponseResult.successData(engInfoBHService.getVmsstbprptKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/stbprpData/GetKendoListCust")
|
||||
@Operation(summary = "电站通用实时监测数据查询")
|
||||
public ResponseResult getStbprpDataKendoListCust(@RequestBody DataSourceRequest dataSourceRequest,
|
||||
@RequestParam("tbCode") String tbCode,
|
||||
@RequestParam(value = "ignorePageLimit", required = false) Boolean ignorePageLimit) {
|
||||
return ResponseResult.successData(engInfoBHService.getStbprpDataKendoListCust(dataSourceRequest, tbCode, ignorePageLimit));
|
||||
}
|
||||
|
||||
@Log(module = "电站管理", value = "新增电站")
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增电站")
|
||||
public ResponseResult add(@RequestBody SdEngInfoBH engInfo) {
|
||||
boolean result = engInfoBHService.addEngInfo(engInfo);
|
||||
public ResponseResult add(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdEngInfoBH engInfo = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdEngInfoBH.class);
|
||||
boolean result = engInfoBHService.addEngInfo(engInfo, request.getSource());
|
||||
return result ? ResponseResult.success("新增成功") : ResponseResult.error("新增失败");
|
||||
}
|
||||
|
||||
@Log(module = "电站管理", value = "修改电站")
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改电站")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBH engInfo) {
|
||||
boolean result = engInfoBHService.updateEngInfo(engInfo);
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = engInfoBHService.updateEngInfo(request.getEngInfo(), request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
@Log(module = "电站管理", value = "删除电站")
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "删除电站")
|
||||
public ResponseResult delete(@RequestParam String stcd) {
|
||||
boolean result = engInfoBHService.deleteEngInfo(stcd);
|
||||
public ResponseResult delete(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
boolean result = engInfoBHService.deleteEngInfo(request == null ? null : request.getIds(),
|
||||
request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -27,9 +27,21 @@ public class SdEngMonitorController {
|
||||
return ResponseResult.successData(engInfoBHService.getStInfoByStcd(stcd));
|
||||
}
|
||||
|
||||
@GetMapping("/msstbprpt/getStcdInfo")
|
||||
@Operation(summary = "根据站码查询电站详情兼容结构")
|
||||
public ResponseResult getStcdInfo(@RequestParam String stcd) {
|
||||
return ResponseResult.successData(engInfoBHService.getStcdInfo(stcd));
|
||||
}
|
||||
|
||||
@PostMapping("/eiaapproval/GetKendoList")
|
||||
@Operation(summary = "查询生态环保批复文件列表")
|
||||
public ResponseResult getEiaapprovalKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(engInfoBHService.getEiaapprovalKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/operat/GetKendoListCust")
|
||||
@Operation(summary = "首页-环保设施运行状况")
|
||||
public ResponseResult getOperatKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(engInfoBHService.getOperatKendoList(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,6 +111,15 @@ public class SdRvcdDicController {
|
||||
return ResponseResult.successData(rvcdDicService.selectForDropdown(rvnm, rvcd));
|
||||
}
|
||||
|
||||
@GetMapping("/selectRvcdDropdown")
|
||||
@Operation(summary = "流域下拉框列表查询")
|
||||
public ResponseResult selectRvcdDropdown(
|
||||
@RequestParam(required = false) String rvnm,
|
||||
@RequestParam(required = false) String baseId
|
||||
) {
|
||||
return ResponseResult.successData(rvcdDicService.selectRvcdDropdown(rvnm,baseId));
|
||||
}
|
||||
|
||||
@GetMapping("/regDropdown")
|
||||
@Operation(summary = "下拉框列表查询(注册)")
|
||||
public ResponseResult regDropdown(
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
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 lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("MS_OPERATION_LOG")
|
||||
public class MsOperationLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
@TableField("OPERATOR")
|
||||
private String operator;
|
||||
|
||||
@TableField("OPERATE_TIME")
|
||||
private Date operateTime;
|
||||
|
||||
@TableField("SOURCE")
|
||||
private String source;
|
||||
|
||||
@TableField("REMARK")
|
||||
private String remark;
|
||||
|
||||
@TableField("TABLE_NAME")
|
||||
private String tableName;
|
||||
|
||||
@TableField("RECORD_ID")
|
||||
private String recordId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
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 lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@TableName("MS_OPERATION_LOG_DETAIL")
|
||||
public class MsOperationLogDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
@TableField("MAIN_ID")
|
||||
private String mainId;
|
||||
|
||||
@TableField("FIELD_CODE")
|
||||
private String fieldCode;
|
||||
|
||||
@TableField("TABLE_NAME")
|
||||
private String tableName;
|
||||
|
||||
@TableField("FIELD_MEANING")
|
||||
private String fieldMeaning;
|
||||
|
||||
@TableField("STATION_CODE")
|
||||
private String stationCode;
|
||||
|
||||
@TableField("OLD_VALUE_CODE")
|
||||
private String oldValueCode;
|
||||
|
||||
@TableField("OLD_VALUE_NAME")
|
||||
private String oldValueName;
|
||||
|
||||
@TableField("NEW_VALUE_CODE")
|
||||
private String newValueCode;
|
||||
|
||||
@TableField("NEW_VALUE_NAME")
|
||||
private String newValueName;
|
||||
|
||||
@TableField("REMARK")
|
||||
private String remark;
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 行政区字典表
|
||||
* </p>
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("SD_ADDVCD_DIC")
|
||||
public class SdAddvcdDic implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 行政区编码
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String addvcd;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
private String addvnm;
|
||||
|
||||
/**
|
||||
* 所属行政编码,根节点为空
|
||||
*/
|
||||
private String paddvcd;
|
||||
|
||||
/**
|
||||
* 树级别,从1开始 1=省 2=市 3=县
|
||||
*/
|
||||
private Integer grd;
|
||||
|
||||
/**
|
||||
* 树全路径
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer orderIndex;
|
||||
|
||||
/**
|
||||
* 中心经度
|
||||
*/
|
||||
private Double lgtd;
|
||||
|
||||
/**
|
||||
* 中心纬度
|
||||
*/
|
||||
private Double lttd;
|
||||
|
||||
/**
|
||||
* 面积
|
||||
*/
|
||||
private Double area;
|
||||
|
||||
/**
|
||||
* 周长
|
||||
*/
|
||||
private Double perimeter;
|
||||
|
||||
/**
|
||||
* 所属国家
|
||||
*/
|
||||
private String country;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
private String introduce;
|
||||
|
||||
/**
|
||||
* 介绍图片
|
||||
*/
|
||||
private String inffile;
|
||||
|
||||
/**
|
||||
* 简称
|
||||
*/
|
||||
private String shortname;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SdAddvcdDicDropdownRequest {
|
||||
|
||||
/**
|
||||
* 树级别,从1开始 1=省 2=市 3=县
|
||||
*/
|
||||
private Integer grd;
|
||||
|
||||
/**
|
||||
* 所属行政编码,根节点为空
|
||||
*/
|
||||
private String paddvcd;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class SdEngInfoBHOperateRequest {
|
||||
|
||||
private Map<String, Object> engInfo;
|
||||
|
||||
private List<String> ids;
|
||||
|
||||
private String source;
|
||||
}
|
||||
@ -13,8 +13,10 @@ public class SdEngInfoBHRequest {
|
||||
private String baseId;
|
||||
private String hbrvcd;
|
||||
private String rvcd;
|
||||
private String reachcd;
|
||||
private List<String> basIds;
|
||||
private List<String> hbrvcds;
|
||||
private List<String> rvcds;
|
||||
// private List<String> rvcds;
|
||||
private String ennm;
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ public class SdFpssBH implements Serializable {
|
||||
/**
|
||||
* 鱼道或仿自然通道-流速,单位:m/s
|
||||
*/
|
||||
private String v;
|
||||
private String flow;
|
||||
|
||||
/**
|
||||
* 仿自然通道断面形状
|
||||
@ -308,7 +308,7 @@ public class SdFpssBH implements Serializable {
|
||||
/**
|
||||
* 设计过鱼规模,单位:尾
|
||||
*/
|
||||
private Long sjgycnt;
|
||||
private String sjgycnt;
|
||||
|
||||
/**
|
||||
* 主要过鱼对象{[code:鱼编码1,name:鱼名称1,数量],[code:鱼编码2,name:鱼名称2]...}
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package com.yfd.platform.qgc_base.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Schema(description = "环保设施运行状况")
|
||||
public class EngOperatVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String repCode;
|
||||
private String sttpCode;
|
||||
private String pcode;
|
||||
private String pname;
|
||||
private String stcd;
|
||||
private String ennm;
|
||||
private String stnm;
|
||||
private String addvcdName;
|
||||
private String rvcdName;
|
||||
private String sttpName;
|
||||
private String baseId;
|
||||
private Integer dtin;
|
||||
private Integer runState;
|
||||
private Integer stdState;
|
||||
private Integer runSstate;
|
||||
private Integer bldsttCcode;
|
||||
private Integer yr;
|
||||
private Integer count;
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.yfd.platform.qgc_base.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "电站单站基础信息")
|
||||
public class EngStBaseInfoVo {
|
||||
|
||||
@Schema(description = "站点编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "站点名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "站类编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "站类名称")
|
||||
private String sttpName;
|
||||
|
||||
@Schema(description = "站类全路径")
|
||||
private String sttpFullPath;
|
||||
|
||||
@Schema(description = "站类层级")
|
||||
private Integer sttpTreeLevel;
|
||||
|
||||
@Schema(description = "关联站点编码")
|
||||
private String stCode;
|
||||
|
||||
@Schema(description = "关联站点名称")
|
||||
private String stName;
|
||||
|
||||
@Schema(description = "所属基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "所属基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "所属基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "所属基地流域名称")
|
||||
private String hbrvcdName;
|
||||
|
||||
@Schema(description = "所属流域编码")
|
||||
private String rvcd;
|
||||
|
||||
@Schema(description = "所属流域名称")
|
||||
private String rvcdName;
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.yfd.platform.qgc_base.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "电站详情返回")
|
||||
public class EngStInfoResultVo {
|
||||
|
||||
@Schema(description = "主信息兼容对象")
|
||||
private Map<String, Object> msStbprpT = new LinkedHashMap<>();
|
||||
|
||||
@Schema(description = "测值列表")
|
||||
private List<Object> stcdValVoList = new ArrayList<>();
|
||||
|
||||
@Schema(description = "关联列表")
|
||||
private List<Object> relList = new ArrayList<>();
|
||||
|
||||
@Schema(description = "站点基础信息")
|
||||
private EngStBaseInfoVo stBaseInfo;
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.yfd.platform.qgc_base.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "电站通用监测数据动态行")
|
||||
public class EngStbprpDataVo extends LinkedHashMap<String, Object> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public EngStbprpDataVo() {
|
||||
super();
|
||||
}
|
||||
|
||||
public EngStbprpDataVo(Map<String, Object> source) {
|
||||
super();
|
||||
if (source != null && !source.isEmpty()) {
|
||||
putAll(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -20,6 +20,8 @@ public class EngVmsstbprptVo implements Serializable {
|
||||
private String ennm;
|
||||
private String baseId;
|
||||
private String baseName;
|
||||
private String reachcdName;
|
||||
private String reachcd;
|
||||
private String hbrvcd;
|
||||
private String hbrvcdName;
|
||||
private String rvcd;
|
||||
@ -27,12 +29,17 @@ public class EngVmsstbprptVo implements Serializable {
|
||||
private String addvcdName;
|
||||
private String hynm;
|
||||
private String topHynm;
|
||||
private String hycd;
|
||||
private String topHycd;
|
||||
private String stlc;
|
||||
private Double lgtd;
|
||||
private Double lttd;
|
||||
private Date jcdt;
|
||||
private Date piodt;
|
||||
private Date aiodt;
|
||||
private String bldstt;
|
||||
private Integer bldsttCcode;
|
||||
private String bldsttCcodeName;
|
||||
private Double nrupar;
|
||||
private Double dstcrvr;
|
||||
private Double avyrp;
|
||||
@ -79,6 +86,7 @@ public class EngVmsstbprptVo implements Serializable {
|
||||
private Double ddcp;
|
||||
private Double cpsc;
|
||||
private String rgcp;
|
||||
private String rgcpName;
|
||||
private Double dsflzmxq;
|
||||
private Double dsflzxyz;
|
||||
private Double ckflzmxq;
|
||||
@ -102,7 +110,9 @@ public class EngVmsstbprptVo implements Serializable {
|
||||
private Double unyge;
|
||||
private Double gap;
|
||||
private String dvtp;
|
||||
private String dvtpName;
|
||||
private Integer dtin;
|
||||
private String dtinName;
|
||||
private Integer baseStepSort;
|
||||
private Integer rvcdStepSort;
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@ -12,6 +12,9 @@ public class BatchDeleteAo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "数据类型")
|
||||
private String dataType;
|
||||
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
package com.yfd.platform.qgc_base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.qgc_base.domain.MsOperationLogDetail;
|
||||
|
||||
public interface MsOperationLogDetailMapper extends BaseMapper<MsOperationLogDetail> {
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.yfd.platform.qgc_base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.qgc_base.domain.MsOperationLog;
|
||||
|
||||
public interface MsOperationLogMapper extends BaseMapper<MsOperationLog> {
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.yfd.platform.qgc_base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.qgc_base.domain.SdAddvcdDic;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 行政区字典表 Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface SdAddvcdDicMapper extends BaseMapper<SdAddvcdDic> {
|
||||
}
|
||||
@ -32,4 +32,6 @@ public interface SdRvcdDicMapper extends BaseMapper<SdRvcdDic> {
|
||||
* 注册场景下拉框查询,仅返回能被电站表 RVCD 命中的流域
|
||||
*/
|
||||
List<SdRvcdDic> selectRegDropdownWithEng(@Param("rvnm") String rvnm, @Param("rvcd") String rvcd);
|
||||
|
||||
List<SdRvcdDic> selectRvcdDropdown(@Param("rvnm") String rvnm,@Param("baseId") String baseId);
|
||||
}
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
package com.yfd.platform.qgc_base.service;
|
||||
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBH;
|
||||
|
||||
public interface IMsOperationLogService {
|
||||
|
||||
void recordEngAddLog(SdEngInfoBH engInfo, String source);
|
||||
|
||||
void recordEngUpdateLog(SdEngInfoBH before, SdEngInfoBH changeSet, String source);
|
||||
|
||||
void recordEngDeleteLog(SdEngInfoBH engInfo, String source);
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.yfd.platform.qgc_base.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.qgc_base.domain.SdAddvcdDic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 行政区字典表 服务类
|
||||
* </p>
|
||||
*/
|
||||
public interface ISdAddvcdDicService extends IService<SdAddvcdDic> {
|
||||
|
||||
/**
|
||||
* 根据级别和父级行政区编码查询下拉数据
|
||||
*/
|
||||
List<SdAddvcdDic> selectForDropdown(Integer grd, String paddvcd);
|
||||
}
|
||||
@ -8,9 +8,12 @@ import com.yfd.platform.qgc_base.domain.SdEngInfoBH;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBHRequest;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngBaseInfoVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngEiaapprovalVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngOperatVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngStInfoResultVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngVmsstbprptVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@ -52,21 +55,35 @@ public interface ISdEngInfoBHService extends IService<SdEngInfoBH> {
|
||||
*/
|
||||
boolean addEngInfo(SdEngInfoBH engInfo);
|
||||
|
||||
boolean addEngInfo(SdEngInfoBH engInfo, String source);
|
||||
|
||||
/**
|
||||
* 修改电站
|
||||
*/
|
||||
boolean updateEngInfo(SdEngInfoBH engInfo);
|
||||
|
||||
boolean updateEngInfo(SdEngInfoBH engInfo, String source);
|
||||
|
||||
boolean updateEngInfo(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除电站
|
||||
*/
|
||||
boolean deleteEngInfo(String stcd);
|
||||
|
||||
boolean deleteEngInfo(List<String> ids, String source);
|
||||
|
||||
List<SdEngInfoBH> selectRegDropdown(SdEngInfoBHRequest sdEngInfoBHRequest);
|
||||
|
||||
EngBaseInfoVo getStInfoByStcd(String stcd);
|
||||
|
||||
EngStInfoResultVo getStcdInfo(String stcd);
|
||||
|
||||
DataSourceResult<EngEiaapprovalVo> getEiaapprovalKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngVmsstbprptVo> getVmsstbprptKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngOperatVo> getOperatKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getStbprpDataKendoListCust(DataSourceRequest dataSourceRequest, String tbCode, Boolean ignorePageLimit);
|
||||
}
|
||||
|
||||
@ -55,5 +55,7 @@ public interface ISdRvcdDicService extends IService<SdRvcdDic> {
|
||||
|
||||
List<SdRvcdDic> selectForDropdown(String rvnm, String rvcd);
|
||||
|
||||
List<SdRvcdDic> selectRvcdDropdown(String rvnm,String baseId);
|
||||
|
||||
List<SdRvcdDic> regDropdown(String rvnm, String rvcd);
|
||||
}
|
||||
|
||||
@ -0,0 +1,544 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.yfd.platform.qgc_base.domain.MsOperationLog;
|
||||
import com.yfd.platform.qgc_base.domain.MsOperationLogDetail;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBH;
|
||||
import com.yfd.platform.qgc_base.mapper.MsOperationLogDetailMapper;
|
||||
import com.yfd.platform.qgc_base.mapper.MsOperationLogMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@Service
|
||||
public class MsOperationLogServiceImpl implements IMsOperationLogService {
|
||||
|
||||
private static final String ENG_TABLE_NAME = "SD_ENGINFO_B_H";
|
||||
|
||||
private static final Map<String, String> ENG_FIELD_MEANING_MAP = new LinkedHashMap<>();
|
||||
|
||||
static {
|
||||
ENG_FIELD_MEANING_MAP.put("STCD", "电站编码");
|
||||
ENG_FIELD_MEANING_MAP.put("TM", "数据时间");
|
||||
ENG_FIELD_MEANING_MAP.put("ENNM", "电站名称");
|
||||
ENG_FIELD_MEANING_MAP.put("BASE_ID", "所属基地编码");
|
||||
// ENG_FIELD_MEANING_MAP.put("BASE_NAME", "所属基地名称");
|
||||
ENG_FIELD_MEANING_MAP.put("HBRVCD", "所属基地流域编码");
|
||||
// ENG_FIELD_MEANING_MAP.put("HBRVCD_NAME", "所属基地流域名称");
|
||||
ENG_FIELD_MEANING_MAP.put("RVCD", "所属流域编码");
|
||||
// ENG_FIELD_MEANING_MAP.put("RVCD_NAME", "所属流域名称");
|
||||
ENG_FIELD_MEANING_MAP.put("ADDVCD", "所属行政区编码");
|
||||
// ENG_FIELD_MEANING_MAP.put("ADDVCD_NAME", "所属行政区名称");
|
||||
ENG_FIELD_MEANING_MAP.put("COUNTRY", "所属国家编码");
|
||||
// ENG_FIELD_MEANING_MAP.put("COUNTRY_NAME", "所属国家名称");
|
||||
ENG_FIELD_MEANING_MAP.put("REACHCD", "所属河段编码");
|
||||
// ENG_FIELD_MEANING_MAP.put("REACHCD_NAME", "所属河段名称");
|
||||
ENG_FIELD_MEANING_MAP.put("HYCD", "所属公司编码");
|
||||
// ENG_FIELD_MEANING_MAP.put("HYNM", "所属公司名称");
|
||||
ENG_FIELD_MEANING_MAP.put("TOP_HYCD", "所属集团编码");
|
||||
// ENG_FIELD_MEANING_MAP.put("TOP_HYNM", "所属集团名称");
|
||||
ENG_FIELD_MEANING_MAP.put("BLPRD", "所属建设阶段");
|
||||
ENG_FIELD_MEANING_MAP.put("BLDSTT", "建设状态");
|
||||
ENG_FIELD_MEANING_MAP.put("BLDSTT_CODE", "建设状态分类");
|
||||
ENG_FIELD_MEANING_MAP.put("ENGTP", "工程类别");
|
||||
ENG_FIELD_MEANING_MAP.put("PRSC", "工程规模");
|
||||
ENG_FIELD_MEANING_MAP.put("SCRSC", "工程规模(水库库容)");
|
||||
ENG_FIELD_MEANING_MAP.put("PRGR", "工程等别");
|
||||
ENG_FIELD_MEANING_MAP.put("FN", "主要功能");
|
||||
ENG_FIELD_MEANING_MAP.put("BSSSIN", "地震基本烈度");
|
||||
ENG_FIELD_MEANING_MAP.put("FRSSIN", "设防地震烈度");
|
||||
ENG_FIELD_MEANING_MAP.put("ADJUST_ENG", "是否调节水库");
|
||||
ENG_FIELD_MEANING_MAP.put("ISHVBRRG", "有无拦河坝");
|
||||
ENG_FIELD_MEANING_MAP.put("DVTP", "开发方式");
|
||||
ENG_FIELD_MEANING_MAP.put("CNTP", "建设类型");
|
||||
ENG_FIELD_MEANING_MAP.put("DTIN", "数据是否接入");
|
||||
ENG_FIELD_MEANING_MAP.put("DTIN_TM", "数据接入时间");
|
||||
ENG_FIELD_MEANING_MAP.put("USFL", "是否启用");
|
||||
ENG_FIELD_MEANING_MAP.put("MONTH_REPORT", "是否发布月报");
|
||||
ENG_FIELD_MEANING_MAP.put("TB_WAY", "填报方式");
|
||||
ENG_FIELD_MEANING_MAP.put("TB_FREQUENCY", "填报频率");
|
||||
ENG_FIELD_MEANING_MAP.put("RGCP", "调节性能");
|
||||
ENG_FIELD_MEANING_MAP.put("LGTD", "经度");
|
||||
ENG_FIELD_MEANING_MAP.put("LTTD", "纬度");
|
||||
ENG_FIELD_MEANING_MAP.put("ELEV", "高程");
|
||||
ENG_FIELD_MEANING_MAP.put("STLC", "站址");
|
||||
ENG_FIELD_MEANING_MAP.put("ORDER_INDEX", "排序");
|
||||
ENG_FIELD_MEANING_MAP.put("STDSDT", "规划设计日期");
|
||||
ENG_FIELD_MEANING_MAP.put("PSTSTDT", "计划开工日期");
|
||||
ENG_FIELD_MEANING_MAP.put("PESSTDT", "计划完工日期");
|
||||
ENG_FIELD_MEANING_MAP.put("SWDT", "开工日期");
|
||||
ENG_FIELD_MEANING_MAP.put("JCDT", "建成日期");
|
||||
ENG_FIELD_MEANING_MAP.put("WDDT", "退役/拆除日期");
|
||||
ENG_FIELD_MEANING_MAP.put("JLDT", "截流日期");
|
||||
ENG_FIELD_MEANING_MAP.put("INTRODUCE", "电站简介");
|
||||
ENG_FIELD_MEANING_MAP.put("LOGO", "电站LOGO");
|
||||
ENG_FIELD_MEANING_MAP.put("INFFILE", "介绍弹窗图片");
|
||||
ENG_FIELD_MEANING_MAP.put("DMAT", "坝体材质");
|
||||
ENG_FIELD_MEANING_MAP.put("DMTP", "坝体类型");
|
||||
ENG_FIELD_MEANING_MAP.put("MNUN", "管理单位");
|
||||
ENG_FIELD_MEANING_MAP.put("CMUN", "主管单位");
|
||||
ENG_FIELD_MEANING_MAP.put("BLSYS", "归属部门");
|
||||
ENG_FIELD_MEANING_MAP.put("ROLL", "绕经度方向旋转矩阵值");
|
||||
ENG_FIELD_MEANING_MAP.put("PITCH", "绕纬度方向旋转矩阵值");
|
||||
ENG_FIELD_MEANING_MAP.put("HEADING", "绕高程方向旋转矩阵值");
|
||||
ENG_FIELD_MEANING_MAP.put("SCALE", "模型缩放比例");
|
||||
ENG_FIELD_MEANING_MAP.put("IMPDSTRZ", "是否受下游顶托");
|
||||
ENG_FIELD_MEANING_MAP.put("PROV", "工程概况");
|
||||
ENG_FIELD_MEANING_MAP.put("ESTRYDIS", "河口距离");
|
||||
ENG_FIELD_MEANING_MAP.put("THRSMDAYS", "三同时评价允许误差天数");
|
||||
ENG_FIELD_MEANING_MAP.put("ZJXYDZ", "直接下游电站");
|
||||
ENG_FIELD_MEANING_MAP.put("EDTUN", "编制单位");
|
||||
ENG_FIELD_MEANING_MAP.put("EDTTM", "编制时间");
|
||||
ENG_FIELD_MEANING_MAP.put("DSNSTT", "勘测设计情况");
|
||||
ENG_FIELD_MEANING_MAP.put("YSDLEN", "引水道长");
|
||||
ENG_FIELD_MEANING_MAP.put("DMRKTP", "坝基岩性");
|
||||
ENG_FIELD_MEANING_MAP.put("HNTJZL", "混凝土浇筑量");
|
||||
ENG_FIELD_MEANING_MAP.put("GNTP", "容量构成");
|
||||
ENG_FIELD_MEANING_MAP.put("CNTRAR", "控制流域面积");
|
||||
ENG_FIELD_MEANING_MAP.put("CNTRSC", "控制面积占全流域比例");
|
||||
ENG_FIELD_MEANING_MAP.put("AVYRP", "多年平均降水量");
|
||||
ENG_FIELD_MEANING_MAP.put("AVQ", "多年平均流量");
|
||||
ENG_FIELD_MEANING_MAP.put("DSAVQ", "电站未建枯水期平均流量");
|
||||
ENG_FIELD_MEANING_MAP.put("DSMXQ", "设计洪峰流量");
|
||||
ENG_FIELD_MEANING_MAP.put("CHMXQ", "校核洪峰流量");
|
||||
ENG_FIELD_MEANING_MAP.put("RVLEN", "河道长度");
|
||||
ENG_FIELD_MEANING_MAP.put("RVGR", "河道比降");
|
||||
ENG_FIELD_MEANING_MAP.put("AVW", "多年平均径流量");
|
||||
ENG_FIELD_MEANING_MAP.put("AVYRQ", "多年平均年径流量");
|
||||
ENG_FIELD_MEANING_MAP.put("AVSD", "多年平均输沙量");
|
||||
ENG_FIELD_MEANING_MAP.put("AVS", "多年平均含沙量");
|
||||
ENG_FIELD_MEANING_MAP.put("MYAVMNAT", "多年平均最低气温");
|
||||
ENG_FIELD_MEANING_MAP.put("DSW1", "设计一日洪量");
|
||||
ENG_FIELD_MEANING_MAP.put("DSW3", "设计三日洪量");
|
||||
ENG_FIELD_MEANING_MAP.put("CHFLDR", "校核洪水历时");
|
||||
ENG_FIELD_MEANING_MAP.put("CHFLW", "校核洪水总量");
|
||||
ENG_FIELD_MEANING_MAP.put("CPSC", "库容系数");
|
||||
ENG_FIELD_MEANING_MAP.put("NRZAR", "正常蓄水位时水库面积");
|
||||
ENG_FIELD_MEANING_MAP.put("BCKLEN", "水库回水长度");
|
||||
ENG_FIELD_MEANING_MAP.put("NRAVWT", "天然河流平均水温");
|
||||
ENG_FIELD_MEANING_MAP.put("NRMXAVWT", "天然河流最高温月份多年平均水温");
|
||||
ENG_FIELD_MEANING_MAP.put("NRMNAVWT", "天然河流最低温月份多年平均水温");
|
||||
ENG_FIELD_MEANING_MAP.put("DNAVWT", "建成后坝下平均水温");
|
||||
ENG_FIELD_MEANING_MAP.put("DNMXAVWT", "建成后坝下最高温月份多年平均水温");
|
||||
ENG_FIELD_MEANING_MAP.put("DNMNAVWT", "建成后坝下最低温月份多年平均水温");
|
||||
ENG_FIELD_MEANING_MAP.put("NRUPAR", "坝址以上流域面积");
|
||||
ENG_FIELD_MEANING_MAP.put("NRAVZ", "坝址天然河流平均水位");
|
||||
ENG_FIELD_MEANING_MAP.put("NRAVH", "坝址天然河流平均水深");
|
||||
ENG_FIELD_MEANING_MAP.put("DSNFQFRQ", "设计入库洪水流量");
|
||||
ENG_FIELD_MEANING_MAP.put("CKFQFQR", "校核入库洪水流量");
|
||||
ENG_FIELD_MEANING_MAP.put("OBMXW3", "实测最大洪量(三天)");
|
||||
ENG_FIELD_MEANING_MAP.put("FDCZ", "水库淹没城镇");
|
||||
ENG_FIELD_MEANING_MAP.put("FDQT", "淹没其它设施");
|
||||
ENG_FIELD_MEANING_MAP.put("DSTCRVR", "距河源距离");
|
||||
ENG_FIELD_MEANING_MAP.put("CKW3", "校核洪量(三天)");
|
||||
ENG_FIELD_MEANING_MAP.put("FSLTDZ", "防洪限制水位");
|
||||
ENG_FIELD_MEANING_MAP.put("RSTP", "资源类别");
|
||||
ENG_FIELD_MEANING_MAP.put("ADJCPS", "调节库容单独");
|
||||
ENG_FIELD_MEANING_MAP.put("ADJCPM", "调节库容联合");
|
||||
ENG_FIELD_MEANING_MAP.put("YRGEB", "已正建规模装机容量");
|
||||
ENG_FIELD_MEANING_MAP.put("TTPWRB", "已正建规模年发电量");
|
||||
ENG_FIELD_MEANING_MAP.put("DMCREL", "坝顶高程");
|
||||
ENG_FIELD_MEANING_MAP.put("WSC", "水量利用系数");
|
||||
ENG_FIELD_MEANING_MAP.put("MXDMHG", "最大坝高");
|
||||
ENG_FIELD_MEANING_MAP.put("MXDMHGL", "最大坝高(左)");
|
||||
ENG_FIELD_MEANING_MAP.put("MXDMHGR", "最大坝高(右)");
|
||||
ENG_FIELD_MEANING_MAP.put("WVTPEL", "防浪墙顶高程");
|
||||
}
|
||||
|
||||
private static final Map<String, String> ENG_CODE_NAME_FIELD_MAP = new LinkedHashMap<>();
|
||||
|
||||
private static final Set<String> ENG_NAME_COLUMNS = new HashSet<>();
|
||||
|
||||
private static final Map<String, Map<String, String>> ENG_DICT_VALUE_NAME_MAP = new LinkedHashMap<>();
|
||||
|
||||
static {
|
||||
ENG_CODE_NAME_FIELD_MAP.put("BASE_ID", "BASE_NAME");
|
||||
ENG_CODE_NAME_FIELD_MAP.put("HBRVCD", "HBRVCD_NAME");
|
||||
ENG_CODE_NAME_FIELD_MAP.put("RVCD", "RVCD_NAME");
|
||||
ENG_CODE_NAME_FIELD_MAP.put("ADDVCD", "ADDVCD_NAME");
|
||||
ENG_CODE_NAME_FIELD_MAP.put("COUNTRY", "COUNTRY_NAME");
|
||||
ENG_CODE_NAME_FIELD_MAP.put("HYCD", "HYNM");
|
||||
ENG_CODE_NAME_FIELD_MAP.put("TOP_HYCD", "TOP_HYNM");
|
||||
ENG_CODE_NAME_FIELD_MAP.put("REACHCD", "REACHCD_NAME");
|
||||
ENG_NAME_COLUMNS.addAll(ENG_CODE_NAME_FIELD_MAP.values());
|
||||
|
||||
ENG_DICT_VALUE_NAME_MAP.put("USFL", buildValueNameMap("0", "禁用", "1", "启用"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("DTIN", buildValueNameMap("0", "否", "1", "是"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("MONTH_REPORT", buildValueNameMap("0", "否", "1", "是"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("BLPRD", buildValueNameMap(
|
||||
"1001000", "规划",
|
||||
"1002000", "预可研",
|
||||
"1003000", "环评",
|
||||
"1004000", "可研",
|
||||
"1005000", "在建",
|
||||
"1006000", "招标设计",
|
||||
"1007000", "施工详图",
|
||||
"1009000", "建设",
|
||||
"1010000", "蓄水阶段环保验收",
|
||||
"1011000", "竣工",
|
||||
"1012000", "竣工环保验收",
|
||||
"1013000", "环境影响后评价"
|
||||
));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("BLDSTT", buildValueNameMap(
|
||||
"1", "已建成未验收",
|
||||
"2", "在建",
|
||||
"3", "可研",
|
||||
"4", "规划",
|
||||
"5", "预可研",
|
||||
"6", "已核准",
|
||||
"7", "招标设计",
|
||||
"8", "施工详图",
|
||||
"9", "其他",
|
||||
"10", "已建成已验收",
|
||||
"11", "已开展后评价",
|
||||
"31", "项目建议书",
|
||||
"32", "可研",
|
||||
"33", "已审批",
|
||||
"34", "初步设计",
|
||||
"35", "技施设计",
|
||||
"36", "在建",
|
||||
"37", "已建成未验收",
|
||||
"38", "已建成已验收",
|
||||
"39", "已开展后评价",
|
||||
"40", "其他",
|
||||
"61", "规划",
|
||||
"62", "项目建议书",
|
||||
"63", "预可研",
|
||||
"64", "可研",
|
||||
"65", "已核准",
|
||||
"66", "初步设计",
|
||||
"67", "招标设计",
|
||||
"68", "技施设计",
|
||||
"69", "施工详图",
|
||||
"70", "在建",
|
||||
"71", "已建成未验收",
|
||||
"72", "已建成已验收",
|
||||
"73", "已开展后评价",
|
||||
"74", "其他",
|
||||
"91", "拆除"
|
||||
));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("BLDSTT_CODE", buildValueNameMap(
|
||||
"0", "未建/规划",
|
||||
"1", "在建",
|
||||
"2", "已建"
|
||||
));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("ENGTP", buildValueNameMap("1", "水电站", "2", "水利工程", "3", "航电枢纽"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("PRSC", buildValueNameMap("1", "大型1", "2", "大型2", "3", "中型", "4", "小型"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("SCRSC", buildValueNameMap("1", "大型1", "2", "大型2", "3", "中型", "4", "小型1", "5", "小型2"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("PRGR", buildValueNameMap("1", "Ⅰ", "2", "Ⅱ", "3", "Ⅲ", "4", "Ⅳ", "5", "Ⅴ"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("FN", buildValueNameMap(
|
||||
"1", "发电", "2", "防洪", "3", "灌溉", "4", "供水", "5", "航运",
|
||||
"6", "旅游", "7", "环境", "8", "养殖", "9", "其他"
|
||||
));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("BSSSIN", buildValueNameMap("5", "<Ⅵ", "6", "Ⅵ", "7", "Ⅶ", "8", "Ⅷ", "9", "≥Ⅸ"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("FRSSIN", buildValueNameMap("0", "未设防", "6", "Ⅵ", "7", "Ⅶ", "8", "Ⅷ", "9", "≥Ⅸ"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("ADJUST_ENG", buildValueNameMap("0", "否", "1", "是"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("ISHVBRRG", buildValueNameMap("0", "无", "1", "有"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("RGCP", buildValueNameMap(
|
||||
"1", "多年调节", "2", "年调节", "3", "不完全年调节", "4", "径流式(无调节)",
|
||||
"5", "季调节", "6", "月调节", "7", "周调节", "8", "日调节", "9", "其他"
|
||||
));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("DMAT", buildValueNameMap("0", "混凝土坝", "1", "土坝"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("DMTP", buildValueNameMap(
|
||||
"0", "混合型", "1", "重力坝", "2", "拱坝", "3", "土石坝", "4", "支墩坝",
|
||||
"5", "混凝土闸坝", "6", "混凝土面板堆石坝", "7", "预应力坝",
|
||||
"8", "复合土工膜面板堆石坝", "9", "碾压混凝土重力坝", "10", "混凝土重力坝"
|
||||
));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("DVTP", buildValueNameMap("1", "堤坝式", "2", "引水式", "3", "混合式"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("CNTP", buildValueNameMap("1", "新建", "2", "改建", "3", "扩建", "4", "加固"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("BLSYS", buildValueNameMap("1", "水利", "2", "能源", "3", "交通", "4", "农业", "5", "建设", "9", "其他"));
|
||||
ENG_DICT_VALUE_NAME_MAP.put("IMPDSTRZ", buildValueNameMap("0", "否", "1", "是"));
|
||||
}
|
||||
|
||||
@Resource
|
||||
private MsOperationLogMapper msOperationLogMapper;
|
||||
|
||||
@Resource
|
||||
private MsOperationLogDetailMapper msOperationLogDetailMapper;
|
||||
|
||||
@Override
|
||||
public void recordEngAddLog(SdEngInfoBH engInfo, String source) {
|
||||
if (engInfo == null) {
|
||||
return;
|
||||
}
|
||||
MsOperationLog mainLog = buildMainLog(null,"新增电站", source);
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
Set<String> processedColumns = new HashSet<>();
|
||||
for (Field field : SdEngInfoBH.class.getDeclaredFields()) {
|
||||
if (shouldSkipField(field)) {
|
||||
continue;
|
||||
}
|
||||
field.setAccessible(true);
|
||||
String columnName = resolveColumnName(field);
|
||||
if (ENG_NAME_COLUMNS.contains(columnName) || processedColumns.contains(columnName)) {
|
||||
continue;
|
||||
}
|
||||
Object newValue = getFieldValue(field, engInfo);
|
||||
if (newValue == null) {
|
||||
continue;
|
||||
}
|
||||
String nameColumn = ENG_CODE_NAME_FIELD_MAP.get(columnName);
|
||||
Object newNameValue = StrUtil.isBlank(nameColumn) ? newValue : getColumnValue(engInfo, nameColumn);
|
||||
details.add(buildDetail(mainLog.getId(), engInfo.getStcd(), columnName,
|
||||
null, null, newValue, newNameValue, "新增字段值"));
|
||||
processedColumns.add(columnName);
|
||||
if (StrUtil.isNotBlank(nameColumn)) {
|
||||
processedColumns.add(nameColumn);
|
||||
}
|
||||
}
|
||||
batchInsertDetails(details);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recordEngUpdateLog(SdEngInfoBH before, SdEngInfoBH after, String source) {
|
||||
if (before == null || after == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
MsOperationLog mainLog = buildMainLog(before.getStcd(),"修改电站", source);
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
Set<String> processedColumns = new HashSet<>();
|
||||
for (Field field : SdEngInfoBH.class.getDeclaredFields()) {
|
||||
if (shouldSkipField(field)) {
|
||||
continue;
|
||||
}
|
||||
field.setAccessible(true);
|
||||
String columnName = resolveColumnName(field);
|
||||
if (ENG_NAME_COLUMNS.contains(columnName) || processedColumns.contains(columnName)) {
|
||||
continue;
|
||||
}
|
||||
Object oldValue = getFieldValue(field, before);
|
||||
Object newValue = getFieldValue(field, after);
|
||||
String nameColumn = ENG_CODE_NAME_FIELD_MAP.get(columnName);
|
||||
Object oldNameValue = resolveNameValue(columnName, nameColumn, oldValue, before);
|
||||
Object newNameValue = resolveNameValue(columnName, nameColumn, newValue, after);
|
||||
if (equalsValue(oldValue, newValue) && equalsValue(oldNameValue, newNameValue)) {
|
||||
continue;
|
||||
}
|
||||
details.add(buildDetail(mainLog.getId(), after.getStcd(), columnName,
|
||||
oldValue, oldNameValue, newValue, newNameValue, "修改字段值"));
|
||||
processedColumns.add(columnName);
|
||||
if (StrUtil.isNotBlank(nameColumn)) {
|
||||
processedColumns.add(nameColumn);
|
||||
}
|
||||
}
|
||||
batchInsertDetails(details);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recordEngDeleteLog(SdEngInfoBH engInfo, String source) {
|
||||
if (engInfo == null) {
|
||||
return;
|
||||
}
|
||||
MsOperationLog mainLog = buildMainLog(engInfo.getStcd(),"删除电站", source);
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
Set<String> processedColumns = new HashSet<>();
|
||||
for (Field field : SdEngInfoBH.class.getDeclaredFields()) {
|
||||
if (shouldSkipField(field)) {
|
||||
continue;
|
||||
}
|
||||
field.setAccessible(true);
|
||||
String columnName = resolveColumnName(field);
|
||||
if (ENG_NAME_COLUMNS.contains(columnName) || processedColumns.contains(columnName)) {
|
||||
continue;
|
||||
}
|
||||
Object oldValue = getFieldValue(field, engInfo);
|
||||
if (oldValue == null) {
|
||||
continue;
|
||||
}
|
||||
String nameColumn = ENG_CODE_NAME_FIELD_MAP.get(columnName);
|
||||
Object oldNameValue = resolveNameValue(columnName, nameColumn, oldValue, engInfo);
|
||||
details.add(buildDetail(mainLog.getId(), engInfo.getStcd(), columnName,
|
||||
oldValue, oldNameValue, null, null, "删除字段值"));
|
||||
processedColumns.add(columnName);
|
||||
if (StrUtil.isNotBlank(nameColumn)) {
|
||||
processedColumns.add(nameColumn);
|
||||
}
|
||||
}
|
||||
batchInsertDetails(details);
|
||||
}
|
||||
|
||||
private MsOperationLog buildMainLog(String recordId,String remark, String source) {
|
||||
MsOperationLog log = new MsOperationLog();
|
||||
log.setOperator(resolveOperator());
|
||||
log.setOperateTime(new Date());
|
||||
log.setTableName(ENG_TABLE_NAME);
|
||||
log.setRecordId(recordId);
|
||||
log.setSource(StrUtil.trimToNull(source));
|
||||
log.setRemark(remark);
|
||||
return log;
|
||||
}
|
||||
|
||||
private MsOperationLogDetail buildDetail(String mainId,
|
||||
String stationCode,
|
||||
String fieldCode,
|
||||
Object oldValueCode,
|
||||
Object oldValueName,
|
||||
Object newValueCode,
|
||||
Object newValueName,
|
||||
String remark) {
|
||||
MsOperationLogDetail detail = new MsOperationLogDetail();
|
||||
detail.setMainId(mainId);
|
||||
detail.setTableName(ENG_TABLE_NAME);
|
||||
detail.setStationCode(stationCode);
|
||||
detail.setFieldCode(fieldCode);
|
||||
detail.setFieldMeaning(ENG_FIELD_MEANING_MAP.getOrDefault(fieldCode, fieldCode));
|
||||
detail.setOldValueCode(formatValue(oldValueCode));
|
||||
detail.setOldValueName(formatValue(oldValueName));
|
||||
detail.setNewValueCode(formatValue(newValueCode));
|
||||
detail.setNewValueName(formatValue(newValueName));
|
||||
detail.setRemark(remark);
|
||||
return detail;
|
||||
}
|
||||
|
||||
private void batchInsertDetails(List<MsOperationLogDetail> details) {
|
||||
msOperationLogDetailMapper.insert(details);
|
||||
}
|
||||
|
||||
private boolean shouldSkipField(Field field) {
|
||||
if (Modifier.isStatic(field.getModifiers())) {
|
||||
return true;
|
||||
}
|
||||
TableField tableField = field.getAnnotation(TableField.class);
|
||||
if (tableField != null && !tableField.exist()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String resolveColumnName(Field field) {
|
||||
TableId tableId = field.getAnnotation(TableId.class);
|
||||
if (tableId != null) {
|
||||
return camelToUpperUnderline(field.getName());
|
||||
}
|
||||
TableField tableField = field.getAnnotation(TableField.class);
|
||||
if (tableField != null && StrUtil.isNotBlank(tableField.value())) {
|
||||
return tableField.value();
|
||||
}
|
||||
return camelToUpperUnderline(field.getName());
|
||||
}
|
||||
|
||||
private Object getFieldValue(Field field, Object target) {
|
||||
try {
|
||||
return field.get(target);
|
||||
} catch (IllegalAccessException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Object getColumnValue(Object target, String columnName) {
|
||||
if (target == null || StrUtil.isBlank(columnName)) {
|
||||
return null;
|
||||
}
|
||||
for (Field field : SdEngInfoBH.class.getDeclaredFields()) {
|
||||
if (shouldSkipField(field)) {
|
||||
continue;
|
||||
}
|
||||
field.setAccessible(true);
|
||||
if (StrUtil.equals(resolveColumnName(field), columnName)) {
|
||||
return getFieldValue(field, target);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Object resolveNameValue(String fieldCode, String nameColumn, Object rawValue, SdEngInfoBH target) {
|
||||
if (StrUtil.isNotBlank(nameColumn)) {
|
||||
return getColumnValue(target, nameColumn);
|
||||
}
|
||||
return resolveDictName(fieldCode, rawValue);
|
||||
}
|
||||
|
||||
private Object resolveDictName(String fieldCode, Object rawValue) {
|
||||
String text = formatValue(rawValue);
|
||||
if (StrUtil.isBlank(text)) {
|
||||
return rawValue;
|
||||
}
|
||||
Map<String, String> dictMap = ENG_DICT_VALUE_NAME_MAP.get(fieldCode);
|
||||
if (dictMap == null || dictMap.isEmpty()) {
|
||||
return rawValue;
|
||||
}
|
||||
if (!text.contains(",") && !text.contains(";")) {
|
||||
return dictMap.getOrDefault(text, rawValue == null ? null : text);
|
||||
}
|
||||
String[] parts = text.split("[,;]");
|
||||
List<String> names = new ArrayList<>();
|
||||
for (String part : parts) {
|
||||
String code = StrUtil.trim(part);
|
||||
if (StrUtil.isBlank(code)) {
|
||||
continue;
|
||||
}
|
||||
names.add(dictMap.getOrDefault(code, code));
|
||||
}
|
||||
return names.isEmpty() ? rawValue : String.join(",", names);
|
||||
}
|
||||
|
||||
private static Map<String, String> buildValueNameMap(String... keyValues) {
|
||||
Map<String, String> valueMap = new LinkedHashMap<>();
|
||||
if (keyValues == null) {
|
||||
return valueMap;
|
||||
}
|
||||
for (int i = 0; i + 1 < keyValues.length; i += 2) {
|
||||
valueMap.put(keyValues[i], keyValues[i + 1]);
|
||||
}
|
||||
return valueMap;
|
||||
}
|
||||
|
||||
private boolean equalsValue(Object oldValue, Object newValue) {
|
||||
return StrUtil.equals(formatValue(oldValue), formatValue(newValue));
|
||||
}
|
||||
|
||||
private String formatValue(Object value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
if (value instanceof Date date) {
|
||||
return DateUtil.formatDateTime(date);
|
||||
}
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
private String resolveOperator() {
|
||||
try {
|
||||
return SecurityUtils.getCurrentUsername();
|
||||
} catch (Exception ignored) {
|
||||
try {
|
||||
return SecurityUtils.getUserId();
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String camelToUpperUnderline(String text) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
char ch = text.charAt(i);
|
||||
if (Character.isUpperCase(ch) && i > 0) {
|
||||
builder.append('_');
|
||||
}
|
||||
builder.append(Character.toUpperCase(ch));
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.qgc_base.domain.SdAddvcdDic;
|
||||
import com.yfd.platform.qgc_base.mapper.SdAddvcdDicMapper;
|
||||
import com.yfd.platform.qgc_base.service.ISdAddvcdDicService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 行政区字典表 服务实现类
|
||||
* </p>
|
||||
*/
|
||||
@Service
|
||||
public class SdAddvcdDicServiceImpl extends ServiceImpl<SdAddvcdDicMapper, SdAddvcdDic> implements ISdAddvcdDicService {
|
||||
|
||||
@Override
|
||||
public List<SdAddvcdDic> selectForDropdown(Integer grd, String paddvcd) {
|
||||
return this.lambdaQuery()
|
||||
.eq(grd != null, SdAddvcdDic::getGrd, grd)
|
||||
.eq(StringUtils.hasText(paddvcd), SdAddvcdDic::getPaddvcd, paddvcd)
|
||||
.orderByAsc(SdAddvcdDic::getOrderIndex)
|
||||
.list();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@ import com.yfd.platform.qgc_base.domain.SdFpssBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdEngInfoBHMapper;
|
||||
import com.yfd.platform.qgc_base.mapper.SdFpssBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.ISdFpssBHService;
|
||||
import com.yfd.platform.system.service.IAdminAuthService;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -29,6 +30,9 @@ public class SdFpssBHServiceImpl extends ServiceImpl<SdFpssBHMapper, SdFpssBH> i
|
||||
@Resource
|
||||
private SdEngInfoBHMapper sdEngInfoBHMapper;
|
||||
|
||||
@Resource
|
||||
private IAdminAuthService adminAuthService;
|
||||
|
||||
|
||||
@Override
|
||||
public Page<SdFpssBH> selectPage(String stcd, String sttp, String rstcd, Integer usfl, Page<SdFpssBH> page) {
|
||||
@ -50,7 +54,7 @@ public class SdFpssBHServiceImpl extends ServiceImpl<SdFpssBHMapper, SdFpssBH> i
|
||||
Set<String> authorizedStations = getUserAuthorizedStationCodes();
|
||||
if (authorizedStations != null && !authorizedStations.isEmpty()) {
|
||||
wrapper.in(SdFpssBH::getRstcd, authorizedStations);
|
||||
}else if (!"admin".equals(SecurityUtils.getCurrentUsername())){
|
||||
}else if (!adminAuthService.isCurrentManagedAdmin()){
|
||||
return page;
|
||||
}
|
||||
|
||||
@ -68,7 +72,7 @@ public class SdFpssBHServiceImpl extends ServiceImpl<SdFpssBHMapper, SdFpssBH> i
|
||||
@Override
|
||||
public List<SdFpssBH> selectForDropdown(String rstcd, String stnm, String baseId,String rvcd,String reachcd) {
|
||||
// 管理员直接查询,无需权限过滤
|
||||
if ("admin".equals(SecurityUtils.getCurrentUsername())) {
|
||||
if (adminAuthService.isCurrentManagedAdmin()) {
|
||||
return queryFpssList(rstcd, stnm, baseId,rvcd,reachcd);
|
||||
}
|
||||
|
||||
|
||||
@ -15,6 +15,9 @@ import com.yfd.platform.qgc_base.mapper.SdEngInfoBHMapper;
|
||||
import com.yfd.platform.qgc_base.mapper.SdHbrvDicMapper;
|
||||
import com.yfd.platform.qgc_base.mapper.SdHydrobaseMapper;
|
||||
import com.yfd.platform.qgc_base.service.ISdHbrvDicService;
|
||||
import com.yfd.platform.system.service.IAdminAuthService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
@ -46,7 +49,39 @@ public class SdHbrvDicServiceImpl extends ServiceImpl<SdHbrvDicMapper, SdHbrvDic
|
||||
@Resource
|
||||
private SdHydrobaseMapper hydrobaseMapper;
|
||||
|
||||
@Resource
|
||||
private IAdminAuthService adminAuthService;
|
||||
|
||||
private SdHbrvDicMapper hbrvDicMapper;
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
* <p>
|
||||
* 每个模块的 ServiceImpl 中可按需定义自己的 codeToNameMetadataBoList,
|
||||
* 在查询方法返回前调用 dictCodeToNameConverter.convertCodeToName(voList, codeToNameMetadataBoList)
|
||||
* 即可自动将 code 字段转为对应的 name 字段。
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
* 使用示例:
|
||||
* // 在查询方法末尾调用:
|
||||
* dictCodeToNameConverter.convertCodeToName(voList, CODE_TO_NAME_META_LIST);
|
||||
* </pre>
|
||||
*/
|
||||
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
||||
|
||||
// static {
|
||||
//
|
||||
// CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("grd").modifyProperty("grdName").dictType("STATIC").dictSource("TEST").build());
|
||||
// CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("baseid").modifyProperty("basename").dictType("DYNAMIC").dictSource("SD_HYDROBASE").codeColumn("BASEID").nameColumn("BASENAME").filter("NVL(IS_DELETED, 0) = 0 ").build());
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public Page<SdHbrvDic> queryPageList(Page<SdHbrvDic> page, String hbrvnm, String baseid) {
|
||||
return this.page(page, this.lambdaQuery()
|
||||
@ -110,7 +145,7 @@ public class SdHbrvDicServiceImpl extends ServiceImpl<SdHbrvDicMapper, SdHbrvDic
|
||||
.eq(baseid != null && !baseid.isEmpty(), SdHbrvDic::getBaseid, baseid)
|
||||
.eq(SdHbrvDic::getEnabled, 1)
|
||||
.orderByAsc(SdHbrvDic::getBaseid,SdHbrvDic::getOrderIndex);
|
||||
if("admin".equals(SecurityUtils.getCurrentUsername())){
|
||||
if(adminAuthService.isCurrentManagedAdmin()){
|
||||
return this.list(wrapper);
|
||||
}
|
||||
Set<String> authorizedStations = getUserAuthorizedStationCodes();
|
||||
|
||||
@ -13,6 +13,7 @@ import com.yfd.platform.qgc_base.entity.vo.HydrobaseWbsVo;
|
||||
import com.yfd.platform.qgc_base.mapper.SdEngInfoBHMapper;
|
||||
import com.yfd.platform.qgc_base.mapper.SdHydrobaseMapper;
|
||||
import com.yfd.platform.qgc_base.service.ISdHydrobaseService;
|
||||
import com.yfd.platform.system.service.IAdminAuthService;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -39,6 +40,9 @@ public class SdHydrobaseServiceImpl extends ServiceImpl<SdHydrobaseMapper, SdHyd
|
||||
@Resource
|
||||
private SdEngInfoBHMapper sdEngInfoBHMapper;
|
||||
|
||||
@Resource
|
||||
private IAdminAuthService adminAuthService;
|
||||
|
||||
@Override
|
||||
public Page<SdHydrobase> queryPageList(Page<SdHydrobase> page, String basename, String pbaseid) {
|
||||
return this.page(page, this.lambdaQuery()
|
||||
@ -91,7 +95,7 @@ public class SdHydrobaseServiceImpl extends ServiceImpl<SdHydrobaseMapper, SdHyd
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}else if (!"admin".equals(SecurityUtils.getCurrentUsername())){
|
||||
}else if (!adminAuthService.isCurrentManagedAdmin()){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// else {
|
||||
|
||||
@ -11,6 +11,7 @@ import com.yfd.platform.qgc_base.mapper.SdRvcdDicMapper;
|
||||
import com.yfd.platform.qgc_base.service.ISdRvcdDicService;
|
||||
import com.yfd.platform.qgc_data.domain.SysUserDataScope;
|
||||
import com.yfd.platform.qgc_data.mapper.SysUserDataScopeMapper;
|
||||
import com.yfd.platform.system.service.IAdminAuthService;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -33,6 +34,9 @@ public class SdRvcdDicServiceImpl extends ServiceImpl<SdRvcdDicMapper, SdRvcdDic
|
||||
@Resource
|
||||
private SysUserDataScopeMapper sysUserDataScopeMapper;
|
||||
|
||||
@Resource
|
||||
private IAdminAuthService adminAuthService;
|
||||
|
||||
@Override
|
||||
public Page<SdRvcdDic> queryPageList(Page<SdRvcdDic> page, String rvnm, String prvcd) {
|
||||
return this.page(page, this.lambdaQuery()
|
||||
@ -120,7 +124,7 @@ public class SdRvcdDicServiceImpl extends ServiceImpl<SdRvcdDicMapper, SdRvcdDic
|
||||
@Override
|
||||
public List<SdRvcdDic> selectForDropdown(String rvnm, String rvcd) {
|
||||
List<SdRvcdDic> dropdownList = this.baseMapper.selectRegDropdown(rvnm, rvcd);
|
||||
if("admin".equals(SecurityUtils.getCurrentUsername())){
|
||||
if(adminAuthService.isCurrentManagedAdmin()){
|
||||
return dropdownList;
|
||||
}
|
||||
Set<String> authorizedStations = getUserAuthorizedStationCodes();
|
||||
@ -149,6 +153,12 @@ public class SdRvcdDicServiceImpl extends ServiceImpl<SdRvcdDicMapper, SdRvcdDic
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SdRvcdDic> selectRvcdDropdown(String rvnm,String baseId) {
|
||||
List<SdRvcdDic> dropdownList = this.baseMapper.selectRvcdDropdown(rvnm,baseId);
|
||||
return dropdownList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Set<String> getUserAuthorizedStationCodes() {
|
||||
|
||||
@ -4,8 +4,12 @@ import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqBaseMsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqBaseVmsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDrtpDataVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqIntervalVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitQueryVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqMsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqRuleVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqVmsstbprptVo;
|
||||
@ -22,6 +26,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/eq")
|
||||
@Tag(name = "电站实时数据查询")
|
||||
@ -56,6 +62,12 @@ public class EngEqDataController {
|
||||
return ResponseResult.successData(engEqDataService.getIntervalKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/to/eq/GetKendoListCust")
|
||||
@Operation(summary = "电站生态流量统计查询(电站左连接)")
|
||||
public ResponseResult getToEqKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(engEqDataService.getIntervalKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/msstbprpt/GetKendoList")
|
||||
@Operation(summary = "电站基础信息查询")
|
||||
public ResponseResult getMsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
@ -63,6 +75,20 @@ public class EngEqDataController {
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/base/msstbprpt/GetKendoList")
|
||||
@Operation(summary = "生态流量泄放设施基础信息查询")
|
||||
public ResponseResult getBaseMsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<EngEqBaseMsstbprptVo> result = engEqDataService.getBaseMsstbprptList(dataSourceRequest);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/base/vmsstbprpt/GetKendoList")
|
||||
@Operation(summary = "生态流量泄放设施统计查询")
|
||||
public ResponseResult getBaseVmsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<EngEqBaseVmsstbprptVo> result = engEqDataService.getBaseVmsstbprptList(dataSourceRequest);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/interval/qgc/hour/GetKendoListCust")
|
||||
@Operation(summary = "生态流量达标率小时统计(二级页面)")
|
||||
public ResponseResult getQgcHourKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
@ -81,6 +107,13 @@ public class EngEqDataController {
|
||||
return ResponseResult.successData(engEqDataService.getQgcHourVAlongKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/engalong/statistics/qgc/getEngLimit")
|
||||
@Operation(summary = "沿程生态流量限值变化曲线")
|
||||
public ResponseResult getQgcEngLimit(@RequestBody EngEqLimitQueryVo queryVo) {
|
||||
List<EngEqLimitVo> result = engEqDataService.getQgcEngLimit(queryVo);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/fid/GetKendoListCust")
|
||||
@Operation(summary = "查询电站相关鱼类附件编码")
|
||||
public ResponseResult getFidKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
package com.yfd.platform.qgc_eng.eq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "生态流量泄放设施基础信息查询")
|
||||
public class EngEqBaseMsstbprptVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "设施编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "设施名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "设施类型编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "设施类型名称")
|
||||
private String sttpName;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属电站名称")
|
||||
private String rstcdName;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "基地流域名称")
|
||||
private String hbrvcdName;
|
||||
|
||||
@Schema(description = "设施位置")
|
||||
private String stlc;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private Double lgtd;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private Double lttd;
|
||||
|
||||
@Schema(description = "高程")
|
||||
private Double elev;
|
||||
|
||||
@Schema(description = "建设状态分类编码")
|
||||
private Integer bldsttCode;
|
||||
|
||||
@Schema(description = "建设状态分类名称")
|
||||
private String bldsttCodeName;
|
||||
|
||||
@Schema(description = "数据接入状态")
|
||||
private Integer dtin;
|
||||
|
||||
@Schema(description = "数据接入状态中文")
|
||||
private String dtinName;
|
||||
|
||||
@Schema(description = "数据接入时间")
|
||||
private Date dtinTm;
|
||||
|
||||
@Schema(description = "数据时间")
|
||||
private Date tm;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer orderIndex;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.yfd.platform.qgc_eng.eq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "生态流量泄放设施统计查询")
|
||||
public class EngEqBaseVmsstbprptVo extends EngEqMsstbprptVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属电站名称")
|
||||
private String rstcdName;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "流域排序")
|
||||
private Integer rvcdStepSort;
|
||||
|
||||
@Schema(description = "所属电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "设施排序")
|
||||
private Integer siteStepSort;
|
||||
|
||||
@Schema(description = "死水位时保证流量")
|
||||
private Double ddzgq;
|
||||
|
||||
@Schema(description = "最大泄放流量")
|
||||
private String flkq;
|
||||
|
||||
@Schema(description = "孔口尺寸")
|
||||
private String flksz;
|
||||
|
||||
@Schema(description = "结构形式")
|
||||
private String frntwlltyp;
|
||||
|
||||
@Schema(description = "进水口底版高程")
|
||||
private Double jskgc;
|
||||
|
||||
@Schema(description = "出水口底版高程")
|
||||
private Double outflrelev;
|
||||
|
||||
@Schema(description = "基荷发电工况")
|
||||
private Double jhfdgk;
|
||||
|
||||
@Schema(description = "发电流量")
|
||||
private Double fdll;
|
||||
|
||||
@Schema(description = "生态机组额定流量")
|
||||
private Double stjzysq;
|
||||
|
||||
@Schema(description = "装机容量")
|
||||
private Double ttpwr;
|
||||
|
||||
@Schema(description = "所属建设阶段名称")
|
||||
private String blprdName;
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.yfd.platform.qgc_eng.eq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(description = "沿程生态流量限值查询参数")
|
||||
public class EngEqLimitQueryVo {
|
||||
|
||||
@Schema(description = "查询日期,支持 yyyy-MM-dd、yyyy-MM-dd HH:mm、yyyy-MM-dd HH:mm:ss")
|
||||
private String date;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "流域编码")
|
||||
private String rvcd;
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.yfd.platform.qgc_eng.eq.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(description = "沿程生态流量限值")
|
||||
public class EngEqLimitVo {
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String stnm;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "查询日期")
|
||||
private Date date;
|
||||
|
||||
@Schema(description = "生态流量限值")
|
||||
private BigDecimal qecLimit;
|
||||
}
|
||||
@ -56,6 +56,9 @@ public class EngEqVmsstbprptVo implements Serializable {
|
||||
@Schema(description = "环保数据接入状态")
|
||||
private Integer dtinEnv;
|
||||
|
||||
@Schema(description = "接入状态")
|
||||
private Integer dtin;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
|
||||
@ -2,11 +2,15 @@ package com.yfd.platform.qgc_eng.eq.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqBaseMsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqBaseVmsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayDataVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDrtpDataVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayIntervalVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqHourIntervalVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqIntervalVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitQueryVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqMsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqRuleVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngQecAlongVo;
|
||||
@ -16,6 +20,8 @@ import com.yfd.platform.qgc_eng.eq.entity.vo.QgcQecStaticVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.SdEqMonitorCountVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.WbsbVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EngEqDataService {
|
||||
|
||||
DataSourceResult getKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
@ -28,12 +34,18 @@ public interface EngEqDataService {
|
||||
|
||||
DataSourceResult<EngEqMsstbprptVo> getMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngEqBaseMsstbprptVo> getBaseMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngEqBaseVmsstbprptVo> getBaseVmsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngEqHourIntervalVo> getQgcHourKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngEqDayIntervalVo> getQgcDayKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngQecAlongVo> getQgcHourVAlongKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
List<EngEqLimitVo> getQgcEngLimit(EngEqLimitQueryVo queryVo);
|
||||
|
||||
DataSourceResult<String> getFidKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
EngEqRuleVo getEngLimit(DataSourceRequest dataSourceRequest);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,35 +0,0 @@
|
||||
package com.yfd.platform.qgc_env.fb.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_env.fb.service.FbStationService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/fb/bsmfr")
|
||||
@Tag(name = "亲鱼选配与培育-亲鱼信息")
|
||||
@Validated
|
||||
public class FbBsmfrController {
|
||||
|
||||
@Resource
|
||||
private FbStationService fbStationService;
|
||||
|
||||
@PostMapping("/qgc/GetKendoListCust")
|
||||
@Operation(summary = "(全过程)增殖站二级页面: 亲鱼选配与培育->亲鱼信息")
|
||||
public ResponseResult getQgcKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getQgcBsmfRKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/fish/GetKendoListCust")
|
||||
@Operation(summary = "(全过程)增殖站二级页面: 过程图-亲鱼")
|
||||
public ResponseResult getFishKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getBsmfRFishKendoListCust(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
package com.yfd.platform.qgc_env.fb.controller;
|
||||
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_env.fb.service.FbStationService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
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;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/fb/fbrdmr")
|
||||
@Tag(name = "鱼类增殖站年度鱼类标记数据")
|
||||
@Validated
|
||||
public class FbFbrdmrController {
|
||||
|
||||
@Resource
|
||||
private FbStationService fbStationService;
|
||||
|
||||
@GetMapping("/getFbRelatedYrByStcd")
|
||||
@Operation(summary = "根据增殖站编码查询相关业务年份")
|
||||
public ResponseResult getFbRelatedYrByStcd(@Parameter(description = "增殖站编码")
|
||||
@RequestParam("stcd") String stcd) {
|
||||
return ResponseResult.successData(fbStationService.getFbRelatedYrByStcd(stcd));
|
||||
}
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
package com.yfd.platform.qgc_env.fb.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_env.fb.service.FbStationService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/fb/msfbrdm")
|
||||
@Tag(name = "鱼类增殖站增殖情况")
|
||||
@Validated
|
||||
public class FbMsfbrdmController {
|
||||
|
||||
@Resource
|
||||
private FbStationService fbStationService;
|
||||
|
||||
@PostMapping("/fbFlData/GetKendoListCust")
|
||||
@Operation(summary = "增殖站增殖情况(app)")
|
||||
public ResponseResult getFbFlData(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getFbFlDataKendoListCust(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
@ -16,47 +16,120 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/fb/station")
|
||||
@Tag(name = "鱼类增殖站概况")
|
||||
@RequestMapping("/fb")
|
||||
@Tag(name = "鱼类增殖站模块")
|
||||
@Validated
|
||||
public class FbStationController {
|
||||
|
||||
@Resource
|
||||
private FbStationService fbStationService;
|
||||
|
||||
@PostMapping("/qgcoverview/getOverviewSecond")
|
||||
@PostMapping("/station/qgcoverview/getOverviewSecond")
|
||||
@Operation(summary = "全流域增殖站概况二级页面")
|
||||
public ResponseResult getQgcOverviewSecond(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getQgcOverviewSecond(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/overview/getOverviewSecond")
|
||||
@PostMapping("/station/overview/getOverviewSecond")
|
||||
@Operation(summary = "增殖站概况二级页面")
|
||||
public ResponseResult getOverviewSecond(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getOverviewSecond(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/overview/GetKendoListCust")
|
||||
@PostMapping("/station/overview/GetKendoListCust")
|
||||
@Operation(summary = "全流域增殖站概况")
|
||||
public ResponseResult getOverviewKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getOverviewKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/qgc/getFbStaticsData")
|
||||
@PostMapping("/station/qgc/getFbStaticsData")
|
||||
@Operation(summary = "增殖站放流数据统计")
|
||||
public ResponseResult getQgcFbStaticsData(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getQgcFbStaticsData(dataSourceRequest));
|
||||
}
|
||||
|
||||
@GetMapping("/msstbprpt/getStInfoByStcd")
|
||||
@GetMapping("/station/msstbprpt/getStInfoByStcd")
|
||||
@Operation(summary = "增殖站单站基础信息")
|
||||
public ResponseResult getStInfoByStcd(@Parameter(description = "站点编码") @RequestParam("stcd") String stcd) {
|
||||
return ResponseResult.successData(fbStationService.getStInfoByStcd(stcd));
|
||||
}
|
||||
|
||||
@GetMapping("/rpimnr/qgc/year/GetYearRpStatistics")
|
||||
@GetMapping("/station/rpimnr/qgc/year/GetYearRpStatistics")
|
||||
@Operation(summary = "全过程放流统计总数,根据基地流域分组")
|
||||
public ResponseResult getYearRpStatistics(@Parameter(description = "年份") @RequestParam("year") String year) {
|
||||
return ResponseResult.successData(fbStationService.getYearRpStatistics(year));
|
||||
}
|
||||
|
||||
@PostMapping("/bsmfr/qgc/GetKendoListCust")
|
||||
@Operation(summary = "(全过程)增殖站二级页面: 亲鱼选配与培育->亲鱼信息")
|
||||
public ResponseResult getBsmfrQgcKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getQgcBsmfRKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/bsmfr/fish/GetKendoListCust")
|
||||
@Operation(summary = "(全过程)增殖站二级页面: 过程图-亲鱼")
|
||||
public ResponseResult getBsmfrFishKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getBsmfRFishKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@GetMapping("/fbrdmr/getFbRelatedYrByStcd")
|
||||
@Operation(summary = "根据增殖站编码查询相关业务年份")
|
||||
public ResponseResult getFbRelatedYrByStcd(@Parameter(description = "增殖站编码")
|
||||
@RequestParam("stcd") String stcd) {
|
||||
return ResponseResult.successData(fbStationService.getFbRelatedYrByStcd(stcd));
|
||||
}
|
||||
|
||||
@PostMapping("/msfbrdm/fbFlData/GetKendoListCust")
|
||||
@Operation(summary = "增殖站增殖情况(app)")
|
||||
public ResponseResult getFbFlData(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getFbFlDataKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/fishCount/GetKendoListCust")
|
||||
@Operation(summary = "增殖站鱼数量完成情况统计")
|
||||
public ResponseResult getFishCountKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getFishCountKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/fishrun/qgc/GetKendoListCust")
|
||||
@Operation(summary = "全过程鱼类放鱼数据")
|
||||
public ResponseResult getFishRunQgcKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getFishRunQgcKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/fishType/GetKendoListCust")
|
||||
@Operation(summary = "增殖站鱼种完成情况统计")
|
||||
public ResponseResult getFishTypeKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getFishTypeKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/fishType/getStcdList")
|
||||
@Operation(summary = "增殖放流完成情况获取有数据的测站下拉")
|
||||
public ResponseResult getFishTypeStcdList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getFishTypeStcdList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/msfbrdm/GetKendoListCust")
|
||||
@Operation(summary = "鱼类增殖站运行情况统计列表")
|
||||
public ResponseResult getMsfbrdmKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getMsfbrdmKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/msfbrdm/qgc/GetKendoListCust")
|
||||
@Operation(summary = "(全过程)增殖站二级页面: 增殖放流情况")
|
||||
public ResponseResult getMsfbrdmQgcKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getQgcMsfbrdmKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/msstbprpt/GetKendoList")
|
||||
@Operation(summary = "鱼类增殖站基础信息列表")
|
||||
public ResponseResult getMsstbprptKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getMsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/base/researchb/GetKendoList")
|
||||
@Operation(summary = "鱼类增殖站科研情况列表")
|
||||
public ResponseResult getResearchKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fbStationService.getResearchKendoList(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
package com.yfd.platform.qgc_env.fb.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class FbFishCountFinishVo {
|
||||
|
||||
private String stcd;
|
||||
|
||||
private BigDecimal finished;
|
||||
|
||||
private BigDecimal unfinished;
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.yfd.platform.qgc_env.fb.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FbFishRunQgcVo {
|
||||
|
||||
private String stcd;
|
||||
|
||||
private String stnm;
|
||||
|
||||
private String ftp;
|
||||
|
||||
private String ftpName;
|
||||
|
||||
private String baseId;
|
||||
|
||||
private String baseName;
|
||||
|
||||
private String flyr;
|
||||
|
||||
private Long fcnt;
|
||||
|
||||
private Long totalFcnt;
|
||||
|
||||
private String fid;
|
||||
|
||||
private String release;
|
||||
|
||||
private Integer baseStepSort;
|
||||
|
||||
private Integer siteStepSort;
|
||||
|
||||
private Integer rvcdStepSort;
|
||||
|
||||
private Integer rstcdStepSort;
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.yfd.platform.qgc_env.fb.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FbFishTypeFinishVo {
|
||||
|
||||
private String stcd;
|
||||
|
||||
private Integer finished;
|
||||
|
||||
private Integer unfinished;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.yfd.platform.qgc_env.fb.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class FbFishTypeStcdVo {
|
||||
|
||||
private String stcd;
|
||||
|
||||
private String stnm;
|
||||
|
||||
private BigDecimal lgtd;
|
||||
|
||||
private BigDecimal lttd;
|
||||
|
||||
private String baseId;
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.yfd.platform.qgc_env.fb.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FbMsfbrdmQgcVo {
|
||||
|
||||
private String stcd;
|
||||
|
||||
private String stnm;
|
||||
|
||||
private String baseId;
|
||||
|
||||
private String baseName;
|
||||
|
||||
private String rstcd;
|
||||
|
||||
private String ennm;
|
||||
|
||||
private Integer bldstt;
|
||||
|
||||
private Integer hydrodtin;
|
||||
|
||||
private Integer runState;
|
||||
|
||||
private String runStateName;
|
||||
|
||||
private String ftp;
|
||||
|
||||
private String ftpName;
|
||||
|
||||
private Long fcntjh;
|
||||
|
||||
private Long fcntjc;
|
||||
|
||||
private String flyr;
|
||||
|
||||
private String fsz;
|
||||
|
||||
private String fwet;
|
||||
|
||||
private String fid;
|
||||
|
||||
private List<FbReleaseDirectionVo> directionVoList;
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.yfd.platform.qgc_env.fb.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class FbReleaseDirectionVo {
|
||||
|
||||
private String flstcd;
|
||||
|
||||
private String flstnm;
|
||||
|
||||
private Long flfnct;
|
||||
|
||||
private String flyr;
|
||||
|
||||
private String ftp;
|
||||
|
||||
private String stcd;
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.yfd.platform.qgc_env.fb.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class FbResearchVo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String stcd;
|
||||
|
||||
private Date dt;
|
||||
|
||||
private String ftp;
|
||||
|
||||
private String ftpName;
|
||||
|
||||
private String wco;
|
||||
|
||||
private String jd;
|
||||
|
||||
private String fid;
|
||||
|
||||
private String recordUser;
|
||||
|
||||
private Date recordTime;
|
||||
|
||||
private String modifyUser;
|
||||
|
||||
private Date modifyTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
private String deleteUser;
|
||||
|
||||
private Date deleteTime;
|
||||
|
||||
private String rstcd;
|
||||
|
||||
private String ennm;
|
||||
|
||||
private String baseId;
|
||||
|
||||
private String baseName;
|
||||
|
||||
private String hbrvcd;
|
||||
}
|
||||
@ -5,13 +5,20 @@ import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbBsmfRQgcVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbBsmfRFishTableVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbFlDataVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbFishCountFinishVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbFishRunQgcVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbFishTypeStcdVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbFishTypeFinishVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbRelatedYrVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbMsfbrdmQgcVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbResearchVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbStInfoResultVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbStationStaticsDataVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.YearRpStatisticsVo;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbStationOverviewSecondVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface FbStationService {
|
||||
|
||||
@ -19,12 +26,28 @@ public interface FbStationService {
|
||||
|
||||
DataSourceResult<FbStationOverviewSecondVo> getOverviewKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<Map<String, Object>> getMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbFlDataVo> getFbFlDataKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbFishCountFinishVo> getFishCountKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbFishRunQgcVo> getFishRunQgcKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbFishTypeFinishVo> getFishTypeKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbFishTypeStcdVo> getFishTypeStcdList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbMsfbrdmQgcVo> getMsfbrdmKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbMsfbrdmQgcVo> getQgcMsfbrdmKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbBsmfRQgcVo> getQgcBsmfRKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbBsmfRFishTableVo> getBsmfRFishKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbResearchVo> getResearchKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FbRelatedYrVo> getFbRelatedYrByStcd(String stcd);
|
||||
|
||||
FbStInfoResultVo getStInfoByStcd(String stcd);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -96,10 +96,14 @@ public class FhHabitatServiceImpl implements FhHabitatService {
|
||||
}
|
||||
|
||||
sql.append(buildOrderBySql(dataSourceRequest.getSort()));
|
||||
Page<?> page = null;
|
||||
if (QgcQueryWrapperUtil.getPageInfo(loadOptions).getHasPageInfo()) {
|
||||
page = QgcQueryWrapperUtil.getPageInfo(loadOptions).getPage();
|
||||
}
|
||||
// Page<?> page = null;
|
||||
// if (QgcQueryWrapperUtil.getPageInfo(loadOptions).getHasPageInfo()) {
|
||||
// page = QgcQueryWrapperUtil.getPageInfo(loadOptions).getPage();
|
||||
// }
|
||||
|
||||
// DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
|
||||
|
||||
List<HabitatVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, HabitatVo.class);
|
||||
DataSourceResult<HabitatVo> result = new DataSourceResult<>();
|
||||
|
||||
@ -72,6 +72,9 @@ public class FpFpssrlQueryVo {
|
||||
@Schema(description = "游向")
|
||||
private String direction;
|
||||
|
||||
@Schema(description = "游向中文")
|
||||
private String directionName;
|
||||
|
||||
@Schema(description = "水温")
|
||||
private String temperature;
|
||||
|
||||
|
||||
@ -199,8 +199,11 @@ public class FpVmsstbprptVo implements Serializable {
|
||||
@Schema(description = "升鱼机集鱼槽水深")
|
||||
private String syjwdp;
|
||||
|
||||
// @Schema(description = "设计过鱼规模")
|
||||
// private Integer sjgycnt;
|
||||
|
||||
@Schema(description = "设计过鱼规模")
|
||||
private Integer sjgycnt;
|
||||
private String sjgycnt;
|
||||
|
||||
@Schema(description = "主要过鱼对象描述")
|
||||
private String zygydxms;
|
||||
|
||||
@ -136,15 +136,15 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
String sql = "SELECT DISTINCT " +
|
||||
" fish.ID AS id, " +
|
||||
" fish.NAME AS name " +
|
||||
"FROM SD_FPSS_B_H fp " +
|
||||
"INNER JOIN SD_ENGINFO_B_H eng ON eng.STCD = fp.RSTCD " +
|
||||
" AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
"INNER JOIN SD_FISHDICTORY_RLTN_B rel ON rel.RVCD = eng.HBRVCD " +
|
||||
"FROM SD_FBRD_B_H fb " +
|
||||
// "INNER JOIN SD_ENGINFO_B_H eng ON eng.STCD = fb.RSTCD " +
|
||||
// " AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
"INNER JOIN SD_FISHDICTORY_RLTN_B rel ON rel.BASE_ID = fb.BASE_ID " +
|
||||
" AND NVL(rel.IS_DELETED, 0) = 0 " +
|
||||
"INNER JOIN SD_FISHDICTORY_B fish ON fish.ID = NVL(rel.ZY_FISH_ID, rel.FISH_ID) " +
|
||||
" AND NVL(fish.IS_DELETED, 0) = 0 " +
|
||||
" AND NVL(fish.ENABLE, 1) = 1 " +
|
||||
"WHERE fp.STCD = #{map.stcd} " +
|
||||
"WHERE fb.STCD = #{map.stcd} " +
|
||||
"ORDER BY fish.NAME";
|
||||
|
||||
List<FpFishDicVo> list = microservicDynamicSQLMapper.getAllListWithResultType(
|
||||
@ -337,7 +337,7 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
.append("fp.YDCSPD AS ydcspd, ")
|
||||
.append("fp.YDCSCNT AS ydcscnt, ")
|
||||
.append("fp.YDXXCCNT AS ydxxccnt, ")
|
||||
.append("fp.V AS v, ")
|
||||
.append("fp.FLOW AS flow, ")
|
||||
.append("fp.FZRDMXZ AS fzrdmxz, ")
|
||||
.append("fp.FZRTDSZ AS fzrtdsz, ")
|
||||
.append("fp.FZRYXWDP AS fzryxwdp, ")
|
||||
@ -858,7 +858,7 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
columnMap.put("ydcspd", "fp.YDCSPD");
|
||||
columnMap.put("ydcscnt", "fp.YDCSCNT");
|
||||
columnMap.put("ydxxccnt", "fp.YDXXCCNT");
|
||||
columnMap.put("v", "fp.V");
|
||||
columnMap.put("flow", "fp.flow");
|
||||
columnMap.put("fzrdmxz", "fp.FZRDMXZ");
|
||||
columnMap.put("fzrtdsz", "fp.FZRTDSZ");
|
||||
columnMap.put("fzryxwdp", "fp.FZRYXWDP");
|
||||
|
||||
@ -1635,6 +1635,7 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
selectMap.put("width", "t.width AS width");
|
||||
selectMap.put("fishspeed", "t.fishspeed AS fishspeed");
|
||||
selectMap.put("direction", "t.direction AS direction");
|
||||
selectMap.put("directionName", "CASE t.direction WHEN '0' THEN '上行' WHEN '1' THEN '下行' WHEN '2' THEN '上行折返' WHEN '3' THEN '下行折返' END AS directionName");
|
||||
selectMap.put("temperature", "t.temperature AS temperature");
|
||||
selectMap.put("speed", "t.speed AS speed");
|
||||
selectMap.put("channelno", "t.channelno AS channelno");
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.yfd.platform.qgc_env.fpr.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.ao.FprdRunDataAo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdDetailVo;
|
||||
import com.yfd.platform.qgc_eng.eq.service.EngEqDataService;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFtpChangeInfoVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdRunDataInfoVo;
|
||||
@ -38,6 +40,12 @@ public class FprMonitorController {
|
||||
return ResponseResult.successData(fprMonitorService.getMsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/vmsstbprpt/GetKendoList")
|
||||
@Operation(summary = "鱼类调查装置统计查询")
|
||||
public ResponseResult getVmsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fprMonitorService.getVmsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/fishDic/GetKendoList")
|
||||
@Operation(summary = "鱼类字典列表")
|
||||
public ResponseResult getFishDicList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
@ -64,6 +72,20 @@ public class FprMonitorController {
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/sdFprdR/GetKendoListCust")
|
||||
@Operation(summary = "鱼类调查装置详情数据")
|
||||
public ResponseResult getFprdDetailList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<FprdDetailVo> result = fprMonitorService.getFprdDetailList(dataSourceRequest);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/sdFprdR/getFishInfo")
|
||||
@Operation(summary = "获取鱼种类信息")
|
||||
public ResponseResult getFishInfo() {
|
||||
List<String> result = fprMonitorService.getFishInfo();
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/wbsb/GetKendoList")
|
||||
@Operation(summary = "查询基地/基地流域树数据")
|
||||
public ResponseResult getWbsbList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
|
||||
@ -45,4 +45,5 @@ public class FprZyFishDicVo {
|
||||
private String spawnMonth;
|
||||
private String orders;
|
||||
private String vlsr;
|
||||
private java.util.Date vlsrTm;
|
||||
}
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package com.yfd.platform.qgc_env.fpr.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "鱼类调查装置详情数据")
|
||||
public class FprdDetailVo {
|
||||
|
||||
@Schema(description = "调查鱼类装置编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "调查鱼类装置名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "监测时间")
|
||||
private Date tm;
|
||||
|
||||
@Schema(description = "监测视频文件ID")
|
||||
private String fid;
|
||||
|
||||
@Schema(description = "鱼类名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "鱼类数量")
|
||||
private Long num;
|
||||
|
||||
@Schema(description = "鱼尺寸")
|
||||
private BigDecimal fsz;
|
||||
|
||||
@Schema(description = "鱼重量")
|
||||
private BigDecimal weight;
|
||||
}
|
||||
@ -6,6 +6,7 @@ import com.yfd.platform.qgc_env.fpr.entity.vo.FprFtpChangeInfoVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.ao.FprdRunDataAo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFishDicVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprMsstbprptVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdDetailVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdRunDataInfoVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprZyFishDicVo;
|
||||
|
||||
@ -15,6 +16,8 @@ public interface FprMonitorService {
|
||||
|
||||
DataSourceResult<FprMsstbprptVo> getMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FprMsstbprptVo> getVmsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FprFishDicVo> getFishDicList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FprZyFishDicVo> getZyFishDicList(DataSourceRequest dataSourceRequest);
|
||||
@ -22,4 +25,8 @@ public interface FprMonitorService {
|
||||
FprdRunDataInfoVo getFprdRunDataInfo(FprdRunDataAo ao);
|
||||
|
||||
List<FprFtpChangeInfoVo> getFtpChangeInfo(FprdRunDataAo ao);
|
||||
|
||||
DataSourceResult<FprdDetailVo> getFprdDetailList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
List<String> getFishInfo();
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.yfd.platform.qgc_env.fpr.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
@ -16,6 +17,7 @@ import com.yfd.platform.qgc_env.fpr.entity.ao.FprdRunDataAo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFishDicVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFtpChangeInfoVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprMsstbprptVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdDetailVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdRunDataInfoVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprZyFishDicVo;
|
||||
import com.yfd.platform.qgc_env.fpr.service.FprMonitorService;
|
||||
@ -25,6 +27,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@ -76,6 +79,53 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FprdDetailVo> getFprdDetailList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildFprdDetailFilterCondition(
|
||||
dataSourceRequest == null ? null : dataSourceRequest.getFilter(),
|
||||
paramMap,
|
||||
new int[]{0}
|
||||
);
|
||||
|
||||
StringBuilder sql = new StringBuilder("SELECT ")
|
||||
.append(buildFprdDetailSelectSql(dataSourceRequest == null ? null : dataSourceRequest.getSelect()))
|
||||
.append(" FROM (")
|
||||
.append(buildFprdDetailBaseSql())
|
||||
.append(") t WHERE 1 = 1 ");
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
sql.append(buildFprdDetailOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||
|
||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
List<FprdDetailVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||
page, sql.toString(), paramMap, FprdDetailVo.class
|
||||
);
|
||||
|
||||
DataSourceResult<FprdDetailVo> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(page != null ? page.getTotal() : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getFishInfo() {
|
||||
List<Map<String, Object>> rows = microservicDynamicSQLMapper.getAllList(
|
||||
"SELECT DISTINCT NAME AS name FROM SD_FPRDFISH_R " +
|
||||
"WHERE NVL(IS_DELETED, 0) = 0 AND NAME IS NOT NULL " +
|
||||
"ORDER BY NAME",
|
||||
null
|
||||
);
|
||||
return rows.stream()
|
||||
.map(row -> row.get("NAME"))
|
||||
.filter(java.util.Objects::nonNull)
|
||||
.map(String::valueOf)
|
||||
.toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FprMsstbprptVo> getMsstbprptList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
@ -130,6 +180,11 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FprMsstbprptVo> getVmsstbprptList(DataSourceRequest dataSourceRequest) {
|
||||
return getMsstbprptList(dataSourceRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FprFishDicVo> getFishDicList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
@ -195,87 +250,33 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
new int[]{0}
|
||||
);
|
||||
|
||||
String baseSql = StrUtil.isBlank(rvcd) ? buildZyFishDicSummarySql() : buildZyFishDicBaseSql();
|
||||
StringBuilder sql = new StringBuilder("SELECT * FROM (")
|
||||
.append(buildZyFishDicBaseSql())
|
||||
.append(baseSql)
|
||||
.append(") t WHERE 1 = 1 ");
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
// 增加排序
|
||||
if(dataSourceRequest.getSort() !=null && !dataSourceRequest.getSort().isEmpty()){
|
||||
List<DataSourceRequest.SortDescriptor> sortDescriptors = dataSourceRequest.getSort();
|
||||
StringBuilder orderSql = new StringBuilder();
|
||||
orderSql.append(" order by ");
|
||||
for (DataSourceRequest.SortDescriptor sort:sortDescriptors){
|
||||
orderSql.append(sort.getField()).append(" ").append(sort.getDir()).append(",");
|
||||
}
|
||||
sql.append(orderSql, 0, orderSql.length()-1);
|
||||
// String[] beans = SpringContextHolder.getApplicationContext().getBeanDefinitionNames();
|
||||
sql.append(" nulls last ");
|
||||
}else{
|
||||
sql.append(" order by rvcd nulls last ");
|
||||
}
|
||||
List<FprZyFishDicVo> list = microservicDynamicSQLMapper.getAllListWithResultType(
|
||||
sql.append(buildZyFishDicOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
List<FprZyFishDicVo> resultList = microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||
page,
|
||||
sql.toString(),
|
||||
paramMap,
|
||||
FprZyFishDicVo.class
|
||||
);
|
||||
List<Map<String, Object>> rvcdRows = microservicDynamicSQLMapper.getAllList(
|
||||
"SELECT RVCD AS rvcd, RVNM AS rvcdName FROM SD_RVCD_DIC",
|
||||
null
|
||||
);
|
||||
Map<String, String> rvcdNameMap = new HashMap<>();
|
||||
for (Map<String, Object> row : rvcdRows) {
|
||||
Object rvcdKey = row.get("RVCD");
|
||||
Object rvcdName = row.get("RVCDNAME");
|
||||
if (rvcdKey != null && rvcdName != null) {
|
||||
rvcdNameMap.put(String.valueOf(rvcdKey), String.valueOf(rvcdName));
|
||||
}
|
||||
}
|
||||
|
||||
List<FprZyFishDicVo> resultList;
|
||||
Map<String, List<String>> rvcdMap = new HashMap<>();
|
||||
if (StrUtil.isBlank(rvcd)) {
|
||||
rvcdMap = list.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
item -> StrUtil.blankToDefault(item.getZyFishId(), item.getId()),
|
||||
LinkedHashMap::new,
|
||||
Collectors.mapping(FprZyFishDicVo::getRvcd, Collectors.toList())
|
||||
));
|
||||
LinkedHashMap<String, FprZyFishDicVo> distinctMap = new LinkedHashMap<>();
|
||||
for (FprZyFishDicVo item : list) {
|
||||
distinctMap.putIfAbsent(StrUtil.blankToDefault(item.getZyFishId(), item.getId()), item);
|
||||
}
|
||||
resultList = new ArrayList<>(distinctMap.values());
|
||||
} else {
|
||||
resultList = new ArrayList<>(list);
|
||||
}
|
||||
|
||||
int startIndex = loadOptions == null || loadOptions.getSkip() == null ? 0 : Math.max(loadOptions.getSkip(), 0);
|
||||
fillZyFishRvcdNames(resultList, rvcd);
|
||||
for (int i = 0; i < resultList.size(); i++) {
|
||||
FprZyFishDicVo item = resultList.get(i);
|
||||
item.setIndex(i + 1);
|
||||
item.setIndex(startIndex + i + 1);
|
||||
item.setSpawnMonth(formatSpawnMonth(item.getSpawnMonth()));
|
||||
if (StrUtil.isBlank(rvcd)) {
|
||||
List<String> rvcdList = rvcdMap.getOrDefault(
|
||||
StrUtil.blankToDefault(item.getZyFishId(), item.getId()),
|
||||
new ArrayList<>()
|
||||
).stream().filter(StrUtil::isNotBlank).distinct().toList();
|
||||
List<String> rvcdNames = new ArrayList<>();
|
||||
for (String rvcdItem : rvcdList) {
|
||||
String rvcdName = rvcdNameMap.get(rvcdItem);
|
||||
if (StrUtil.isNotBlank(rvcdName)) {
|
||||
rvcdNames.add(rvcdName);
|
||||
}
|
||||
}
|
||||
item.setRvcdName(String.join(",", rvcdNames));
|
||||
} else {
|
||||
item.setRvcdName(rvcdNameMap.get(item.getRvcd()));
|
||||
}
|
||||
}
|
||||
|
||||
DataSourceResult<FprZyFishDicVo> result = new DataSourceResult<>();
|
||||
result.setTotal((long) resultList.size());
|
||||
result.setData(paginateZyFishDicList(resultList, loadOptions));
|
||||
result.setTotal(page != null ? page.getTotal() : resultList.size());
|
||||
result.setData(resultList);
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
@ -335,7 +336,7 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
"NVL(alongBase.ORDER_INDEX, 999999) AS rvcdStepSort, " +
|
||||
"NVL(engSort.SORT, 999999) AS rstcdStepSort, " +
|
||||
"NVL(siteSort.SORT, NVL(src.ORDER_INDEX, 999999)) AS siteStepSort " +
|
||||
"FROM SD_FPRD_B_H src " +
|
||||
"FROM SD_AIMONITOR_B_H src " +
|
||||
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = src.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = src.BASE_ID AND NVL(hb.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN SD_HBRV_DIC hbrv ON hbrv.HBRVCD = src.HBRVCD " +
|
||||
@ -371,13 +372,13 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
private String buildFprdRunDataInfoSql(FprdRunDataAo ao) {
|
||||
StringBuilder sql = new StringBuilder("SELECT ")
|
||||
.append("NVL((SELECT COUNT(1) ")
|
||||
.append(" FROM SD_FPRD_B_H baseCnt ")
|
||||
.append(" FROM SD_AIMONITOR_B_H baseCnt ")
|
||||
.append(" WHERE NVL(baseCnt.IS_DELETED, 0) = 0 ")
|
||||
.append(" AND baseCnt.STTP = 'FPRD' ")
|
||||
.append(" AND baseCnt.BASE_ID = #{map.baseId}), 0) AS fprdCount, ")
|
||||
.append("NVL((SELECT COUNT(DISTINCT fish.NAME) ")
|
||||
.append(" FROM SD_FPRD_R run ")
|
||||
.append(" INNER JOIN SD_FPRD_B_H base ON base.STCD = run.STCD ")
|
||||
.append(" INNER JOIN SD_AIMONITOR_B_H base ON base.STCD = run.STCD ")
|
||||
.append(" AND NVL(base.IS_DELETED, 0) = 0 ")
|
||||
.append(" AND base.STTP = 'FPRD' ")
|
||||
.append(" INNER JOIN SD_FPRDFISH_R fish ON fish.FPRDR_ID = run.ID ")
|
||||
@ -391,7 +392,7 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
sql.append("), 0) AS ftpCount, ")
|
||||
.append("NVL((SELECT COUNT(1) ")
|
||||
.append(" FROM SD_FPRD_R run ")
|
||||
.append(" INNER JOIN SD_FPRD_B_H base ON base.STCD = run.STCD ")
|
||||
.append(" INNER JOIN SD_AIMONITOR_B_H base ON base.STCD = run.STCD ")
|
||||
.append(" AND NVL(base.IS_DELETED, 0) = 0 ")
|
||||
.append(" AND base.STTP = 'FPRD' ")
|
||||
.append(" INNER JOIN SD_FPRDFISH_R fish ON fish.FPRDR_ID = run.ID ")
|
||||
@ -414,7 +415,7 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
.append("TO_NUMBER(TO_CHAR(run.TM, 'MM')) AS month, ")
|
||||
.append("TO_NUMBER(TO_CHAR(run.TM, 'YYYY')) AS year ")
|
||||
.append("FROM SD_FPRD_R run ")
|
||||
.append("INNER JOIN SD_FPRD_B_H base ON base.STCD = run.STCD ")
|
||||
.append("INNER JOIN SD_AIMONITOR_B_H base ON base.STCD = run.STCD ")
|
||||
.append(" AND NVL(base.IS_DELETED, 0) = 0 ")
|
||||
.append(" AND base.STTP = 'FPRD' ")
|
||||
.append("INNER JOIN SD_FPRDFISH_R fish ON fish.FPRDR_ID = run.ID ")
|
||||
@ -430,6 +431,171 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
return sql.toString();
|
||||
}
|
||||
|
||||
private String buildFprdDetailBaseSql() {
|
||||
return "SELECT " +
|
||||
"run.STCD AS stcd, " +
|
||||
"base.STNM AS stnm, " +
|
||||
"run.TM AS tm, " +
|
||||
"run.FLPTH AS fid, " +
|
||||
"fish.NAME AS name, " +
|
||||
"fish.NUM AS num, " +
|
||||
"fish.FSZ AS fsz, " +
|
||||
"fish.WEIGHT AS weight " +
|
||||
"FROM SD_FPRD_R run " +
|
||||
"INNER JOIN SD_AIMONITOR_B_H base ON run.STCD = base.STCD " +
|
||||
" AND base.STTP = 'FPRD' " +
|
||||
" AND NVL(base.IS_DELETED, 0) = 0 " +
|
||||
"INNER JOIN SD_FPRDFISH_R fish ON run.ID = fish.FPRDR_ID " +
|
||||
" AND NVL(fish.IS_DELETED, 0) = 0 " +
|
||||
"WHERE NVL(run.IS_DELETED, 0) = 0 ";
|
||||
}
|
||||
|
||||
private String buildFprdDetailSelectSql(List<String> selectFields) {
|
||||
LinkedHashMap<String, String> columnMap = new LinkedHashMap<>();
|
||||
columnMap.put("stcd", "t.stcd AS stcd");
|
||||
columnMap.put("stnm", "t.stnm AS stnm");
|
||||
columnMap.put("tm", "t.tm AS tm");
|
||||
columnMap.put("fid", "t.fid AS fid");
|
||||
columnMap.put("name", "t.name AS name");
|
||||
columnMap.put("num", "t.num AS num");
|
||||
columnMap.put("fsz", "t.fsz AS fsz");
|
||||
columnMap.put("weight", "t.weight AS weight");
|
||||
if (CollUtil.isEmpty(selectFields)) {
|
||||
return String.join(", ", columnMap.values());
|
||||
}
|
||||
List<String> columns = new ArrayList<>();
|
||||
for (String field : selectFields) {
|
||||
String column = columnMap.get(field);
|
||||
if (StrUtil.isNotBlank(column)) {
|
||||
columns.add(column);
|
||||
}
|
||||
}
|
||||
return columns.isEmpty() ? String.join(", ", columnMap.values()) : String.join(", ", columns);
|
||||
}
|
||||
|
||||
private String buildFprdDetailFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
if (filter == null) {
|
||||
return "";
|
||||
}
|
||||
if (StrUtil.isNotBlank(filter.getField())) {
|
||||
return buildFprdDetailLeafCondition(filter, paramMap, indexHolder);
|
||||
}
|
||||
if (CollUtil.isEmpty(filter.getFilters())) {
|
||||
return "";
|
||||
}
|
||||
List<String> conditions = new ArrayList<>();
|
||||
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||
String childSql = buildFprdDetailFilterCondition(child, paramMap, indexHolder);
|
||||
if (StrUtil.isNotBlank(childSql)) {
|
||||
conditions.add("(" + childSql + ")");
|
||||
}
|
||||
}
|
||||
if (conditions.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
String logic = "or".equalsIgnoreCase(filter.getLogic()) ? " OR " : " AND ";
|
||||
return String.join(logic, conditions);
|
||||
}
|
||||
|
||||
private String buildFprdDetailLeafCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
String field = filter.getField();
|
||||
Object value = filter.getValue();
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
String key = "fprdDetailP" + indexHolder[0]++;
|
||||
return switch (field) {
|
||||
case "stcd" -> {
|
||||
paramMap.put(key, String.valueOf(value));
|
||||
yield "t.stcd = #{map." + key + "}";
|
||||
}
|
||||
case "name" -> {
|
||||
paramMap.put(key, "%" + value + "%");
|
||||
yield "t.name LIKE #{map." + key + "}";
|
||||
}
|
||||
case "startTime" -> {
|
||||
Date date = parseFprdDate(value);
|
||||
if (date == null) {
|
||||
yield "";
|
||||
}
|
||||
paramMap.put(key, date);
|
||||
yield "t.tm >= #{map." + key + "}";
|
||||
}
|
||||
case "endTime" -> {
|
||||
Date date = parseFprdDate(value);
|
||||
if (date == null) {
|
||||
yield "";
|
||||
}
|
||||
paramMap.put(key, date);
|
||||
yield "t.tm <= #{map." + key + "}";
|
||||
}
|
||||
case "tm" -> {
|
||||
Date date = parseFprdDate(value);
|
||||
if (date == null) {
|
||||
yield "";
|
||||
}
|
||||
paramMap.put(key, date);
|
||||
String operator = StrUtil.blankToDefault(filter.getOperator(), "eq").toLowerCase();
|
||||
yield switch (operator) {
|
||||
case "gte" -> "t.tm >= #{map." + key + "}";
|
||||
case "lte" -> "t.tm <= #{map." + key + "}";
|
||||
case "gt" -> "t.tm > #{map." + key + "}";
|
||||
case "lt" -> "t.tm < #{map." + key + "}";
|
||||
default -> "t.tm = #{map." + key + "}";
|
||||
};
|
||||
}
|
||||
default -> "";
|
||||
};
|
||||
}
|
||||
|
||||
private String buildFprdDetailOrderBySql(List<DataSourceRequest.SortDescriptor> sorts) {
|
||||
if (CollUtil.isEmpty(sorts)) {
|
||||
return " ORDER BY t.tm DESC";
|
||||
}
|
||||
List<String> orderParts = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sort : sorts) {
|
||||
String column = switch (sort.getField()) {
|
||||
case "stcd" -> "t.stcd";
|
||||
case "stnm" -> "t.stnm";
|
||||
case "tm" -> "t.tm";
|
||||
case "name" -> "t.name";
|
||||
case "num" -> "t.num";
|
||||
case "fsz" -> "t.fsz";
|
||||
case "weight" -> "t.weight";
|
||||
default -> "";
|
||||
};
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
orderParts.add(column + ("desc".equalsIgnoreCase(sort.getDir()) ? " DESC" : " ASC"));
|
||||
}
|
||||
return orderParts.isEmpty() ? " ORDER BY t.tm DESC" : " ORDER BY " + String.join(", ", orderParts);
|
||||
}
|
||||
|
||||
private Date parseFprdDate(Object value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
if (value instanceof Date date) {
|
||||
return date;
|
||||
}
|
||||
String text = String.valueOf(value);
|
||||
if (StrUtil.isBlank(text)) {
|
||||
return null;
|
||||
}
|
||||
if (text.length() == 10) {
|
||||
return DateUtil.parse(text, "yyyy-MM-dd");
|
||||
}
|
||||
if (text.length() == 16) {
|
||||
return DateUtil.parse(text, "yyyy-MM-dd HH:mm");
|
||||
}
|
||||
return DateUtil.parse(text, "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
private void validateFprdRunDataAo(FprdRunDataAo ao) {
|
||||
if (ao == null) {
|
||||
throw new BizException("请求参数不能为空.");
|
||||
@ -519,6 +685,7 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
"NVL(src.IS_DELETED, 0) AS isDeleted, " +
|
||||
"CASE WHEN rel.ZY_FISH_ID IS NULL THEN src.ID ELSE rel.ZY_FISH_ID END AS zyFishId, " +
|
||||
"CASE WHEN rel.RVCD IS NULL THEN 'null' ELSE rel.RVCD END AS rvcd, " +
|
||||
"rv.RVNM AS rvcdName, " +
|
||||
"src.NAME AS name, " +
|
||||
"src.TYPE AS type, " +
|
||||
"src.FAMILY AS family, " +
|
||||
@ -549,15 +716,108 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
"src.LOGO AS logo, " +
|
||||
"src.INFFILE AS inffile, " +
|
||||
"src.ORDERS, \n" +
|
||||
"src.VLSR, \n"+
|
||||
"src.VLSR AS vlsr, \n" +
|
||||
"src.VLSR_TM AS vlsrTm, \n" +
|
||||
"src.SPAWN_MONTH AS spawnMonth " +
|
||||
"FROM SD_FISHDICTORY_B src " +
|
||||
"LEFT JOIN SD_FISHDICTORY_RLTN_B rel ON src.ID = rel.ZY_FISH_ID " +
|
||||
" AND rel.RVCD <> 'ZY' " +
|
||||
" AND NVL(rel.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = rel.RVCD " +
|
||||
"WHERE NVL(src.IS_DELETED, 0) = 0 ";
|
||||
}
|
||||
|
||||
private String buildZyFishDicSummarySql() {
|
||||
return "SELECT " +
|
||||
"src.ID AS id, " +
|
||||
"NVL(src.IS_DELETED, 0) AS isDeleted, " +
|
||||
"src.ID AS zyFishId, " +
|
||||
"NVL(relAgg.rvcd, 'null') AS rvcd, " +
|
||||
"NVL(relAgg.rvcdName, '') AS rvcdName, " +
|
||||
"src.NAME AS name, " +
|
||||
"src.TYPE AS type, " +
|
||||
"src.FAMILY AS family, " +
|
||||
"src.GENUS AS genus, " +
|
||||
"src.SPECIES AS species, " +
|
||||
"src.NAME_EN AS nameEn, " +
|
||||
"src.ALIAS AS alias, " +
|
||||
"src.FSZ AS fsz, " +
|
||||
"src.SHAPEDESC AS shapedesc, " +
|
||||
"src.HABITATION AS habitation, " +
|
||||
"src.HABIT_MIGRAT AS habitMigrat, " +
|
||||
"src.FEEDING_HABIT AS feedingHabit, " +
|
||||
"src.FOOD AS food, " +
|
||||
"src.TIME_FEED AS timeFeed, " +
|
||||
"src.ORIGN_DATE AS orignDate, " +
|
||||
"CAST(NULL AS VARCHAR2(255)) AS filterContent, " +
|
||||
"src.PRETEMP AS pretemp, " +
|
||||
"src.FLOW_RATE AS flowRate, " +
|
||||
"src.DEPTH AS depth, " +
|
||||
"src.WQTQ AS wqtq, " +
|
||||
"src.SPAWN_CHARACT AS spawnCharact, " +
|
||||
"src.BOTM_MATER AS botmMater, " +
|
||||
"src.PTYPE AS ptype, " +
|
||||
"CASE src.PTYPE WHEN 1 THEN '濒危' WHEN 2 THEN '极危' WHEN 3 THEN '近危' WHEN 4 THEN '易危' WHEN 5 THEN '重点保护' WHEN 6 THEN '无危' WHEN 7 THEN '国家二级' WHEN 8 THEN '市二级保护' ELSE '未知' END AS ptypeName, " +
|
||||
"src.SPEC_ORIGIN AS specOrigin, " +
|
||||
"CASE WHEN src.SPEC_ORIGIN = 1 THEN '本土物种' WHEN src.SPEC_ORIGIN = 2 THEN '外来物种' ELSE NULL END AS specOriginName, " +
|
||||
"src.DESCRIPTION AS description, " +
|
||||
"src.LOGO AS logo, " +
|
||||
"src.INFFILE AS inffile, " +
|
||||
"src.ORDERS, " +
|
||||
"src.VLSR AS vlsr, " +
|
||||
"src.VLSR_TM AS vlsrTm, " +
|
||||
"src.SPAWN_MONTH AS spawnMonth " +
|
||||
"FROM SD_FISHDICTORY_B src " +
|
||||
"LEFT JOIN ( " +
|
||||
" SELECT relBase.ZY_FISH_ID AS zyFishId, " +
|
||||
" MIN(relBase.RVCD) AS rvcd, " +
|
||||
" LISTAGG(relBase.RVNM, ',') WITHIN GROUP (ORDER BY relBase.RVNM) AS rvcdName " +
|
||||
" FROM ( " +
|
||||
" SELECT DISTINCT rel.ZY_FISH_ID, rel.RVCD, rv.RVNM " +
|
||||
" FROM SD_FISHDICTORY_RLTN_B rel " +
|
||||
" LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = rel.RVCD " +
|
||||
" WHERE rel.RVCD <> 'ZY' " +
|
||||
" AND NVL(rel.IS_DELETED, 0) = 0 " +
|
||||
" AND rv.RVNM IS NOT NULL " +
|
||||
" ) relBase " +
|
||||
" GROUP BY relBase.ZY_FISH_ID " +
|
||||
") relAgg ON relAgg.zyFishId = src.ID " +
|
||||
"WHERE NVL(src.IS_DELETED, 0) = 0 ";
|
||||
}
|
||||
|
||||
private void fillZyFishRvcdNames(List<FprZyFishDicVo> list, String rvcdFilter) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
if (StrUtil.isNotBlank(rvcdFilter)) {
|
||||
for (FprZyFishDicVo item : list) {
|
||||
if (item != null && StrUtil.isBlank(item.getRvcdName()) && StrUtil.isNotBlank(item.getRvcd()) && !"null".equalsIgnoreCase(item.getRvcd())) {
|
||||
item.setRvcdName(querySingleRvcdName(item.getRvcd()));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (FprZyFishDicVo item : list) {
|
||||
if (item != null && item.getRvcdName() == null) {
|
||||
item.setRvcdName("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String querySingleRvcdName(String rvcd) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("rvcd", rvcd);
|
||||
List<Map<String, Object>> rows = microservicDynamicSQLMapper.getAllList(
|
||||
"SELECT RVNM AS rvcdName FROM SD_RVCD_DIC WHERE RVCD = #{map.rvcd} AND ROWNUM = 1",
|
||||
paramMap
|
||||
);
|
||||
if (CollUtil.isEmpty(rows)) {
|
||||
return null;
|
||||
}
|
||||
Object value = rows.get(0).get("RVCDNAME");
|
||||
return value == null ? null : String.valueOf(value);
|
||||
}
|
||||
|
||||
private String buildMsstbprptDetailSelectSql(List<String> selectFields) {
|
||||
LinkedHashMap<String, String> columnMap = buildMsstbprptSelectColumnMap();
|
||||
if (CollUtil.isEmpty(selectFields)) {
|
||||
@ -1164,6 +1424,7 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
case "isDeleted" -> "t.isDeleted";
|
||||
case "zyFishId" -> "t.zyFishId";
|
||||
case "rvcd" -> "t.rvcd";
|
||||
case "rvcdName" -> "t.rvcdName";
|
||||
case "name" -> "t.name";
|
||||
case "type" -> "t.type";
|
||||
case "family" -> "t.family";
|
||||
@ -1192,26 +1453,33 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
case "logo" -> "t.logo";
|
||||
case "inffile" -> "t.inffile";
|
||||
case "spawnMonth" -> "t.spawnMonth";
|
||||
case "orders" -> "t.orders";
|
||||
case "vlsr" -> "t.vlsr";
|
||||
case "vlsrTm" -> "t.vlsrTm";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private List<FprZyFishDicVo> paginateZyFishDicList(List<FprZyFishDicVo> resultList, DataSourceLoadOptionsBase loadOptions) {
|
||||
if (CollUtil.isEmpty(resultList) || loadOptions == null || loadOptions.getTake() == null || loadOptions.getTake() <= 0) {
|
||||
return resultList;
|
||||
private String buildZyFishDicOrderBySql(List<DataSourceRequest.SortDescriptor> sorts) {
|
||||
List<String> orderItems = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(sorts)) {
|
||||
for (DataSourceRequest.SortDescriptor sort : sorts) {
|
||||
if (sort == null || StrUtil.isBlank(sort.getField())) {
|
||||
continue;
|
||||
}
|
||||
int page = loadOptions.getSkip() == null ? 1 : loadOptions.getSkip(); // 页码从1开始,缺省为1
|
||||
// 如果页码 ≤ 0,强制设为1(避免负值)
|
||||
if (page < 1) {
|
||||
page = 1;
|
||||
String column = mapZyFishDicColumn(sort.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
int size = loadOptions.getTake();
|
||||
int start = (page - 1) * size;
|
||||
int end = Math.min(start + size, resultList.size());
|
||||
if (start >= resultList.size()) {
|
||||
return new ArrayList<>();
|
||||
String direction = "desc".equalsIgnoreCase(sort.getDir()) || "des".equalsIgnoreCase(sort.getDir())
|
||||
? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + direction + " NULLS LAST");
|
||||
}
|
||||
return new ArrayList<>(resultList.subList(start, end));
|
||||
}
|
||||
if (orderItems.isEmpty()) {
|
||||
return " ORDER BY t.rvcd ASC NULLS LAST, t.name ASC";
|
||||
}
|
||||
return " ORDER BY " + String.join(", ", orderItems);
|
||||
}
|
||||
|
||||
private String formatSpawnMonth(String input) {
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package com.yfd.platform.qgc_env.overview.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_env.overview.service.OverviewService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/overview")
|
||||
@Tag(name = "首页概览")
|
||||
@Validated
|
||||
public class OverviewController {
|
||||
|
||||
@Resource
|
||||
private OverviewService overviewService;
|
||||
|
||||
@PostMapping("/msstbprpt/GetKendoList")
|
||||
@Operation(summary = "首页基础设施概览列表")
|
||||
public ResponseResult getMsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(overviewService.getMsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/oped/GetKendoListCust")
|
||||
@Operation(summary = "首页环保设施运行状况明细")
|
||||
public ResponseResult getOpedList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(overviewService.getOpedList(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.yfd.platform.qgc_env.overview.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "首页基础设施概览列表")
|
||||
public class OverviewMsstbprptVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
private String stcd;
|
||||
private String stnm;
|
||||
private String sttp;
|
||||
private String sttpCode;
|
||||
private String sttpName;
|
||||
private String sttpFullPath;
|
||||
private Integer sttpTreeLevel;
|
||||
private String blprdId;
|
||||
private Double lgtd;
|
||||
private Double lttd;
|
||||
private Double dtmel;
|
||||
private String stlc;
|
||||
private Integer usfl;
|
||||
private String rstcd;
|
||||
private String ennm;
|
||||
private String baseId;
|
||||
private String baseName;
|
||||
private String hbrvcd;
|
||||
private String hbrvcdName;
|
||||
private String rvcd;
|
||||
private String rvcdName;
|
||||
private String addvcd;
|
||||
private String addvcdName;
|
||||
private String country;
|
||||
private String countryName;
|
||||
private String stCode;
|
||||
private String stName;
|
||||
private Date stdsdt;
|
||||
private Date pststdt;
|
||||
private Date pesstdt;
|
||||
private Date ststdt;
|
||||
private Date jcdt;
|
||||
private Date stwddt;
|
||||
private String introduce;
|
||||
private String precis;
|
||||
private String logo;
|
||||
private String inffile;
|
||||
private Integer dtin;
|
||||
private String dtinName;
|
||||
private Date dtinTm;
|
||||
private Integer bldsttCode;
|
||||
private String bldsttCcode;
|
||||
private String bldsttCcodeName;
|
||||
private Double inv;
|
||||
private Integer invinmn;
|
||||
private String dsun;
|
||||
private String jbtxcs;
|
||||
private Integer dtfrqcy;
|
||||
private String remark;
|
||||
private String vlsr;
|
||||
private Date vlsrTm;
|
||||
private Integer orderIndex;
|
||||
private Integer baseStepSort;
|
||||
private Integer rvcdStepSort;
|
||||
private Integer rstcdStepSort;
|
||||
private Integer siteStepSort;
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.yfd.platform.qgc_env.overview.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "首页环保设施运行状况明细")
|
||||
public class OverviewOpedVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Map<String, Object> _tls = new HashMap<>();
|
||||
|
||||
private String id;
|
||||
private String recordUser;
|
||||
private Date recordTime;
|
||||
private Date modifyTime;
|
||||
private String displayRecordUser;
|
||||
private String repCode;
|
||||
private String pcode;
|
||||
private String pname;
|
||||
private String psttpName;
|
||||
private String sttpName;
|
||||
private String baseId;
|
||||
private String stcd;
|
||||
private String stnm;
|
||||
private String sttpCode;
|
||||
private String baseName;
|
||||
private String rstcd;
|
||||
private String ennm;
|
||||
private String bldsttCcode;
|
||||
private String bldsttCcodeName;
|
||||
private Date dtinTm;
|
||||
private Integer dtin;
|
||||
private String dtinName;
|
||||
private Integer runState;
|
||||
private String runStateName;
|
||||
private Integer stdState;
|
||||
private String stdStateName;
|
||||
private Integer stdSstate;
|
||||
private String stdSstateName;
|
||||
private Integer runSstate;
|
||||
private String runSstateName;
|
||||
private Integer mway;
|
||||
private String mwayName;
|
||||
private String hbrvcd;
|
||||
private String hbrvcdName;
|
||||
private String addvcdName;
|
||||
private String rvcdName;
|
||||
private Integer baseStepSort;
|
||||
private Integer baseStepsort;
|
||||
private Integer rvcdStepSort;
|
||||
private Integer rstcdStepSort;
|
||||
private Integer rstcdStepsort;
|
||||
private Integer siteStepSort;
|
||||
private Integer count;
|
||||
private Date jcdt;
|
||||
private String departmentId;
|
||||
private String displayDepartment;
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.yfd.platform.qgc_env.overview.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_env.overview.entity.vo.OverviewMsstbprptVo;
|
||||
import com.yfd.platform.qgc_env.overview.entity.vo.OverviewOpedVo;
|
||||
|
||||
public interface OverviewService {
|
||||
|
||||
DataSourceResult<OverviewMsstbprptVo> getMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<OverviewOpedVo> getOpedList(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1738,7 +1738,7 @@ public class VpConstructionServiceImpl implements VpConstructionService {
|
||||
columnMap.put("runState", "vp.RUN_STATE");
|
||||
columnMap.put("runStateName", "CASE NVL(vp.RUN_STATE, -1) WHEN 1 THEN '运行' WHEN 0 THEN '未运行' ELSE NULL END");
|
||||
columnMap.put("baseStepSort", "hb.ORDER_INDEX");
|
||||
columnMap.put("rvcdStepSort", "hbrv.ORDER_INDEX");
|
||||
// columnMap.put("rvcdStepSort", "hbrv.ORDER_INDEX");
|
||||
columnMap.put("rstcdStepSort", "eng.ORDER_INDEX");
|
||||
columnMap.put("siteStepSort", "vp.ORDER_INDEX");
|
||||
return columnMap.get(field);
|
||||
|
||||
@ -47,6 +47,24 @@ public class VdMonitorController {
|
||||
return ResponseResult.successData(vdMonitorService.getKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/tree/GetKendoListCust")
|
||||
@Operation(summary = "视频站树级结构查询")
|
||||
public ResponseResult getVdTreeKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(vdMonitorService.getVdTreeKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/tree/GetKendoListCustSt")
|
||||
@Operation(summary = "视频站树级结构查询-站点维度")
|
||||
public ResponseResult getVdTreeKendoListCustSt(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(vdMonitorService.getVdTreeKendoListCustSt(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/vdpoint/GetKendoListCust")
|
||||
@Operation(summary = "视频站锚点接口")
|
||||
public ResponseResult getVdPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(vdMonitorService.getVdPointKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/runData/GetKendoListCust")
|
||||
@Operation(summary = "查询视频监控运行数据")
|
||||
public ResponseResult getRunDataKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
|
||||
@ -0,0 +1,86 @@
|
||||
package com.yfd.platform.qgc_env.vd.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "视频站锚点信息")
|
||||
public class VdPointVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "视频站子站类")
|
||||
private String sttp;
|
||||
|
||||
@Schema(description = "视频站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private BigDecimal lttd;
|
||||
|
||||
@Schema(description = "高程")
|
||||
private BigDecimal dtmel;
|
||||
|
||||
@Schema(description = "锚点状态")
|
||||
private String anchoPointState;
|
||||
|
||||
@Schema(description = "站类地图标识")
|
||||
private String sttpMap;
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String titleName;
|
||||
|
||||
@Schema(description = "默认距离")
|
||||
private Integer distance;
|
||||
|
||||
@Schema(description = "流域编码")
|
||||
private String rvcd;
|
||||
|
||||
@Schema(description = "行政区编码")
|
||||
private String addvcd;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcds;
|
||||
|
||||
@Schema(description = "站类编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "视频站名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "流域名称")
|
||||
private String rvnm;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "栖息地编码")
|
||||
private String fhstcd;
|
||||
|
||||
@Schema(description = "栖息地名称")
|
||||
private String fhstnm;
|
||||
|
||||
@Schema(description = "站类名称")
|
||||
private String sttpName;
|
||||
|
||||
@Schema(description = "站址")
|
||||
private String stlc;
|
||||
|
||||
@Schema(description = "播放方式")
|
||||
private String playWay;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
|
||||
@Schema(description = "基地流域编码")
|
||||
private String hbrvcd;
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.yfd.platform.qgc_env.vd.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "视频站树节点")
|
||||
public class VdTreeNodeVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "节点ID")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "节点名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "节点类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "节点类型名称")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "排序值")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "父节点ID")
|
||||
private String parentId;
|
||||
|
||||
@Schema(description = "父节点名称")
|
||||
private String parentName;
|
||||
|
||||
@Schema(description = "是否有子节点")
|
||||
private Integer hasChildren;
|
||||
|
||||
@Schema(description = "播放地址")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "播放方式")
|
||||
private String playWay;
|
||||
|
||||
@Schema(description = "设备序列号")
|
||||
private String deviceSerial;
|
||||
|
||||
@Schema(description = "接入方式")
|
||||
private String accessWay;
|
||||
|
||||
@Schema(description = "流协议")
|
||||
private String protocol;
|
||||
|
||||
@Schema(description = "清晰度")
|
||||
private String quality;
|
||||
|
||||
@Schema(description = "控制方式")
|
||||
private String controlMode;
|
||||
|
||||
@Schema(description = "设备状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "状态时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date statusTm;
|
||||
|
||||
@Schema(description = "子节点")
|
||||
private List<VdTreeNodeVo> children;
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.yfd.platform.qgc_env.vd.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class VdTreeRowVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String stcd;
|
||||
private String stCode;
|
||||
private String stName;
|
||||
private String stnm;
|
||||
private String sttpCode;
|
||||
private String sttpName;
|
||||
private String sttpFullPath;
|
||||
private String rstcd;
|
||||
private String ennm;
|
||||
private String baseId;
|
||||
private String baseName;
|
||||
private String url;
|
||||
private String playWay;
|
||||
private Integer baseSort;
|
||||
private Integer rstcdStepSort;
|
||||
private Integer siteStepSort;
|
||||
private String deviceSerial;
|
||||
private String accessWay;
|
||||
private String protocol;
|
||||
private String quality;
|
||||
private String controlMode;
|
||||
private Integer status;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date statusTm;
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.yfd.platform.qgc_env.vd.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdTreeNodeVo;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdRunDataVo;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdVmsstbprptVo;
|
||||
|
||||
@ -13,5 +14,11 @@ public interface VdMonitorService {
|
||||
|
||||
DataSourceResult<VdRunDataVo> getKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<VdTreeNodeVo> getVdTreeKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<VdTreeNodeVo> getVdTreeKendoListCustSt(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<?> getVdPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<VdRunDataVo> getRunDataKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
|
||||
@ -9,7 +9,10 @@ import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.GroupHelper;
|
||||
import com.yfd.platform.common.GroupingInfo;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdPointVo;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdRunDataVo;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdTreeNodeVo;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdTreeRowVo;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdVmsstbprptVo;
|
||||
import com.yfd.platform.qgc_env.vd.service.VdMonitorService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
@ -18,6 +21,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@ -118,6 +122,113 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
return queryLatestRunDataGroupList(dataSourceRequest, loadOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<VdTreeNodeVo> getVdTreeKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildVdTreeFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append("t.stcd AS stcd, ")
|
||||
.append("t.stCode AS stCode, ")
|
||||
.append("t.stName AS stName, ")
|
||||
.append("t.stnm AS stnm, ")
|
||||
.append("t.sttpCode AS sttpCode, ")
|
||||
.append("t.sttpName AS sttpName, ")
|
||||
.append("t.sttpFullPath AS sttpFullPath, ")
|
||||
.append("t.rstcd AS rstcd, ")
|
||||
.append("t.ennm AS ennm, ")
|
||||
.append("t.baseId AS baseId, ")
|
||||
.append("t.baseName AS baseName, ")
|
||||
.append("t.url AS url, ")
|
||||
.append("t.playWay AS playWay, ")
|
||||
.append("t.baseSort AS baseSort, ")
|
||||
.append("t.rstcdStepSort AS rstcdStepSort, ")
|
||||
.append("t.siteStepSort AS siteStepSort, ")
|
||||
.append("t.deviceSerial AS deviceSerial, ")
|
||||
.append("t.accessWay AS accessWay, ")
|
||||
.append("t.protocol AS protocol, ")
|
||||
.append("t.quality AS quality, ")
|
||||
.append("t.controlMode AS controlMode, ")
|
||||
.append("t.status AS status, ")
|
||||
.append("t.statusTm AS statusTm ")
|
||||
.append("FROM (")
|
||||
.append(buildVdTreeCoreSql())
|
||||
.append(") t WHERE 1 = 1 AND t.sttpCode != 'VD_FPRD'");
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
sql.append(" ORDER BY t.baseSort ASC NULLS LAST, t.rstcdStepSort ASC NULLS LAST, t.siteStepSort ASC NULLS LAST, t.stcd ASC");
|
||||
|
||||
List<VdTreeRowVo> rows = microservicDynamicSQLMapper.getAllListWithResultType(sql.toString(), paramMap, VdTreeRowVo.class);
|
||||
boolean baseScoped = containsNonBlankFilterValue(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), "baseId");
|
||||
|
||||
DataSourceResult<VdTreeNodeVo> result = new DataSourceResult<>();
|
||||
List<VdTreeNodeVo> treeData = buildVdTreeNodes(rows, baseScoped);
|
||||
result.setData(treeData);
|
||||
result.setTotal((long) treeData.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<VdTreeNodeVo> getVdTreeKendoListCustSt(DataSourceRequest dataSourceRequest) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildVdTreeFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append("t.stcd AS stcd, ")
|
||||
.append("t.stCode AS stCode, ")
|
||||
.append("t.stName AS stName, ")
|
||||
.append("t.stnm AS stnm, ")
|
||||
.append("t.sttpCode AS sttpCode, ")
|
||||
.append("t.sttpName AS sttpName, ")
|
||||
.append("t.sttpFullPath AS sttpFullPath, ")
|
||||
.append("t.rstcd AS rstcd, ")
|
||||
.append("t.ennm AS ennm, ")
|
||||
.append("t.baseId AS baseId, ")
|
||||
.append("t.baseName AS baseName, ")
|
||||
.append("t.url AS url, ")
|
||||
.append("t.playWay AS playWay, ")
|
||||
.append("t.baseSort AS baseSort, ")
|
||||
.append("t.rstcdStepSort AS rstcdStepSort, ")
|
||||
.append("t.siteStepSort AS siteStepSort, ")
|
||||
.append("t.deviceSerial AS deviceSerial, ")
|
||||
.append("t.accessWay AS accessWay, ")
|
||||
.append("t.protocol AS protocol, ")
|
||||
.append("t.quality AS quality, ")
|
||||
.append("t.controlMode AS controlMode, ")
|
||||
.append("t.status AS status, ")
|
||||
.append("t.statusTm AS statusTm ")
|
||||
.append("FROM (")
|
||||
.append(buildVdTreeCoreSql())
|
||||
.append(") t WHERE 1 = 1 ");
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
sql.append(" ORDER BY t.baseSort ASC NULLS LAST, t.rstcdStepSort ASC NULLS LAST, t.siteStepSort ASC NULLS LAST, t.stcd ASC");
|
||||
|
||||
List<VdTreeRowVo> rows = microservicDynamicSQLMapper.getAllListWithResultType(sql.toString(), paramMap, VdTreeRowVo.class);
|
||||
boolean baseScoped = containsNonBlankFilterValue(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), "baseId");
|
||||
|
||||
DataSourceResult<VdTreeNodeVo> result = new DataSourceResult<>();
|
||||
List<VdTreeNodeVo> treeData = buildVdTreeNodesByStation(rows, baseScoped);
|
||||
result.setData(treeData);
|
||||
result.setTotal((long) treeData.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<?> getVdPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
if (CollUtil.isNotEmpty(dataSourceRequest == null ? null : dataSourceRequest.getGroup())) {
|
||||
return getKendoListCust(dataSourceRequest);
|
||||
}
|
||||
return queryVdPointDetailList(dataSourceRequest, loadOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<VdRunDataVo> getRunDataKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
@ -131,9 +242,30 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
GroupingInfo[] groups,
|
||||
String filterSql,
|
||||
Map<String, Object> paramMap) {
|
||||
List<DataSourceRequest.GroupDescriptor> groupDescriptors = dataSourceRequest == null ? null : dataSourceRequest.getGroup();
|
||||
List<String> selectItems = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(groupDescriptors)) {
|
||||
for (DataSourceRequest.GroupDescriptor descriptor : groupDescriptors) {
|
||||
if (descriptor == null || StrUtil.isBlank(descriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapColumn(descriptor.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
selectItems.add(column + " AS " + descriptor.getField());
|
||||
selectItems.add("COUNT(1) AS count_" + descriptor.getField());
|
||||
}
|
||||
}
|
||||
if (selectItems.isEmpty()) {
|
||||
selectItems.add("t.sttpCode AS sttpCode");
|
||||
selectItems.add("COUNT(1) AS count_sttpCode");
|
||||
}
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT t.sttpCode AS sttpCode, COUNT(1) AS count_sttpCode ")
|
||||
.append("FROM (")
|
||||
sql.append("SELECT ")
|
||||
.append(String.join(", ", selectItems))
|
||||
.append(" FROM (")
|
||||
.append(buildVmsstbprptViewSql())
|
||||
.append(") t ")
|
||||
.append("WHERE 1 = 1 ");
|
||||
@ -141,8 +273,24 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
|
||||
List<String> groupByColumns = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(groupDescriptors)) {
|
||||
for (DataSourceRequest.GroupDescriptor descriptor : groupDescriptors) {
|
||||
if (descriptor == null || StrUtil.isBlank(descriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapColumn(descriptor.getField());
|
||||
if (StrUtil.isNotBlank(column)) {
|
||||
groupByColumns.add(column);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!groupByColumns.isEmpty()) {
|
||||
sql.append(" GROUP BY ").append(String.join(", ", groupByColumns));
|
||||
} else {
|
||||
sql.append(" GROUP BY t.sttpCode ");
|
||||
sql.append(buildOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getGroup()));
|
||||
}
|
||||
sql.append(buildOrderBySql(groupDescriptors));
|
||||
|
||||
List<Map<String, Object>> rows = microservicDynamicSQLMapper.pageAllList(null, sql.toString(), paramMap);
|
||||
DataSourceResult<VdVmsstbprptVo> result = new DataSourceResult<>();
|
||||
@ -294,6 +442,32 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
return queryRunDataGroupList(dataSourceRequest, loadOptions, buildLatestRunDataCoreSql());
|
||||
}
|
||||
|
||||
private DataSourceResult<VdPointVo> queryVdPointDetailList(DataSourceRequest dataSourceRequest,
|
||||
DataSourceLoadOptionsBase loadOptions) {
|
||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append(buildVdPointSelectSql())
|
||||
.append("FROM (")
|
||||
.append(buildVdPointCoreSql())
|
||||
.append(") t WHERE 1 = 1 ");
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
sql.append(buildVdPointOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||
|
||||
List<VdPointVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||
page, sql.toString(), paramMap, VdPointVo.class);
|
||||
DataSourceResult<VdPointVo> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(page != null ? page.getTotal() : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
private DataSourceResult<VdRunDataVo> queryRunDataGroupList(DataSourceRequest dataSourceRequest,
|
||||
DataSourceLoadOptionsBase loadOptions,
|
||||
String coreSql) {
|
||||
@ -418,12 +592,57 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
" AND NVL(sttp.IS_DELETED, 0) = 0 AND NVL(sttp.ENABLE, 1) = 1 ";
|
||||
}
|
||||
|
||||
private String buildVdTreeCoreSql() {
|
||||
return "SELECT " +
|
||||
"base.STCD AS stcd, " +
|
||||
"base.STNM AS stnm, " +
|
||||
"base.CSTCD AS stCode, " +
|
||||
"cst.STNM AS stName, " +
|
||||
"base.STTP AS sttpCode, " +
|
||||
"sttp.STTP_NAME AS sttpName, " +
|
||||
"sttp.FULL_PATH AS sttpFullPath, " +
|
||||
"base.RSTCD AS rstcd, " +
|
||||
"eng.ENNM AS ennm, " +
|
||||
"NVL(eng.BASE_ID, base.BASE_ID) AS baseId, " +
|
||||
"hb.BASENAME AS baseName, " +
|
||||
"base.URL AS url, " +
|
||||
"CASE WHEN base.URL IS NULL THEN NULL WHEN INSTR(base.URL, 'm3u8') > 0 THEN '1' ELSE '0' END AS playWay, " +
|
||||
"NVL(hb.ORDER_INDEX, 999999) AS baseSort, " +
|
||||
"NVL(eng.ORDER_INDEX, 999999) AS rstcdStepSort, " +
|
||||
"NVL(base.ORDER_INDEX, 999999) AS siteStepSort, " +
|
||||
"base.DEVICE_SERIAL AS deviceSerial, " +
|
||||
"base.ACCESS_WAY AS accessWay, " +
|
||||
"base.PROTOCOL AS protocol, " +
|
||||
"base.QUALITY AS quality, " +
|
||||
"base.CONTROL_MODE AS controlMode, " +
|
||||
"status.STATUS AS status, " +
|
||||
"status.TM AS statusTm " +
|
||||
"FROM (" + buildVdDeviceBaseSql() + ") base " +
|
||||
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = base.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = NVL(eng.BASE_ID, base.BASE_ID) " +
|
||||
" AND NVL(hb.IS_DELETED, 0) = 0 AND NVL(hb.ENABLED, 1) = 1 " +
|
||||
"LEFT JOIN (" + buildStationBaseSql() + ") cst ON cst.STCD = base.CSTCD " +
|
||||
"LEFT JOIN SD_STTP_B sttp ON sttp.STTP_CODE = base.STTP " +
|
||||
" AND NVL(sttp.IS_DELETED, 0) = 0 AND NVL(sttp.ENABLE, 1) = 1 " +
|
||||
"LEFT JOIN ( " +
|
||||
"SELECT detail.STCD, detail.TM, detail.STATUS " +
|
||||
"FROM MS_SBGZSTAT_B detail " +
|
||||
"INNER JOIN ( " +
|
||||
"SELECT STCD, MAX(TM) AS MAX_TM FROM MS_SBGZSTAT_B " +
|
||||
"WHERE NVL(IS_DELETED, 0) = 0 GROUP BY STCD " +
|
||||
") latest ON detail.STCD = latest.STCD AND detail.TM = latest.MAX_TM " +
|
||||
"WHERE NVL(detail.IS_DELETED, 0) = 0 " +
|
||||
") status ON status.STCD = base.STCD " +
|
||||
"WHERE base.STTP LIKE 'VD_%' ";
|
||||
}
|
||||
|
||||
private String buildVdDeviceBaseSql() {
|
||||
return "SELECT vd.STCD, vd.STNM, vd.MNTP, vd.STTP, vd.LGTD, vd.LTTD, vd.ELEV, vd.STLC, " +
|
||||
" vd.JCDT, vd.WDDT, vd.BLDSTT_CODE, vd.USFL, vd.DTIN, vd.STINDX, vd.RSTCD, vd.BASE_ID, " +
|
||||
" vd.HBRVCD, vd.RVCD, vd.ADDVCD, vd.CSTCD, vd.FHSTCD, CAST(NULL AS VARCHAR2(3000)) AS INTRODUCE, " +
|
||||
" CAST(NULL AS VARCHAR2(255)) AS LOGO, CAST(NULL AS VARCHAR2(1000)) AS INFFILE, " +
|
||||
" vd.DTFRQCY, vd.REMARK, vd.VLSR, vd.VLSR_TM, vd.URL AS URL, CAST(NULL AS NUMBER(8,0)) AS ORDER_INDEX, " +
|
||||
" vd.DTFRQCY, vd.REMARK, vd.VLSR, vd.VLSR_TM, vd.URL AS URL, vd.DEVICE_SERIAL, vd.ACCESS_WAY, " +
|
||||
" vd.PROTOCOL, vd.QUALITY, vd.CONTROL_MODE, CAST(NULL AS NUMBER(8,0)) AS ORDER_INDEX, " +
|
||||
" 'SD_VDINFO_B' AS SOURCE_TABLE " +
|
||||
"FROM SD_VDINFO_B vd WHERE 1=1 " +
|
||||
// " AND vd.STTP = 'VD_FP' "+
|
||||
@ -431,11 +650,59 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
"SELECT sonar.STCD, sonar.STNM, sonar.MNTP, sonar.STTP, sonar.LGTD, sonar.LTTD, sonar.ELEV, sonar.STLC, " +
|
||||
" sonar.JCDT, sonar.WDDT, sonar.BLDSTT_CODE, sonar.USFL, sonar.DTIN, sonar.STINDX, sonar.RSTCD, sonar.BASE_ID, " +
|
||||
" sonar.HBRVCD, sonar.RVCD, sonar.ADDVCD, CAST(NULL AS VARCHAR2(36)) AS CSTCD, CAST(NULL AS VARCHAR2(36)) AS FHSTCD, " +
|
||||
" sonar.INTRODUCE, sonar.LOGO, sonar.INFFILE, sonar.DTFRQCY, sonar.REMARK, sonar.VLSR, sonar.VLSR_TM, CAST(NULL AS VARCHAR2(512)) AS URL, sonar.ORDER_INDEX, " +
|
||||
" sonar.INTRODUCE, sonar.LOGO, sonar.INFFILE, sonar.DTFRQCY, sonar.REMARK, sonar.VLSR, sonar.VLSR_TM, CAST(NULL AS VARCHAR2(512)) AS URL, " +
|
||||
" CAST(NULL AS VARCHAR2(255)) AS DEVICE_SERIAL, CAST(NULL AS VARCHAR2(10)) AS ACCESS_WAY, " +
|
||||
" CAST(NULL AS VARCHAR2(50)) AS PROTOCOL, CAST(NULL AS VARCHAR2(50)) AS QUALITY, CAST(NULL AS VARCHAR2(2048)) AS CONTROL_MODE, sonar.ORDER_INDEX, " +
|
||||
" 'SD_SONAR_B_H' AS SOURCE_TABLE " +
|
||||
"FROM SD_SONAR_B_H sonar WHERE NVL(sonar.IS_DELETED, 0) = 0 AND sonar.STTP IN ('VD_WVD', 'VD_SN') ";
|
||||
}
|
||||
|
||||
private String buildVdPointCoreSql() {
|
||||
return "SELECT " +
|
||||
"src.STTP AS sttp, " +
|
||||
"src.STCD AS stcd, " +
|
||||
"src.LGTD AS lgtd, " +
|
||||
"src.LTTD AS lttd, " +
|
||||
"CAST(NULL AS NUMBER(10, 6)) AS dtmel, " +
|
||||
"CASE " +
|
||||
" WHEN NVL(eng.HBRVCD, src.HBRVCD) = 'SJLY126' THEN CASE src.STTP " +
|
||||
" WHEN 'VD_FBFM' THEN 'fbfm_spjk' " +
|
||||
" WHEN 'VD_EQS' THEN 'eqs_spjk' " +
|
||||
" WHEN 'VD_FB' THEN 'fb_spjk' " +
|
||||
" WHEN 'VD_FP' THEN 'fp_spjk' " +
|
||||
" WHEN 'VD_FH' THEN 'fh_spjk' " +
|
||||
" WHEN 'VD_VA' THEN 'va_spjk' " +
|
||||
" WHEN 'VD_VP' THEN 'vp_spjk' " +
|
||||
" WHEN 'VD_DW' THEN 'dw_spjk' " +
|
||||
" WHEN 'VD_WQ' THEN 'wq_spjk' " +
|
||||
" ELSE 'spjk' END " +
|
||||
" ELSE 'spjk' END AS anchoPointState, " +
|
||||
"'VD' AS sttpMap, " +
|
||||
"src.STNM AS titleName, " +
|
||||
"400000 AS distance, " +
|
||||
"NVL(eng.RVCD, src.RVCD) AS rvcd, " +
|
||||
"NVL(eng.ADDVCD, src.ADDVCD) AS addvcd, " +
|
||||
"NVL(eng.BASE_ID, src.BASE_ID) AS baseId, " +
|
||||
"src.RSTCD AS rstcds, " +
|
||||
"'VD' AS sttpCode, " +
|
||||
"src.STNM AS stnm, " +
|
||||
"rv.RVNM AS rvnm, " +
|
||||
"eng.ENNM AS ennm, " +
|
||||
"src.FHSTCD AS fhstcd, " +
|
||||
"fh.STNM AS fhstnm, " +
|
||||
"sttp.STTP_NAME AS sttpName, " +
|
||||
"src.STLC AS stlc, " +
|
||||
"CASE WHEN src.URL IS NULL THEN NULL WHEN INSTR(src.URL, 'm3u8') > 0 THEN '1' ELSE '0' END AS playWay, " +
|
||||
"src.ORDER_INDEX AS siteStepSort, " +
|
||||
"NVL(eng.HBRVCD, src.HBRVCD) AS hbrvcd " +
|
||||
"FROM (" + buildVdDeviceBaseSql() + ") src " +
|
||||
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = src.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN SD_FHBT_B_H fh ON fh.STCD = src.FHSTCD AND NVL(fh.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = NVL(eng.RVCD, src.RVCD) " +
|
||||
"LEFT JOIN SD_STTP_B sttp ON sttp.STTP_CODE = src.STTP " +
|
||||
" AND NVL(sttp.IS_DELETED, 0) = 0 AND NVL(sttp.ENABLE, 1) = 1 ";
|
||||
}
|
||||
|
||||
private String buildRunDataCoreSql() {
|
||||
return "SELECT " +
|
||||
"run.ID AS id, " +
|
||||
@ -591,6 +858,33 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
return String.join(", ", actualColumns);
|
||||
}
|
||||
|
||||
private String buildVdPointSelectSql() {
|
||||
return "t.sttp AS sttp, " +
|
||||
"t.stcd AS stcd, " +
|
||||
"t.lgtd AS lgtd, " +
|
||||
"t.lttd AS lttd, " +
|
||||
"t.dtmel AS dtmel, " +
|
||||
"t.anchoPointState AS anchoPointState, " +
|
||||
"t.sttpMap AS sttpMap, " +
|
||||
"t.titleName AS titleName, " +
|
||||
"t.distance AS distance, " +
|
||||
"t.rvcd AS rvcd, " +
|
||||
"t.addvcd AS addvcd, " +
|
||||
"t.baseId AS baseId, " +
|
||||
"t.rstcds AS rstcds, " +
|
||||
"t.sttpCode AS sttpCode, " +
|
||||
"t.stnm AS stnm, " +
|
||||
"t.rvnm AS rvnm, " +
|
||||
"t.ennm AS ennm, " +
|
||||
"t.fhstcd AS fhstcd, " +
|
||||
"t.fhstnm AS fhstnm, " +
|
||||
"t.sttpName AS sttpName, " +
|
||||
"t.stlc AS stlc, " +
|
||||
"t.playWay AS playWay, " +
|
||||
"t.siteStepSort AS siteStepSort, " +
|
||||
"t.hbrvcd AS hbrvcd ";
|
||||
}
|
||||
|
||||
private String buildRunDataOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (CollUtil.isEmpty(sortList)) {
|
||||
return " ORDER BY t.baseStepSort ASC, t.rvcdStepSort ASC, t.rstcdStepSort ASC, t.siteStepSort ASC, t.stcd ASC, t.tm DESC";
|
||||
@ -613,6 +907,28 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
return " ORDER BY " + String.join(", ", orderItems);
|
||||
}
|
||||
|
||||
private String buildVdPointOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (CollUtil.isEmpty(sortList)) {
|
||||
return " ORDER BY t.siteStepSort ASC NULLS LAST, t.stcd ASC";
|
||||
}
|
||||
List<String> orderItems = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sort : sortList) {
|
||||
if (sort == null || StrUtil.isBlank(sort.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapColumn(sort.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
String direction = "desc".equalsIgnoreCase(sort.getDir()) || "des".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + direction + " NULLS LAST");
|
||||
}
|
||||
if (orderItems.isEmpty()) {
|
||||
return " ORDER BY t.siteStepSort ASC NULLS LAST, t.stcd ASC";
|
||||
}
|
||||
return " ORDER BY " + String.join(", ", orderItems);
|
||||
}
|
||||
|
||||
private String buildRunDataGroupOrderBySql(List<DataSourceRequest.GroupDescriptor> groups) {
|
||||
if (CollUtil.isEmpty(groups)) {
|
||||
return "";
|
||||
@ -641,6 +957,42 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
};
|
||||
}
|
||||
|
||||
private String buildVdTreeFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
if (filter == null) {
|
||||
return "";
|
||||
}
|
||||
if (StrUtil.isNotBlank(filter.getField())) {
|
||||
return buildVdTreeLeafCondition(filter, paramMap, indexHolder);
|
||||
}
|
||||
if (CollUtil.isEmpty(filter.getFilters())) {
|
||||
return "";
|
||||
}
|
||||
List<String> conditions = new ArrayList<>();
|
||||
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||
String childSql = buildVdTreeFilterCondition(child, paramMap, indexHolder);
|
||||
if (StrUtil.isNotBlank(childSql)) {
|
||||
conditions.add("(" + childSql + ")");
|
||||
}
|
||||
}
|
||||
if (conditions.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
String logic = "or".equalsIgnoreCase(filter.getLogic()) ? " OR " : " AND ";
|
||||
return String.join(logic, conditions);
|
||||
}
|
||||
|
||||
private String buildVdTreeLeafCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
String column = mapVdTreeColumn(filter.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
return "";
|
||||
}
|
||||
return buildSimpleCondition(column, "vdTreeParam", filter, paramMap, indexHolder, isVdTreeDateField(filter));
|
||||
}
|
||||
|
||||
private String buildFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
@ -804,6 +1156,16 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
return "date".equalsIgnoreCase(filter.getDataType());
|
||||
}
|
||||
|
||||
private boolean isVdTreeDateField(DataSourceRequest.FilterDescriptor filter) {
|
||||
if (filter == null || StrUtil.isBlank(filter.getField())) {
|
||||
return false;
|
||||
}
|
||||
if ("statusTm".equalsIgnoreCase(filter.getField())) {
|
||||
return true;
|
||||
}
|
||||
return "date".equalsIgnoreCase(filter.getDataType());
|
||||
}
|
||||
|
||||
private String buildValueExpr(String paramKey, boolean dateField, Object value) {
|
||||
if (!dateField || value == null) {
|
||||
return "#{map." + paramKey + "}";
|
||||
@ -817,26 +1179,62 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
|
||||
private List<Object> normalizeValues(Object value) {
|
||||
List<Object> values = new ArrayList<>();
|
||||
appendNormalizedValues(values, value);
|
||||
return values;
|
||||
}
|
||||
|
||||
private void appendNormalizedValues(List<Object> values, Object value) {
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
if (value instanceof List<?> list) {
|
||||
for (Object item : list) {
|
||||
if (item != null) {
|
||||
values.add(item);
|
||||
appendNormalizedValues(values, item);
|
||||
}
|
||||
}
|
||||
return values;
|
||||
return;
|
||||
}
|
||||
if (value instanceof Object[] array) {
|
||||
for (Object item : array) {
|
||||
if (item != null) {
|
||||
values.add(item);
|
||||
appendNormalizedValues(values, item);
|
||||
}
|
||||
return;
|
||||
}
|
||||
return values;
|
||||
if (value instanceof String text) {
|
||||
if (StrUtil.isNotBlank(text)) {
|
||||
values.add(text);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (value != null) {
|
||||
values.add(value);
|
||||
}
|
||||
return values;
|
||||
|
||||
private String mapVdTreeColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "stcd" -> "t.stcd";
|
||||
case "stCode" -> "t.stCode";
|
||||
case "stName" -> "t.stName";
|
||||
case "stnm" -> "t.stnm";
|
||||
case "sttpCode" -> "t.sttpCode";
|
||||
case "sttpName" -> "t.sttpName";
|
||||
case "sttpFullPath" -> "t.sttpFullPath";
|
||||
case "rstcd" -> "t.rstcd";
|
||||
case "ennm" -> "t.ennm";
|
||||
case "baseId" -> "t.baseId";
|
||||
case "baseName" -> "t.baseName";
|
||||
case "url" -> "t.url";
|
||||
case "playWay" -> "t.playWay";
|
||||
case "deviceSerial" -> "t.deviceSerial";
|
||||
case "accessWay" -> "t.accessWay";
|
||||
case "protocol" -> "t.protocol";
|
||||
case "quality" -> "t.quality";
|
||||
case "controlMode" -> "t.controlMode";
|
||||
case "status" -> "NVL(t.status, 0)";
|
||||
case "statusTm" -> "t.statusTm";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private String mapColumn(String field) {
|
||||
@ -844,6 +1242,7 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "sttp" -> "t.sttp";
|
||||
case "sttpCode" -> "t.sttpCode";
|
||||
case "sttpName" -> "t.sttpName";
|
||||
case "sttpFullPath" -> "t.sttpFullPath";
|
||||
@ -878,11 +1277,15 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
case "vlsr" -> "t.vlsr";
|
||||
case "vlsrTm" -> "t.vlsrTm";
|
||||
case "rvcd" -> "t.rvcd";
|
||||
case "rvnm" -> "t.rvnm";
|
||||
case "addvcd" -> "t.addvcd";
|
||||
case "dtin" -> "t.dtin";
|
||||
case "usfl" -> "t.usfl";
|
||||
case "url" -> "t.url";
|
||||
case "playWay" -> "t.playWay";
|
||||
case "titleName" -> "t.titleName";
|
||||
case "rstcds" -> "t.rstcds";
|
||||
case "anchoPointState" -> "t.anchoPointState";
|
||||
case "sourceTable" -> "t.sourceTable";
|
||||
case "baseStepSort" -> "t.baseStepSort";
|
||||
case "rstcdStepSort" -> "t.rstcdStepSort";
|
||||
@ -971,4 +1374,265 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
}
|
||||
return " ORDER BY " + String.join(", ", orderItems);
|
||||
}
|
||||
|
||||
private boolean containsNonBlankFilterValue(DataSourceRequest.FilterDescriptor filter, String fieldName) {
|
||||
if (filter == null || StrUtil.isBlank(fieldName)) {
|
||||
return false;
|
||||
}
|
||||
if (fieldName.equalsIgnoreCase(filter.getField())) {
|
||||
if (filter.getValue() instanceof List<?> list) {
|
||||
return CollUtil.isNotEmpty(list);
|
||||
}
|
||||
return StrUtil.isNotBlank(filter.getValue() == null ? null : String.valueOf(filter.getValue()));
|
||||
}
|
||||
if (CollUtil.isEmpty(filter.getFilters())) {
|
||||
return false;
|
||||
}
|
||||
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||
if (containsNonBlankFilterValue(child, fieldName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<VdTreeNodeVo> buildVdTreeNodes(List<VdTreeRowVo> rows, boolean baseScoped) {
|
||||
List<VdTreeNodeVo> stationNodes = buildStationTreeNodes(rows, baseScoped);
|
||||
if (baseScoped) {
|
||||
return sortTreeNodes(stationNodes);
|
||||
}
|
||||
|
||||
LinkedHashMap<String, VdTreeNodeVo> baseNodeMap = new LinkedHashMap<>();
|
||||
List<VdTreeNodeVo> topLevelWithoutBase = new ArrayList<>();
|
||||
for (VdTreeRowVo row : rows) {
|
||||
if (row == null) {
|
||||
continue;
|
||||
}
|
||||
if (StrUtil.isBlank(row.getBaseId())) {
|
||||
continue;
|
||||
}
|
||||
baseNodeMap.computeIfAbsent(row.getBaseId(), key -> {
|
||||
VdTreeNodeVo node = new VdTreeNodeVo();
|
||||
node.setId(key);
|
||||
node.setName(StrUtil.blankToDefault(row.getBaseName(), key));
|
||||
node.setType("PSB");
|
||||
node.setTypeName("基地");
|
||||
node.setSort(defaultSort(row.getBaseSort()));
|
||||
node.setHasChildren(1);
|
||||
node.setParentId(null);
|
||||
node.setParentName(null);
|
||||
return node;
|
||||
});
|
||||
}
|
||||
|
||||
Map<String, List<VdTreeNodeVo>> stationByBase = new LinkedHashMap<>();
|
||||
for (VdTreeNodeVo stationNode : stationNodes) {
|
||||
if (StrUtil.isBlank(stationNode.getParentId())) {
|
||||
topLevelWithoutBase.add(stationNode);
|
||||
continue;
|
||||
}
|
||||
stationByBase.computeIfAbsent(stationNode.getParentId(), key -> new ArrayList<>()).add(stationNode);
|
||||
}
|
||||
|
||||
List<VdTreeNodeVo> result = new ArrayList<>();
|
||||
for (Map.Entry<String, VdTreeNodeVo> entry : baseNodeMap.entrySet()) {
|
||||
VdTreeNodeVo baseNode = entry.getValue();
|
||||
baseNode.setChildren(sortTreeNodes(stationByBase.get(entry.getKey())));
|
||||
result.add(baseNode);
|
||||
}
|
||||
result.addAll(topLevelWithoutBase);
|
||||
return sortTreeNodes(result);
|
||||
}
|
||||
|
||||
private List<VdTreeNodeVo> buildVdTreeNodesByStation(List<VdTreeRowVo> rows, boolean baseScoped) {
|
||||
List<VdTreeNodeVo> stationNodes = buildStationCodeTreeNodes(rows, baseScoped);
|
||||
if (baseScoped) {
|
||||
return sortTreeNodes(stationNodes);
|
||||
}
|
||||
|
||||
LinkedHashMap<String, VdTreeNodeVo> baseNodeMap = new LinkedHashMap<>();
|
||||
List<VdTreeNodeVo> topLevelWithoutBase = new ArrayList<>();
|
||||
for (VdTreeRowVo row : rows) {
|
||||
if (row == null || StrUtil.isBlank(row.getBaseId())) {
|
||||
continue;
|
||||
}
|
||||
baseNodeMap.computeIfAbsent(row.getBaseId(), key -> {
|
||||
VdTreeNodeVo node = new VdTreeNodeVo();
|
||||
node.setId(key);
|
||||
node.setName(StrUtil.blankToDefault(row.getBaseName(), key));
|
||||
node.setType("PSB");
|
||||
node.setTypeName("基地");
|
||||
node.setSort(defaultSort(row.getBaseSort()));
|
||||
node.setHasChildren(1);
|
||||
node.setParentId(null);
|
||||
node.setParentName(null);
|
||||
return node;
|
||||
});
|
||||
}
|
||||
|
||||
Map<String, List<VdTreeNodeVo>> stationByBase = new LinkedHashMap<>();
|
||||
for (VdTreeNodeVo stationNode : stationNodes) {
|
||||
if (StrUtil.isBlank(stationNode.getParentId())) {
|
||||
topLevelWithoutBase.add(stationNode);
|
||||
continue;
|
||||
}
|
||||
stationByBase.computeIfAbsent(stationNode.getParentId(), key -> new ArrayList<>()).add(stationNode);
|
||||
}
|
||||
|
||||
List<VdTreeNodeVo> result = new ArrayList<>();
|
||||
for (Map.Entry<String, VdTreeNodeVo> entry : baseNodeMap.entrySet()) {
|
||||
VdTreeNodeVo baseNode = entry.getValue();
|
||||
baseNode.setChildren(sortTreeNodes(stationByBase.get(entry.getKey())));
|
||||
result.add(baseNode);
|
||||
}
|
||||
result.addAll(topLevelWithoutBase);
|
||||
return sortTreeNodes(result);
|
||||
}
|
||||
|
||||
private List<VdTreeNodeVo> buildStationTreeNodes(List<VdTreeRowVo> rows, boolean baseScoped) {
|
||||
LinkedHashMap<String, List<VdTreeRowVo>> stationRowMap = new LinkedHashMap<>();
|
||||
for (VdTreeRowVo row : rows) {
|
||||
if (row == null || StrUtil.isBlank(row.getRstcd())) {
|
||||
continue;
|
||||
}
|
||||
stationRowMap.computeIfAbsent(row.getRstcd(), key -> new ArrayList<>()).add(row);
|
||||
}
|
||||
|
||||
List<VdTreeNodeVo> stationNodes = new ArrayList<>();
|
||||
for (Map.Entry<String, List<VdTreeRowVo>> entry : stationRowMap.entrySet()) {
|
||||
List<VdTreeRowVo> stationRows = entry.getValue();
|
||||
if (CollUtil.isEmpty(stationRows)) {
|
||||
continue;
|
||||
}
|
||||
VdTreeRowVo sample = stationRows.get(0);
|
||||
VdTreeNodeVo stationNode = new VdTreeNodeVo();
|
||||
stationNode.setId(entry.getKey());
|
||||
stationNode.setName(StrUtil.blankToDefault(sample.getEnnm(), entry.getKey()));
|
||||
stationNode.setType("ENG");
|
||||
stationNode.setTypeName("电站");
|
||||
stationNode.setSort(defaultSort(sample.getRstcdStepSort()));
|
||||
stationNode.setHasChildren(1);
|
||||
if (baseScoped) {
|
||||
stationNode.setParentId(null);
|
||||
stationNode.setParentName(null);
|
||||
} else {
|
||||
stationNode.setParentId(sample.getBaseId());
|
||||
stationNode.setParentName(sample.getBaseName());
|
||||
}
|
||||
stationNode.setChildren(buildSiteTreeNodes(stationRows));
|
||||
stationNodes.add(stationNode);
|
||||
}
|
||||
return sortTreeNodes(stationNodes);
|
||||
}
|
||||
|
||||
private List<VdTreeNodeVo> buildSiteTreeNodes(List<VdTreeRowVo> rows) {
|
||||
LinkedHashMap<String, VdTreeNodeVo> siteNodeMap = new LinkedHashMap<>();
|
||||
for (VdTreeRowVo row : rows) {
|
||||
if (row == null || StrUtil.isBlank(row.getStcd()) || siteNodeMap.containsKey(row.getStcd())) {
|
||||
continue;
|
||||
}
|
||||
VdTreeNodeVo node = new VdTreeNodeVo();
|
||||
node.setId(row.getStcd());
|
||||
node.setName(StrUtil.blankToDefault(row.getStnm(), row.getStcd()));
|
||||
node.setType(row.getSttpCode());
|
||||
node.setTypeName(row.getSttpName());
|
||||
node.setSort(defaultSort(row.getSiteStepSort()));
|
||||
node.setHasChildren(0);
|
||||
node.setParentId(row.getRstcd());
|
||||
node.setParentName(row.getEnnm());
|
||||
node.setUrl(row.getUrl());
|
||||
node.setPlayWay(row.getPlayWay());
|
||||
node.setDeviceSerial(row.getDeviceSerial());
|
||||
node.setAccessWay(row.getAccessWay());
|
||||
node.setProtocol(row.getProtocol());
|
||||
node.setQuality(row.getQuality());
|
||||
node.setControlMode(row.getControlMode());
|
||||
node.setStatus(row.getStatus());
|
||||
node.setStatusTm(row.getStatusTm());
|
||||
siteNodeMap.put(row.getStcd(), node);
|
||||
}
|
||||
return sortTreeNodes(new ArrayList<>(siteNodeMap.values()));
|
||||
}
|
||||
|
||||
private List<VdTreeNodeVo> buildStationCodeTreeNodes(List<VdTreeRowVo> rows, boolean baseScoped) {
|
||||
LinkedHashMap<String, List<VdTreeRowVo>> stationRowMap = new LinkedHashMap<>();
|
||||
for (VdTreeRowVo row : rows) {
|
||||
if (row == null || StrUtil.isBlank(row.getStCode())) {
|
||||
continue;
|
||||
}
|
||||
stationRowMap.computeIfAbsent(row.getStCode(), key -> new ArrayList<>()).add(row);
|
||||
}
|
||||
|
||||
List<VdTreeNodeVo> stationNodes = new ArrayList<>();
|
||||
for (Map.Entry<String, List<VdTreeRowVo>> entry : stationRowMap.entrySet()) {
|
||||
List<VdTreeRowVo> stationRows = entry.getValue();
|
||||
if (CollUtil.isEmpty(stationRows)) {
|
||||
continue;
|
||||
}
|
||||
VdTreeRowVo sample = stationRows.get(0);
|
||||
VdTreeNodeVo stationNode = new VdTreeNodeVo();
|
||||
stationNode.setId(entry.getKey());
|
||||
stationNode.setName(StrUtil.blankToDefault(sample.getStName(), entry.getKey()));
|
||||
stationNode.setType("VD_FB");
|
||||
stationNode.setTypeName("鱼类增殖站");
|
||||
stationNode.setSort(defaultSort(sample.getRstcdStepSort()));
|
||||
stationNode.setHasChildren(1);
|
||||
if (baseScoped) {
|
||||
stationNode.setParentId(null);
|
||||
stationNode.setParentName(null);
|
||||
} else {
|
||||
stationNode.setParentId(sample.getBaseId());
|
||||
stationNode.setParentName(sample.getBaseName());
|
||||
}
|
||||
stationNode.setChildren(buildSiteTreeNodesByStation(stationRows));
|
||||
stationNodes.add(stationNode);
|
||||
}
|
||||
return sortTreeNodes(stationNodes);
|
||||
}
|
||||
|
||||
private List<VdTreeNodeVo> buildSiteTreeNodesByStation(List<VdTreeRowVo> rows) {
|
||||
LinkedHashMap<String, VdTreeNodeVo> siteNodeMap = new LinkedHashMap<>();
|
||||
for (VdTreeRowVo row : rows) {
|
||||
if (row == null || StrUtil.isBlank(row.getStcd()) || siteNodeMap.containsKey(row.getStcd())) {
|
||||
continue;
|
||||
}
|
||||
VdTreeNodeVo node = new VdTreeNodeVo();
|
||||
node.setId(row.getStcd());
|
||||
node.setName(StrUtil.blankToDefault(row.getStnm(), row.getStcd()));
|
||||
node.setType(row.getSttpCode());
|
||||
node.setTypeName(row.getSttpName());
|
||||
node.setSort(defaultSort(row.getSiteStepSort()));
|
||||
node.setHasChildren(0);
|
||||
node.setParentId(row.getStCode());
|
||||
node.setParentName(row.getStName());
|
||||
node.setUrl(row.getUrl());
|
||||
node.setPlayWay(row.getPlayWay());
|
||||
node.setDeviceSerial(row.getDeviceSerial());
|
||||
node.setAccessWay(row.getAccessWay());
|
||||
node.setProtocol(row.getProtocol());
|
||||
node.setQuality(row.getQuality());
|
||||
node.setControlMode(row.getControlMode());
|
||||
node.setStatus(row.getStatus());
|
||||
node.setStatusTm(row.getStatusTm());
|
||||
siteNodeMap.put(row.getStcd(), node);
|
||||
}
|
||||
return sortTreeNodes(new ArrayList<>(siteNodeMap.values()));
|
||||
}
|
||||
|
||||
private List<VdTreeNodeVo> sortTreeNodes(List<VdTreeNodeVo> nodes) {
|
||||
if (CollUtil.isEmpty(nodes)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
nodes.sort(Comparator.comparing(VdMonitorServiceImpl::sortValue)
|
||||
.thenComparing(node -> StrUtil.blankToDefault(node.getId(), "")));
|
||||
return nodes;
|
||||
}
|
||||
|
||||
private static Integer sortValue(VdTreeNodeVo node) {
|
||||
return node == null ? 999999 : defaultSort(node.getSort());
|
||||
}
|
||||
|
||||
private static Integer defaultSort(Integer sort) {
|
||||
return sort == null ? 999999 : sort;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
package com.yfd.platform.qgc_env.warn.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_env.warn.service.WarnDataService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/warn")
|
||||
@Tag(name = "告警状态模块")
|
||||
@Validated
|
||||
public class WarnDataController {
|
||||
|
||||
@Resource
|
||||
private WarnDataService warnDataService;
|
||||
|
||||
@PostMapping("/stcd/eng/GetKendoListCust")
|
||||
@Operation(summary = "电站水位、生态流量告警状态统计")
|
||||
public ResponseResult getEngWarnCount(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(warnDataService.getEngWarnCount(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/ai/com/qgcDmRun/GetKendoListCust")
|
||||
@Operation(summary = "全过程AI识别大坝运行")
|
||||
public ResponseResult getAiDmRunCount(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(warnDataService.getAiDmRunCount(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/ai/com/qgcProtect/GetKendoListCust")
|
||||
@Operation(summary = "全过程AI识别动植物保护")
|
||||
public ResponseResult getAiProtectCount(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(warnDataService.getAiProtectCount(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/ai/com/GetKendoListCust")
|
||||
@Operation(summary = "AI常规业务列表")
|
||||
public ResponseResult getAiComKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(warnDataService.getAiComKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/ai/com/qgc/aiRstcd/GetKendoListCust")
|
||||
@Operation(summary = "全过程AI识别有数据的电站下拉")
|
||||
public ResponseResult getAiRstcdListKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(warnDataService.getAiRstcdListKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/ai/com/qgc/aiPfwRecord/GetKendoListCust")
|
||||
@Operation(summary = "全过程AI识别监测日历表(漂浮物+清漂合并)")
|
||||
public ResponseResult getAiPfwRecordKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(warnDataService.getAiPfwRecordKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/ai/com/qgc/aiRecord/GetKendoListCust")
|
||||
@Operation(summary = "全过程AI识别监测日历表")
|
||||
public ResponseResult getAiRecordKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(warnDataService.getAiRecordKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/alarmPoint/GetKendoListCust")
|
||||
@Operation(summary = "电站告警描点列表")
|
||||
public ResponseResult getAlarmPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(warnDataService.getAlarmPointKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/stcd/GetKendoListCust")
|
||||
@Operation(summary = "监测设备告警情况列表")
|
||||
public ResponseResult getWarnStcdKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(warnDataService.getWarnStcdKendoListCust(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.yfd.platform.qgc_env.warn.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "AI常规业务列表")
|
||||
public class AiComListVo {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "类型编码")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "AI测站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "AI测站名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "所属基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "所属基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "所属流域编码")
|
||||
private String rvcd;
|
||||
|
||||
@Schema(description = "数据时间")
|
||||
private Date tm;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private Date endTm;
|
||||
|
||||
@Schema(description = "AI识别值")
|
||||
private String aiVal;
|
||||
|
||||
@Schema(description = "附件ID")
|
||||
private String fid;
|
||||
|
||||
@Schema(description = "是否填报")
|
||||
private Integer isFsf;
|
||||
|
||||
@Schema(description = "是否大面积漂浮物")
|
||||
private Integer isBigDebrisArea;
|
||||
|
||||
@Schema(description = "是否已清漂")
|
||||
private Integer isClearDrift;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date recordTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private Date modifyTime;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.yfd.platform.qgc_env.warn.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "全过程AI识别大坝运行")
|
||||
public class AiDmRunVo {
|
||||
|
||||
@Schema(description = "漂浮物监测次数")
|
||||
private Integer pfwCnt;
|
||||
|
||||
@Schema(description = "漂浮物清理次数")
|
||||
private Integer pfwqlCnt;
|
||||
|
||||
@Schema(description = "叠梁门运行次数")
|
||||
private Integer dlmCnt;
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.yfd.platform.qgc_env.warn.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "全过程AI识别动植物保护")
|
||||
public class AiProtectVo {
|
||||
|
||||
@Schema(description = "运鱼船进出港次数")
|
||||
private Integer fpYycCnt;
|
||||
|
||||
@Schema(description = "赶鱼栅运行次数")
|
||||
private Integer fpGysCnt;
|
||||
|
||||
@Schema(description = "升鱼机运行次数")
|
||||
private Integer fpSyjCnt;
|
||||
|
||||
@Schema(description = "AGV小车次数")
|
||||
private Integer fpAgvCnt;
|
||||
|
||||
@Schema(description = "运鱼车运行次数")
|
||||
private Integer fpYychCnt;
|
||||
|
||||
@Schema(description = "鱼道放流次数")
|
||||
private Integer fpYdhCnt;
|
||||
|
||||
@Schema(description = "植物园养护次数")
|
||||
private Integer vpYhCnt;
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.yfd.platform.qgc_env.warn.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(description = "全过程AI识别监测日历记录")
|
||||
public class AiRecordVo {
|
||||
|
||||
@Schema(description = "AI类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "日期")
|
||||
private String dt;
|
||||
|
||||
@Schema(description = "是否大面积漂浮物")
|
||||
private Integer isBigDebrisArea;
|
||||
|
||||
@Schema(description = "AI数据数")
|
||||
private Integer aiCnt;
|
||||
|
||||
@Schema(description = "统计数")
|
||||
private Integer cnt;
|
||||
|
||||
@Schema(description = "是否已清漂")
|
||||
private Integer isClearDrift;
|
||||
|
||||
@Schema(description = "漂浮物状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "漂浮物状态名称")
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "清漂状态")
|
||||
private Integer qpStatus;
|
||||
|
||||
@Schema(description = "清漂状态名称")
|
||||
private String qpStatusName;
|
||||
|
||||
@Schema(description = "附件ID")
|
||||
private String fid;
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.yfd.platform.qgc_env.warn.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "全过程AI识别电站下拉")
|
||||
public class AiRstcdVo {
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String stnm;
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package com.yfd.platform.qgc_env.warn.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(description = "电站告警描点")
|
||||
public class AlarmPointVo {
|
||||
|
||||
@Schema(description = "站点类型")
|
||||
private String sttp;
|
||||
|
||||
@Schema(description = "站点编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private BigDecimal lttd;
|
||||
|
||||
@Schema(description = "高程")
|
||||
private BigDecimal dtmel;
|
||||
|
||||
@Schema(description = "描点状态")
|
||||
private String anchoPointState;
|
||||
|
||||
@Schema(description = "锚点类型")
|
||||
private String sttpMap;
|
||||
|
||||
@Schema(description = "弹框站点名称")
|
||||
private String titleName;
|
||||
|
||||
@Schema(description = "地图避让")
|
||||
private Integer distance;
|
||||
|
||||
@Schema(description = "流域编码")
|
||||
private String rvcd;
|
||||
|
||||
@Schema(description = "行政编码")
|
||||
private String addvcd;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "关联电站编码")
|
||||
private String rstcds;
|
||||
|
||||
@Schema(description = "设施类型")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "流域名称")
|
||||
private String rvnm;
|
||||
|
||||
@Schema(description = "电站装机类型")
|
||||
private Integer endInstalledType;
|
||||
|
||||
@Schema(description = "生态流量告警数")
|
||||
private Integer stqCount;
|
||||
|
||||
@Schema(description = "水质告警数")
|
||||
private Integer wqCount;
|
||||
|
||||
@Schema(description = "水位告警数")
|
||||
private Integer zCount;
|
||||
|
||||
@Schema(description = "水温告警数")
|
||||
private Integer wtCount;
|
||||
|
||||
@Schema(description = "年份")
|
||||
private String yyyy;
|
||||
|
||||
@Schema(description = "告警区间范围")
|
||||
private String range;
|
||||
|
||||
@Schema(description = "装机容量")
|
||||
private BigDecimal ttpwr;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "流域沿程")
|
||||
private Integer rvcdStepSort;
|
||||
|
||||
@Schema(description = "电站沿程")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "站点沿程")
|
||||
private Integer siteStepSort;
|
||||
|
||||
@Schema(description = "电站图片")
|
||||
private String logo;
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.yfd.platform.qgc_env.warn.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Schema(description = "电站告警状态统计")
|
||||
public class EngWarnCountVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "告警状态")
|
||||
private Integer warnState;
|
||||
|
||||
@Schema(description = "告警状态名称")
|
||||
private String warnStateName;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Integer num;
|
||||
|
||||
@Schema(description = "告警类型")
|
||||
private String warnType;
|
||||
|
||||
@Schema(description = "告警类型名称")
|
||||
private String warnTypeName;
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.yfd.platform.qgc_env.warn.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "监测设备告警情况")
|
||||
public class StcdWarnStateVo {
|
||||
|
||||
@Schema(description = "测站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "测站名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "监测方式")
|
||||
private Integer mway;
|
||||
|
||||
@Schema(description = "测站类型编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "测站类型名称")
|
||||
private String sttpName;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "流域编码")
|
||||
private String rvcd;
|
||||
|
||||
@Schema(description = "告警状态")
|
||||
private Integer warnState;
|
||||
|
||||
@Schema(description = "告警状态名称")
|
||||
private String warnstateName;
|
||||
|
||||
@Schema(description = "告警时间")
|
||||
private Date warnTm;
|
||||
|
||||
@Schema(description = "基础排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "流域排序")
|
||||
private Integer rvcdStepSort;
|
||||
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
|
||||
@Schema(description = "数据接入类型")
|
||||
private Integer dtinType;
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.yfd.platform.qgc_env.warn.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_env.warn.entity.vo.AlarmPointVo;
|
||||
import com.yfd.platform.qgc_env.warn.entity.vo.AiRecordVo;
|
||||
import com.yfd.platform.qgc_env.warn.entity.vo.AiProtectVo;
|
||||
import com.yfd.platform.qgc_env.warn.entity.vo.AiDmRunVo;
|
||||
import com.yfd.platform.qgc_env.warn.entity.vo.AiComListVo;
|
||||
import com.yfd.platform.qgc_env.warn.entity.vo.AiRstcdVo;
|
||||
import com.yfd.platform.qgc_env.warn.entity.vo.EngWarnCountVo;
|
||||
import com.yfd.platform.qgc_env.warn.entity.vo.StcdWarnStateVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface WarnDataService {
|
||||
|
||||
DataSourceResult<EngWarnCountVo> getEngWarnCount(DataSourceRequest dataSourceRequest);
|
||||
|
||||
AiDmRunVo getAiDmRunCount(DataSourceRequest dataSourceRequest);
|
||||
|
||||
AiProtectVo getAiProtectCount(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<AiComListVo> getAiComKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<AiRstcdVo> getAiRstcdListKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
List<AiRecordVo> getAiPfwRecordKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
List<AiRecordVo> getAiRecordKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<AlarmPointVo> getAlarmPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<StcdWarnStateVo> getWarnStcdKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,9 @@ package com.yfd.platform.qgc_env.wq.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.annotation.Log;
|
||||
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.qgc_env.wq.entity.vo.WqOperateRequest;
|
||||
import com.yfd.platform.qgc_env.wq.service.EnvWqDataService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -57,13 +59,18 @@ public class EnvWqDataController {
|
||||
return ResponseResult.successData(envWqDataService.getDrtpKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@Log(module = "水质统计分析", value = "修改水质小时数据")
|
||||
@PostMapping("/updateWqRsData")
|
||||
@Operation(summary = "修改水质小时数据")
|
||||
public ResponseResult updateWqRsData(@RequestBody Map<String, Object> updateData) {
|
||||
envWqDataService.updateWqRsData(updateData);
|
||||
public ResponseResult updateWqRsData(@RequestBody WqOperateRequest wqOperateRequest) {
|
||||
envWqDataService.updateWqRsData(
|
||||
wqOperateRequest == null ? null : wqOperateRequest.getUpdateData(),
|
||||
wqOperateRequest == null ? null : wqOperateRequest.getSource()
|
||||
);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@Log(module = "水质统计分析", value = "删除水质小时/日/月数据")
|
||||
@PostMapping("/removeKendoByIds")
|
||||
@Operation(summary = "删除水质小时/日/月数据")
|
||||
public ResponseResult removeKendoByIds(@RequestBody BatchDeleteAo batchDeleteAo) {
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
package com.yfd.platform.qgc_env.wq.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class WqOperateRequest {
|
||||
|
||||
private String source;
|
||||
|
||||
private Map<String, Object> updateData;
|
||||
}
|
||||
@ -39,7 +39,7 @@ public interface EnvWqDataService {
|
||||
|
||||
DataSourceResult getStTbYsBVoKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
boolean updateWqRsData(Map<String, Object> updateData);
|
||||
boolean updateWqRsData(Map<String, Object> updateData, String source);
|
||||
|
||||
boolean removeKendoByIds(BatchDeleteAo batchDeleteAo);
|
||||
}
|
||||
|
||||
@ -1,20 +1,18 @@
|
||||
package com.yfd.platform.qgc_env.wq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.common.CommonConstant;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.Group;
|
||||
import com.yfd.platform.common.GroupHelper;
|
||||
import com.yfd.platform.common.GroupingInfo;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.common.PageInfo;
|
||||
import com.yfd.platform.common.*;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.MsOperationLog;
|
||||
import com.yfd.platform.qgc_base.domain.MsOperationLogDetail;
|
||||
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.qgc_base.entity.vo.DataParam;
|
||||
import com.yfd.platform.qgc_base.mapper.MsOperationLogDetailMapper;
|
||||
import com.yfd.platform.qgc_base.mapper.MsOperationLogMapper;
|
||||
import com.yfd.platform.qgc_env.wq.entity.vo.*;
|
||||
import com.yfd.platform.qgc_env.wq.service.EnvWqDataService;
|
||||
import com.yfd.platform.qgc_env.wt.entity.vo.WbsbVo;
|
||||
@ -44,12 +42,114 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class EnvWqDataServiceImpl implements EnvWqDataService {
|
||||
|
||||
private static final String WQ_HOUR_TABLE_NAME = "SD_WQ_R";
|
||||
private static final String WQ_DAY_TABLE_NAME = "SD_WQDAY_S";
|
||||
private static final String WQ_MONTH_TABLE_NAME = "SD_WQDRTP_S";
|
||||
private static final String WQ_STATION_TABLE_NAME = "SD_WQ_B_H";
|
||||
|
||||
private static final LinkedHashMap<String, String> WQ_UPDATE_COLUMN_MAP = new LinkedHashMap<>();
|
||||
private static final Map<String, String> WQ_FIELD_MEANING_MAP = new LinkedHashMap<>();
|
||||
static {
|
||||
WQ_UPDATE_COLUMN_MAP.put("wtmp", "WTMP");
|
||||
WQ_UPDATE_COLUMN_MAP.put("ph", "PH");
|
||||
WQ_UPDATE_COLUMN_MAP.put("dox", "DOX");
|
||||
WQ_UPDATE_COLUMN_MAP.put("codmn", "CODMN");
|
||||
WQ_UPDATE_COLUMN_MAP.put("codcr", "CODCR");
|
||||
WQ_UPDATE_COLUMN_MAP.put("bod5", "BOD5");
|
||||
WQ_UPDATE_COLUMN_MAP.put("nh3n", "NH3N");
|
||||
WQ_UPDATE_COLUMN_MAP.put("tp", "TP");
|
||||
WQ_UPDATE_COLUMN_MAP.put("tn", "TN");
|
||||
WQ_UPDATE_COLUMN_MAP.put("cu", "CU");
|
||||
WQ_UPDATE_COLUMN_MAP.put("zn", "ZN");
|
||||
WQ_UPDATE_COLUMN_MAP.put("f", "F");
|
||||
WQ_UPDATE_COLUMN_MAP.put("se", "SE");
|
||||
WQ_UPDATE_COLUMN_MAP.put("ars", "ARS");
|
||||
WQ_UPDATE_COLUMN_MAP.put("hg", "HG");
|
||||
WQ_UPDATE_COLUMN_MAP.put("cd", "CD");
|
||||
WQ_UPDATE_COLUMN_MAP.put("cr6", "CR6");
|
||||
WQ_UPDATE_COLUMN_MAP.put("pb", "PB");
|
||||
WQ_UPDATE_COLUMN_MAP.put("cn", "CN");
|
||||
WQ_UPDATE_COLUMN_MAP.put("vlph", "VLPH");
|
||||
WQ_UPDATE_COLUMN_MAP.put("oil", "OIL");
|
||||
WQ_UPDATE_COLUMN_MAP.put("las", "LAS");
|
||||
WQ_UPDATE_COLUMN_MAP.put("s2", "S2");
|
||||
WQ_UPDATE_COLUMN_MAP.put("fcg", "FCG");
|
||||
WQ_UPDATE_COLUMN_MAP.put("cl", "CL");
|
||||
WQ_UPDATE_COLUMN_MAP.put("so4", "SO4");
|
||||
WQ_UPDATE_COLUMN_MAP.put("no3", "NO3");
|
||||
WQ_UPDATE_COLUMN_MAP.put("thrd", "THRD");
|
||||
WQ_UPDATE_COLUMN_MAP.put("cond", "COND");
|
||||
WQ_UPDATE_COLUMN_MAP.put("fe", "FE");
|
||||
WQ_UPDATE_COLUMN_MAP.put("mn", "MN");
|
||||
WQ_UPDATE_COLUMN_MAP.put("al", "AL");
|
||||
WQ_UPDATE_COLUMN_MAP.put("chla", "CHLA");
|
||||
WQ_UPDATE_COLUMN_MAP.put("clarity", "CLARITY");
|
||||
WQ_UPDATE_COLUMN_MAP.put("tu", "TU");
|
||||
WQ_UPDATE_COLUMN_MAP.put("cyano", "CYANO");
|
||||
WQ_UPDATE_COLUMN_MAP.put("wqgrd", "WQGRD");
|
||||
WQ_UPDATE_COLUMN_MAP.put("sfdb", "SFDB");
|
||||
WQ_UPDATE_COLUMN_MAP.put("wqSfdbhnYs", "WQ_SFDBHN_YS");
|
||||
|
||||
WQ_FIELD_MEANING_MAP.put("STCD", "站点编码");
|
||||
WQ_FIELD_MEANING_MAP.put("TM", "监测时间");
|
||||
WQ_FIELD_MEANING_MAP.put("DT", "统计日期");
|
||||
WQ_FIELD_MEANING_MAP.put("DRTP", "统计类型");
|
||||
WQ_FIELD_MEANING_MAP.put("YEAR", "年份");
|
||||
WQ_FIELD_MEANING_MAP.put("MONTH", "月份");
|
||||
WQ_FIELD_MEANING_MAP.put("WTMP", "水温");
|
||||
WQ_FIELD_MEANING_MAP.put("PH", "酸碱度");
|
||||
WQ_FIELD_MEANING_MAP.put("DOX", "溶解氧");
|
||||
WQ_FIELD_MEANING_MAP.put("CODMN", "高锰酸盐指数");
|
||||
WQ_FIELD_MEANING_MAP.put("CODCR", "化学需氧量");
|
||||
WQ_FIELD_MEANING_MAP.put("BOD5", "五日生化需氧量");
|
||||
WQ_FIELD_MEANING_MAP.put("NH3N", "氨氮");
|
||||
WQ_FIELD_MEANING_MAP.put("TP", "总磷");
|
||||
WQ_FIELD_MEANING_MAP.put("TN", "总氮");
|
||||
WQ_FIELD_MEANING_MAP.put("CU", "铜");
|
||||
WQ_FIELD_MEANING_MAP.put("ZN", "锌");
|
||||
WQ_FIELD_MEANING_MAP.put("F", "氟化物");
|
||||
WQ_FIELD_MEANING_MAP.put("SE", "硒");
|
||||
WQ_FIELD_MEANING_MAP.put("ARS", "砷");
|
||||
WQ_FIELD_MEANING_MAP.put("HG", "汞");
|
||||
WQ_FIELD_MEANING_MAP.put("CD", "镉");
|
||||
WQ_FIELD_MEANING_MAP.put("CR6", "六价铬");
|
||||
WQ_FIELD_MEANING_MAP.put("PB", "铅");
|
||||
WQ_FIELD_MEANING_MAP.put("CN", "氰化物");
|
||||
WQ_FIELD_MEANING_MAP.put("VLPH", "挥发酚");
|
||||
WQ_FIELD_MEANING_MAP.put("OIL", "石油类");
|
||||
WQ_FIELD_MEANING_MAP.put("LAS", "阴离子表面活性剂");
|
||||
WQ_FIELD_MEANING_MAP.put("S2", "硫化物");
|
||||
WQ_FIELD_MEANING_MAP.put("FCG", "粪大肠菌群");
|
||||
WQ_FIELD_MEANING_MAP.put("CL", "氯化物");
|
||||
WQ_FIELD_MEANING_MAP.put("SO4", "硫酸盐");
|
||||
WQ_FIELD_MEANING_MAP.put("NO3", "硝酸盐");
|
||||
WQ_FIELD_MEANING_MAP.put("THRD", "总硬度");
|
||||
WQ_FIELD_MEANING_MAP.put("COND", "电导率");
|
||||
WQ_FIELD_MEANING_MAP.put("FE", "铁");
|
||||
WQ_FIELD_MEANING_MAP.put("MN", "锰");
|
||||
WQ_FIELD_MEANING_MAP.put("AL", "铝");
|
||||
WQ_FIELD_MEANING_MAP.put("CHLA", "叶绿素a");
|
||||
WQ_FIELD_MEANING_MAP.put("CLARITY", "透明度");
|
||||
WQ_FIELD_MEANING_MAP.put("TU", "浊度");
|
||||
WQ_FIELD_MEANING_MAP.put("CYANO", "蓝绿藻");
|
||||
WQ_FIELD_MEANING_MAP.put("WQGRD", "水质类别");
|
||||
WQ_FIELD_MEANING_MAP.put("WWQTG", "水功能区目标");
|
||||
WQ_FIELD_MEANING_MAP.put("SFDB", "是否达标");
|
||||
WQ_FIELD_MEANING_MAP.put("WQ_SFDBHN_YS", "是否达标湖内饮用水源");
|
||||
}
|
||||
|
||||
@Resource
|
||||
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||
|
||||
@Resource
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Resource
|
||||
private MsOperationLogMapper msOperationLogMapper;
|
||||
|
||||
@Resource
|
||||
private MsOperationLogDetailMapper msOperationLogDetailMapper;
|
||||
|
||||
@Override
|
||||
public DataSourceResult processKendoList(DataSourceRequest dataSourceRequest) {
|
||||
boolean calculated = CommonConstant.CALCULATE_SUCCESS.equals(
|
||||
@ -694,6 +794,7 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
||||
baseSql.append("SELECT ")
|
||||
.append("NVL(t.IS_DELETED, 0) AS isDeleted, ")
|
||||
.append("t.STTP AS sttpCode, ")
|
||||
.append("t.WARN_STATE AS warnState, ")
|
||||
.append("t.MWAY AS mway, ")
|
||||
.append("t.DTIN_TYPE AS dtinType, ")
|
||||
.append("t.STCD AS stcd, ")
|
||||
@ -731,6 +832,8 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
||||
DataSourceResult result = new DataSourceResult();
|
||||
if (Boolean.TRUE.equals(dataSourceRequest.getGroupResultFlat())) {
|
||||
result.setData(new GroupHelper().faltGroup(rows, Arrays.asList(groupInfos)));
|
||||
} else if (groupInfos != null && groupInfos.length == 1 && groupInfos[0] != null && StrUtil.isNotBlank(groupInfos[0].getSelector())) {
|
||||
result.setData(toMsstbprptLegacyGroups(rows, groupInfos[0].getSelector()));
|
||||
} else {
|
||||
result.setData(toLegacyGroupResult(new GroupHelper().group(rows, Arrays.asList(groupInfos)), 0));
|
||||
}
|
||||
@ -3181,14 +3284,17 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
||||
return result;
|
||||
}
|
||||
String upperField = groupField == null ? "DTINTYPE" : groupField.toUpperCase();
|
||||
String countField = "COUNT_" + upperField;
|
||||
String aggregateKey = "count_" + groupField;
|
||||
for (Map<String, Object> row : rows) {
|
||||
Object key = row.get(upperField);
|
||||
if (key == null) {
|
||||
key = row.get(groupField);
|
||||
}
|
||||
String countField = row.containsKey("COUNT_STCD") ? "COUNT_STCD" : "COUNT_" + upperField;
|
||||
String aggregateKey = "COUNT_STCD".equals(countField) ? "count_stcd" : "count_" + groupField;
|
||||
Object countValue = row.get(countField);
|
||||
if (countValue == null) {
|
||||
countValue = row.get("count_stcd");
|
||||
}
|
||||
if (countValue == null) {
|
||||
countValue = row.get("count_" + upperField);
|
||||
}
|
||||
@ -3208,7 +3314,7 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
||||
detail.put(upperField, key);
|
||||
detail.put(countField, count);
|
||||
item.put("items", List.of(detail));
|
||||
item.put("count", count);
|
||||
item.put("count", 0);
|
||||
item.put("summary", new Object[0]);
|
||||
|
||||
Map<String, Object> aggregates = new LinkedHashMap<>();
|
||||
@ -3224,27 +3330,52 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
||||
return baseSql;
|
||||
}
|
||||
List<String> groupFields = new ArrayList<>();
|
||||
List<String> selectItems = new ArrayList<>();
|
||||
List<String> orderByItems = new ArrayList<>();
|
||||
for (GroupingInfo item : groupInfos) {
|
||||
if (item == null || StrUtil.isBlank(item.getSelector())) {
|
||||
continue;
|
||||
}
|
||||
groupFields.add(item.getSelector());
|
||||
String selector = item.getSelector();
|
||||
groupFields.add(selector);
|
||||
selectItems.add(selector + " AS " + selector.toUpperCase());
|
||||
String dir = Boolean.TRUE.equals(item.getDesc()) ? "DESC" : "ASC";
|
||||
orderByItems.add(item.getSelector() + " " + dir);
|
||||
orderByItems.add(selector + " " + dir);
|
||||
boolean hasCountStcd = false;
|
||||
if (CollUtil.isNotEmpty(item.getSummaryInfos())) {
|
||||
for (SummaryInfo summaryInfo : item.getSummaryInfos()) {
|
||||
if (summaryInfo == null || StrUtil.isBlank(summaryInfo.getSelector()) || StrUtil.isBlank(summaryInfo.getSummaryType())) {
|
||||
continue;
|
||||
}
|
||||
String summaryType = summaryInfo.getSummaryType().toUpperCase();
|
||||
String summarySelector = summaryInfo.getSelector().toUpperCase();
|
||||
if ("count".equalsIgnoreCase(summaryInfo.getSummaryType()) && "stcd".equalsIgnoreCase(summaryInfo.getSelector())) {
|
||||
hasCountStcd = true;
|
||||
}
|
||||
switch (summaryInfo.getSummaryType().toLowerCase()) {
|
||||
case "count" -> selectItems.add("COUNT(" + summaryInfo.getSelector() + ") AS " + summaryType + "_" + summarySelector);
|
||||
case "sum" -> selectItems.add("SUM(" + summaryInfo.getSelector() + ") AS " + summaryType + "_" + summarySelector);
|
||||
case "avg", "average" -> selectItems.add("AVG(" + summaryInfo.getSelector() + ") AS AVG_" + summarySelector);
|
||||
case "min" -> selectItems.add("MIN(" + summaryInfo.getSelector() + ") AS " + summaryType + "_" + summarySelector);
|
||||
case "max" -> selectItems.add("MAX(" + summaryInfo.getSelector() + ") AS " + summaryType + "_" + summarySelector);
|
||||
default -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasCountStcd) {
|
||||
selectItems.add("COUNT(*) AS COUNT_STCD");
|
||||
}
|
||||
}
|
||||
if (groupFields.isEmpty()) {
|
||||
return baseSql;
|
||||
}
|
||||
StringBuilder sql = new StringBuilder("SELECT ");
|
||||
sql.append(String.join(", ", groupFields));
|
||||
for (String groupField : groupFields) {
|
||||
sql.append(", COUNT(*) AS count_").append(groupField).append(" ");
|
||||
}
|
||||
sql.append("FROM (").append(baseSql).append(") T ")
|
||||
.append("GROUP BY ").append(String.join(", ", groupFields)).append(" ");
|
||||
sql.append(String.join(", ", selectItems));
|
||||
sql.append(" FROM (").append(baseSql).append(") T ")
|
||||
.append(" GROUP BY ").append(String.join(", ", groupFields)).append(" ");
|
||||
if (!orderByItems.isEmpty()) {
|
||||
sql.append("ORDER BY ").append(String.join(", ", orderByItems));
|
||||
sql.append(" ORDER BY ").append(String.join(", ", orderByItems));
|
||||
}
|
||||
return sql.toString();
|
||||
}
|
||||
@ -3648,15 +3779,18 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateWqRsData(Map<String, Object> updateData) {
|
||||
public boolean updateWqRsData(Map<String, Object> updateData, String source) {
|
||||
if (updateData == null || updateData.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
updateWqHourData(updateData);
|
||||
updateWqTargetIfNeeded(updateData);
|
||||
|
||||
String stcd = asString(updateData.get("stcd"));
|
||||
String tm = asString(updateData.get("tm"));
|
||||
Map<String, Object> beforeHour = queryWqHourRow(stcd, tm);
|
||||
Map<String, Object> beforeStation = queryWqStationRow(stcd);
|
||||
updateWqHourData(updateData);
|
||||
updateWqTargetIfNeeded(updateData);
|
||||
recordWqUpdateLog(beforeHour, beforeStation, updateData, source);
|
||||
|
||||
if (StrUtil.isNotBlank(stcd) && StrUtil.isNotBlank(tm) && tm.length() >= 10) {
|
||||
String dateStr = tm.substring(0, 10);
|
||||
statisticsDayDataFromHour(stcd, dateStr, dateStr);
|
||||
@ -3681,17 +3815,24 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
||||
return true;
|
||||
}
|
||||
String dataType = StrUtil.blankToDefault(batchDeleteAo.getDataType(), "").toUpperCase();
|
||||
String source = batchDeleteAo == null ? null : batchDeleteAo.getSource();
|
||||
int batchSize = 500;
|
||||
for (int i = 0; i < dataList.size(); i += batchSize) {
|
||||
List<DataParam> subList = dataList.subList(i, Math.min(i + batchSize, dataList.size()));
|
||||
if ("MON".equals(dataType)) {
|
||||
List<Map<String, Object>> beforeRows = queryWqMonthRows(subList);
|
||||
softDeleteWqMonthData(subList);
|
||||
recordWqDeleteLog(beforeRows, WQ_MONTH_TABLE_NAME, "删除水质月数据", source);
|
||||
}
|
||||
if ("DATE".equals(dataType)) {
|
||||
List<Map<String, Object>> beforeRows = queryWqDayRows(subList);
|
||||
softDeleteWqDayData(subList);
|
||||
recordWqDeleteLog(beforeRows, WQ_DAY_TABLE_NAME, "删除水质日数据", source);
|
||||
}
|
||||
if ("TIME".equals(dataType)) {
|
||||
List<Map<String, Object>> beforeRows = queryWqHourRows(subList);
|
||||
deleteWqHourData(subList);
|
||||
recordWqDeleteLog(beforeRows, WQ_HOUR_TABLE_NAME, "删除水质小时数据", source);
|
||||
|
||||
Map<String, String[]> dateRangeMap = new HashMap<>();
|
||||
Map<String, String[]> monthRangeMap = new HashMap<>();
|
||||
@ -3742,50 +3883,9 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
||||
}
|
||||
|
||||
private void updateWqHourData(Map<String, Object> updateData) {
|
||||
LinkedHashMap<String, String> columnMap = new LinkedHashMap<>();
|
||||
columnMap.put("wtmp", "WTMP");
|
||||
columnMap.put("ph", "PH");
|
||||
columnMap.put("dox", "DOX");
|
||||
columnMap.put("codmn", "CODMN");
|
||||
columnMap.put("codcr", "CODCR");
|
||||
columnMap.put("bod5", "BOD5");
|
||||
columnMap.put("nh3n", "NH3N");
|
||||
columnMap.put("tp", "TP");
|
||||
columnMap.put("tn", "TN");
|
||||
columnMap.put("cu", "CU");
|
||||
columnMap.put("zn", "ZN");
|
||||
columnMap.put("f", "F");
|
||||
columnMap.put("se", "SE");
|
||||
columnMap.put("ars", "ARS");
|
||||
columnMap.put("hg", "HG");
|
||||
columnMap.put("cd", "CD");
|
||||
columnMap.put("cr6", "CR6");
|
||||
columnMap.put("pb", "PB");
|
||||
columnMap.put("cn", "CN");
|
||||
columnMap.put("vlph", "VLPH");
|
||||
columnMap.put("oil", "OIL");
|
||||
columnMap.put("las", "LAS");
|
||||
columnMap.put("s2", "S2");
|
||||
columnMap.put("fcg", "FCG");
|
||||
columnMap.put("cl", "CL");
|
||||
columnMap.put("so4", "SO4");
|
||||
columnMap.put("no3", "NO3");
|
||||
columnMap.put("thrd", "THRD");
|
||||
columnMap.put("cond", "COND");
|
||||
columnMap.put("fe", "FE");
|
||||
columnMap.put("mn", "MN");
|
||||
columnMap.put("al", "AL");
|
||||
columnMap.put("chla", "CHLA");
|
||||
columnMap.put("clarity", "CLARITY");
|
||||
columnMap.put("tu", "TU");
|
||||
columnMap.put("cyano", "CYANO");
|
||||
columnMap.put("wqgrd", "WQGRD");
|
||||
columnMap.put("sfdb", "SFDB");
|
||||
columnMap.put("wqSfdbhnYs", "WQ_SFDBHN_YS");
|
||||
|
||||
List<String> setClauses = new ArrayList<>();
|
||||
List<Object> params = new ArrayList<>();
|
||||
for (Map.Entry<String, String> entry : columnMap.entrySet()) {
|
||||
for (Map.Entry<String, String> entry : WQ_UPDATE_COLUMN_MAP.entrySet()) {
|
||||
if (updateData.containsKey(entry.getKey())) {
|
||||
setClauses.add(entry.getValue() + " = ?");
|
||||
params.add(updateData.get(entry.getKey()));
|
||||
@ -3886,6 +3986,286 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
||||
jdbcTemplate.update(sql.toString(), params.toArray());
|
||||
}
|
||||
|
||||
private Map<String, Object> queryWqHourRow(String stcd, String tm) {
|
||||
if (StrUtil.isBlank(stcd) || StrUtil.isBlank(tm)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
String sql = "SELECT " + buildWqHourLogSelectColumns() +
|
||||
" FROM SD_WQ_R WHERE STCD = ? AND TM = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')";
|
||||
List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql, stcd, tm);
|
||||
return rows.isEmpty() ? new HashMap<>() : normalizeLogRow(rows.getFirst());
|
||||
}
|
||||
|
||||
private Map<String, Object> queryWqStationRow(String stcd) {
|
||||
if (StrUtil.isBlank(stcd)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
String sql = "SELECT STCD, WWQTG FROM SD_WQ_B_H WHERE STCD = ? AND NVL(IS_DELETED, 0) = 0";
|
||||
List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql, stcd);
|
||||
return rows.isEmpty() ? new HashMap<>() : normalizeLogRow(rows.getFirst());
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> queryWqHourRows(List<DataParam> dataParamList) {
|
||||
if (CollUtil.isEmpty(dataParamList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
StringBuilder sql = new StringBuilder("SELECT ")
|
||||
.append(buildWqHourLogSelectColumns())
|
||||
.append(" FROM SD_WQ_R WHERE ");
|
||||
List<Object> params = new ArrayList<>();
|
||||
appendHourRowConditions(sql, params, dataParamList);
|
||||
return normalizeLogRows(jdbcTemplate.queryForList(sql.toString(), params.toArray()));
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> queryWqDayRows(List<DataParam> dataParamList) {
|
||||
if (CollUtil.isEmpty(dataParamList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
StringBuilder sql = new StringBuilder("SELECT ")
|
||||
.append(buildWqDayLogSelectColumns())
|
||||
.append(" FROM SD_WQDAY_S WHERE ");
|
||||
List<Object> params = new ArrayList<>();
|
||||
for (int i = 0; i < dataParamList.size(); i++) {
|
||||
if (i > 0) {
|
||||
sql.append(" OR ");
|
||||
}
|
||||
sql.append("(STCD = ? AND DT = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'))");
|
||||
DataParam item = dataParamList.get(i);
|
||||
params.add(item == null ? null : item.getId());
|
||||
params.add(item == null ? null : item.getDt());
|
||||
}
|
||||
return normalizeLogRows(jdbcTemplate.queryForList(sql.toString(), params.toArray()));
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> queryWqMonthRows(List<DataParam> dataParamList) {
|
||||
if (CollUtil.isEmpty(dataParamList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
StringBuilder sql = new StringBuilder("SELECT ")
|
||||
.append(buildWqMonthLogSelectColumns())
|
||||
.append(" FROM SD_WQDRTP_S WHERE ");
|
||||
List<Object> params = new ArrayList<>();
|
||||
for (int i = 0; i < dataParamList.size(); i++) {
|
||||
if (i > 0) {
|
||||
sql.append(" OR ");
|
||||
}
|
||||
sql.append("(STCD = ? AND DRTP = ? AND YEAR = ? AND MONTH = ?)");
|
||||
DataParam item = dataParamList.get(i);
|
||||
params.add(item == null ? null : item.getId());
|
||||
params.add(item == null ? null : item.getDrtp());
|
||||
params.add(item == null ? null : item.getYear());
|
||||
params.add(item == null ? null : item.getMonth());
|
||||
}
|
||||
return normalizeLogRows(jdbcTemplate.queryForList(sql.toString(), params.toArray()));
|
||||
}
|
||||
|
||||
private void appendHourRowConditions(StringBuilder sql, List<Object> params, List<DataParam> dataParamList) {
|
||||
for (int i = 0; i < dataParamList.size(); i++) {
|
||||
if (i > 0) {
|
||||
sql.append(" OR ");
|
||||
}
|
||||
sql.append("(STCD = ? AND TM = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'))");
|
||||
DataParam item = dataParamList.get(i);
|
||||
params.add(item == null ? null : item.getId());
|
||||
params.add(item == null ? null : item.getTm());
|
||||
}
|
||||
}
|
||||
|
||||
private String buildWqHourLogSelectColumns() {
|
||||
return "ID,STCD, TO_CHAR(TM, 'YYYY-MM-DD HH24:MI:SS') AS TM, " +
|
||||
"WTMP, PH, DOX, CODMN, CODCR, BOD5, NH3N, TP, TN, CU, ZN, F, SE, ARS, HG, CD, CR6, PB, CN, " +
|
||||
"VLPH, OIL, LAS, S2, FCG, CL, SO4, NO3, THRD, COND, FE, MN, AL, CHLA, CLARITY, TU, CYANO, " +
|
||||
"WQGRD, SFDB, WQ_SFDBHN_YS";
|
||||
}
|
||||
|
||||
private String buildWqDayLogSelectColumns() {
|
||||
return "STCD, TO_CHAR(DT, 'YYYY-MM-DD HH24:MI:SS') AS DT, " +
|
||||
"WTMP, PH, DOX, CODMN, CODCR, BOD5, NH3N, TP, TN, CU, ZN, F, SE, ARS, HG, CD, CR6, PB, CN, " +
|
||||
"VLPH, OIL, LAS, S2, FCG, CL, SO4, NO3, THRD, COND, FE, MN, AL, CHLA, CLARITY, TU, CYANO, " +
|
||||
"WQGRD, SFDB, IS_DELETED";
|
||||
}
|
||||
|
||||
private String buildWqMonthLogSelectColumns() {
|
||||
return "STCD, DRTP, YEAR, MONTH, " +
|
||||
"WTMP, PH, DOX, CODMN, CODCR, BOD5, NH3N, TP, TN, CU, ZN, F, SE, ARS, HG, CD, CR6, PB, CN, " +
|
||||
"VLPH, OIL, LAS, S2, FCG, CL, SO4, NO3, THRD, COND, FE, MN, AL, CHLA, CLARITY, TU, CYANO, " +
|
||||
"WQGRD, SFDB, IS_DELETED";
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> normalizeLogRows(List<Map<String, Object>> rows) {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
if (CollUtil.isEmpty(rows)) {
|
||||
return result;
|
||||
}
|
||||
for (Map<String, Object> row : rows) {
|
||||
result.add(normalizeLogRow(row));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Map<String, Object> normalizeLogRow(Map<String, Object> row) {
|
||||
Map<String, Object> normalized = new LinkedHashMap<>();
|
||||
if (row == null || row.isEmpty()) {
|
||||
return normalized;
|
||||
}
|
||||
for (Map.Entry<String, Object> entry : row.entrySet()) {
|
||||
normalized.put(entry.getKey() == null ? null : entry.getKey().toUpperCase(), entry.getValue());
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
private void recordWqUpdateLog(Map<String, Object> beforeHour,
|
||||
Map<String, Object> beforeStation,
|
||||
Map<String, Object> updateData,
|
||||
String source) {
|
||||
if (updateData == null || updateData.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String stcd = asString(updateData.get("stcd"));
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
for (Map.Entry<String, String> entry : WQ_UPDATE_COLUMN_MAP.entrySet()) {
|
||||
if (!updateData.containsKey(entry.getKey())) {
|
||||
continue;
|
||||
}
|
||||
String column = entry.getValue();
|
||||
Object oldValue = beforeHour == null ? null : beforeHour.get(column);
|
||||
Object newValue = updateData.get(entry.getKey());
|
||||
if (StrUtil.equals(formatLogValue(oldValue), formatLogValue(newValue))) {
|
||||
continue;
|
||||
}
|
||||
details.add(buildWqDetail(null, WQ_HOUR_TABLE_NAME, stcd, column,
|
||||
oldValue, resolveWqDisplayValue(column, oldValue),
|
||||
newValue, resolveWqDisplayValue(column, newValue), "修改字段值"));
|
||||
}
|
||||
if (updateData.containsKey("wwqtg")) {
|
||||
Object oldValue = beforeStation == null ? null : beforeStation.get("WWQTG");
|
||||
Object newValue = updateData.get("wwqtg");
|
||||
if (!StrUtil.equals(formatLogValue(oldValue), formatLogValue(newValue))) {
|
||||
details.add(buildWqDetail(null, WQ_STATION_TABLE_NAME, stcd, "WWQTG",
|
||||
oldValue, resolveWqDisplayValue("WWQTG", oldValue),
|
||||
newValue, resolveWqDisplayValue("WWQTG", newValue), "修改字段值"));
|
||||
}
|
||||
}
|
||||
if (details.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String recordId = ObjectUtil.isNotEmpty(beforeHour) && ObjectUtil.isNotEmpty(beforeHour.get("ID"))
|
||||
? beforeHour.get("ID").toString()
|
||||
: null; MsOperationLog mainLog = buildWqMainLog(recordId,"修改水质小时数据", source);
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
for (MsOperationLogDetail detail : details) {
|
||||
detail.setMainId(mainLog.getId());
|
||||
}
|
||||
batchInsertWqLogDetails(details);
|
||||
}
|
||||
|
||||
private void recordWqDeleteLog(List<Map<String, Object>> rows, String tableName, String remark, String source) {
|
||||
if (CollUtil.isEmpty(rows)) {
|
||||
return;
|
||||
}
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
for (Map<String, Object> row : rows) {
|
||||
String stcd = asString(row.get("STCD"));
|
||||
String recordId = asString(row.get("ID"));
|
||||
MsOperationLog mainLog = buildWqMainLog(recordId,remark, source);
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
for (Map.Entry<String, Object> entry : row.entrySet()) {
|
||||
String fieldCode = entry.getKey();
|
||||
if (StrUtil.isBlank(fieldCode)) {
|
||||
continue;
|
||||
}
|
||||
Object oldValue = entry.getValue();
|
||||
if (oldValue == null) {
|
||||
continue;
|
||||
}
|
||||
details.add(buildWqDetail(mainLog.getId(), tableName, stcd, fieldCode,
|
||||
oldValue, resolveWqDisplayValue(fieldCode, oldValue),
|
||||
null, null, "删除字段值"));
|
||||
}
|
||||
}
|
||||
batchInsertWqLogDetails(details);
|
||||
}
|
||||
|
||||
private MsOperationLog buildWqMainLog(String recordId,String remark, String source) {
|
||||
MsOperationLog log = new MsOperationLog();
|
||||
log.setOperator(resolveLogOperator());
|
||||
log.setRecordId(recordId);
|
||||
log.setOperateTime(new Date());
|
||||
log.setTableName(WQ_HOUR_TABLE_NAME);
|
||||
log.setSource(StrUtil.trimToNull(source));
|
||||
log.setRemark(remark);
|
||||
return log;
|
||||
}
|
||||
|
||||
private MsOperationLogDetail buildWqDetail(String mainId,
|
||||
String tableName,
|
||||
String stationCode,
|
||||
String fieldCode,
|
||||
Object oldValueCode,
|
||||
Object oldValueName,
|
||||
Object newValueCode,
|
||||
Object newValueName,
|
||||
String remark) {
|
||||
MsOperationLogDetail detail = new MsOperationLogDetail();
|
||||
detail.setMainId(mainId);
|
||||
detail.setTableName(tableName);
|
||||
detail.setStationCode(stationCode);
|
||||
detail.setFieldCode(fieldCode);
|
||||
detail.setFieldMeaning(WQ_FIELD_MEANING_MAP.getOrDefault(fieldCode, fieldCode));
|
||||
detail.setOldValueCode(formatLogValue(oldValueCode));
|
||||
detail.setOldValueName(formatLogValue(oldValueName));
|
||||
detail.setNewValueCode(formatLogValue(newValueCode));
|
||||
detail.setNewValueName(formatLogValue(newValueName));
|
||||
detail.setRemark(remark);
|
||||
return detail;
|
||||
}
|
||||
|
||||
private void batchInsertWqLogDetails(List<MsOperationLogDetail> details) {
|
||||
if (CollUtil.isEmpty(details)) {
|
||||
return;
|
||||
}
|
||||
for (MsOperationLogDetail detail : details) {
|
||||
if (detail == null) {
|
||||
continue;
|
||||
}
|
||||
msOperationLogDetailMapper.insert(detail);
|
||||
}
|
||||
}
|
||||
|
||||
private Object resolveWqDisplayValue(String fieldCode, Object rawValue) {
|
||||
String text = formatLogValue(rawValue);
|
||||
if (StrUtil.isBlank(text)) {
|
||||
return rawValue;
|
||||
}
|
||||
return switch (fieldCode) {
|
||||
case "WQGRD", "WWQTG" -> getWqLevelName(text);
|
||||
case "SFDB" -> parseInteger(text) == null ? text : getSfdbName(parseInteger(text));
|
||||
default -> text;
|
||||
};
|
||||
}
|
||||
|
||||
private String resolveLogOperator() {
|
||||
try {
|
||||
return SecurityUtils.getCurrentUsername();
|
||||
} catch (Exception ignored) {
|
||||
try {
|
||||
return SecurityUtils.getUserId();
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String formatLogValue(Object value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
if (value instanceof Date date) {
|
||||
return DateUtil.formatDateTime(date);
|
||||
}
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
private String getMonthEndDate(Integer year, Integer month) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(year, month - 1, 1);
|
||||
|
||||
@ -2,13 +2,16 @@ package com.yfd.platform.qgc_env.wt.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.annotation.Log;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.qgc_env.wt.entity.vo.WtOperateRequest;
|
||||
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvInfo;
|
||||
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvAmendSaveVo;
|
||||
import com.yfd.platform.qgc_env.wt.service.*;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -17,6 +20,7 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@ -52,10 +56,14 @@ public class SdWTMonitorController {
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@Log(module = "水温监测", value = "修改表层水温日数据")
|
||||
@PostMapping("/alongDetail/updateWtrvRData")
|
||||
@Operation(summary = "修改表层水温日数据")
|
||||
public ResponseResult updateWtrvRData(@RequestBody Map<String, Object> updateData) {
|
||||
alongDetailService.updateWtrvRData(updateData);
|
||||
public ResponseResult updateWtrvRData(@RequestBody WtOperateRequest wtOperateRequest) {
|
||||
alongDetailService.updateWtrvRData(
|
||||
wtOperateRequest == null ? null : wtOperateRequest.getUpdateData(),
|
||||
wtOperateRequest == null ? null : wtOperateRequest.getSource()
|
||||
);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ -73,6 +81,7 @@ public class SdWTMonitorController {
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@Log(module = "水温监测", value = "删除出库水温周旬月季年数据")
|
||||
@PostMapping("/alongDetail/drtp/removeKendoByIds")
|
||||
@Operation(summary = "删除出库水温周旬月季年数据")
|
||||
public ResponseResult removeKendoByIds(@RequestBody BatchDeleteAo batchDeleteAo) {
|
||||
@ -197,6 +206,25 @@ public class SdWTMonitorController {
|
||||
return ResponseResult.successData(sdWtMonitorService.getMsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/msstbprpt/eng/GetKendoList")
|
||||
@Operation(summary = "根据条件查询电站页水温基础站点列表")
|
||||
public ResponseResult getMsstbprptEngList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getMsstbprptEngList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/wtrvAmend/dayAmend/GetKendoListCust")
|
||||
@Operation(summary = "水温日数据统计修正结果数据")
|
||||
public ResponseResult getWtrvAmendDayList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getWtrvAmendDayList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/wtrvAmend/dayAmend/saveAmendData")
|
||||
@Operation(summary = "保存修正后的河道水温日数据")
|
||||
public ResponseResult saveWtrvAmendData(@RequestBody List<WtrvAmendSaveVo> amendDataList) {
|
||||
sdWtMonitorService.saveWtrvAmendData(amendDataList);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/msstbprpt/getStcdInfo")
|
||||
@Operation(summary = "根据站码查询单条水温基础数据")
|
||||
public ResponseResult getStcdInfo(@RequestParam String stcd) {
|
||||
@ -215,6 +243,7 @@ public class SdWTMonitorController {
|
||||
return ResponseResult.successData(sdWtMonitorService.getCxDetailList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@Log(module = "水温监测", value = "删除垂向水温数据")
|
||||
@PostMapping("/cxDetail/removeKendoByIds")
|
||||
@Operation(summary = "删除垂向水温数据")
|
||||
public ResponseResult removeCxDetailByIds(@RequestBody BatchDeleteAo batchDeleteAo) {
|
||||
@ -222,10 +251,14 @@ public class SdWTMonitorController {
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@Log(module = "水温监测", value = "修改垂向水温数据")
|
||||
@PostMapping("/cxDetail/updateWtvtRData")
|
||||
@Operation(summary = "修改垂向水温数据")
|
||||
public ResponseResult updateWtvtRData(@RequestBody Map<String, Object> updateData) {
|
||||
sdWtvtRService.updateWtvtRData(updateData);
|
||||
public ResponseResult updateWtvtRData(@RequestBody WtOperateRequest wtOperateRequest) {
|
||||
sdWtvtRService.updateWtvtRData(
|
||||
wtOperateRequest == null ? null : wtOperateRequest.getUpdateData(),
|
||||
wtOperateRequest == null ? null : wtOperateRequest.getSource()
|
||||
);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
@ -74,6 +74,15 @@ public class SdWtBaseInfoVO implements Serializable {
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "设备类型")
|
||||
private Integer wtDeviceType;
|
||||
|
||||
@Schema(description = "接入类型")
|
||||
private Integer dtinType;
|
||||
|
||||
@Schema(description = "监测方式")
|
||||
private Integer mway;
|
||||
|
||||
@Schema(description = "所属测站编码")
|
||||
private String stCode;
|
||||
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
package com.yfd.platform.qgc_env.wt.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class WtOperateRequest {
|
||||
|
||||
private String source;
|
||||
|
||||
private Map<String, Object> updateData;
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.yfd.platform.qgc_env.wt.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水温日数据统计修正结果数据")
|
||||
public class WtrvAmendResultVo {
|
||||
|
||||
@Schema(description = "站点编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date dt;
|
||||
|
||||
@Schema(description = "温度")
|
||||
private BigDecimal wt;
|
||||
|
||||
@Schema(description = "站点名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.yfd.platform.qgc_env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "河道水温日修正保存入参")
|
||||
public class WtrvAmendSaveVo {
|
||||
|
||||
@Schema(description = "站点编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "日期,支持 yyyy-MM-dd 或 yyyy-MM-dd HH:mm:ss")
|
||||
private String dt;
|
||||
|
||||
@Schema(description = "修正后水温")
|
||||
private BigDecimal wt;
|
||||
}
|
||||
@ -43,6 +43,6 @@ public interface AlongDetailService extends IService<SdAlongDetailVO> {
|
||||
|
||||
boolean removeKendoByIds(BatchDeleteAo batchDeleteAo);
|
||||
|
||||
void updateWtrvRData(Map<String, Object> updateData);
|
||||
void updateWtrvRData(Map<String, Object> updateData, String source);
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user