Merge branch 'main' of http://121.37.111.42:3000/zhengsl/WholeProcessPlatform into main_hzz
This commit is contained in:
commit
a82a1142f7
@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@EnableTransactionManagement
|
||||
@ServletComponentScan("com.yfd.platform.config")
|
||||
@MapperScan(basePackages = {"com.yfd.platform.*.mapper", "com.yfd.platform.common"})
|
||||
@MapperScan(basePackages = {"com.yfd.platform.*.mapper","com.yfd.platform.*.*.mapper", "com.yfd.platform.common"})
|
||||
//@ComponentScan("com.zny.dec")
|
||||
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class, DataRedisAutoConfiguration.class})
|
||||
//@SpringBootApplication
|
||||
|
||||
@ -255,13 +255,17 @@ public class DataSourceRequest {
|
||||
for(SortDescriptor entry : sort) {
|
||||
String field = entry.getField();
|
||||
String dir = entry.getDir();
|
||||
String normalizedDir = StringUtil.isBlank(dir) ? "" : dir.toLowerCase();
|
||||
if ("des".equals(normalizedDir)) {
|
||||
normalizedDir = "desc";
|
||||
}
|
||||
SortingInfo sortingInfo = new SortingInfo();
|
||||
sortingInfo.setSelector(field);
|
||||
if (StringUtil.isBlank(dir)) {
|
||||
if (StringUtil.isBlank(normalizedDir)) {
|
||||
sortingInfo.setDesc(false);
|
||||
} else if (dir.equals("asc")) {
|
||||
} else if (normalizedDir.equals("asc")) {
|
||||
sortingInfo.setDesc(false);
|
||||
} else if (dir.equals("desc")) {
|
||||
} else if (normalizedDir.equals("desc")) {
|
||||
sortingInfo.setDesc(true);
|
||||
}
|
||||
|
||||
@ -303,11 +307,15 @@ public class DataSourceRequest {
|
||||
GroupingInfo groupingInfo = new GroupingInfo();
|
||||
groupingInfo.setSelector(groupDescriptor.getField());
|
||||
String dir = groupDescriptor.getDir();
|
||||
if (StringUtil.isBlank(dir)) {
|
||||
String normalizedDir = StringUtil.isBlank(dir) ? "" : dir.toLowerCase();
|
||||
if ("des".equals(normalizedDir)) {
|
||||
normalizedDir = "desc";
|
||||
}
|
||||
if (StringUtil.isBlank(normalizedDir)) {
|
||||
groupingInfo.setDesc(false);
|
||||
} else if (dir.equals("asc")) {
|
||||
} else if (normalizedDir.equals("asc")) {
|
||||
groupingInfo.setDesc(false);
|
||||
} else if (dir.equals("desc")) {
|
||||
} else if (normalizedDir.equals("desc")) {
|
||||
groupingInfo.setDesc(true);
|
||||
}
|
||||
|
||||
|
||||
@ -102,6 +102,9 @@ public class GroupHelper {
|
||||
Group newGroup = new Group();
|
||||
newGroup.setKey(groupKey);
|
||||
newGroup.setField(groupInfo.getSelector());
|
||||
newGroup.setKeyExt(new HashMap());
|
||||
newGroup.setSummary(new Object[0]);
|
||||
newGroup.setAggregates(new HashMap());
|
||||
if (tempCount != null) {
|
||||
newGroup.setCount(NumberUtil.parseInt(tempCount.toString()));
|
||||
}
|
||||
|
||||
@ -60,6 +60,9 @@ public class SecurityConfig {
|
||||
.requestMatchers("/eng/**").permitAll()
|
||||
.requestMatchers("/env/**").permitAll()
|
||||
.requestMatchers("/wt/**").permitAll()
|
||||
.requestMatchers("/wq/**").permitAll()
|
||||
.requestMatchers("/fp/**").permitAll()
|
||||
.requestMatchers("/fh/**").permitAll()
|
||||
.requestMatchers("/data/**").permitAll()
|
||||
.requestMatchers("/sms/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/").permitAll()
|
||||
|
||||
@ -56,11 +56,45 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3. 全过程-生态环保数据服务")
|
||||
.group("3全过程-生态环保数据服务")
|
||||
.packagesToScan("com.yfd.platform.env.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvWTApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.1 全过程-生态环保数据服务-水温监测")
|
||||
.packagesToScan("com.yfd.platform.env.wt.controller")
|
||||
.build();
|
||||
}
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvWQApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.2 全过程-生态环保数据服务-水质监测")
|
||||
.packagesToScan("com.yfd.platform.env.wq.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvFPApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.3 全过程-生态环保数据服务-过鱼设施")
|
||||
.packagesToScan("com.yfd.platform.env.fp.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvFHApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.4 全过程-生态环保数据服务-栖息地")
|
||||
.packagesToScan("com.yfd.platform.env.fh.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi groupEngApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
|
||||
@ -2,6 +2,7 @@ package com.yfd.platform.env.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.annotation.Log;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.env.domain.SdHydrobase;
|
||||
import com.yfd.platform.env.service.ISdHydrobaseService;
|
||||
@ -68,6 +69,12 @@ public class SdHydrobaseController {
|
||||
return ResponseResult.successData(hydrobaseService.selectForDropdown(basename));
|
||||
}
|
||||
|
||||
@PostMapping("/wbsb/GetKendoList")
|
||||
@Operation(summary = "水电基地列表")
|
||||
public ResponseResult getWbsbKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(hydrobaseService.getWbsbKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
// @Log(module = "基地管理", value = "新增基地")
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增基地")
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
package com.yfd.platform.env.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.env.service.SdWtvtRService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 垂向水温Controller
|
||||
*
|
||||
* @author
|
||||
* @date 2023/04/18 19:22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sw/wtvt")
|
||||
@Tag(name = "垂向水温")
|
||||
@Validated
|
||||
public class SdWtvtRController {
|
||||
|
||||
@Resource
|
||||
private SdWtvtRService sdWtvtRService;
|
||||
|
||||
@PostMapping({"/defaultYear/GetKendoListCust"})
|
||||
@Operation(summary = "获取垂向水温有数据的年份")
|
||||
public ResponseResult getWtrvDefaultYear(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtvtRService.getWtrvDefaultYear(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
39
backend/src/main/java/com/yfd/platform/env/entity/vo/HydrobaseWbsVo.java
vendored
Normal file
39
backend/src/main/java/com/yfd/platform/env/entity/vo/HydrobaseWbsVo.java
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水电基地WBS列表")
|
||||
public class HydrobaseWbsVo {
|
||||
|
||||
@Schema(description = "WBS编码")
|
||||
private String wbsCode;
|
||||
|
||||
@Schema(description = "WBS名称")
|
||||
private String wbsName;
|
||||
|
||||
@Schema(description = "父级WBS编码")
|
||||
private String pwbsCode;
|
||||
|
||||
@Schema(description = "WBS类型")
|
||||
private String wbsType;
|
||||
|
||||
@Schema(description = "树级别")
|
||||
private String treeLevel;
|
||||
|
||||
@Schema(description = "树路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer orderIndex;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String rmk;
|
||||
|
||||
@Schema(description = "简介")
|
||||
private String des;
|
||||
|
||||
@Schema(description = "简称")
|
||||
private String shortname;
|
||||
}
|
||||
66
backend/src/main/java/com/yfd/platform/env/fh/controller/FhHabitatController.java
vendored
Normal file
66
backend/src/main/java/com/yfd/platform/env/fh/controller/FhHabitatController.java
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
package com.yfd.platform.env.fh.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.env.fh.entity.ao.FhDefaultAo;
|
||||
import com.yfd.platform.env.fh.service.FhHabitatService;
|
||||
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("/fh")
|
||||
@Tag(name = "栖息地统计")
|
||||
@Validated
|
||||
public class FhHabitatController {
|
||||
|
||||
@Resource
|
||||
private FhHabitatService fhHabitatService;
|
||||
|
||||
@PostMapping("/GetKendoListCust")
|
||||
@Operation(summary = "栖息地主列表")
|
||||
public ResponseResult getKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fhHabitatService.getKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/GetKendoListCustom")
|
||||
@Operation(summary = "栖息地河段自动监测情况统计和二级页")
|
||||
public ResponseResult getKendoListCustom(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fhHabitatService.getKendoListCustom(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/default/getFhList")
|
||||
@Operation(summary = "获取默认有数据的栖息地站点信息")
|
||||
public ResponseResult getDefaultFhList(@RequestBody FhDefaultAo fhDefaultAo) {
|
||||
return ResponseResult.successData(fhHabitatService.getDefaultFhList(fhDefaultAo));
|
||||
}
|
||||
|
||||
@PostMapping("/sdrvwts/GetKendoList")
|
||||
@Operation(summary = "查询栖息地河道水温日统计数据")
|
||||
public ResponseResult getSdrvwtsList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fhHabitatService.getSdrvwtsList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/zq/sdriverdays/GetKendoList")
|
||||
@Operation(summary = "查询栖息地流量站日统计数据")
|
||||
public ResponseResult getSdriverdaysList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fhHabitatService.getSdriverdaysList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/msstbprpt/GetKendoList")
|
||||
@Operation(summary = "查询栖息地监测站点列表")
|
||||
public ResponseResult getMsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fhHabitatService.getMsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/stTbYs/GetStTbYsBVoKendoListCust")
|
||||
@Operation(summary = "水质监测信息查询")
|
||||
public ResponseResult getStTbYsBVoKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fhHabitatService.getStTbYsBVoKendoListCust(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
20
backend/src/main/java/com/yfd/platform/env/fh/entity/ao/FhDefaultAo.java
vendored
Normal file
20
backend/src/main/java/com/yfd/platform/env/fh/entity/ao/FhDefaultAo.java
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
package com.yfd.platform.env.fh.entity.ao;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "栖息地默认数据信息")
|
||||
public class FhDefaultAo {
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
private Date sdt;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private Date edt;
|
||||
}
|
||||
56
backend/src/main/java/com/yfd/platform/env/fh/entity/vo/FhDefaultVo.java
vendored
Normal file
56
backend/src/main/java/com/yfd/platform/env/fh/entity/vo/FhDefaultVo.java
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
package com.yfd.platform.env.fh.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 FhDefaultVo {
|
||||
|
||||
@Schema(description = "站点编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "站点名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "水温站编码")
|
||||
private String wtstcd;
|
||||
|
||||
@Schema(description = "水温站名称")
|
||||
private String wtstnm;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "基地流域名称")
|
||||
private String hbrvcdName;
|
||||
|
||||
@Schema(description = "栖息地编码")
|
||||
private String fhstcd;
|
||||
|
||||
@Schema(description = "栖息地名称")
|
||||
private String fhstnm;
|
||||
|
||||
@Schema(description = "数据数量")
|
||||
private Integer dataStatus;
|
||||
|
||||
@Schema(description = "站点类型编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "站点类型名称")
|
||||
private String sttpName;
|
||||
|
||||
@Schema(description = "流量站编码")
|
||||
private String zqstcd;
|
||||
|
||||
@Schema(description = "流量站名称")
|
||||
private String zqstnm;
|
||||
}
|
||||
80
backend/src/main/java/com/yfd/platform/env/fh/entity/vo/FhMsstbprptVo.java
vendored
Normal file
80
backend/src/main/java/com/yfd/platform/env/fh/entity/vo/FhMsstbprptVo.java
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
package com.yfd.platform.env.fh.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 FhMsstbprptVo 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 fhstcd;
|
||||
|
||||
@Schema(description = "所属栖息地名称")
|
||||
private String fhstnm;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "建成日期")
|
||||
private Date jcdt;
|
||||
|
||||
@Schema(description = "监测方式")
|
||||
private Integer mway;
|
||||
|
||||
@Schema(description = "数据是否接入")
|
||||
private Integer dtin;
|
||||
|
||||
@Schema(description = "数据接入来源")
|
||||
private String dtinSrc;
|
||||
|
||||
@Schema(description = "数据接入类型")
|
||||
private Integer dtinType;
|
||||
|
||||
@Schema(description = "数据接入开始时间")
|
||||
private Date dtinTm;
|
||||
|
||||
@Schema(description = "监测指标")
|
||||
private String stindx;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private Integer usfl;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "流域排序")
|
||||
private Integer rvcdStepSort;
|
||||
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
}
|
||||
38
backend/src/main/java/com/yfd/platform/env/fh/entity/vo/FhSdriverdayVo.java
vendored
Normal file
38
backend/src/main/java/com/yfd/platform/env/fh/entity/vo/FhSdriverdayVo.java
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
package com.yfd.platform.env.fh.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.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "栖息地流量站日统计数据")
|
||||
public class FhSdriverdayVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date dt;
|
||||
|
||||
@Schema(description = "水位")
|
||||
private BigDecimal z;
|
||||
|
||||
@Schema(description = "流量")
|
||||
private BigDecimal q;
|
||||
|
||||
@Schema(description = "流速")
|
||||
private BigDecimal v;
|
||||
|
||||
@Schema(description = "测流方法")
|
||||
private String msqmt;
|
||||
}
|
||||
29
backend/src/main/java/com/yfd/platform/env/fh/entity/vo/FhSdrvwtsVo.java
vendored
Normal file
29
backend/src/main/java/com/yfd/platform/env/fh/entity/vo/FhSdrvwtsVo.java
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
package com.yfd.platform.env.fh.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.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "栖息地河道水温日统计数据")
|
||||
public class FhSdrvwtsVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date dt;
|
||||
|
||||
@Schema(description = "水温")
|
||||
private BigDecimal wt;
|
||||
}
|
||||
114
backend/src/main/java/com/yfd/platform/env/fh/entity/vo/HabitatVo.java
vendored
Normal file
114
backend/src/main/java/com/yfd/platform/env/fh/entity/vo/HabitatVo.java
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
package com.yfd.platform.env.fh.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 HabitatVo {
|
||||
|
||||
@Schema(description = "栖息地编码")
|
||||
private String fhstcd;
|
||||
|
||||
@Schema(description = "基地ID")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "类型编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "栖息地名称")
|
||||
private String fhstnm;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "水电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "基础对象编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "基础对象名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "是否开展监测")
|
||||
private Integer fhmonitor;
|
||||
|
||||
@Schema(description = "建设阶段")
|
||||
private Integer bldstt;
|
||||
|
||||
@Schema(description = "保护对象")
|
||||
private String qxdbhdx;
|
||||
|
||||
@Schema(description = "保护范围")
|
||||
private String qxdbhfw;
|
||||
|
||||
@Schema(description = "保护长度")
|
||||
private BigDecimal qxdbhcd;
|
||||
|
||||
@Schema(description = "保护面积")
|
||||
private BigDecimal qxdbhmj;
|
||||
|
||||
@Schema(description = "保护河流")
|
||||
private String bhhl;
|
||||
|
||||
@Schema(description = "保护河段")
|
||||
private String bhhd;
|
||||
|
||||
@Schema(description = "保护措施")
|
||||
private String bhcs;
|
||||
|
||||
@Schema(description = "保护方式")
|
||||
private String qxdbhfs;
|
||||
|
||||
@Schema(description = "开工日期")
|
||||
private Date ststdt;
|
||||
|
||||
@Schema(description = "建成日期")
|
||||
private Date esstdt;
|
||||
|
||||
@Schema(description = "监测方式")
|
||||
private Integer mway;
|
||||
|
||||
@Schema(description = "是否接入")
|
||||
private Integer dtin;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
private String vlsr;
|
||||
|
||||
@Schema(description = "数据接入类型")
|
||||
private Integer dtinType;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private Integer enable;
|
||||
|
||||
@Schema(description = "保护核心长度")
|
||||
private BigDecimal qxdbhhxcd;
|
||||
|
||||
@Schema(description = "保护外围长度")
|
||||
private BigDecimal qxdbhwwcd;
|
||||
|
||||
@Schema(description = "数据监测频次")
|
||||
private Integer dtfrqcy;
|
||||
|
||||
@Schema(description = "投资")
|
||||
private BigDecimal qxdinv;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
|
||||
@Schema(description = "流域排序")
|
||||
private Integer rvcdStepSort;
|
||||
}
|
||||
24
backend/src/main/java/com/yfd/platform/env/fh/service/FhHabitatService.java
vendored
Normal file
24
backend/src/main/java/com/yfd/platform/env/fh/service/FhHabitatService.java
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
package com.yfd.platform.env.fh.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.fh.entity.ao.FhDefaultAo;
|
||||
import com.yfd.platform.env.fh.entity.vo.FhDefaultVo;
|
||||
import com.yfd.platform.env.fh.entity.vo.HabitatVo;
|
||||
|
||||
public interface FhHabitatService {
|
||||
|
||||
DataSourceResult<HabitatVo> getKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<HabitatVo> getKendoListCustom(DataSourceRequest dataSourceRequest);
|
||||
|
||||
FhDefaultVo getDefaultFhList(FhDefaultAo fhDefaultAo);
|
||||
|
||||
DataSourceResult getSdrvwtsList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getSdriverdaysList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getStTbYsBVoKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
1745
backend/src/main/java/com/yfd/platform/env/fh/service/impl/FhHabitatServiceImpl.java
vendored
Normal file
1745
backend/src/main/java/com/yfd/platform/env/fh/service/impl/FhHabitatServiceImpl.java
vendored
Normal file
File diff suppressed because it is too large
Load Diff
48
backend/src/main/java/com/yfd/platform/env/fp/controller/FishPassageController.java
vendored
Normal file
48
backend/src/main/java/com/yfd/platform/env/fp/controller/FishPassageController.java
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
package com.yfd.platform.env.fp.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.env.fp.service.FpBuildService;
|
||||
import com.yfd.platform.env.fp.service.FpRunService;
|
||||
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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/fp")
|
||||
@Tag(name = "过鱼设施建设及运行情况")
|
||||
@Validated
|
||||
public class FishPassageController {
|
||||
|
||||
@Resource
|
||||
private FpRunService fpRunService;
|
||||
|
||||
|
||||
@Resource
|
||||
private FpBuildService fpBuildService;
|
||||
|
||||
@PostMapping("/run/secondPlan/qgc/GetKendoListCust")
|
||||
@Operation(summary = "环保部-建设及运行运行情况(二级级页面 已建设施运行情况-计划接口)")
|
||||
public ResponseResult getQgcSecondPlanKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fpRunService.processQgcSecondPlanKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/build/GetKendoListCust")
|
||||
@Operation(summary = "过鱼设施建设及接入情况统计")
|
||||
public ResponseResult getKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fpBuildService.processKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@GetMapping("/run/qgc/year/GetYearFpStatistics")
|
||||
@Operation(summary = "全过程过鱼统计总数,根据基地分组")
|
||||
public ResponseResult getYearFpStatic(@RequestParam("year") String year) {
|
||||
return ResponseResult.successData(fpRunService.getYearFpStatic(year));
|
||||
}
|
||||
}
|
||||
15
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/FdFishVo.java
vendored
Normal file
15
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/FdFishVo.java
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
package com.yfd.platform.env.fp.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "过鱼鱼类信息")
|
||||
public class FdFishVo {
|
||||
|
||||
@Schema(description = "鱼类编码")
|
||||
private String ftp;
|
||||
|
||||
@Schema(description = "鱼类名称")
|
||||
private String name;
|
||||
}
|
||||
30
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/FpConstructionSituationVo.java
vendored
Normal file
30
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/FpConstructionSituationVo.java
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
package com.yfd.platform.env.fp.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "过鱼设施建设及接入情况")
|
||||
public class FpConstructionSituationVo {
|
||||
|
||||
@Schema(description = "过鱼设施类型")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "已接入")
|
||||
private Integer bonusing;
|
||||
|
||||
@Schema(description = "已建")
|
||||
private Integer built;
|
||||
|
||||
@Schema(description = "已建已接入")
|
||||
private Integer builtConnected;
|
||||
|
||||
@Schema(description = "在建")
|
||||
private Integer building;
|
||||
|
||||
@Schema(description = "在建已接入")
|
||||
private Integer buildingConnected;
|
||||
|
||||
@Schema(description = "规划")
|
||||
private Integer noBuilt;
|
||||
}
|
||||
24
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/FpFtpStatisticsVo.java
vendored
Normal file
24
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/FpFtpStatisticsVo.java
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
package com.yfd.platform.env.fp.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "按鱼种统计的过鱼数量")
|
||||
public class FpFtpStatisticsVo {
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "鱼种编码")
|
||||
private String ftp;
|
||||
|
||||
@Schema(description = "鱼种名称")
|
||||
private String fishName;
|
||||
|
||||
@Schema(description = "过鱼数量")
|
||||
private Integer fcnt;
|
||||
}
|
||||
47
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/FpRunPlanVo.java
vendored
Normal file
47
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/FpRunPlanVo.java
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
package com.yfd.platform.env.fp.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "过鱼设施运行情况二级弹窗标题数据")
|
||||
public class FpRunPlanVo {
|
||||
|
||||
@Schema(description = "设施编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "计划开始月份")
|
||||
private String designStartDate;
|
||||
|
||||
@Schema(description = "计划结束月份")
|
||||
private String designEndDate;
|
||||
|
||||
@Schema(description = "计划运行月数")
|
||||
private Integer mon;
|
||||
|
||||
@Schema(description = "计划运行频次")
|
||||
private Integer pyRate;
|
||||
|
||||
@Schema(description = "计划运行次数")
|
||||
private Integer pycnt;
|
||||
|
||||
@Schema(description = "设施类型编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "过鱼类型 0鱼道 1过鱼机")
|
||||
private Integer dwtp;
|
||||
|
||||
@Schema(description = "计划过鱼种类")
|
||||
private String planFtp;
|
||||
|
||||
@Schema(description = "计划过鱼列表")
|
||||
private List<FdFishVo> planList;
|
||||
|
||||
@Schema(description = "设计过鱼列表")
|
||||
private List<FdFishVo> designList;
|
||||
|
||||
@Schema(description = "过鱼对象列表")
|
||||
private List<FdFishVo> objList;
|
||||
}
|
||||
23
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/YearFpStatisticsVo.java
vendored
Normal file
23
backend/src/main/java/com/yfd/platform/env/fp/entity/vo/YearFpStatisticsVo.java
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
package com.yfd.platform.env.fp.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "按基地分组的年度过鱼统计")
|
||||
public class YearFpStatisticsVo {
|
||||
|
||||
@Schema(description = "过鱼总数")
|
||||
private Integer fpCount;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "按鱼种统计列表")
|
||||
private List<FpFtpStatisticsVo> fpFtpStatitcsVos;
|
||||
}
|
||||
10
backend/src/main/java/com/yfd/platform/env/fp/service/FpBuildService.java
vendored
Normal file
10
backend/src/main/java/com/yfd/platform/env/fp/service/FpBuildService.java
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
package com.yfd.platform.env.fp.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.fp.entity.vo.FpConstructionSituationVo;
|
||||
|
||||
public interface FpBuildService {
|
||||
|
||||
DataSourceResult<FpConstructionSituationVo> processKendoList(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
15
backend/src/main/java/com/yfd/platform/env/fp/service/FpRunService.java
vendored
Normal file
15
backend/src/main/java/com/yfd/platform/env/fp/service/FpRunService.java
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
package com.yfd.platform.env.fp.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.fp.entity.vo.YearFpStatisticsVo;
|
||||
import com.yfd.platform.env.fp.entity.vo.FpRunPlanVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FpRunService {
|
||||
|
||||
DataSourceResult<FpRunPlanVo> processQgcSecondPlanKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
List<YearFpStatisticsVo> getYearFpStatic(String year);
|
||||
}
|
||||
54
backend/src/main/java/com/yfd/platform/env/fp/service/impl/FpBuildServiceImpl.java
vendored
Normal file
54
backend/src/main/java/com/yfd/platform/env/fp/service/impl/FpBuildServiceImpl.java
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
package com.yfd.platform.env.fp.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.common.PageInfo;
|
||||
import com.yfd.platform.env.fp.entity.vo.FpConstructionSituationVo;
|
||||
import com.yfd.platform.env.fp.service.FpBuildService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FpBuildServiceImpl implements FpBuildService {
|
||||
|
||||
@Resource
|
||||
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FpConstructionSituationVo> processKendoList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
PageInfo pageInfo = QgcQueryWrapperUtil.getPageInfo(loadOptions);
|
||||
Page<?> page = pageInfo.getHasPageInfo() ? pageInfo.getPage() : null;
|
||||
|
||||
String sql = "SELECT t.STTP AS sttpCode, " +
|
||||
" SUM(CASE WHEN t.DTIN = 1 THEN 1 ELSE 0 END) AS bonusing, " +
|
||||
" SUM(CASE WHEN t.DTIN = 1 AND t.BLDSTT_CODE = 2 THEN 1 ELSE 0 END) AS builtConnected, " +
|
||||
" SUM(CASE WHEN t.BLDSTT_CODE = 2 THEN 1 ELSE 0 END) AS built, " +
|
||||
" SUM(CASE WHEN t.DTIN = 1 AND t.BLDSTT_CODE = 1 THEN 1 ELSE 0 END) AS buildingConnected, " +
|
||||
" SUM(CASE WHEN t.BLDSTT_CODE = 1 THEN 1 ELSE 0 END) AS building, " +
|
||||
" SUM(CASE WHEN NVL(t.BLDSTT_CODE, 0) = 0 THEN 1 ELSE 0 END) AS noBuilt " +
|
||||
"FROM SD_FPSS_B_H t " +
|
||||
"GROUP BY t.STTP " +
|
||||
"ORDER BY t.STTP";
|
||||
|
||||
List<FpConstructionSituationVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||
page,
|
||||
sql,
|
||||
new HashMap<>(),
|
||||
FpConstructionSituationVo.class
|
||||
);
|
||||
|
||||
DataSourceResult<FpConstructionSituationVo> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(page != null ? page.getTotal() : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
242
backend/src/main/java/com/yfd/platform/env/fp/service/impl/FpRunServiceImpl.java
vendored
Normal file
242
backend/src/main/java/com/yfd/platform/env/fp/service/impl/FpRunServiceImpl.java
vendored
Normal file
@ -0,0 +1,242 @@
|
||||
package com.yfd.platform.env.fp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.env.fp.entity.vo.FpFtpStatisticsVo;
|
||||
import com.yfd.platform.env.fp.entity.vo.FpRunPlanVo;
|
||||
import com.yfd.platform.env.fp.entity.vo.YearFpStatisticsVo;
|
||||
import com.yfd.platform.env.fp.service.FpRunService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Service
|
||||
public class FpRunServiceImpl implements FpRunService {
|
||||
|
||||
private static final String FP_1 = "FP_1";
|
||||
private static final String FP_2 = "FP_2";
|
||||
private static final Pattern FISH_NAME_PATTERN = Pattern.compile("name\\s*[::]\\s*([^,,}\\]]+)");
|
||||
|
||||
@Resource
|
||||
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FpRunPlanVo> processQgcSecondPlanKendoList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||
String yr = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "yr");
|
||||
if (StrUtil.isBlank(stcd)) {
|
||||
throw new BizException("设施编码(stcd)不能为空.");
|
||||
}
|
||||
if (StrUtil.isBlank(yr)) {
|
||||
throw new BizException("年份(yr)不能为空.");
|
||||
}
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", stcd);
|
||||
paramMap.put("yr", yr);
|
||||
|
||||
Map<String, Object> row = microservicDynamicSQLMapper.getOneBySql(buildQgcSecondPlanSql(), paramMap);
|
||||
FpRunPlanVo vo = row == null || row.isEmpty()
|
||||
? new FpRunPlanVo()
|
||||
: BeanUtil.fillBeanWithMap(
|
||||
row,
|
||||
new FpRunPlanVo(),
|
||||
CopyOptions.create().setIgnoreCase(true).setIgnoreError(true)
|
||||
);
|
||||
|
||||
String fallbackFishJson = row == null ? null : Convert.toStr(row.get("fallbackFishJson"), null);
|
||||
String fallbackFishText = row == null ? null : Convert.toStr(row.get("fallbackFishText"), null);
|
||||
if (StrUtil.isBlank(vo.getPlanFtp())) {
|
||||
vo.setPlanFtp(resolveFallbackFishText(fallbackFishJson, fallbackFishText));
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(vo.getDesignStartDate()) && StrUtil.isNotBlank(vo.getDesignEndDate())) {
|
||||
try {
|
||||
int startMonth = Integer.parseInt(vo.getDesignStartDate());
|
||||
int endMonth = Integer.parseInt(vo.getDesignEndDate());
|
||||
vo.setMon(Math.abs(endMonth - startMonth) + 1);
|
||||
} catch (Exception ignored) {
|
||||
// Keep the old behavior: ignore invalid month format and return the raw values.
|
||||
}
|
||||
}
|
||||
|
||||
if (FP_1.equals(vo.getSttpCode()) || FP_2.equals(vo.getSttpCode())) {
|
||||
vo.setDwtp(0);
|
||||
} else {
|
||||
vo.setDwtp(1);
|
||||
if (vo.getPycnt() != null && vo.getPycnt() != 0 && vo.getMon() != null && vo.getMon() != 0) {
|
||||
vo.setPyRate(new BigDecimal(vo.getPycnt())
|
||||
.divide(new BigDecimal(vo.getMon()), 2, RoundingMode.HALF_UP)
|
||||
.intValue());
|
||||
}
|
||||
}
|
||||
|
||||
DataSourceResult<FpRunPlanVo> result = new DataSourceResult<>();
|
||||
result.setData(Collections.singletonList(vo));
|
||||
result.setTotal(1L);
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YearFpStatisticsVo> getYearFpStatic(String year) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("year", StrUtil.trim(year));
|
||||
List<FpFtpStatisticsVo> rows = microservicDynamicSQLMapper.getAllListWithResultType(
|
||||
buildYearFpStatisticsSql(),
|
||||
paramMap,
|
||||
FpFtpStatisticsVo.class
|
||||
);
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
Map<String, YearFpStatisticsVo> grouped = new LinkedHashMap<>();
|
||||
for (FpFtpStatisticsVo row : rows) {
|
||||
String key = StrUtil.nullToDefault(row.getBaseId(), "");
|
||||
YearFpStatisticsVo yearVo = grouped.computeIfAbsent(key, k -> {
|
||||
YearFpStatisticsVo item = new YearFpStatisticsVo();
|
||||
item.setBaseId(row.getBaseId());
|
||||
item.setBaseName(row.getBaseName());
|
||||
item.setFpCount(0);
|
||||
item.setFpFtpStatitcsVos(new ArrayList<>());
|
||||
return item;
|
||||
});
|
||||
yearVo.setFpCount(yearVo.getFpCount() + (row.getFcnt() == null ? 0 : row.getFcnt()));
|
||||
yearVo.getFpFtpStatitcsVos().add(row);
|
||||
}
|
||||
return new ArrayList<>(grouped.values());
|
||||
}
|
||||
|
||||
private String buildQgcSecondPlanSql() {
|
||||
return "SELECT t.STCD AS stcd, " +
|
||||
" t2.stm AS designStartDate, " +
|
||||
" t2.edm AS designEndDate, " +
|
||||
" t2.pycnt AS pycnt, " +
|
||||
" NULL AS pyRate, " +
|
||||
" t.STTP AS sttpCode, " +
|
||||
" t1.planFtp AS planFtp, " +
|
||||
" t.ZYGYDX AS fallbackFishJson, " +
|
||||
" NVL(t.ZYGYDXMS, t.JGGYDXMS) AS fallbackFishText " +
|
||||
"FROM SD_FPSS_B_H t " +
|
||||
"LEFT JOIN ( " +
|
||||
" SELECT a.STCD, " +
|
||||
" REGEXP_REPLACE(LISTAGG(TO_CHAR(fish.NAME), ',') WITHIN GROUP (ORDER BY NVL(rel.ORDER_INDEX, 999999), a.FTP), '([^,]+)(,\\1)*(,|$)', '\\1\\3') AS planFtp " +
|
||||
" FROM ( " +
|
||||
" SELECT STCD, TRIM(REGEXP_SUBSTR(FTP, '[^,]+', 1, LEVEL)) AS FTP " +
|
||||
" FROM ( " +
|
||||
" SELECT STCD, FTP " +
|
||||
" FROM SD_FPRUNPLAN_B " +
|
||||
" WHERE (TASK_STATUS = 'Approved' OR TASK_STATUS IS NULL) " +
|
||||
" AND IS_DELETED = 0 " +
|
||||
" AND STCD = #{map.stcd} " +
|
||||
" AND TO_CHAR(START_TIME, 'yyyy') = #{map.yr} " +
|
||||
" ) " +
|
||||
" CONNECT BY REGEXP_SUBSTR(FTP, '[^,]+', 1, LEVEL) IS NOT NULL " +
|
||||
" AND PRIOR TO_CHAR(SYS_GUID()) IS NOT NULL " +
|
||||
" AND PRIOR FTP = FTP " +
|
||||
" AND PRIOR STCD = STCD " +
|
||||
" ) a " +
|
||||
" INNER JOIN SD_FPSS_B_H fpss ON fpss.STCD = a.STCD " +
|
||||
" LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = fpss.RSTCD " +
|
||||
" LEFT JOIN SD_FISHDICTORY_RLTN_B rel ON rel.RVCD = eng.HBRVCD " +
|
||||
" AND rel.FISH_ID = a.FTP " +
|
||||
" AND rel.IS_DELETED = 0 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_B fish ON fish.ID = NVL(rel.ZY_FISH_ID, a.FTP) " +
|
||||
" AND fish.IS_DELETED = 0 " +
|
||||
" GROUP BY a.STCD " +
|
||||
") t1 ON t.STCD = t1.STCD " +
|
||||
"LEFT JOIN ( " +
|
||||
" SELECT a.STCD, MIN(a.stm) AS stm, MAX(a.edm) AS edm, MAX(a.pycnt) AS pycnt " +
|
||||
" FROM ( " +
|
||||
" SELECT STCD, TO_CHAR(START_TIME, 'mm') AS stm, TO_CHAR(END_TIME, 'mm') AS edm, PYCNT AS pycnt " +
|
||||
" FROM SD_FPRUNPLAN_B " +
|
||||
" WHERE (TASK_STATUS = 'Approved' OR TASK_STATUS IS NULL) " +
|
||||
" AND IS_DELETED = 0 " +
|
||||
" AND STCD = #{map.stcd} " +
|
||||
" AND TO_CHAR(START_TIME, 'yyyy') = #{map.yr} " +
|
||||
" UNION ALL " +
|
||||
" SELECT STCD, STMONTH AS stm, ETMMONTH AS edm, FREQUENCY AS pycnt " +
|
||||
" FROM SD_FPDESIGNSTAND_B " +
|
||||
" WHERE IS_DELETED = 0 " +
|
||||
" AND STCD = #{map.stcd} " +
|
||||
" AND STCD NOT IN ( " +
|
||||
" SELECT STCD " +
|
||||
" FROM SD_FPRUNPLAN_B " +
|
||||
" WHERE (TASK_STATUS = 'Approved' OR TASK_STATUS IS NULL) " +
|
||||
" AND IS_DELETED = 0 " +
|
||||
" AND STCD = #{map.stcd} " +
|
||||
" AND TO_CHAR(START_TIME, 'yyyy') = #{map.yr} " +
|
||||
" GROUP BY STCD " +
|
||||
" ) " +
|
||||
" ) a " +
|
||||
" GROUP BY a.STCD " +
|
||||
") t2 ON t.STCD = t2.STCD " +
|
||||
"WHERE t.STCD = #{map.stcd}";
|
||||
}
|
||||
|
||||
private String buildYearFpStatisticsSql() {
|
||||
return "SELECT eng.BASE_ID AS baseId, " +
|
||||
" hb.BASENAME AS baseName, " +
|
||||
" a.FTP AS ftp, " +
|
||||
" COALESCE(fishRv.NAME, relRv.FISH_NAME, fishZy.NAME, relZy.FISH_NAME, a.FTP) AS fishName, " +
|
||||
" SUM(a.FCNT) AS fcnt " +
|
||||
"FROM SD_FPSS_R a " +
|
||||
"INNER JOIN ( " +
|
||||
" SELECT STCD, MAX(RSTCD) AS RSTCD " +
|
||||
" FROM SD_FPSS_B_H " +
|
||||
" GROUP BY STCD " +
|
||||
") fpss ON fpss.STCD = a.STCD " +
|
||||
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = fpss.RSTCD " +
|
||||
"LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = eng.BASE_ID " +
|
||||
"LEFT JOIN SD_FISHDICTORY_RLTN_B relRv ON relRv.FISH_ID = a.FTP " +
|
||||
" AND relRv.RVCD = eng.HBRVCD " +
|
||||
" AND relRv.IS_DELETED = 0 " +
|
||||
"LEFT JOIN SD_FISHDICTORY_B fishRv ON fishRv.ID = NVL(relRv.ZY_FISH_ID, relRv.FISH_ID) " +
|
||||
" AND fishRv.IS_DELETED = 0 " +
|
||||
"LEFT JOIN SD_FISHDICTORY_RLTN_B relZy ON relZy.FISH_ID = a.FTP " +
|
||||
" AND relZy.RVCD = 'ZY' " +
|
||||
" AND relZy.IS_DELETED = 0 " +
|
||||
"LEFT JOIN SD_FISHDICTORY_B fishZy ON fishZy.ID = NVL(relZy.ZY_FISH_ID, relZy.FISH_ID) " +
|
||||
" AND fishZy.IS_DELETED = 0 " +
|
||||
"WHERE NVL(a.IS_DELETED, 0) = 0 " +
|
||||
" AND (#{map.year} IS NULL OR #{map.year} = '' OR TO_CHAR(a.STRDT, 'YYYY') = #{map.year}) " +
|
||||
"GROUP BY eng.BASE_ID, hb.BASENAME, a.FTP, COALESCE(fishRv.NAME, relRv.FISH_NAME, fishZy.NAME, relZy.FISH_NAME, a.FTP) " +
|
||||
"ORDER BY eng.BASE_ID, a.FTP";
|
||||
}
|
||||
|
||||
private String resolveFallbackFishText(String fallbackFishJson, String fallbackFishText) {
|
||||
if (StrUtil.isNotBlank(fallbackFishJson)) {
|
||||
Set<String> fishNames = new LinkedHashSet<>();
|
||||
Matcher matcher = FISH_NAME_PATTERN.matcher(fallbackFishJson);
|
||||
while (matcher.find()) {
|
||||
fishNames.add(StrUtil.trim(matcher.group(1)));
|
||||
}
|
||||
if (!fishNames.isEmpty()) {
|
||||
return String.join(",", fishNames);
|
||||
}
|
||||
}
|
||||
return StrUtil.blankToDefault(StrUtil.trim(fallbackFishText), null);
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,11 @@
|
||||
package com.yfd.platform.env.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.env.domain.SdHydrobase;
|
||||
import com.yfd.platform.env.entity.vo.HydrobaseWbsVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@ -34,6 +37,8 @@ public interface ISdHydrobaseService extends IService<SdHydrobase> {
|
||||
*/
|
||||
List<SdHydrobase> selectForDropdown(String basename);
|
||||
|
||||
DataSourceResult<HydrobaseWbsVo> getWbsbKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
Set<String> getUserAuthorizedStationCodes();
|
||||
|
||||
/**
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
package com.yfd.platform.env.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.entity.vo.FishSpawnVo;
|
||||
import com.yfd.platform.env.entity.vo.WtrvVo;
|
||||
|
||||
public interface SdWtMonitorService {
|
||||
|
||||
DataSourceResult getEvnmAutoMonitorList();
|
||||
|
||||
DataSourceResult getVmsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getCxDetailList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getWtFishAnalysis(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FishSpawnVo> getWtFishInfo(DataSourceRequest dataSourceRequest);
|
||||
|
||||
WtrvVo getFlagByStcd(String stcd);
|
||||
}
|
||||
@ -3,10 +3,13 @@ package com.yfd.platform.env.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.data.domain.SysUserDataScope;
|
||||
import com.yfd.platform.data.mapper.SysUserDataScopeMapper;
|
||||
import com.yfd.platform.env.domain.SdEngInfoBH;
|
||||
import com.yfd.platform.env.domain.SdHydrobase;
|
||||
import com.yfd.platform.env.entity.vo.HydrobaseWbsVo;
|
||||
import com.yfd.platform.env.mapper.SdEngInfoBHMapper;
|
||||
import com.yfd.platform.env.mapper.SdHydrobaseMapper;
|
||||
import com.yfd.platform.env.service.ISdHydrobaseService;
|
||||
@ -16,8 +19,10 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -97,6 +102,64 @@ public class SdHydrobaseServiceImpl extends ServiceImpl<SdHydrobaseMapper, SdHyd
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<HydrobaseWbsVo> getWbsbKendoList(DataSourceRequest dataSourceRequest) {
|
||||
LambdaQueryWrapper<SdHydrobase> wrapper = new LambdaQueryWrapper<>();
|
||||
List<DataSourceRequest.FilterDescriptor> filters = new ArrayList<>();
|
||||
collectFilters(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), filters);
|
||||
|
||||
String wbsType = null;
|
||||
String treeLevel = null;
|
||||
for (DataSourceRequest.FilterDescriptor filter : filters) {
|
||||
if (!"eq".equalsIgnoreCase(filter.getOperator()) || filter.getValue() == null) {
|
||||
continue;
|
||||
}
|
||||
if ("wbsType".equals(filter.getField())) {
|
||||
wbsType = String.valueOf(filter.getValue());
|
||||
} else if ("treeLevel".equals(filter.getField())) {
|
||||
treeLevel = String.valueOf(filter.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
DataSourceResult<HydrobaseWbsVo> result = new DataSourceResult<>();
|
||||
result.setAggregates(new HashMap<>());
|
||||
|
||||
if (StringUtils.hasText(wbsType) && !"PSB".equalsIgnoreCase(wbsType)) {
|
||||
result.setData(new ArrayList<>());
|
||||
result.setTotal(0L);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (StringUtils.hasText(treeLevel)) {
|
||||
try {
|
||||
wrapper.eq(SdHydrobase::getGrd, Integer.parseInt(treeLevel));
|
||||
} catch (NumberFormatException ignored) {
|
||||
result.setData(new ArrayList<>());
|
||||
result.setTotal(0L);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
applySort(wrapper, dataSourceRequest == null ? null : dataSourceRequest.getSort());
|
||||
|
||||
List<SdHydrobase> hydrobaseList;
|
||||
if (dataSourceRequest != null && dataSourceRequest.getTake() > 0) {
|
||||
Page<SdHydrobase> page = new Page<>(
|
||||
(long) (dataSourceRequest.getSkip() / dataSourceRequest.getTake() + 1),
|
||||
dataSourceRequest.getTake()
|
||||
);
|
||||
Page<SdHydrobase> pageResult = this.page(page, wrapper);
|
||||
hydrobaseList = pageResult.getRecords();
|
||||
result.setTotal(pageResult.getTotal());
|
||||
} else {
|
||||
hydrobaseList = this.list(wrapper);
|
||||
result.setTotal(hydrobaseList.size());
|
||||
}
|
||||
|
||||
result.setData(hydrobaseList.stream().map(this::toHydrobaseWbsVo).collect(Collectors.toList()));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getUserAuthorizedStationCodes() {
|
||||
String userId = SecurityUtils.getUserId();
|
||||
@ -176,4 +239,72 @@ public class SdHydrobaseServiceImpl extends ServiceImpl<SdHydrobaseMapper, SdHyd
|
||||
public boolean deleteHydrobase(String baseid) {
|
||||
return this.removeById(baseid);
|
||||
}
|
||||
|
||||
private void collectFilters(DataSourceRequest.FilterDescriptor root, List<DataSourceRequest.FilterDescriptor> filters) {
|
||||
if (root == null) {
|
||||
return;
|
||||
}
|
||||
if (StringUtils.hasText(root.getField())) {
|
||||
filters.add(root);
|
||||
return;
|
||||
}
|
||||
if (root.getFilters() == null || root.getFilters().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (DataSourceRequest.FilterDescriptor filter : root.getFilters()) {
|
||||
collectFilters(filter, filters);
|
||||
}
|
||||
}
|
||||
|
||||
private void applySort(LambdaQueryWrapper<SdHydrobase> wrapper, List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
boolean hasSort = false;
|
||||
if (sortList != null) {
|
||||
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||
if (sortDescriptor == null || !StringUtils.hasText(sortDescriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
boolean asc = !"desc".equalsIgnoreCase(sortDescriptor.getDir());
|
||||
if ("orderIndex".equals(sortDescriptor.getField())) {
|
||||
if (asc) {
|
||||
wrapper.orderByAsc(SdHydrobase::getOrderIndex);
|
||||
} else {
|
||||
wrapper.orderByDesc(SdHydrobase::getOrderIndex);
|
||||
}
|
||||
hasSort = true;
|
||||
} else if ("wbsCode".equals(sortDescriptor.getField())) {
|
||||
if (asc) {
|
||||
wrapper.orderByAsc(SdHydrobase::getBaseid);
|
||||
} else {
|
||||
wrapper.orderByDesc(SdHydrobase::getBaseid);
|
||||
}
|
||||
hasSort = true;
|
||||
} else if ("wbsName".equals(sortDescriptor.getField())) {
|
||||
if (asc) {
|
||||
wrapper.orderByAsc(SdHydrobase::getBasename);
|
||||
} else {
|
||||
wrapper.orderByDesc(SdHydrobase::getBasename);
|
||||
}
|
||||
hasSort = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasSort) {
|
||||
wrapper.orderByAsc(SdHydrobase::getOrderIndex);
|
||||
}
|
||||
}
|
||||
|
||||
private HydrobaseWbsVo toHydrobaseWbsVo(SdHydrobase hydrobase) {
|
||||
HydrobaseWbsVo vo = new HydrobaseWbsVo();
|
||||
vo.setWbsCode(hydrobase.getBaseid());
|
||||
vo.setWbsName(hydrobase.getBasename());
|
||||
vo.setPwbsCode(hydrobase.getPbaseid());
|
||||
vo.setWbsType("PSB");
|
||||
vo.setTreeLevel(hydrobase.getGrd() == null ? null : String.valueOf(hydrobase.getGrd()));
|
||||
vo.setPath(hydrobase.getPath());
|
||||
vo.setOrderIndex(hydrobase.getOrderIndex());
|
||||
vo.setRmk(hydrobase.getRmk());
|
||||
vo.setDes(hydrobase.getDes());
|
||||
vo.setShortname(hydrobase.getShortname());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
@ -1,800 +0,0 @@
|
||||
package com.yfd.platform.env.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.common.*;
|
||||
import com.yfd.platform.env.entity.vo.FishSpawnVo;
|
||||
import com.yfd.platform.env.entity.vo.SdWtMonitorCountVO;
|
||||
import com.yfd.platform.env.entity.vo.SdWtBaseInfoVO;
|
||||
import com.yfd.platform.env.entity.vo.WtrvVo;
|
||||
import com.yfd.platform.env.entity.vo.WtFishVo;
|
||||
import com.yfd.platform.env.mapper.SdWtMonitorMapper;
|
||||
import com.yfd.platform.env.service.SdWtMonitorService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.Data;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
||||
|
||||
@Resource
|
||||
private SdWtMonitorMapper sdWtMonitorMapper;
|
||||
|
||||
@Resource
|
||||
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||
|
||||
@Override
|
||||
public DataSourceResult getEvnmAutoMonitorList() {
|
||||
List<SdWtMonitorCountVO> list = sdWtMonitorMapper.getMonitorCountList();
|
||||
DataSourceResult<SdWtMonitorCountVO> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(list == null ? 0 : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WtrvVo getFlagByStcd(String stcd) {
|
||||
String sql = "SELECT wt.STCD AS stcd, " +
|
||||
"CASE WHEN rel.ENG_IWT_CODE IS NOT NULL OR rel.ENG_DWT_CODE IS NOT NULL THEN 1 ELSE 0 END AS isIoWtrv, " +
|
||||
"CASE WHEN EXISTS ( " +
|
||||
" SELECT 1 FROM SD_WT_B_H vt " +
|
||||
" WHERE vt.RSTCD = wt.RSTCD " +
|
||||
" AND vt.STTP = 'WTVT' " +
|
||||
" AND vt.IS_DELETED = 0 " +
|
||||
" AND vt.MWAY = 2" +
|
||||
") THEN 1 ELSE 0 END AS hasRstcdWtvt " +
|
||||
"FROM SD_WT_B_H wt " +
|
||||
"LEFT JOIN SD_WTENGRLTN_B rel ON rel.STCD = wt.STCD AND rel.IS_DELETED = 0 " +
|
||||
"WHERE wt.STCD = #{map.stcd} " +
|
||||
" AND wt.STTP = 'WTRV' " +
|
||||
" AND wt.IS_DELETED = 0";
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", stcd);
|
||||
WtrvVo vo = (WtrvVo) microservicDynamicSQLMapper.getOneBySqlWithResultType(sql, paramMap, WtrvVo.class);
|
||||
if (vo == null ) {
|
||||
return buildDefaultWtrvVo(stcd);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult getWtFishAnalysis(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String startTime = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "startTime");
|
||||
String endTime = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "endTime");
|
||||
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||
DataSourceResult<WtFishVo> result = new DataSourceResult<>();
|
||||
if (StrUtil.isBlank(stcd) || StrUtil.isBlank(startTime) || StrUtil.isBlank(endTime)) {
|
||||
result.setData(new ArrayList<>());
|
||||
result.setTotal(0L);
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append("t1.DT AS dt, ")
|
||||
.append("t2.WT AS wt, ")
|
||||
.append("eng.HBRVCD AS hbrvcd, ")
|
||||
.append("t3.WT AS beforeWt ")
|
||||
.append("FROM (SELECT TRUNC(TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS')) + LEVEL - 1 AS DT ")
|
||||
.append(" FROM DUAL ")
|
||||
.append(" CONNECT BY TRUNC(TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS')) + LEVEL - 1 <= TRUNC(TO_DATE(#{map.endTime}, 'YYYY-MM-DD HH24:MI:SS'))) t1 ")
|
||||
.append("LEFT JOIN (SELECT STCD, WT, DT FROM SD_WTRVDAY_S ")
|
||||
.append(" WHERE IS_DELETED = 0 ")
|
||||
.append(" AND STCD = #{map.stcd} ")
|
||||
.append(" AND DT >= TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS') ")
|
||||
.append(" AND DT <= TO_DATE(#{map.endTime}, 'YYYY-MM-DD HH24:MI:SS')) t2 ")
|
||||
.append(" ON t1.DT = t2.DT ")
|
||||
.append("LEFT JOIN (SELECT STCD, WT, DT FROM SD_WTRVDAY_S ")
|
||||
.append(" WHERE IS_DELETED = 0 ")
|
||||
.append(" AND STCD = #{map.stcd} ")
|
||||
.append(" AND DT >= ADD_MONTHS(TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS'), -12) ")
|
||||
.append(" AND DT <= ADD_MONTHS(TO_DATE(#{map.endTime}, 'YYYY-MM-DD HH24:MI:SS'), -12)) t3 ")
|
||||
.append(" ON t1.DT = ADD_MONTHS(t3.DT, 12) ")
|
||||
.append("LEFT JOIN SD_WT_B_H wt ON wt.STCD = #{map.stcd} AND wt.IS_DELETED = 0 AND wt.STTP = 'WTRV' ")
|
||||
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = wt.RSTCD ")
|
||||
.append("WHERE (t2.WT IS NOT NULL OR t3.WT IS NOT NULL) ")
|
||||
.append(" AND t1.DT <= SYSDATE ")
|
||||
.append("ORDER BY t1.DT DESC");
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", stcd);
|
||||
paramMap.put("startTime", startTime);
|
||||
paramMap.put("endTime", endTime);
|
||||
|
||||
Page<?> page = buildPage(dataSourceRequest.toDevRequest());
|
||||
List<WtFishVo> wtFishVoList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, WtFishVo.class);
|
||||
String hbrvcd = wtFishVoList.isEmpty() ? null : wtFishVoList.get(0).getHbrvcd();
|
||||
|
||||
if (StrUtil.isNotBlank(hbrvcd)) {
|
||||
String fishSql = "SELECT t1.ID AS id, " +
|
||||
"t1.NAME AS name, " +
|
||||
"t1.PRETEMP AS pretempStr, " +
|
||||
"t1.SPAWN_MONTH AS spawnMonthStr " +
|
||||
"FROM SD_FISHDICTORY_B t1 " +
|
||||
"INNER JOIN SD_FISHDICTORY_RLTN_B t2 ON t1.ID = t2.ZY_FISH_ID " +
|
||||
"WHERE t1.IS_DELETED = 0 " +
|
||||
" AND t2.IS_DELETED = 0 " +
|
||||
" AND t2.RVCD = #{map.hbrvcd} " +
|
||||
" AND t1.PRETEMP IS NOT NULL " +
|
||||
" AND t1.SPAWN_MONTH IS NOT NULL " +
|
||||
"ORDER BY NVL(t2.ORDER_INDEX, 999999), NVL(t1.ORDER_INDEX, 999999), t1.NAME";
|
||||
Map<String, Object> fishParamMap = new HashMap<>();
|
||||
fishParamMap.put("hbrvcd", hbrvcd);
|
||||
List<FishSpawnVo> fishSpawnVoList = microservicDynamicSQLMapper.getAllListWithResultType(fishSql, fishParamMap, FishSpawnVo.class);
|
||||
fillFishList(wtFishVoList, fishSpawnVoList);
|
||||
}
|
||||
|
||||
result.setData(wtFishVoList);
|
||||
result.setTotal(page != null ? page.getTotal() : wtFishVoList.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FishSpawnVo> getWtFishInfo(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||
|
||||
DataSourceResult<FishSpawnVo> result = new DataSourceResult<>();
|
||||
if (StrUtil.isBlank(stcd)) {
|
||||
result.setData(new ArrayList<>());
|
||||
result.setTotal(0L);
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
String sql = "SELECT DISTINCT " +
|
||||
"t2.ID AS id, " +
|
||||
"t2.NAME AS name, " +
|
||||
"t2.PRETEMP AS pretempStr, " +
|
||||
"t2.SPAWN_MONTH AS spawnMonthStr " +
|
||||
"FROM SD_WT_B_H t1 " +
|
||||
"INNER JOIN SD_ENGINFO_B_H eng ON eng.STCD = t1.RSTCD " +
|
||||
"INNER JOIN SD_FISHDICTORY_RLTN_B t3 ON eng.HBRVCD = t3.RVCD " +
|
||||
"INNER JOIN SD_FISHDICTORY_B t2 ON t2.ID = t3.ZY_FISH_ID " +
|
||||
"WHERE t1.STCD = #{map.stcd} " +
|
||||
" AND t1.IS_DELETED = 0 " +
|
||||
" AND t1.STTP = 'WTRV' " +
|
||||
" AND t2.IS_DELETED = 0 " +
|
||||
" AND t3.IS_DELETED = 0 " +
|
||||
" AND t2.PRETEMP IS NOT NULL " +
|
||||
" AND t2.SPAWN_MONTH IS NOT NULL";
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", stcd);
|
||||
List<FishSpawnVo> list = microservicDynamicSQLMapper.getAllListWithResultType(sql, paramMap, FishSpawnVo.class);
|
||||
for (FishSpawnVo fishSpawnVo : list) {
|
||||
fillFishSpawnMeta(fishSpawnVo);
|
||||
}
|
||||
result.setData(list);
|
||||
result.setTotal((long) list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult getVmsstbprptList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String mway = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "mway");
|
||||
String sttpCode = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "sttpCode");
|
||||
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rstcd");
|
||||
String stnm = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stnm");
|
||||
String coenvwState = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "coenvwState");
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append("hb.BASENAME AS baseName, ")
|
||||
.append("wt.STNM AS stnm, ")
|
||||
.append("eng.ENNM AS ennm, ")
|
||||
.append("wt.JCDT AS jcdt, ")
|
||||
.append("wt.STINDX AS stindx, ")
|
||||
.append("CASE ")
|
||||
.append("WHEN wt.STTP = 'WTRV' AND rvRecent.STCD IS NOT NULL THEN 1 ")
|
||||
.append("WHEN wt.STTP = 'WTVT' AND vtRecent.STCD IS NOT NULL THEN 1 ")
|
||||
.append("ELSE 0 END AS coenvwState, ")
|
||||
.append("wt.STTP AS sttpCode, ")
|
||||
.append("wt.STCD AS stcd, ")
|
||||
.append("wt.RSTCD AS rstcd, ")
|
||||
.append("NULL AS stCode, ")
|
||||
.append("NULL AS stName, ")
|
||||
.append("eng.DVTP AS dvtp, ")
|
||||
.append("hb.ORDER_INDEX AS baseStepSort, ")
|
||||
.append("eng.HBRVCD AS hbrvcd, ")
|
||||
.append("eng.ORDER_INDEX AS rstcdStepSort, ")
|
||||
.append("wt.ORDER_INDEX AS siteStepSort ")
|
||||
.append("FROM SD_WT_B_H wt ")
|
||||
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = wt.RSTCD ")
|
||||
.append("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = eng.BASE_ID ")
|
||||
.append("LEFT JOIN (SELECT DISTINCT STCD FROM SD_WTRV_R WHERE IS_DELETED = 0 AND TM >= SYSDATE - 1) rvRecent ON rvRecent.STCD = wt.STCD ")
|
||||
.append("LEFT JOIN (SELECT DISTINCT STCD FROM SD_WTVT_R WHERE IS_DELETED = 0 AND TM >= SYSDATE - 1) vtRecent ON vtRecent.STCD = wt.STCD ")
|
||||
.append("WHERE wt.IS_DELETED = 0 AND wt.DTIN_TYPE = 0 ");
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
if (mway != null && !mway.isBlank()) {
|
||||
paramMap.put("mway", mway);
|
||||
sql.append("AND wt.MWAY = #{map.mway} ");
|
||||
}
|
||||
if (sttpCode != null && !sttpCode.isBlank()) {
|
||||
paramMap.put("sttpCode", sttpCode);
|
||||
sql.append("AND wt.STTP = #{map.sttpCode} ");
|
||||
}
|
||||
if (rstcd != null && !rstcd.isBlank()) {
|
||||
paramMap.put("rstcd", rstcd);
|
||||
sql.append("AND wt.RSTCD = #{map.rstcd} ");
|
||||
}
|
||||
if (stnm != null && !stnm.isBlank()) {
|
||||
paramMap.put("stnm", "%" + stnm + "%");
|
||||
sql.append("AND wt.STNM LIKE #{map.stnm} ");
|
||||
}
|
||||
if (coenvwState != null && !coenvwState.isBlank()) {
|
||||
paramMap.put("coenvwState", coenvwState);
|
||||
sql.append("AND CASE ")
|
||||
.append("WHEN wt.STTP = 'WTRV' AND rvRecent.STCD IS NOT NULL THEN 1 ")
|
||||
.append("WHEN wt.STTP = 'WTVT' AND vtRecent.STCD IS NOT NULL THEN 1 ")
|
||||
.append("ELSE 0 END = #{map.coenvwState} ");
|
||||
}
|
||||
|
||||
sql.append(buildVmsstbprptOrderBySql(dataSourceRequest.getSort()));
|
||||
Page<?> page = buildPage(loadOptions);
|
||||
List<SdWtBaseInfoVO> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, SdWtBaseInfoVO.class);
|
||||
|
||||
DataSourceResult<SdWtBaseInfoVO> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(page != null ? page.getTotal() : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult getCxDetailList(DataSourceRequest dataSourceRequest) {
|
||||
List<DataSourceRequest.FilterDescriptor> filters = new ArrayList<>();
|
||||
collectFilters(dataSourceRequest.getFilter(), filters);
|
||||
|
||||
String stcd = null;
|
||||
String drtp = null;
|
||||
Object startTime = null;
|
||||
Object endTime = null;
|
||||
Integer startYear = null;
|
||||
Integer endYear = null;
|
||||
Integer startMonth = null;
|
||||
Integer endMonth = null;
|
||||
Integer startDr = null;
|
||||
Integer endDr = null;
|
||||
|
||||
for (DataSourceRequest.FilterDescriptor filter : filters) {
|
||||
if ("stcd".equals(filter.getField())) {
|
||||
stcd = toStringValue(filter.getValue());
|
||||
} else if ("drtp".equals(filter.getField())) {
|
||||
drtp = toStringValue(filter.getValue());
|
||||
} else if ("tm".equals(filter.getField()) && "gte".equals(filter.getOperator())) {
|
||||
startTime = filter.getValue();
|
||||
} else if ("tm".equals(filter.getField()) && "lte".equals(filter.getOperator())) {
|
||||
endTime = filter.getValue();
|
||||
} else if ("startYear".equals(filter.getField()) && "gte".equals(filter.getOperator())) {
|
||||
startYear = toIntegerValue(filter.getValue());
|
||||
} else if ("endYear".equals(filter.getField()) && "lte".equals(filter.getOperator())) {
|
||||
endYear = toIntegerValue(filter.getValue());
|
||||
} else if ("startMonth".equals(filter.getField()) && "gte".equals(filter.getOperator())) {
|
||||
startMonth = toIntegerValue(filter.getValue());
|
||||
} else if ("endMonth".equals(filter.getField()) && "lte".equals(filter.getOperator())) {
|
||||
endMonth = toIntegerValue(filter.getValue());
|
||||
} else if ("startDr".equals(filter.getField()) && "gte".equals(filter.getOperator())) {
|
||||
startDr = toIntegerValue(filter.getValue());
|
||||
} else if ("endDr".equals(filter.getField()) && "lte".equals(filter.getOperator())) {
|
||||
endDr = toIntegerValue(filter.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(stcd)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Integer wtDeviceType = sdWtMonitorMapper.getWtDeviceTypeByStcd(stcd);
|
||||
StringBuilder sql = new StringBuilder();
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", stcd);
|
||||
|
||||
if ("DAY".equals(drtp)) {
|
||||
if (startTime == null || endTime == null) {
|
||||
return emptyCxDetailResult(wtDeviceType, drtp);
|
||||
}
|
||||
sql.append("SELECT t1.STCD AS stcd, ")
|
||||
.append("wt.STNM AS stnm, ")
|
||||
.append("TO_CHAR(t1.DT, 'YYYY-MM-DD') AS dt, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.WTHG), ',') WITHIN GROUP(ORDER BY t1.VWT) AS wthg, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.VWT), ',') WITHIN GROUP(ORDER BY t1.VWT) AS vwt ")
|
||||
.append("FROM SD_WTVTDAY_S t1 ")
|
||||
.append("INNER JOIN SD_WT_B_H wt ON t1.STCD = wt.STCD ")
|
||||
.append("WHERE t1.STCD = #{map.stcd} ")
|
||||
.append("AND t1.IS_DELETED = 0 ")
|
||||
.append("AND wt.IS_DELETED = 0 ")
|
||||
.append("AND wt.STTP = 'WTVT' ")
|
||||
.append("AND t1.DT <= #{map.endTime} ")
|
||||
.append("AND t1.DT >= #{map.startTime} ")
|
||||
.append("AND t1.WTHG IS NOT NULL ")
|
||||
.append("AND t1.VWT IS NOT NULL ")
|
||||
.append("GROUP BY t1.DT, t1.STCD, wt.STNM ");
|
||||
paramMap.put("startTime", startTime);
|
||||
paramMap.put("endTime", endTime);
|
||||
} else if ("HOUR".equals(drtp)) {
|
||||
if (startTime == null || endTime == null) {
|
||||
return emptyCxDetailResult(wtDeviceType, drtp);
|
||||
}
|
||||
sql.append("SELECT t1.STCD AS stcd, ")
|
||||
.append("wt.STNM AS stnm, ")
|
||||
.append("TO_CHAR(t1.TM, 'YYYY-MM-DD HH24:MI:SS') AS dt, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.WTHG), ',') WITHIN GROUP(ORDER BY t1.WTHG) AS wthg, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.VWT), ',') WITHIN GROUP(ORDER BY t1.WTHG) AS vwt ")
|
||||
.append("FROM SD_WTVT_R t1 ")
|
||||
.append("INNER JOIN SD_WT_B_H wt ON t1.STCD = wt.STCD ")
|
||||
.append("WHERE t1.STCD = #{map.stcd} ")
|
||||
.append("AND t1.IS_DELETED = 0 ")
|
||||
.append("AND wt.IS_DELETED = 0 ")
|
||||
.append("AND wt.STTP = 'WTVT' ")
|
||||
.append("AND t1.TM <= TO_DATE(#{map.endTime}, 'YYYY-MM-DD HH24:MI:SS') ")
|
||||
.append("AND t1.TM >= TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS') ")
|
||||
.append("AND t1.WTHG IS NOT NULL ")
|
||||
.append("AND t1.VWT IS NOT NULL ")
|
||||
.append("GROUP BY t1.TM, t1.STCD, wt.STNM ");
|
||||
paramMap.put("startTime", startTime);
|
||||
paramMap.put("endTime", endTime);
|
||||
} else if ("YEAR".equals(drtp)) {
|
||||
if (startYear == null || endYear == null) {
|
||||
return emptyCxDetailResult(wtDeviceType, drtp);
|
||||
}
|
||||
sql.append("SELECT t1.STCD AS stcd, ")
|
||||
.append("wt.STNM AS stnm, ")
|
||||
.append("t1.YEAR || '年' AS dt, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.WTHG), ',') WITHIN GROUP(ORDER BY t1.WTHG) AS wthg, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.VWT), ',') WITHIN GROUP(ORDER BY t1.WTHG) AS vwt ")
|
||||
.append("FROM SD_WTVTDRTP_S t1 ")
|
||||
.append("LEFT JOIN SD_WT_B_H wt ON t1.STCD = wt.STCD ")
|
||||
.append("WHERE t1.DRTP = 'YEAR' ")
|
||||
.append("AND t1.STCD = #{map.stcd} ")
|
||||
.append("AND t1.IS_DELETED = 0 ")
|
||||
.append("AND wt.IS_DELETED = 0 ")
|
||||
.append("AND wt.STTP = 'WTVT' ")
|
||||
.append("AND t1.YEAR >= #{map.startYear} ")
|
||||
.append("AND t1.YEAR <= #{map.endYear} ")
|
||||
.append("GROUP BY t1.STCD, wt.STNM, t1.YEAR ");
|
||||
paramMap.put("startYear", startYear);
|
||||
paramMap.put("endYear", endYear);
|
||||
} else if ("MON".equals(drtp)) {
|
||||
if (startYear == null || endYear == null || startMonth == null || endMonth == null) {
|
||||
return emptyCxDetailResult(wtDeviceType, drtp);
|
||||
}
|
||||
sql.append("SELECT t1.STCD AS stcd, ")
|
||||
.append("wt.STNM AS stnm, ")
|
||||
.append("t1.YEAR || '-' || LPAD(t1.MONTH, 2, '0') AS dt, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.WTHG), ',') WITHIN GROUP(ORDER BY t1.WTHG) AS wthg, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.VWT), ',') WITHIN GROUP(ORDER BY t1.WTHG) AS vwt ")
|
||||
.append("FROM SD_WTVTDRTP_S t1 ")
|
||||
.append("LEFT JOIN SD_WT_B_H wt ON t1.STCD = wt.STCD ")
|
||||
.append("WHERE t1.DRTP = 'MON' ")
|
||||
.append("AND t1.STCD = #{map.stcd} ")
|
||||
.append("AND t1.IS_DELETED = 0 ")
|
||||
.append("AND wt.IS_DELETED = 0 ")
|
||||
.append("AND wt.STTP = 'WTVT' ")
|
||||
.append("AND TO_DATE(t1.YEAR || '-' || t1.MONTH, 'YYYY-MM') >= TO_DATE(#{map.startYearMonth}, 'YYYY-MM') ")
|
||||
.append("AND TO_DATE(t1.YEAR || '-' || t1.MONTH, 'YYYY-MM') <= TO_DATE(#{map.endYearMonth}, 'YYYY-MM') ")
|
||||
.append("GROUP BY t1.STCD, wt.STNM, t1.YEAR, t1.MONTH ");
|
||||
paramMap.put("startYearMonth", startYear + "-" + startMonth);
|
||||
paramMap.put("endYearMonth", endYear + "-" + endMonth);
|
||||
} else if ("QUA".equals(drtp)) {
|
||||
if (startYear == null || endYear == null || startDr == null || endDr == null) {
|
||||
return emptyCxDetailResult(wtDeviceType, drtp);
|
||||
}
|
||||
sql.append("SELECT t1.STCD AS stcd, ")
|
||||
.append("wt.STNM AS stnm, ")
|
||||
.append("t1.YEAR || '年' || t1.DR || '季度' AS dt, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.WTHG), ',') WITHIN GROUP(ORDER BY t1.WTHG) AS wthg, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.VWT), ',') WITHIN GROUP(ORDER BY t1.WTHG) AS vwt ")
|
||||
.append("FROM SD_WTVTDRTP_S t1 ")
|
||||
.append("LEFT JOIN SD_WT_B_H wt ON t1.STCD = wt.STCD ")
|
||||
.append("WHERE t1.DRTP = 'QUA' ")
|
||||
.append("AND t1.STCD = #{map.stcd} ")
|
||||
.append("AND t1.IS_DELETED = 0 ")
|
||||
.append("AND wt.IS_DELETED = 0 ")
|
||||
.append("AND wt.STTP = 'WTVT' ")
|
||||
.append("AND t1.YEAR >= #{map.startYear} ")
|
||||
.append("AND t1.YEAR <= #{map.endYear} ")
|
||||
.append("AND t1.DR >= #{map.startDr} ")
|
||||
.append("AND t1.DR <= #{map.endDr} ")
|
||||
.append("GROUP BY t1.STCD, wt.STNM, t1.YEAR, t1.DR ");
|
||||
paramMap.put("startYear", startYear);
|
||||
paramMap.put("endYear", endYear);
|
||||
paramMap.put("startDr", startDr);
|
||||
paramMap.put("endDr", endDr);
|
||||
} else if ("TEN".equals(drtp)) {
|
||||
if (startYear == null || endYear == null || startMonth == null || endMonth == null || startDr == null || endDr == null) {
|
||||
return emptyCxDetailResult(wtDeviceType, drtp);
|
||||
}
|
||||
sql.append("SELECT t1.STCD AS stcd, ")
|
||||
.append("wt.STNM AS stnm, ")
|
||||
.append("t1.YEAR || '年' || t1.MONTH || '月' || CASE t1.DR WHEN 1 THEN '上' WHEN 2 THEN '中' WHEN 3 THEN '下' ELSE '' END || '旬' AS dt, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.WTHG), ',') WITHIN GROUP(ORDER BY t1.WTHG) AS wthg, ")
|
||||
.append("LISTAGG(TO_CHAR(t1.VWT), ',') WITHIN GROUP(ORDER BY t1.WTHG) AS vwt ")
|
||||
.append("FROM SD_WTVTDRTP_S t1 ")
|
||||
.append("LEFT JOIN SD_WT_B_H wt ON t1.STCD = wt.STCD ")
|
||||
.append("WHERE t1.DRTP = 'TEN' ")
|
||||
.append("AND t1.STCD = #{map.stcd} ")
|
||||
.append("AND t1.IS_DELETED = 0 ")
|
||||
.append("AND wt.IS_DELETED = 0 ")
|
||||
.append("AND wt.STTP = 'WTVT' ")
|
||||
.append("AND t1.YEAR >= #{map.startYear} ")
|
||||
.append("AND t1.YEAR <= #{map.endYear} ")
|
||||
.append("AND t1.MONTH >= #{map.startMonth} ")
|
||||
.append("AND t1.MONTH <= #{map.endMonth} ")
|
||||
.append("AND t1.DR >= #{map.startDr} ")
|
||||
.append("AND t1.DR <= #{map.endDr} ")
|
||||
.append("GROUP BY t1.STCD, wt.STNM, t1.YEAR, t1.MONTH, t1.DR ");
|
||||
paramMap.put("startYear", startYear);
|
||||
paramMap.put("endYear", endYear);
|
||||
paramMap.put("startMonth", startMonth);
|
||||
paramMap.put("endMonth", endMonth);
|
||||
paramMap.put("startDr", startDr);
|
||||
paramMap.put("endDr", endDr);
|
||||
} else {
|
||||
return emptyCxDetailResult(wtDeviceType, drtp);
|
||||
}
|
||||
|
||||
appendCxDetailOrderBy(sql, dataSourceRequest.getSort());
|
||||
Page<?> page = buildPage(dataSourceRequest.toDevRequest());
|
||||
List<WtCxDetailRow> rowList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, WtCxDetailRow.class);
|
||||
|
||||
List<Double> verticalList = getVerticals(rowList, wtDeviceType);
|
||||
List<Map<String, Object>> resultData = new ArrayList<>();
|
||||
for (WtCxDetailRow row : rowList) {
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("stcd", row.getStcd());
|
||||
result.put("stnm", row.getStnm());
|
||||
result.put("dt", row.getDt());
|
||||
|
||||
Map<String, Object> dataList = new LinkedHashMap<>();
|
||||
for (Double vertical : verticalList) {
|
||||
dataList.put(Double.toString(vertical), "-");
|
||||
}
|
||||
|
||||
List<String> wthgList = splitValue(row.getWthg());
|
||||
List<String> vwtList = splitValue(row.getVwt());
|
||||
for (int i = 0; i < wthgList.size(); i++) {
|
||||
try {
|
||||
Double wthg = Double.parseDouble(wthgList.get(i));
|
||||
String key = Double.toString(wthg);
|
||||
String vwt = i < vwtList.size() ? vwtList.get(i) : null;
|
||||
dataList.put(key, vwt);
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
}
|
||||
result.put("dataList", dataList);
|
||||
resultData.add(result);
|
||||
}
|
||||
|
||||
List<Map<String, Object>> columns = new ArrayList<>();
|
||||
columns.add(buildColumn("stnm", "测站名称", true, "stnm", false, null, null));
|
||||
String dateFormat = "yyyy-MM-dd HH:mm";
|
||||
if ("DAY".equals(drtp)) {
|
||||
dateFormat = "yyyy-MM-dd";
|
||||
} else if ("MON".equals(drtp)) {
|
||||
dateFormat = "yyyy-MM";
|
||||
}
|
||||
columns.add(buildColumn("dt", "时间", true, "dt", false, "date", dateFormat));
|
||||
for (Double vertical : verticalList) {
|
||||
String key = Double.toString(vertical);
|
||||
String title = (wtDeviceType == null || wtDeviceType == 1) ? "水深" + vertical + "m(℃)" : "高程" + vertical + "m(℃)";
|
||||
columns.add(buildColumn(key, title, true, key, false, null, null));
|
||||
}
|
||||
|
||||
Map<String, Object> table = new LinkedHashMap<>();
|
||||
table.put("columns", columns);
|
||||
table.put("dataSource", resultData);
|
||||
table.put("wtDeviceType", wtDeviceType);
|
||||
|
||||
DataSourceResult<Map<String, Object>> result = new DataSourceResult<>();
|
||||
result.setData(Collections.singletonList(table));
|
||||
result.setTotal(page != null ? page.getTotal() : rowList.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
private Page<?> buildPage(DataSourceLoadOptionsBase loadOptions) {
|
||||
PageInfo pageInfo = QgcQueryWrapperUtil.getPageInfo(loadOptions);
|
||||
if (Boolean.TRUE.equals(pageInfo.getHasPageInfo())) {
|
||||
return pageInfo.getPage();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String buildVmsstbprptOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
List<String> orderColumns = new ArrayList<>();
|
||||
if (sortList != null) {
|
||||
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||
String field = sortDescriptor.getField();
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
if ("baseStepSort".equals(field)) {
|
||||
orderColumns.add("NVL(hb.ORDER_INDEX, 999999) " + dir);
|
||||
} else if ("hbrvcd".equals(field)) {
|
||||
orderColumns.add("NVL(eng.HBRVCD, '~') " + dir);
|
||||
} else if ("rstcdStepSort".equals(field)) {
|
||||
orderColumns.add("NVL(eng.ORDER_INDEX, 999999) " + dir);
|
||||
} else if ("siteStepSort".equals(field)) {
|
||||
orderColumns.add("NVL(wt.ORDER_INDEX, 999999) " + dir);
|
||||
} else if ("stnm".equals(field)) {
|
||||
orderColumns.add("wt.STNM " + dir);
|
||||
} else if ("ennm".equals(field)) {
|
||||
orderColumns.add("eng.ENNM " + dir);
|
||||
} else if ("stcd".equals(field)) {
|
||||
orderColumns.add("wt.STCD " + dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (orderColumns.isEmpty()) {
|
||||
return " ORDER BY NVL(hb.ORDER_INDEX, 999999) ASC, NVL(eng.HBRVCD, '~') ASC, NVL(eng.ORDER_INDEX, 999999) ASC, NVL(wt.ORDER_INDEX, 999999) ASC";
|
||||
}
|
||||
return " ORDER BY " + String.join(", ", orderColumns);
|
||||
}
|
||||
|
||||
private void collectFilters(DataSourceRequest.FilterDescriptor filter, List<DataSourceRequest.FilterDescriptor> result) {
|
||||
if (filter == null) {
|
||||
return;
|
||||
}
|
||||
if (filter.getFilters() == null || filter.getFilters().isEmpty()) {
|
||||
if (StrUtil.isNotBlank(filter.getField())) {
|
||||
result.add(filter);
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||
collectFilters(child, result);
|
||||
}
|
||||
}
|
||||
|
||||
private String toStringValue(Object value) {
|
||||
return value == null ? null : String.valueOf(value);
|
||||
}
|
||||
|
||||
private Integer toIntegerValue(Object value) {
|
||||
if (value == null || StrUtil.isBlank(String.valueOf(value))) {
|
||||
return null;
|
||||
}
|
||||
return Integer.parseInt(String.valueOf(value));
|
||||
}
|
||||
|
||||
private void appendCxDetailOrderBy(StringBuilder sql, List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (sortList == null || sortList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<String> orderColumns = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
if ("dt".equals(sortDescriptor.getField())) {
|
||||
orderColumns.add("dt " + dir);
|
||||
} else if ("stcd".equals(sortDescriptor.getField())) {
|
||||
orderColumns.add("stcd " + dir);
|
||||
} else if ("stnm".equals(sortDescriptor.getField())) {
|
||||
orderColumns.add("stnm " + dir);
|
||||
}
|
||||
}
|
||||
if (!orderColumns.isEmpty()) {
|
||||
sql.append(" ORDER BY ").append(String.join(", ", orderColumns));
|
||||
}
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> emptyTableList(Integer wtDeviceType, String drtp) {
|
||||
List<Map<String, Object>> columns = new ArrayList<>();
|
||||
columns.add(buildColumn("stnm", "测站名称", true, "stnm", false, null, null));
|
||||
String dateFormat = "yyyy-MM-dd HH:mm";
|
||||
if ("DAY".equals(drtp)) {
|
||||
dateFormat = "yyyy-MM-dd";
|
||||
} else if ("MON".equals(drtp)) {
|
||||
dateFormat = "yyyy-MM";
|
||||
}
|
||||
columns.add(buildColumn("dt", "时间", true, "dt", false, "date", dateFormat));
|
||||
Map<String, Object> table = new LinkedHashMap<>();
|
||||
table.put("columns", columns);
|
||||
table.put("dataSource", new ArrayList<>());
|
||||
table.put("wtDeviceType", wtDeviceType);
|
||||
return Collections.singletonList(table);
|
||||
}
|
||||
|
||||
private DataSourceResult emptyCxDetailResult(Integer wtDeviceType, String drtp) {
|
||||
DataSourceResult<Map<String, Object>> result = new DataSourceResult<>();
|
||||
result.setData(emptyTableList(wtDeviceType, drtp));
|
||||
result.setTotal(0);
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
private Map<String, Object> buildColumn(String dataIndex,
|
||||
String title,
|
||||
boolean visible,
|
||||
String key,
|
||||
boolean merge,
|
||||
String dataType,
|
||||
String dataFormat) {
|
||||
Map<String, Object> column = new LinkedHashMap<>();
|
||||
column.put("dataIndex", dataIndex);
|
||||
column.put("title", title);
|
||||
column.put("visible", visible);
|
||||
column.put("key", key);
|
||||
column.put("unit", null);
|
||||
column.put("merge", merge);
|
||||
column.put("dataType", dataType);
|
||||
column.put("dataFormat", dataFormat);
|
||||
column.put("children", new ArrayList<>());
|
||||
return column;
|
||||
}
|
||||
|
||||
private List<String> splitValue(String value) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
String[] values = value.split(",");
|
||||
List<String> result = new ArrayList<>(values.length);
|
||||
for (String item : values) {
|
||||
result.add(item == null ? null : item.trim());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<Double> getVerticals(List<WtCxDetailRow> rowList, Integer wtDeviceType) {
|
||||
List<Double> verticals = new ArrayList<>();
|
||||
for (WtCxDetailRow row : rowList) {
|
||||
for (String wthg : splitValue(row.getWthg())) {
|
||||
try {
|
||||
verticals.add(Double.parseDouble(wthg));
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return verticals.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.sorted((wtDeviceType == null || wtDeviceType == 1) ? Comparator.naturalOrder() : Comparator.reverseOrder())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private void fillFishList(List<WtFishVo> wtFishVoList, List<FishSpawnVo> fishSpawnVoList) {
|
||||
if (wtFishVoList == null || wtFishVoList.isEmpty() || fishSpawnVoList == null || fishSpawnVoList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (WtFishVo wtFishVo : wtFishVoList) {
|
||||
List<FishSpawnVo> fishList = new ArrayList<>();
|
||||
Date dt = wtFishVo.getDt();
|
||||
BigDecimal wt = wtFishVo.getWt();
|
||||
if (dt == null || wt == null) {
|
||||
wtFishVo.setFishList(fishList);
|
||||
continue;
|
||||
}
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(dt);
|
||||
int month = calendar.get(Calendar.MONTH) + 1;
|
||||
for (FishSpawnVo fishSpawnVo : fishSpawnVoList) {
|
||||
if (!matchSpawnMonth(fishSpawnVo.getSpawnMonthStr(), month)) {
|
||||
continue;
|
||||
}
|
||||
BigDecimal[] range = parsePretempRange(fishSpawnVo.getPretempStr());
|
||||
if (range == null) {
|
||||
continue;
|
||||
}
|
||||
if (wt.compareTo(range[0]) >= 0 && wt.compareTo(range[1]) <= 0) {
|
||||
fishList.add(fishSpawnVo);
|
||||
}
|
||||
}
|
||||
wtFishVo.setFishList(fishList);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean matchSpawnMonth(String spawnMonthStr, int month) {
|
||||
if (StrUtil.isBlank(spawnMonthStr)) {
|
||||
return false;
|
||||
}
|
||||
for (String monthStr : spawnMonthStr.split(",")) {
|
||||
if (StrUtil.isBlank(monthStr)) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
if (Integer.parseInt(monthStr.trim()) == month) {
|
||||
return true;
|
||||
}
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private BigDecimal[] parsePretempRange(String pretempStr) {
|
||||
if (StrUtil.isBlank(pretempStr)) {
|
||||
return null;
|
||||
}
|
||||
String temp = pretempStr.replace("℃", "").trim();
|
||||
String[] split = temp.contains("~") ? temp.split("~") : temp.split("~");
|
||||
if (split.length != 2) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return new BigDecimal[]{new BigDecimal(split[0].trim()), new BigDecimal(split[1].trim())};
|
||||
} catch (Exception ignored) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void fillFishSpawnMeta(FishSpawnVo fishSpawnVo) {
|
||||
if (fishSpawnVo == null) {
|
||||
return;
|
||||
}
|
||||
BigDecimal[] range = parsePretempRange(fishSpawnVo.getPretempStr());
|
||||
if (range != null) {
|
||||
List<String> preTempList = new ArrayList<>(2);
|
||||
preTempList.add(range[0].stripTrailingZeros().toPlainString());
|
||||
preTempList.add(range[1].stripTrailingZeros().toPlainString());
|
||||
fishSpawnVo.setPretemp(preTempList);
|
||||
}
|
||||
if (StrUtil.isNotBlank(fishSpawnVo.getSpawnMonthStr())) {
|
||||
List<String> spawnList = new ArrayList<>();
|
||||
for (String str : Arrays.asList(fishSpawnVo.getSpawnMonthStr().split(","))) {
|
||||
if (StrUtil.isBlank(str)) {
|
||||
continue;
|
||||
}
|
||||
String month = str.trim();
|
||||
try {
|
||||
if (Integer.parseInt(month) < 10 && month.length() == 1) {
|
||||
month = "0" + month;
|
||||
}
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
spawnList.add(month);
|
||||
}
|
||||
fishSpawnVo.setSpawnMonth(spawnList);
|
||||
}
|
||||
}
|
||||
|
||||
private WtrvVo buildDefaultWtrvVo(String stcd) {
|
||||
WtrvVo vo = new WtrvVo();
|
||||
vo.setStcd(stcd);
|
||||
vo.setIsIoWtrv(false);
|
||||
vo.setHasRstcdWtvt(false);
|
||||
return vo;
|
||||
}
|
||||
|
||||
private Boolean toBooleanValue(Object value) {
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
if (value instanceof Boolean boolValue) {
|
||||
return boolValue;
|
||||
}
|
||||
if (value instanceof Number number) {
|
||||
return number.intValue() != 0;
|
||||
}
|
||||
String strValue = String.valueOf(value).trim();
|
||||
return "1".equals(strValue) || "true".equalsIgnoreCase(strValue) || "Y".equalsIgnoreCase(strValue);
|
||||
}
|
||||
|
||||
@Data
|
||||
private static class WtCxDetailRow {
|
||||
private String stcd;
|
||||
private String dt;
|
||||
private String stnm;
|
||||
private String wthg;
|
||||
private String vwt;
|
||||
}
|
||||
|
||||
}
|
||||
109
backend/src/main/java/com/yfd/platform/env/wq/controller/EnvWqDataController.java
vendored
Normal file
109
backend/src/main/java/com/yfd/platform/env/wq/controller/EnvWqDataController.java
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
package com.yfd.platform.env.wq.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.env.wq.service.EnvWqDataService;
|
||||
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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/wq")
|
||||
@Tag(name = "水质统计分析")
|
||||
@Validated
|
||||
public class EnvWqDataController {
|
||||
|
||||
@Resource
|
||||
private EnvWqDataService envWqDataService;
|
||||
|
||||
@PostMapping("/GetKendoListCust")
|
||||
@Operation(summary = "水质统计分析")
|
||||
public ResponseResult getKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.processKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/data/GetKendoListCust")
|
||||
@Operation(summary = "水质明细数据查询")
|
||||
public ResponseResult getDataKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.processDataKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/GetStbprpYsByStcd")
|
||||
@Operation(summary = "水质监测数据查询")
|
||||
public ResponseResult GetStbprpYsByStcd(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.getStbprpYsByStcd(dataSourceRequest));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/stbprp/GetStbprpYsByStcd")
|
||||
@Operation(summary = "水质监测信息查询")
|
||||
public ResponseResult getStTbYsBVoKendoListCust(
|
||||
@RequestParam String stcd,
|
||||
@RequestParam String tbCode,
|
||||
@RequestParam String startTime,
|
||||
@RequestParam String endTime) {
|
||||
return ResponseResult.successData(envWqDataService.getStTbYsBVoKendoListCust(stcd, tbCode, startTime, endTime));
|
||||
}
|
||||
|
||||
@PostMapping("/stTbYs/GetStTbYsBVoKendoListCust")
|
||||
@Operation(summary = "水质监测信息查询")
|
||||
public ResponseResult getStTbYsBVoKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.getStTbYsBVoKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/data/noAuth/GetKendoListCust")
|
||||
@Operation(summary = "水质统计分析(完成)")
|
||||
public ResponseResult getNoAuthKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.processDataKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/along/qgc/GetKendoListCust")
|
||||
@Operation(summary = "查询时间范围内沿程水质最新时间的数据")
|
||||
public ResponseResult getAlongWqKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.getAlongWqKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/along/default/rvcd")
|
||||
@Operation(summary = "获取水质沿程变化默认有数据的河流")
|
||||
public ResponseResult getAlongDefaultRvcd(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.getAlongDefaultRvcd(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/msstbprpt/GetKendoList")
|
||||
@Operation(summary = "查询水质基础站点分组统计")
|
||||
public ResponseResult getMsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.getMsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
// @PostMapping("/base/msstbprpt/GetKendoList")
|
||||
// @Operation(summary = "查询水质基础站点分组统计")
|
||||
// public ResponseResult getBaseMsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
// return ResponseResult.successData(envWqDataService.getMsstbprptList(dataSourceRequest));
|
||||
// }
|
||||
|
||||
|
||||
@PostMapping("/wbsb/GetKendoList")
|
||||
@Operation(summary = "查询水电基地流域字典列表")
|
||||
public ResponseResult getWbsbList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.getWbsbList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/vmsstbprpt/GetKendoList")
|
||||
@Operation(summary = "根据条件查询水质基础站点数据(完成)")
|
||||
public ResponseResult getVmsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.getVmsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@GetMapping("/msstbprpt/getStcdInfo")
|
||||
@Operation(summary = "根据站码查询单条水质基础数据(完成)")
|
||||
public ResponseResult getStcdInfo(@RequestParam String stcd) {
|
||||
return ResponseResult.successData(envWqDataService.getStcdInfo(stcd));
|
||||
}
|
||||
}
|
||||
144
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/EnvWqDataVo.java
vendored
Normal file
144
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/EnvWqDataVo.java
vendored
Normal file
@ -0,0 +1,144 @@
|
||||
package com.yfd.platform.env.wq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水质实时数据")
|
||||
public class EnvWqDataVo {
|
||||
@Schema(description = "测站编码")
|
||||
private String stcd;
|
||||
@Schema(description = "电站编码")
|
||||
private String rstcd;
|
||||
@Schema(description = "测站名称")
|
||||
private String stnm;
|
||||
@Schema(description = "栖息地编码")
|
||||
private String stCode;
|
||||
@Schema(description = "栖息地名称")
|
||||
private String stName;
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
@Schema(description = "数据时间")
|
||||
private Date tm;
|
||||
@Schema(description = "水温")
|
||||
private BigDecimal wtmp;
|
||||
@Schema(description = "pH")
|
||||
private BigDecimal ph;
|
||||
@Schema(description = "溶解氧")
|
||||
private BigDecimal dox;
|
||||
@Schema(description = "高锰酸盐指数")
|
||||
private BigDecimal codmn;
|
||||
@Schema(description = "化学需氧量")
|
||||
private BigDecimal codcr;
|
||||
@Schema(description = "五日生化需氧量")
|
||||
private BigDecimal bod5;
|
||||
@Schema(description = "氨氮")
|
||||
private BigDecimal nh3n;
|
||||
@Schema(description = "总磷")
|
||||
private BigDecimal tp;
|
||||
@Schema(description = "总氮")
|
||||
private BigDecimal tn;
|
||||
@Schema(description = "铜")
|
||||
private BigDecimal cu;
|
||||
@Schema(description = "锌")
|
||||
private BigDecimal zn;
|
||||
@Schema(description = "氟化物")
|
||||
private BigDecimal f;
|
||||
@Schema(description = "硒")
|
||||
private BigDecimal se;
|
||||
@Schema(description = "砷")
|
||||
private BigDecimal ars;
|
||||
@Schema(description = "汞")
|
||||
private BigDecimal hg;
|
||||
@Schema(description = "镉")
|
||||
private BigDecimal cd;
|
||||
@Schema(description = "六价铬")
|
||||
private BigDecimal cr6;
|
||||
@Schema(description = "铅")
|
||||
private BigDecimal pb;
|
||||
@Schema(description = "氰化物")
|
||||
private BigDecimal cn;
|
||||
@Schema(description = "挥发酚")
|
||||
private BigDecimal vlph;
|
||||
@Schema(description = "石油类")
|
||||
private BigDecimal oil;
|
||||
@Schema(description = "阴离子表面活性剂")
|
||||
private BigDecimal las;
|
||||
@Schema(description = "硫化物")
|
||||
private BigDecimal s2;
|
||||
@Schema(description = "粪大肠菌群")
|
||||
private BigDecimal fcg;
|
||||
@Schema(description = "氯化物")
|
||||
private BigDecimal cl;
|
||||
@Schema(description = "硫酸盐")
|
||||
private BigDecimal so4;
|
||||
@Schema(description = "硝酸盐氮")
|
||||
private BigDecimal no3;
|
||||
@Schema(description = "总硬度")
|
||||
private BigDecimal thrd;
|
||||
@Schema(description = "电导率")
|
||||
private BigDecimal cond;
|
||||
@Schema(description = "铁")
|
||||
private BigDecimal fe;
|
||||
@Schema(description = "锰")
|
||||
private BigDecimal mn;
|
||||
@Schema(description = "铝")
|
||||
private BigDecimal al;
|
||||
@Schema(description = "叶绿素a")
|
||||
private BigDecimal chla;
|
||||
@Schema(description = "透明度")
|
||||
private BigDecimal clarity;
|
||||
@Schema(description = "浊度")
|
||||
private BigDecimal tu;
|
||||
@Schema(description = "总需氧量")
|
||||
private BigDecimal tod;
|
||||
@Schema(description = "蓝绿藻")
|
||||
private BigDecimal cyano;
|
||||
@Schema(description = "实际水质等级")
|
||||
private String wqgrd;
|
||||
@Schema(description = "实际水质等级名称")
|
||||
private String wqgrdName;
|
||||
@Schema(description = "目标水质等级")
|
||||
private String wwqtg;
|
||||
@Schema(description = "目标水质等级名称")
|
||||
private String wwqtgName;
|
||||
@Schema(description = "是否达标")
|
||||
private Integer sfdb;
|
||||
@Schema(description = "是否达标名称")
|
||||
private String sfdbName;
|
||||
@Schema(description = "水质不达标的要素")
|
||||
private String wqSfdbhnYs;
|
||||
@Schema(description = "水质不达标的要素名称")
|
||||
private String wqSfdbhnYsName;
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
@Schema(description = "流域名称")
|
||||
private String rvcdName;
|
||||
@Schema(description = "行政区名称")
|
||||
private String addvcdName;
|
||||
@Schema(description = "数据接入类型")
|
||||
private String dtinType;
|
||||
@Schema(description = "入库流量")
|
||||
private BigDecimal qi;
|
||||
@Schema(description = "出库流量")
|
||||
private BigDecimal qo;
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
@Schema(description = "流域排序")
|
||||
private Integer rvcdStepSort;
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
@Schema(description = "测站排序")
|
||||
private Integer siteStepSort;
|
||||
@Schema(description = "水质要素最小限值集合")
|
||||
private List<Map<String, Object>> min;
|
||||
@Schema(description = "水质要素最大限值集合")
|
||||
private List<Map<String, Object>> max;
|
||||
}
|
||||
239
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/EnvWqVo.java
vendored
Normal file
239
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/EnvWqVo.java
vendored
Normal file
@ -0,0 +1,239 @@
|
||||
package com.yfd.platform.env.wq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水质统计分析结果")
|
||||
public class EnvWqVo {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "测站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "测站名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "统计时间")
|
||||
private Date tm;
|
||||
|
||||
@Schema(description = "统计类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "测站类型")
|
||||
private String sttype;
|
||||
|
||||
@Schema(description = "测站类型名称")
|
||||
private String sttypeName;
|
||||
|
||||
@Schema(description = "是否达标")
|
||||
private Integer sfdb;
|
||||
|
||||
@Schema(description = "是否达标名称")
|
||||
private String sfdbName;
|
||||
|
||||
@Schema(description = "月维度")
|
||||
private String drMonth;
|
||||
|
||||
@Schema(description = "年维度")
|
||||
private String drYear;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "流域名称")
|
||||
private String hbrvcdName;
|
||||
|
||||
@Schema(description = "河流名称")
|
||||
private String rvcdName;
|
||||
|
||||
@Schema(description = "行政区名称")
|
||||
private String addvcdName;
|
||||
|
||||
@Schema(description = "水质目标")
|
||||
private String wwqtg;
|
||||
|
||||
@Schema(description = "水质目标名称")
|
||||
private String wwqtgName;
|
||||
|
||||
@Schema(description = "水质等级")
|
||||
private String wqGrd;
|
||||
|
||||
@Schema(description = "水质等级名称")
|
||||
private String wqGrdName;
|
||||
|
||||
@Schema(description = "去年同期水质等级")
|
||||
private String beforeWqGrd;
|
||||
|
||||
@Schema(description = "去年同期水质等级名称")
|
||||
private String beforeWqGrdName;
|
||||
|
||||
@Schema(description = "水质达标率")
|
||||
private String wqRate;
|
||||
|
||||
@Schema(description = "位置")
|
||||
private String lctn;
|
||||
|
||||
@Schema(description = "计算标识")
|
||||
private String calculateFlag;
|
||||
|
||||
@Schema(description = "水温")
|
||||
private BigDecimal wtmp;
|
||||
|
||||
@Schema(description = "pH")
|
||||
private BigDecimal ph;
|
||||
|
||||
@Schema(description = "溶解氧")
|
||||
private BigDecimal dox;
|
||||
|
||||
@Schema(description = "高锰酸盐指数")
|
||||
private BigDecimal codmn;
|
||||
|
||||
@Schema(description = "化学需氧量")
|
||||
private BigDecimal codcr;
|
||||
|
||||
@Schema(description = "五日生化需氧量")
|
||||
private BigDecimal bod5;
|
||||
|
||||
@Schema(description = "氨氮")
|
||||
private BigDecimal nh3n;
|
||||
|
||||
@Schema(description = "总磷")
|
||||
private BigDecimal tp;
|
||||
|
||||
@Schema(description = "总氮")
|
||||
private BigDecimal tn;
|
||||
|
||||
@Schema(description = "铜")
|
||||
private BigDecimal cu;
|
||||
|
||||
@Schema(description = "锌")
|
||||
private BigDecimal zn;
|
||||
|
||||
@Schema(description = "氟化物")
|
||||
private BigDecimal f;
|
||||
|
||||
@Schema(description = "硒")
|
||||
private BigDecimal se;
|
||||
|
||||
@Schema(description = "砷")
|
||||
private BigDecimal ars;
|
||||
|
||||
@Schema(description = "汞")
|
||||
private BigDecimal hg;
|
||||
|
||||
@Schema(description = "镉")
|
||||
private BigDecimal cd;
|
||||
|
||||
@Schema(description = "六价铬")
|
||||
private BigDecimal cr6;
|
||||
|
||||
@Schema(description = "铅")
|
||||
private BigDecimal pb;
|
||||
|
||||
@Schema(description = "氰化物")
|
||||
private BigDecimal cn;
|
||||
|
||||
@Schema(description = "挥发酚")
|
||||
private BigDecimal vlph;
|
||||
|
||||
@Schema(description = "石油类")
|
||||
private BigDecimal oil;
|
||||
|
||||
@Schema(description = "阴离子表面活性剂")
|
||||
private BigDecimal las;
|
||||
|
||||
@Schema(description = "硫化物")
|
||||
private BigDecimal s2;
|
||||
|
||||
@Schema(description = "粪大肠菌群")
|
||||
private BigDecimal fcg;
|
||||
|
||||
@Schema(description = "氯化物")
|
||||
private BigDecimal cl;
|
||||
|
||||
@Schema(description = "硫酸盐")
|
||||
private BigDecimal so4;
|
||||
|
||||
@Schema(description = "硝酸盐氮")
|
||||
private BigDecimal no3;
|
||||
|
||||
@Schema(description = "总硬度")
|
||||
private BigDecimal thrd;
|
||||
|
||||
@Schema(description = "电导率")
|
||||
private BigDecimal cond;
|
||||
|
||||
@Schema(description = "铁")
|
||||
private BigDecimal fe;
|
||||
|
||||
@Schema(description = "锰")
|
||||
private BigDecimal mn;
|
||||
|
||||
@Schema(description = "铝")
|
||||
private BigDecimal al;
|
||||
|
||||
@Schema(description = "叶绿素a")
|
||||
private BigDecimal chla;
|
||||
|
||||
@Schema(description = "透明度")
|
||||
private BigDecimal clarity;
|
||||
|
||||
@Schema(description = "浊度")
|
||||
private BigDecimal tu;
|
||||
|
||||
@Schema(description = "总需氧量")
|
||||
private BigDecimal tod;
|
||||
|
||||
@Schema(description = "蓝绿藻")
|
||||
private BigDecimal cyano;
|
||||
|
||||
@Schema(description = "水质要素最小限值集合")
|
||||
private List<Map<String, Object>> min;
|
||||
|
||||
@Schema(description = "水质要素最大限值集合")
|
||||
private List<Map<String, Object>> max;
|
||||
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "流域排序")
|
||||
private Integer rvcdStepSort;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "测站排序")
|
||||
private Integer siteStepSort;
|
||||
|
||||
@Schema(description = "R表水质达标数")
|
||||
private BigDecimal wqSfdbHy;
|
||||
|
||||
@Schema(description = "R表水质不达标数")
|
||||
private BigDecimal wqSfdbHn;
|
||||
|
||||
@Schema(description = "R表水质统计数")
|
||||
private BigDecimal wqSfdbCount;
|
||||
|
||||
@Schema(description = "R表水质异常数")
|
||||
private BigDecimal wqSfdbHo;
|
||||
}
|
||||
39
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/StTbYsVo.java
vendored
Normal file
39
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/StTbYsVo.java
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
package com.yfd.platform.env.wq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "监测表要素配置")
|
||||
public class StTbYsVo {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "所属监测表ID")
|
||||
private String tbId;
|
||||
|
||||
@Schema(description = "监测表名称")
|
||||
private String tbName;
|
||||
|
||||
@Schema(description = "监测表编码")
|
||||
private String tbCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "要素编码")
|
||||
private String ys;
|
||||
|
||||
@Schema(description = "要素显示名称")
|
||||
private String ysShowName;
|
||||
|
||||
@Schema(description = "显示控制")
|
||||
private String showControl;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private String enable;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer orderIndex;
|
||||
}
|
||||
65
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/StbprpYsVo.java
vendored
Normal file
65
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/StbprpYsVo.java
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
package com.yfd.platform.env.wq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "对象监测要素配置")
|
||||
public class StbprpYsVo {
|
||||
|
||||
@Schema(description = "对象编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "要素编码")
|
||||
private String ys;
|
||||
|
||||
@Schema(description = "监测表ID")
|
||||
private String tbId;
|
||||
|
||||
@Schema(description = "要素显示名称")
|
||||
private String ysShowName;
|
||||
|
||||
@Schema(description = "显示控制")
|
||||
private String showControl;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private String enable;
|
||||
|
||||
@Schema(description = "字段数据类型")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "标准单位ID")
|
||||
private String standardUomId;
|
||||
|
||||
@Schema(description = "监测表名称")
|
||||
private String tbName;
|
||||
|
||||
@Schema(description = "实时表名")
|
||||
private String tb;
|
||||
|
||||
@Schema(description = "监测表编码")
|
||||
private String tbCode;
|
||||
|
||||
@Schema(description = "日统计表")
|
||||
private String dayTb;
|
||||
|
||||
@Schema(description = "时间维度统计表")
|
||||
private String statTb;
|
||||
|
||||
@Schema(description = "最新数据表")
|
||||
private String lastTb;
|
||||
|
||||
@Schema(description = "数据源ID")
|
||||
private String dataSourceId;
|
||||
|
||||
@Schema(description = "站类监测表要素关联ID")
|
||||
private String sttpTbYsBId;
|
||||
|
||||
@Schema(description = "最小值")
|
||||
private BigDecimal minVal;
|
||||
|
||||
@Schema(description = "最大值")
|
||||
private BigDecimal maxVal;
|
||||
}
|
||||
155
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/WqAlongVo.java
vendored
Normal file
155
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/WqAlongVo.java
vendored
Normal file
@ -0,0 +1,155 @@
|
||||
package com.yfd.platform.env.wq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "沿程水质数据")
|
||||
public class WqAlongVo {
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "站名")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "站类")
|
||||
private String sttp;
|
||||
|
||||
@Schema(description = "采样时间")
|
||||
private Date tm;
|
||||
|
||||
@Schema(description = "最小时间")
|
||||
private Date minTm;
|
||||
|
||||
@Schema(description = "目标水质类别")
|
||||
private String wwqtg;
|
||||
|
||||
@Schema(description = "实际水质类别")
|
||||
private String wqgrd;
|
||||
|
||||
@Schema(description = "实际水质类别名称")
|
||||
private String wqgrdName;
|
||||
|
||||
@Schema(description = "水温")
|
||||
private BigDecimal wtmp;
|
||||
|
||||
@Schema(description = "PH")
|
||||
private BigDecimal ph;
|
||||
|
||||
@Schema(description = "溶解氧")
|
||||
private BigDecimal dox;
|
||||
|
||||
@Schema(description = "高锰酸盐指数")
|
||||
private BigDecimal codmn;
|
||||
|
||||
@Schema(description = "化学需氧量")
|
||||
private BigDecimal codcr;
|
||||
|
||||
@Schema(description = "五日生化需氧量")
|
||||
private BigDecimal bod5;
|
||||
|
||||
@Schema(description = "氨氮")
|
||||
private BigDecimal nh3n;
|
||||
|
||||
@Schema(description = "总磷")
|
||||
private BigDecimal tp;
|
||||
|
||||
@Schema(description = "总氮")
|
||||
private BigDecimal tn;
|
||||
|
||||
@Schema(description = "铜")
|
||||
private BigDecimal cu;
|
||||
|
||||
@Schema(description = "锌")
|
||||
private BigDecimal zn;
|
||||
|
||||
@Schema(description = "氟化物")
|
||||
private BigDecimal f;
|
||||
|
||||
@Schema(description = "硒")
|
||||
private BigDecimal se;
|
||||
|
||||
@Schema(description = "砷")
|
||||
private BigDecimal ars;
|
||||
|
||||
@Schema(description = "汞")
|
||||
private BigDecimal hg;
|
||||
|
||||
@Schema(description = "镉")
|
||||
private BigDecimal cd;
|
||||
|
||||
@Schema(description = "六价铬")
|
||||
private BigDecimal cr6;
|
||||
|
||||
@Schema(description = "铅")
|
||||
private BigDecimal pb;
|
||||
|
||||
@Schema(description = "氰化物")
|
||||
private BigDecimal cn;
|
||||
|
||||
@Schema(description = "挥发酚")
|
||||
private BigDecimal vlph;
|
||||
|
||||
@Schema(description = "石油类")
|
||||
private BigDecimal oil;
|
||||
|
||||
@Schema(description = "阴离子表面活性剂")
|
||||
private BigDecimal las;
|
||||
|
||||
@Schema(description = "硫化物")
|
||||
private BigDecimal s2;
|
||||
|
||||
@Schema(description = "粪大肠菌群")
|
||||
private BigDecimal fcg;
|
||||
|
||||
@Schema(description = "氯化物")
|
||||
private BigDecimal cl;
|
||||
|
||||
@Schema(description = "硫酸盐")
|
||||
private BigDecimal so4;
|
||||
|
||||
@Schema(description = "硝酸盐氮")
|
||||
private BigDecimal no3;
|
||||
|
||||
@Schema(description = "总硬度")
|
||||
private BigDecimal thrd;
|
||||
|
||||
@Schema(description = "电导率")
|
||||
private BigDecimal cond;
|
||||
|
||||
@Schema(description = "铁")
|
||||
private BigDecimal fe;
|
||||
|
||||
@Schema(description = "锰")
|
||||
private BigDecimal mn;
|
||||
|
||||
@Schema(description = "铝")
|
||||
private BigDecimal al;
|
||||
|
||||
@Schema(description = "叶绿素a")
|
||||
private BigDecimal chla;
|
||||
|
||||
@Schema(description = "透明度")
|
||||
private BigDecimal clarity;
|
||||
|
||||
@Schema(description = "浊度")
|
||||
private BigDecimal tu;
|
||||
|
||||
@Schema(description = "蓝绿藻")
|
||||
private BigDecimal cyano;
|
||||
|
||||
@Schema(description = "水质要素最小限值集合")
|
||||
private List<Map<String, Object>> min;
|
||||
|
||||
@Schema(description = "水质要素最大限值集合")
|
||||
private List<Map<String, Object>> max;
|
||||
}
|
||||
152
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/WqBaseInfoVo.java
vendored
Normal file
152
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/WqBaseInfoVo.java
vendored
Normal file
@ -0,0 +1,152 @@
|
||||
package com.yfd.platform.env.wq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水质基础站点信息")
|
||||
public class WqBaseInfoVo {
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "站名")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "数据时间")
|
||||
private Date tm;
|
||||
|
||||
@Schema(description = "站类")
|
||||
private String sttp;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private Double lgtd;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private Double lttd;
|
||||
|
||||
@Schema(description = "海拔")
|
||||
private Double elev;
|
||||
|
||||
@Schema(description = "站址")
|
||||
private String stlc;
|
||||
|
||||
@Schema(description = "水质目标")
|
||||
private String wwqtg;
|
||||
|
||||
@Schema(description = "水质建设类型")
|
||||
private String wqtype;
|
||||
|
||||
@Schema(description = "建成日期")
|
||||
private Date jcdt;
|
||||
|
||||
@Schema(description = "退役日期")
|
||||
private Date wddt;
|
||||
|
||||
@Schema(description = "建设状态分类")
|
||||
private Integer bldsttCode;
|
||||
|
||||
@Schema(description = "简介")
|
||||
private String introduce;
|
||||
|
||||
@Schema(description = "LOGO")
|
||||
private String logo;
|
||||
|
||||
@Schema(description = "介绍图片")
|
||||
private String inffile;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private Integer usfl;
|
||||
|
||||
@Schema(description = "数据是否接入")
|
||||
private Integer dtin;
|
||||
|
||||
@Schema(description = "数据接入来源")
|
||||
private String dtinSrc;
|
||||
|
||||
@Schema(description = "数据接入类型")
|
||||
private Integer dtinType;
|
||||
|
||||
@Schema(description = "数据接入开始时间")
|
||||
private Date dtinTm;
|
||||
|
||||
@Schema(description = "监测方式")
|
||||
private Integer mway;
|
||||
|
||||
@Schema(description = "监测指标")
|
||||
private String stindx;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer orderIndex;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属电站名称")
|
||||
private String ennm;
|
||||
|
||||
@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;
|
||||
|
||||
@Schema(description = "行政区编码")
|
||||
private String addvcd;
|
||||
|
||||
@Schema(description = "行政区名称")
|
||||
private String addvcdName;
|
||||
|
||||
@Schema(description = "所属栖息地编码")
|
||||
private String fhstcd;
|
||||
|
||||
@Schema(description = "是否关联断面")
|
||||
private Integer ispro;
|
||||
|
||||
@Schema(description = "数据监测频次")
|
||||
private Integer dtfrqcy;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
private String vlsr;
|
||||
|
||||
@Schema(description = "数据来源时间")
|
||||
private Date vlsrTm;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String recordUser;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date recordTime;
|
||||
|
||||
@Schema(description = "更新人")
|
||||
private String modifyUser;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private Date modifyTime;
|
||||
|
||||
@Schema(description = "是否删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
@Schema(description = "删除人")
|
||||
private String deleteUser;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
private Date deleteTime;
|
||||
}
|
||||
15
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/WqMsstbprptGroupVo.java
vendored
Normal file
15
backend/src/main/java/com/yfd/platform/env/wq/entity/vo/WqMsstbprptGroupVo.java
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
package com.yfd.platform.env.wq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水质基础站点分组统计")
|
||||
public class WqMsstbprptGroupVo {
|
||||
|
||||
@Schema(description = "数据接入类型")
|
||||
private Integer dtinType;
|
||||
|
||||
@Schema(description = "数据接入类型分组数量")
|
||||
private Integer countDtinType;
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -7,11 +7,14 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水温表基本数据")
|
||||
public class SdWtBaseInfoVO implements Serializable {
|
||||
@Schema(description = "水质基础站点列表")
|
||||
public class WqVmsstbprptVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "基地Id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@ -27,7 +30,7 @@ public class SdWtBaseInfoVO implements Serializable {
|
||||
@Schema(description = "监测指标")
|
||||
private String stindx;
|
||||
|
||||
@Schema(description = "开展环保自动检测工作状态:1=正常 0=暂无数据")
|
||||
@Schema(description = "开展环保自动监测工作状态:1=正常 0=暂无数据")
|
||||
private Integer coenvwState;
|
||||
|
||||
@Schema(description = "站类")
|
||||
@ -47,4 +50,16 @@ public class SdWtBaseInfoVO implements Serializable {
|
||||
|
||||
@Schema(description = "开发方式")
|
||||
private String dvtp;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
}
|
||||
30
backend/src/main/java/com/yfd/platform/env/wq/service/EnvWqDataService.java
vendored
Normal file
30
backend/src/main/java/com/yfd/platform/env/wq/service/EnvWqDataService.java
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
package com.yfd.platform.env.wq.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.wq.entity.vo.WqBaseInfoVo;
|
||||
|
||||
public interface EnvWqDataService {
|
||||
|
||||
DataSourceResult processKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult processDataKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getStbprpYsByStcd(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getAlongWqKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getAlongDefaultRvcd(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getVmsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
WqBaseInfoVo getStcdInfo(String stcd);
|
||||
|
||||
DataSourceResult getWbsbList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getStTbYsBVoKendoListCust(String stcd, String tbCode, String startTime, String endTime);
|
||||
|
||||
DataSourceResult getStTbYsBVoKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
2317
backend/src/main/java/com/yfd/platform/env/wq/service/impl/EnvWqDataServiceImpl.java
vendored
Normal file
2317
backend/src/main/java/com/yfd/platform/env/wq/service/impl/EnvWqDataServiceImpl.java
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.controller;
|
||||
package com.yfd.platform.env.wt.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -8,8 +8,8 @@ import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.env.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.env.entity.vo.WtrvInfo;
|
||||
import com.yfd.platform.env.service.*;
|
||||
import com.yfd.platform.env.wt.entity.vo.WtrvInfo;
|
||||
import com.yfd.platform.env.wt.service.*;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -17,8 +17,6 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@ -144,6 +142,12 @@ public class SdWTMonitorController {
|
||||
return ResponseResult.successData(this.alongListService.getMonthKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/monthDetail/Det/GetKendoListCust")
|
||||
@Operation(summary = "全过程月平均水温历史对比二级数据接口")
|
||||
public ResponseResult getMonthDetailList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getMonthDetailList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/yearList/default/stcd")
|
||||
@Operation(summary = "获取水温年内分布默认有数据的电站")
|
||||
public ResponseResult getYearDefaultStcd(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
@ -156,19 +160,43 @@ public class SdWTMonitorController {
|
||||
return ResponseResult.successData(this.alongListService.getYearList(dataSourceRequest));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/base/evnmAutoMonitor/GetKendoListCust")
|
||||
@Operation(summary = "查询水温监测数量")
|
||||
public ResponseResult getWTDataCount(@RequestBody(required = false) DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getEvnmAutoMonitorList());
|
||||
@PostMapping("/yearDetail/GetKendoListCust")
|
||||
@Operation(summary = "水温年内分布二级列表")
|
||||
public ResponseResult getYearDetailList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getYearDetailList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/base/vmsstbprpt/GetKendoList")
|
||||
|
||||
@PostMapping("/evnmAutoMonitor/GetKendoListCust")
|
||||
@Operation(summary = "查询水温监测数量")
|
||||
public ResponseResult getWTDataCount(@RequestBody(required = false) DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getEvnmAutoMonitorList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/dwInfo/GetKendoListCust")
|
||||
@Operation(summary = "查询低温水减缓设施数量")
|
||||
public ResponseResult getDfltkwFacilityCount(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getDfltkwFacilityCount(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/sttpb/GetKendoList")
|
||||
@Operation(summary = "查询水减缓设施类型介绍")
|
||||
public ResponseResult getSttpbList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getSttpbList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/vmsstbprpt/GetKendoList")
|
||||
@Operation(summary = "根据类型查询水温表基本数据")
|
||||
public ResponseResult getVmsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getVmsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/wbsb/GetKendoList")
|
||||
@Operation(summary = "查询水电基地流域字典列表")
|
||||
public ResponseResult getWbsbList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getWbsbList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/cxDetail/GetKendoListCust")
|
||||
@Operation(summary = "查询垂向水温明细")
|
||||
public ResponseResult getCxDetailList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
@ -181,6 +209,12 @@ public class SdWTMonitorController {
|
||||
return ResponseResult.successData(sdWtvtRService.getWtrvDefaultYear(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/sdrvwts/default/treeStcd")
|
||||
@Operation(summary = "查询水温指定时间有数据的站点-树形结构")
|
||||
public ResponseResult getWtvtDefaultTreeStcd(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getWtvtDefaultTreeStcd(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/wtrv/fish/GetKendoListCust")
|
||||
@Operation(summary = "鱼类繁殖适宜性分析")
|
||||
public ResponseResult getWtFishAnalysis(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
29
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/DfltkwFacilityCountVo.java
vendored
Normal file
29
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/DfltkwFacilityCountVo.java
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Schema(description = "低温水减缓设施数量统计")
|
||||
public class DfltkwFacilityCountVo implements Serializable {
|
||||
|
||||
@Schema(description = "类型编码")
|
||||
private String dwtp;
|
||||
|
||||
@Schema(description = "类型名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "已接入数量")
|
||||
private Integer accessNum;
|
||||
|
||||
@Schema(description = "已建数量")
|
||||
private Integer buildNum;
|
||||
|
||||
@Schema(description = "在建数量")
|
||||
private Integer zjNum;
|
||||
|
||||
@Schema(description = "总数量")
|
||||
private Integer totalNum;
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
24
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/RstcdTreeInfoVo.java
vendored
Normal file
24
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/RstcdTreeInfoVo.java
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "电站-站点树形结构")
|
||||
public class RstcdTreeInfoVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "测站数据")
|
||||
private List<WtTreeStcdVo> stcdVo = new ArrayList<>();
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
38
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/SdMonthDetailVO.java
vendored
Normal file
38
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/SdMonthDetailVO.java
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(description = "月平均水温历史对比二级列表")
|
||||
public class SdMonthDetailVO {
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "日期")
|
||||
private Date dt;
|
||||
|
||||
@Schema(description = "日均水温实测值")
|
||||
private BigDecimal wt;
|
||||
|
||||
@Schema(description = "日均水温去年同期")
|
||||
private BigDecimal beforeWt;
|
||||
|
||||
@Schema(description = "天然值")
|
||||
private BigDecimal actualTemp;
|
||||
|
||||
@Schema(description = "站点类型")
|
||||
private String sttp;
|
||||
|
||||
@Schema(description = "站点类型编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "站名")
|
||||
private String stnm;
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
82
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/SdWtBaseInfoVO.java
vendored
Normal file
82
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/SdWtBaseInfoVO.java
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
package com.yfd.platform.env.wt.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 SdWtBaseInfoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "基地Id")
|
||||
private String baseId;
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "流域排序")
|
||||
private Integer rvcdStepSort;
|
||||
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
|
||||
@Schema(description = "站名")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "建成日期")
|
||||
private Date jcdt;
|
||||
|
||||
@Schema(description = "开工日期")
|
||||
private Date ststdt;
|
||||
|
||||
@Schema(description = "建设状态")
|
||||
private String bldsttCcodeName;
|
||||
|
||||
@Schema(description = "接入状态")
|
||||
private String dtinName;
|
||||
|
||||
@Schema(description = "监测指标")
|
||||
private String stindx;
|
||||
|
||||
@Schema(description = "开展环保自动检测工作状态:1=正常 0=暂无数据")
|
||||
private Integer coenvwState;
|
||||
|
||||
@Schema(description = "站类")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "站类名称")
|
||||
private String sttpName;
|
||||
|
||||
@Schema(description = "站类全路径")
|
||||
private String sttpFullPath;
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属测站编码")
|
||||
private String stCode;
|
||||
|
||||
@Schema(description = "所属测站名称")
|
||||
private String stName;
|
||||
|
||||
@Schema(description = "开发方式")
|
||||
private String dvtp;
|
||||
|
||||
@Schema(description = "基地流域编码")
|
||||
private String hbrvcd;
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -1,12 +1,10 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@FieldNameConstants
|
||||
50
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/SdYearDetailVO.java
vendored
Normal file
50
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/SdYearDetailVO.java
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(description = "水温年内分布二级列表")
|
||||
public class SdYearDetailVO {
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "站名")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "时间")
|
||||
private Date dt;
|
||||
|
||||
@Schema(description = "月份排序值")
|
||||
private Integer monthInt;
|
||||
|
||||
@Schema(description = "月份")
|
||||
private String month;
|
||||
|
||||
@Schema(description = "实测值水温")
|
||||
private BigDecimal actualTemp;
|
||||
|
||||
@Schema(description = "水温")
|
||||
private BigDecimal wt;
|
||||
|
||||
@Schema(description = "天然水温")
|
||||
private BigDecimal naturalTemp;
|
||||
|
||||
@Schema(description = "天然水温累计值")
|
||||
private BigDecimal sumVal;
|
||||
|
||||
@Schema(description = "天然水温累计条数")
|
||||
private Integer sumCount;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String sttp;
|
||||
|
||||
@Schema(description = "去年同期")
|
||||
private BigDecimal beforeWt;
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
41
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/SttpInfoVo.java
vendored
Normal file
41
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/SttpInfoVo.java
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
package com.yfd.platform.env.wt.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 SttpInfoVo implements Serializable {
|
||||
|
||||
private String id;
|
||||
private String recordUser;
|
||||
private Date recordTime;
|
||||
private Date modifyTime;
|
||||
private String displayRecordUser;
|
||||
private String isolateType;
|
||||
private Integer stbprpCnt;
|
||||
private String recordUserName;
|
||||
private String modifyUserName;
|
||||
private String displayDepartment;
|
||||
private String sttpCode;
|
||||
private String sttpName;
|
||||
private String description;
|
||||
private String parentId;
|
||||
private Integer enable;
|
||||
private Integer treeLevel;
|
||||
private Integer hasChildren;
|
||||
private String fullPath;
|
||||
private Integer internal;
|
||||
private String introduce;
|
||||
private String logo;
|
||||
private String inffile;
|
||||
private Integer orderIndex;
|
||||
private String filterContent;
|
||||
private Integer isTempStorage;
|
||||
private String departmentId;
|
||||
private String systemId;
|
||||
private String platformId;
|
||||
}
|
||||
60
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/WbsbVo.java
vendored
Normal file
60
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/WbsbVo.java
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水电基地流域字典")
|
||||
public class WbsbVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
private String recordUser;
|
||||
private Date recordTime;
|
||||
private Date modifyTime;
|
||||
private String displayRecordUser;
|
||||
private String isolateType;
|
||||
private String wbsType;
|
||||
private String wbsCode;
|
||||
private String wbsName;
|
||||
private String wbsSname;
|
||||
private String wbsNameEn;
|
||||
private String wbsSnameEn;
|
||||
private Integer enable;
|
||||
private String description;
|
||||
private String parentId;
|
||||
private String parentCode;
|
||||
private Integer treeLevel;
|
||||
private Integer hasChildren;
|
||||
private String objId;
|
||||
private String topWbsType;
|
||||
private String fullPath;
|
||||
private Integer internal;
|
||||
private BigDecimal lgtd;
|
||||
private BigDecimal lttd;
|
||||
private BigDecimal area;
|
||||
private BigDecimal perimeter;
|
||||
private String synopsis;
|
||||
private String introduce;
|
||||
private String logo;
|
||||
private String inffile;
|
||||
private Integer orderIndex;
|
||||
private String filterContent;
|
||||
private String departmentId;
|
||||
private String systemId;
|
||||
private String platformId;
|
||||
private String reachWwqtg;
|
||||
private BigDecimal maxElev;
|
||||
private BigDecimal minElev;
|
||||
private String datTp;
|
||||
private String rvAg;
|
||||
private Integer ifInnRv;
|
||||
private String showControl;
|
||||
private String stcd;
|
||||
private String displayDepartment;
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
58
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/WtTreeStcdVo.java
vendored
Normal file
58
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/WtTreeStcdVo.java
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Schema(description = "垂向水温树形站点")
|
||||
public class WtTreeStcdVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "站名")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private String lgtd;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private String lttd;
|
||||
|
||||
@Schema(description = "监测方式")
|
||||
private Integer mway;
|
||||
|
||||
@Schema(description = "垂向水温类型:1=浮动式 2=固定式")
|
||||
private Integer wtDeviceType;
|
||||
|
||||
@Schema(description = "所属流域")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer orderIndex;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
|
||||
@Schema(description = "范围内是否有日数据")
|
||||
private Integer sort;
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -1,7 +1,6 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
package com.yfd.platform.env.wt.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
@ -1,8 +1,8 @@
|
||||
package com.yfd.platform.env.mapper;
|
||||
package com.yfd.platform.env.wt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.env.entity.vo.SdAlongDetailVO;
|
||||
import com.yfd.platform.env.entity.vo.WtrvInfo;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdAlongDetailVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.WtrvInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@ -1,9 +1,9 @@
|
||||
package com.yfd.platform.env.mapper;
|
||||
package com.yfd.platform.env.wt.mapper;
|
||||
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.env.entity.vo.SdAlongVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdAlongVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@ -1,7 +1,7 @@
|
||||
package com.yfd.platform.env.mapper;
|
||||
package com.yfd.platform.env.wt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.env.entity.vo.SdDzChuiXiangListVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdDzChuiXiangListVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@ -1,8 +1,8 @@
|
||||
package com.yfd.platform.env.mapper;
|
||||
package com.yfd.platform.env.wt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.env.entity.vo.SdRvwtSVO;
|
||||
import com.yfd.platform.env.entity.vo.StcdVo;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdRvwtSVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.StcdVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@ -1,6 +1,6 @@
|
||||
package com.yfd.platform.env.mapper;
|
||||
package com.yfd.platform.env.wt.mapper;
|
||||
|
||||
import com.yfd.platform.env.entity.vo.SdWtMonitorCountVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdWtMonitorCountVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.mapper;
|
||||
package com.yfd.platform.env.wt.mapper;
|
||||
|
||||
import com.yfd.platform.env.entity.vo.DataParam;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
@ -1,7 +1,7 @@
|
||||
package com.yfd.platform.env.mapper;
|
||||
package com.yfd.platform.env.wt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.env.entity.vo.SdWtvtYearVo;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdWtvtYearVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.service;
|
||||
package com.yfd.platform.env.wt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -6,8 +6,8 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.GroupResult;
|
||||
import com.yfd.platform.env.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.env.entity.vo.SdAlongDetailVO;
|
||||
import com.yfd.platform.env.entity.vo.WtrvInfo;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdAlongDetailVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.WtrvInfo;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
@ -1,10 +1,10 @@
|
||||
package com.yfd.platform.env.service;
|
||||
package com.yfd.platform.env.wt.service;
|
||||
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.entity.vo.SdYearListVO;
|
||||
import com.yfd.platform.env.entity.vo.StcdVo;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdYearListVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.StcdVo;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.Map;
|
||||
@ -1,10 +1,8 @@
|
||||
package com.yfd.platform.env.service;
|
||||
package com.yfd.platform.env.wt.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 电站专题垂向水温一级面板Service接口
|
||||
*
|
||||
@ -1,9 +1,9 @@
|
||||
package com.yfd.platform.env.service;
|
||||
package com.yfd.platform.env.wt.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.entity.vo.SdRvwtSVO;
|
||||
import com.yfd.platform.env.entity.vo.StcdVo;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdRvwtSVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.StcdVo;
|
||||
|
||||
public interface SdRvwtSInOutOneService {
|
||||
|
||||
41
backend/src/main/java/com/yfd/platform/env/wt/service/SdWtMonitorService.java
vendored
Normal file
41
backend/src/main/java/com/yfd/platform/env/wt/service/SdWtMonitorService.java
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
package com.yfd.platform.env.wt.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.wt.entity.vo.DfltkwFacilityCountVo;
|
||||
import com.yfd.platform.env.wt.entity.vo.FishSpawnVo;
|
||||
import com.yfd.platform.env.wt.entity.vo.RstcdTreeInfoVo;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdMonthDetailVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdYearDetailVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.SttpInfoVo;
|
||||
import com.yfd.platform.env.wt.entity.vo.WbsbVo;
|
||||
import com.yfd.platform.env.wt.entity.vo.WtrvVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SdWtMonitorService {
|
||||
|
||||
DataSourceResult getEvnmAutoMonitorList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getVmsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getCxDetailList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getWtFishAnalysis(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FishSpawnVo> getWtFishInfo(DataSourceRequest dataSourceRequest);
|
||||
|
||||
WtrvVo getFlagByStcd(String stcd);
|
||||
|
||||
DataSourceResult<WbsbVo> getWbsbList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<DfltkwFacilityCountVo> getDfltkwFacilityCount(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<SttpInfoVo> getSttpbList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<SdYearDetailVO> getYearDetailList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<SdMonthDetailVO> getMonthDetailList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
List<RstcdTreeInfoVo> getWtvtDefaultTreeStcd(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.service;
|
||||
package com.yfd.platform.env.wt.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.service.impl;
|
||||
package com.yfd.platform.env.wt.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
@ -9,9 +9,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.*;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.env.entity.vo.*;
|
||||
import com.yfd.platform.env.mapper.AlongDetailMapper;
|
||||
import com.yfd.platform.env.mapper.SdWtrvdrtpSMapper;
|
||||
import com.yfd.platform.env.service.AlongDetailService;
|
||||
import com.yfd.platform.env.wt.mapper.AlongDetailMapper;
|
||||
import com.yfd.platform.env.wt.mapper.SdWtrvdrtpSMapper;
|
||||
import com.yfd.platform.env.wt.service.AlongDetailService;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdAlongDetailVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.WtrvInfo;
|
||||
import com.yfd.platform.utils.CollectionExtUtils;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
@ -50,6 +52,7 @@ public class AlongDetailServiceImpl extends ServiceImpl<AlongDetailMapper, SdAlo
|
||||
DataSourceResult dataSourceResult = new DataSourceResult();
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
|
||||
String tm = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "tm");
|
||||
if (StrUtil.isBlank(tm)) {
|
||||
throw new BizException("时间(tm)不能为空.");
|
||||
@ -85,6 +88,9 @@ public class AlongDetailServiceImpl extends ServiceImpl<AlongDetailMapper, SdAlo
|
||||
if (StrUtil.isNotBlank(stcd)) {
|
||||
sql.append(" AND r.STCD = #{map.stcd} ");
|
||||
}
|
||||
if (StrUtil.isNotBlank(baseId)) {
|
||||
sql.append(" AND eng.BASE_ID = #{map.baseId} ");
|
||||
}
|
||||
sql.append(") t WHERE 1=1 ");
|
||||
if (dataSourceRequest.getSort() != null && !dataSourceRequest.getSort().isEmpty()) {
|
||||
DataSourceRequest.SortDescriptor sortDescriptor = dataSourceRequest.getSort().get(0);
|
||||
@ -108,6 +114,9 @@ public class AlongDetailServiceImpl extends ServiceImpl<AlongDetailMapper, SdAlo
|
||||
if (StrUtil.isNotBlank(stcd)) {
|
||||
map.put("stcd", stcd);
|
||||
}
|
||||
if (StrUtil.isNotBlank(baseId)) {
|
||||
map.put("baseId", baseId);
|
||||
}
|
||||
PageInfo pageInfo = QgcQueryWrapperUtil.getPageInfo(loadOptions);
|
||||
Page currentPage = pageInfo.getHasPageInfo() ? pageInfo.getPage() : page;
|
||||
List<SdAlongDetailVO> list = this.microservicDynamicSQLMapper.pageAllListWithResultType(currentPage, sql.toString(), map, SdAlongDetailVO.class);
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.service.impl;
|
||||
package com.yfd.platform.env.wt.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -10,13 +10,12 @@ import com.yfd.platform.common.DynamicSQLMapper;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.common.PageInfo;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.env.entity.vo.SdAlongVO;
|
||||
import com.yfd.platform.env.entity.vo.SdYearListVO;
|
||||
import com.yfd.platform.env.entity.vo.StcdVo;
|
||||
import com.yfd.platform.env.mapper.AlongListMapper;
|
||||
import com.yfd.platform.env.service.AlongListService;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdAlongVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdYearListVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.StcdVo;
|
||||
import com.yfd.platform.env.wt.mapper.AlongListMapper;
|
||||
import com.yfd.platform.env.wt.service.AlongListService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import com.yfd.platform.utils.QueryWrapperUtil;
|
||||
import com.yfd.platform.utils.SqlUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -72,7 +71,7 @@ public class AlongListServiceImpl extends ServiceImpl<AlongListMapper, SdAlongVO
|
||||
"\t(SELECT HBRVCD FROM SD_HBRV_DIC WHERE #{full_path} HBRVNM IS NOT NULL) t2 " +
|
||||
"\tON t1.RVCD = t2.HBRVCD " +
|
||||
"\tINNER JOIN " +
|
||||
"\t(SELECT STCD FROM SD_WTRV_R WHERE TM >= #{tm} AND TM <= #{tm_1} AND WT IS NOT NULL ) t3 " +
|
||||
"\t(SELECT STCD FROM SD_WTRV_R WHERE TM >= #{dt} AND TM <= #{dt_1} AND WT IS NOT NULL ) t3 " +
|
||||
"\tON t1.STCD = t3.STCD ORDER BY SORT ASC " +
|
||||
"\t) WHERE ROWNUM = 1 ";
|
||||
Map<String,Object> sqlWhereMap = new HashMap<>();
|
||||
@ -312,6 +311,7 @@ public class AlongListServiceImpl extends ServiceImpl<AlongListMapper, SdAlongVO
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||
String year = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "year");
|
||||
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT t.stcd AS stcd, t.rstcd AS rstcd, t.stnm AS stnm, t.YEAR AS year, t.MONTH AS month, ")
|
||||
@ -323,7 +323,9 @@ public class AlongListServiceImpl extends ServiceImpl<AlongListMapper, SdAlongVO
|
||||
.append(" FROM SD_WTRVDRTP_S sms ")
|
||||
.append(" LEFT JOIN SD_WT_B_H wt ON wt.STCD = sms.STCD ")
|
||||
.append(" AND wt.STTP = 'WTRV' AND wt.USFL = 1 AND wt.IS_DELETED = 0 ")
|
||||
.append(" LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = wt.RSTCD ")
|
||||
.append(" WHERE sms.IS_DELETED = 0 ")
|
||||
.append(StrUtil.isNotBlank(baseId) ? " AND eng.BASE_ID = #{map.baseId} " : "")
|
||||
.append(" ) t1 ")
|
||||
.append(" LEFT JOIN (SELECT STCD, WT, MNTH FROM SD_WTNP_B WHERE IS_DELETED = 0) t2 ")
|
||||
.append(" ON t2.STCD = t1.RSTCD AND t2.MNTH = t1.MONTH ")
|
||||
@ -339,6 +341,7 @@ public class AlongListServiceImpl extends ServiceImpl<AlongListMapper, SdAlongVO
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", stcd);
|
||||
paramMap.put("year", year);
|
||||
paramMap.put("baseId", baseId);
|
||||
Page<?> page = buildPage(loadOptions);
|
||||
List<SdYearListVO> voList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, SdYearListVO.class);
|
||||
for (SdYearListVO vo : voList) {
|
||||
@ -1,20 +1,21 @@
|
||||
package com.yfd.platform.env.service.impl;
|
||||
package com.yfd.platform.env.wt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.entity.vo.SdDzChuiXiangListVO;
|
||||
import com.yfd.platform.env.mapper.SdDzChuiXiangListMapper;
|
||||
import com.yfd.platform.env.service.SdDzChuiXiangListService;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdDzChuiXiangListVO;
|
||||
import com.yfd.platform.env.wt.mapper.SdDzChuiXiangListMapper;
|
||||
import com.yfd.platform.env.wt.service.SdDzChuiXiangListService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import com.yfd.platform.utils.QueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 电站专题垂向水温一级面板Service实现类
|
||||
@ -28,12 +29,23 @@ public class SdDzChuiXiangListServiceImpl extends ServiceImpl<SdDzChuiXiangListM
|
||||
@Resource
|
||||
private SdDzChuiXiangListMapper sdDzChuiXiangListMapper;
|
||||
|
||||
@Resource
|
||||
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||
|
||||
@Override
|
||||
public DataSourceResult processKendoList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult dataSourceResult = new DataSourceResult<>();
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||
String year = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "year");
|
||||
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
|
||||
|
||||
if (baseId != null && !baseId.isBlank() && !matchWtvtBaseId(stcd, baseId)) {
|
||||
dataSourceResult.setData(null);
|
||||
dataSourceResult.setTotal(0);
|
||||
dataSourceResult.setAggregates(new LinkedHashMap<>());
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
int m = 12;
|
||||
Map<String, List<SdDzChuiXiangListVO>> map = new LinkedHashMap<>();
|
||||
@ -46,4 +58,19 @@ public class SdDzChuiXiangListServiceImpl extends ServiceImpl<SdDzChuiXiangListM
|
||||
dataSourceResult.setAggregates(map);
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
private boolean matchWtvtBaseId(String stcd, String baseId) {
|
||||
String sql = "SELECT 1 AS flag " +
|
||||
"FROM SD_WT_B_H wt " +
|
||||
"INNER JOIN SD_ENGINFO_B_H eng ON eng.STCD = wt.RSTCD " +
|
||||
"WHERE NVL(wt.IS_DELETED, 0) = 0 " +
|
||||
" AND wt.STTP = 'WTVT' " +
|
||||
" AND wt.STCD = #{map.stcd} " +
|
||||
" AND eng.BASE_ID = #{map.baseId}";
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", stcd);
|
||||
paramMap.put("baseId", baseId);
|
||||
List<Map<String, Object>> result = microservicDynamicSQLMapper.pageAllList(null, sql, paramMap);
|
||||
return result != null && !result.isEmpty();
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.yfd.platform.env.service.impl;
|
||||
package com.yfd.platform.env.wt.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@ -6,10 +6,10 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.*;
|
||||
import com.yfd.platform.env.entity.vo.SdRvwtSVO;
|
||||
import com.yfd.platform.env.entity.vo.StcdVo;
|
||||
import com.yfd.platform.env.mapper.SdRvwtSInOutOneMapper;
|
||||
import com.yfd.platform.env.service.SdRvwtSInOutOneService;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdRvwtSVO;
|
||||
import com.yfd.platform.env.wt.entity.vo.StcdVo;
|
||||
import com.yfd.platform.env.wt.mapper.SdRvwtSInOutOneMapper;
|
||||
import com.yfd.platform.env.wt.service.SdRvwtSInOutOneService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
2086
backend/src/main/java/com/yfd/platform/env/wt/service/impl/SdWtMonitorServiceImpl.java
vendored
Normal file
2086
backend/src/main/java/com/yfd/platform/env/wt/service/impl/SdWtMonitorServiceImpl.java
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,21 @@
|
||||
package com.yfd.platform.env.service.impl;
|
||||
package com.yfd.platform.env.wt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.entity.vo.SdWtvtYearVo;
|
||||
import com.yfd.platform.env.mapper.SdWtvtRMapper;
|
||||
import com.yfd.platform.env.service.SdWtvtRService;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.env.wt.entity.vo.SdWtvtYearVo;
|
||||
import com.yfd.platform.env.wt.mapper.SdWtvtRMapper;
|
||||
import com.yfd.platform.env.wt.service.SdWtvtRService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import com.yfd.platform.utils.QueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 垂向水温Service实现类
|
||||
@ -27,21 +29,45 @@ public class SdWtvtRServiceImpl extends ServiceImpl<SdWtvtRMapper, SdWtvtYearVo>
|
||||
@Resource
|
||||
private SdWtvtRMapper sdWtvtRMapper;
|
||||
|
||||
@Resource
|
||||
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||
|
||||
@Override
|
||||
public DataSourceResult getWtrvDefaultYear(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<SdWtvtYearVo> dataSourceResult = new DataSourceResult<>();
|
||||
DataSourceLoadOptionsBase loadOptionsBase = dataSourceRequest.toDevRequest();
|
||||
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptionsBase, "stcd");
|
||||
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptionsBase, "baseId");
|
||||
|
||||
if (StringUtils.isNotBlank(stcd)) {
|
||||
stcd = stcd.replaceAll("\\[", "")
|
||||
.replaceAll("]", "")
|
||||
.replaceAll("\"", "");
|
||||
}
|
||||
if (StringUtils.isNotBlank(baseId) && !matchWtvtBaseId(stcd, baseId)) {
|
||||
dataSourceResult.setTotal(0L);
|
||||
dataSourceResult.setData(List.of());
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
List<SdWtvtYearVo> result = sdWtvtRMapper.getWtrvDefaultYear(stcd);
|
||||
dataSourceResult.setTotal(result.size());
|
||||
dataSourceResult.setData(result);
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
private boolean matchWtvtBaseId(String stcd, String baseId) {
|
||||
String sql = "SELECT 1 AS flag " +
|
||||
"FROM SD_WT_B_H wt " +
|
||||
"INNER JOIN SD_ENGINFO_B_H eng ON eng.STCD = wt.RSTCD " +
|
||||
"WHERE NVL(wt.IS_DELETED, 0) = 0 " +
|
||||
" AND wt.STTP = 'WTVT' " +
|
||||
" AND wt.STCD = #{map.stcd} " +
|
||||
" AND eng.BASE_ID = #{map.baseId}";
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", stcd);
|
||||
paramMap.put("baseId", baseId);
|
||||
List<Map<String, Object>> result = microservicDynamicSQLMapper.pageAllList(null, sql, paramMap);
|
||||
return result != null && !result.isEmpty();
|
||||
}
|
||||
}
|
||||
@ -44,9 +44,13 @@ public class KendoUtil extends ReflectUtil {
|
||||
DataSourceRequest.GroupDescriptor groupingInfo = (DataSourceRequest.GroupDescriptor)groupDescriptorList.get(i);
|
||||
String selector = groupingInfo.getField();
|
||||
String dir = groupingInfo.getDir();
|
||||
String normalizedDir = StrUtil.blankToDefault(dir, "asc").toLowerCase();
|
||||
if ("des".equals(normalizedDir)) {
|
||||
normalizedDir = "desc";
|
||||
}
|
||||
groupByBuilder.append(selector);
|
||||
if (groupingInfo.getNeedSortFlag()) {
|
||||
if ("desc".equals(dir)) {
|
||||
if ("desc".equals(normalizedDir)) {
|
||||
orderByBuilder.append(selector).append(" desc");
|
||||
} else {
|
||||
orderByBuilder.append(selector).append(" asc");
|
||||
|
||||
@ -77,6 +77,36 @@ public class QgcQueryWrapperUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 支持页码模式和偏移量模式的分页
|
||||
* 优先使用页码模式:当 page > 0 且 pageSize > 0 时,自动转换为 take/skip
|
||||
* 否则回退到原有的 take/skip 偏移量模式
|
||||
*/
|
||||
public static PageInfo getPageInfo(DataSourceLoadOptionsBase loadOptions, Integer page, Integer pageSize) {
|
||||
if (page != null && page > 0 && pageSize != null && pageSize > 0) {
|
||||
loadOptions.setTake(pageSize);
|
||||
loadOptions.setSkip((page - 1) * pageSize);
|
||||
}
|
||||
return getPageInfo(loadOptions);
|
||||
}
|
||||
|
||||
|
||||
public static Page<?> buildPage(DataSourceLoadOptionsBase loadOptions) {
|
||||
PageInfo pageInfo = QgcQueryWrapperUtil.getPageInfo(loadOptions);
|
||||
if (Boolean.TRUE.equals(pageInfo.getHasPageInfo())) {
|
||||
return pageInfo.getPage();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Page<?> buildPage(DataSourceLoadOptionsBase loadOptions, Integer page, Integer pageSize) {
|
||||
PageInfo pageInfo = QgcQueryWrapperUtil.getPageInfo(loadOptions, page, pageSize);
|
||||
if (Boolean.TRUE.equals(pageInfo.getHasPageInfo())) {
|
||||
return pageInfo.getPage();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void parseJArrayConditions(JsonArray jsonArray, String fieldName, StringBuffer fieldValue) {
|
||||
if (jsonArray != null && jsonArray.size() != 0) {
|
||||
if (jsonArray.get(0).isJsonPrimitive()) {
|
||||
|
||||
@ -9,7 +9,7 @@ VITE_APP_BASE_API = '/dev-api'
|
||||
# 本地环境
|
||||
VITE_APP_BASE_URL = 'http://localhost:8093'
|
||||
# 测试环境
|
||||
# VITE_APP_BASE_URL = 'http://172.16.21.142:8096'
|
||||
# VITE_APP_BASE_URL = 'http://172.16.21.142:8093'
|
||||
# VITE_APP_BASE_URL = 'http://172.16.21.142:8096'
|
||||
# 汤伟
|
||||
# VITE_APP_BASE_URL = 'http://10.84.121.21:8093'
|
||||
|
||||
8
frontend/src/api/mapModal/index.ts
Normal file
8
frontend/src/api/mapModal/index.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request';
|
||||
export function getStcdDetail(url: string, stcd: string) {
|
||||
return request({
|
||||
url: url,
|
||||
method: 'get',
|
||||
params: { stcd }
|
||||
});
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
import request from '@/utils/request';
|
||||
export function getKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/api/wmp-env-server/sw/alongList/qgc/GetKendoListCust',
|
||||
url: '/wt/alongList/qgc/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
@ -9,7 +9,7 @@ export function getKendoListCust(data: any) {
|
||||
//获取水温下拉框
|
||||
export function wbsbGetKendoList(data: any) {
|
||||
return request({
|
||||
url: '/api/dec-lygk-base-server/base/wbsb/GetKendoList',
|
||||
url: '/wt/wbsb/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
@ -21,7 +21,7 @@ export function wbsbGetKendoList(data: any) {
|
||||
*/
|
||||
export function getChuiXiangShuiWenTreeStcd(data: any) {
|
||||
return request({
|
||||
url: '/api/wmp-env-server/base/sdrvwts/default/treeStcd',
|
||||
url: '/wt/sdrvwts/default/treeStcd',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
@ -34,7 +34,7 @@ export function getChuiXiangShuiWenTreeStcd(data: any) {
|
||||
*/
|
||||
export function getCxswList(data: any) {
|
||||
return request({
|
||||
url: '/api/wmp-env-server/sw/dzCxList/GetKendoListCust',
|
||||
url: '/wt/dzCxList/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
@ -42,7 +42,7 @@ export function getCxswList(data: any) {
|
||||
//获取出入库水温下拉选则树
|
||||
export function getVmsstbprpt(data: any) {
|
||||
return request({
|
||||
url: '/api/dec-lygk-base-server/base/vmsstbprpt/GetKendoList',
|
||||
url: '/wt/vmsstbprpt/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
@ -51,7 +51,7 @@ export function getVmsstbprpt(data: any) {
|
||||
//
|
||||
export function inOutOneGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/api/wmp-env-server/sw/inOutOne/GetKendoListCust',
|
||||
url: '/wt/inOutOne/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
@ -59,8 +59,96 @@ export function inOutOneGetKendoListCust(data: any) {
|
||||
//水温监测工作开展情况
|
||||
export function baseEvnmAutoMonitorGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/api/dec-lygk-base-server/base/evnmAutoMonitor/GetKendoListCust',
|
||||
url: '/wt/evnmAutoMonitor/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
////水温监测工作开展情况弹框
|
||||
export function vmsstbprptGetKendoList(data: any) {
|
||||
return request({
|
||||
url: '/wt/vmsstbprpt/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//出入库水温打开弹框api/wmp-env-server/sw/inOutOne/details
|
||||
export function inOutOneDetails(data: any) {
|
||||
return request({
|
||||
url: '/wt/inOutOne/details',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//鱼类适宜性分析 - select
|
||||
export function infoGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/wt/wtrv/fish/info/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//鱼类适宜性分析-图表和table
|
||||
export function fishGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/wt/wtrv/fish/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//月平均水温历史对比
|
||||
export function avgMonGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/wt/monthList/avgMon/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//水温年内分布
|
||||
export function yearListGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/wt/yearList/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//设施类型介绍
|
||||
export function sttpbGetKendoList(data: any) {
|
||||
return request({
|
||||
url: '/wt/sttpb/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//设施类型及接入情况
|
||||
export function dwInfoGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/wt/dwInfo/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//月均水温对比,图表,表格 /api/wmp-env-server/sw/monthDetail/Det/GetKendoListCust
|
||||
export function DetGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/wt/monthDetail/Det/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//水温年内分布
|
||||
export function yearDetailGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/wt/yearDetail/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//获取建设状态
|
||||
export function dictgetRemoteDictValue(data: any) {
|
||||
return request({
|
||||
url: '/wt/usm/v1/dict/getRemoteDictValue',
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
}
|
||||
|
||||
50
frontend/src/api/sz/index.ts
Normal file
50
frontend/src/api/sz/index.ts
Normal file
@ -0,0 +1,50 @@
|
||||
import request from '@/utils/request';
|
||||
//水质监测工作开展情况
|
||||
export function msstbprptGetKendoList(data: any) {
|
||||
return request({
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
////水温监测工作开展情况弹框
|
||||
export function vmsstbprptGetKendoList(data: any) {
|
||||
return request({
|
||||
url: '/wq/vmsstbprpt/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//地表水水质达标率
|
||||
export function wqGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/api/wmp-env-server/env/wq/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
//环境质量满足度 - 表格数据列表
|
||||
export function wqGetKendoList(data: any) {
|
||||
return request({
|
||||
url: '/api/wmp-env-server/env/wq/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//沿程水质变化_ 图表数据
|
||||
export function qgcGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/api/wmp-env-server/env/wq/along/qgc/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
//沿程水质变化_ 根据流域获取河段 https://211.99.26.225:12122
|
||||
export function wbsbGetKendoList(data: any) {
|
||||
return request({
|
||||
url: '/api/dec-lygk-base-server/base/wbsb/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
@ -82,7 +82,7 @@ const scrollConfig = computed(() => {
|
||||
else if (tableScrollY.value > 0) {
|
||||
config.y = tableScrollY.value;
|
||||
}
|
||||
console.log(tableScrollY.value);
|
||||
console.log(config);
|
||||
|
||||
return config;
|
||||
});
|
||||
|
||||
@ -1455,7 +1455,7 @@ const FPPointColumns: Array<any> = [
|
||||
filed: 'inv',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 4,
|
||||
toFixed: 6,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -1629,7 +1629,7 @@ const FBPointColumns: Array<any> = [
|
||||
filed: 'inv',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 4,
|
||||
toFixed: 6,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -1760,7 +1760,7 @@ const VaPointColumns: Array<any> = [
|
||||
filed: 'inv',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 4,
|
||||
toFixed: 6,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2072,7 +2072,7 @@ const DwPointColumns: Array<any> = [
|
||||
},
|
||||
{
|
||||
name: '站址',
|
||||
filed: 'stlc',
|
||||
filed: 'addvcdName',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: '',
|
||||
@ -2149,6 +2149,7 @@ const DwPointColumns: Array<any> = [
|
||||
filed: 'nrmxavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2156,6 +2157,7 @@ const DwPointColumns: Array<any> = [
|
||||
filed: 'nrmnavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2163,6 +2165,7 @@ const DwPointColumns: Array<any> = [
|
||||
filed: 'dnavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2170,6 +2173,7 @@ const DwPointColumns: Array<any> = [
|
||||
filed: 'dnmxavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2177,6 +2181,7 @@ const DwPointColumns: Array<any> = [
|
||||
filed: 'dnwnavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2200,7 +2205,7 @@ const DwPointColumns: Array<any> = [
|
||||
filed: 'inv',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 4,
|
||||
toFixed: 6,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2336,6 +2341,7 @@ const DwFivePointColumns: Array<any> = [
|
||||
filed: 'nrmxavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2343,6 +2349,7 @@ const DwFivePointColumns: Array<any> = [
|
||||
filed: 'nrmnavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2350,6 +2357,7 @@ const DwFivePointColumns: Array<any> = [
|
||||
filed: 'dnavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2357,6 +2365,7 @@ const DwFivePointColumns: Array<any> = [
|
||||
filed: 'dnmxavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2364,6 +2373,7 @@ const DwFivePointColumns: Array<any> = [
|
||||
filed: 'dnwnavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
|
||||
@ -2372,7 +2382,7 @@ const DwFivePointColumns: Array<any> = [
|
||||
filed: 'inv',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 4,
|
||||
toFixed: 6,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2608,7 +2618,7 @@ const DwOnePointColumns: Array<any> = [
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
name: '多层式进水口',
|
||||
name: '夹岩双层取水',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
@ -2627,7 +2637,7 @@ const DwOnePointColumns: Array<any> = [
|
||||
filed: 'nrmxavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 2,
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2635,7 +2645,7 @@ const DwOnePointColumns: Array<any> = [
|
||||
filed: 'nrmnavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 2,
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2643,7 +2653,7 @@ const DwOnePointColumns: Array<any> = [
|
||||
filed: 'dnavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 2,
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2651,7 +2661,7 @@ const DwOnePointColumns: Array<any> = [
|
||||
filed: 'dnmxavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 2,
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2659,7 +2669,7 @@ const DwOnePointColumns: Array<any> = [
|
||||
filed: 'dnmnavwt',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 2,
|
||||
toFixed: 1,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
@ -2667,7 +2677,7 @@ const DwOnePointColumns: Array<any> = [
|
||||
filed: 'inv',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 4,
|
||||
toFixed: 6,
|
||||
url: '',
|
||||
},
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
监测数据
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@ -0,0 +1,669 @@
|
||||
<template>
|
||||
<div class="body_one">
|
||||
<div class="search_one">
|
||||
<div class="search_left">
|
||||
<div>鱼类选择:</div>
|
||||
<a-select v-model:value="selectValue" mode="multiple" style="width: 260px;" placeholder=" "
|
||||
:options="selectOption" @change="handleChange"></a-select>
|
||||
</div>
|
||||
<div>
|
||||
<a-range-picker v-model:value="rangePicker" format="YYYY-MM-DD" :disabled-date="disabledDate"
|
||||
:allow-clear="false" @change="handleDateChange">
|
||||
<template #renderExtraFooter>
|
||||
<div class="quick-date-options">
|
||||
<a-button size="small" @click="setQuickRange(7)">最近七天</a-button>
|
||||
<a-button size="small" @click="setQuickRange(30)">最近一个月</a-button>
|
||||
<a-button size="small" @click="setQuickRange(90)">最近三个月</a-button>
|
||||
<a-button size="small" @click="setQuickRange(180)">最近六个月</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</a-range-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="body_body">
|
||||
<div class="echarts" ref="chartRef"></div>
|
||||
<div class="table">
|
||||
<BasicTable ref="tableRef" :scrollY="460" :columns="columns" :list-url="fishGetKendoListCust"
|
||||
:search-params="{}" :transform-data="customTransform">
|
||||
<!-- 同期对比列的自定义渲染 -->
|
||||
<template #contrast="{ record }">
|
||||
<span v-if="record.wt && record.beforeWt"
|
||||
:style="{ color: (record.wt - record.beforeWt) > 0 ? 'rgb(255, 85, 0)' : 'rgb(135, 208, 104)' }">
|
||||
{{ (record.wt - record.beforeWt) > 0 ? '+' : '' }}{{ (record.wt - record.beforeWt).toFixed(2) }}
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch, onMounted, onUnmounted, computed } from "vue";
|
||||
import * as echarts from 'echarts';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import { useModelStore } from "@/store/modules/model";
|
||||
import { infoGetKendoListCust, fishGetKendoListCust } from "@/api/sw";
|
||||
import BasicTable from "@/components/BasicTable/index.vue";
|
||||
const modelStore = useModelStore();
|
||||
const selectOption = ref([])
|
||||
const selectValue = ref([])
|
||||
const tableRef = ref<any>(null);
|
||||
const chartRef = ref<HTMLDivElement | null>(null);
|
||||
let chartInstance: echarts.ECharts | null = null;
|
||||
const chartData = ref<any[]>([]);
|
||||
const columns = [
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'dt',
|
||||
width: 180,
|
||||
customRender: ({ text }: any) => text ? dayjs(text).format('YYYY-MM-DD') : '-'
|
||||
},
|
||||
{
|
||||
title: '水温°C',
|
||||
dataIndex: 'wt',
|
||||
customRender: ({ text }: any) => text !== undefined && text !== null ? text : '-'
|
||||
},
|
||||
{
|
||||
title: '上一年水温',
|
||||
dataIndex: 'beforeWt',
|
||||
customRender: ({ text }: any) => text !== undefined && text !== null ? text : '-'
|
||||
},
|
||||
{
|
||||
title: '同期对比',
|
||||
dataIndex: 'contrast',
|
||||
width: 120,
|
||||
slots: { customRender: 'contrast' }
|
||||
},
|
||||
{
|
||||
title: '适宜产卵鱼',
|
||||
dataIndex: 'spawnFish',
|
||||
width: 200,
|
||||
customRender: ({ record }: any) => {
|
||||
if (record.fishList && Array.isArray(record.fishList) && record.fishList.length > 0) {
|
||||
return record.fishList.map(fish => fish.name).join('、');
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
];
|
||||
// 初始化日期范围:7天前到当天
|
||||
const initDateRange = () => {
|
||||
const endDate = dayjs();
|
||||
const startDate = dayjs().subtract(7, 'day');
|
||||
return [startDate, endDate] as [Dayjs, Dayjs];
|
||||
};
|
||||
|
||||
const rangePicker = ref<[Dayjs, Dayjs] | undefined>(initDateRange());
|
||||
// 禁用超过当前日期的选项
|
||||
const disabledDate = (current: Dayjs) => {
|
||||
// 不能选择今天之后的日期
|
||||
return current && current.isAfter(dayjs(), 'day');
|
||||
};
|
||||
|
||||
// 设置快捷日期范围
|
||||
const setQuickRange = (days: number) => {
|
||||
const endDate = dayjs();
|
||||
const startDate = dayjs().subtract(days, 'day');
|
||||
rangePicker.value = [startDate, endDate];
|
||||
// 手动触发变更事件
|
||||
handleDateChange(rangePicker.value, [
|
||||
startDate.format('YYYY-MM-DD'),
|
||||
endDate.format('YYYY-MM-DD')
|
||||
]);
|
||||
};
|
||||
|
||||
// 日期改变时的处理方法(内容待定)
|
||||
const handleDateChange = (dates: any, dateStrings: string[]) => {
|
||||
console.log('日期改变:', dates, dateStrings);
|
||||
getEchartsData()
|
||||
gerTableData()
|
||||
// TODO: 在此处添加日期改变后的业务逻辑
|
||||
};
|
||||
// 下拉框数据
|
||||
const getSelectOption = async () => {
|
||||
//
|
||||
// modelStore.params.date
|
||||
let params = {
|
||||
"filter": {
|
||||
"logic": "and",
|
||||
"filters": [
|
||||
{
|
||||
"field": "stcd",
|
||||
"operator": "eq",
|
||||
"dataType": "string",
|
||||
"value": modelStore.params.stcd
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
let res = await infoGetKendoListCust(params)
|
||||
let data = res?.data?.data || res?.data
|
||||
console.log(res)
|
||||
selectOption.value = data.map(item => {
|
||||
return {
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
pretemp: item.pretemp,
|
||||
}
|
||||
})
|
||||
// 根据数据长度智能选择ID:2个及以上取前2个,少于2个取第1个
|
||||
selectValue.value = data.length >= 2 ? data.slice(0, 2).map(item => item.id) : (data.length > 0 ? [data[0].id] : [])
|
||||
}
|
||||
//echarts 数据获取
|
||||
const getEchartsData = async () => {
|
||||
const params = {
|
||||
"filter": {
|
||||
"logic": "and",
|
||||
"filters": [
|
||||
{
|
||||
"field": "stcd",
|
||||
"operator": "eq",
|
||||
"dataType": "string",
|
||||
"value": modelStore.params.stcd
|
||||
},
|
||||
{
|
||||
"field": "startTime",
|
||||
"operator": "gte",
|
||||
"dataType": "date",
|
||||
"value": rangePicker.value[0].format('YYYY-MM-DD') + " 00:00:00"
|
||||
},
|
||||
{
|
||||
"field": "endTime",
|
||||
"operator": "lte",
|
||||
"dataType": "date",
|
||||
"value": rangePicker.value[1].format('YYYY-MM-DD') + " 23:59:59"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sort": [
|
||||
{
|
||||
"field": "dt",
|
||||
"dir": "desc"
|
||||
}
|
||||
]
|
||||
}
|
||||
let res = await fishGetKendoListCust(params)
|
||||
console.log('ECharts原始数据:', res)
|
||||
|
||||
// 存储原始数据到响应式变量
|
||||
const rawData = res?.data?.data || res?.data?.records || []
|
||||
chartData.value = rawData
|
||||
|
||||
// 延迟更新图表,确保DOM已渲染
|
||||
setTimeout(() => {
|
||||
updateChart()
|
||||
}, 100)
|
||||
}
|
||||
//table 数据获取
|
||||
const gerTableData = async () => {
|
||||
const filter = {
|
||||
logic: 'and',
|
||||
"filters": [
|
||||
{
|
||||
"field": "stcd",
|
||||
"operator": "eq",
|
||||
"dataType": "string",
|
||||
"value": modelStore.params.stcd
|
||||
},
|
||||
{
|
||||
"field": "startTime",
|
||||
"operator": "gte",
|
||||
"dataType": "date",
|
||||
"value": rangePicker.value[0].format('YYYY-MM-DD') + " 00:00:00"
|
||||
},
|
||||
{
|
||||
"field": "endTime",
|
||||
"operator": "lte",
|
||||
"dataType": "date",
|
||||
"value": rangePicker.value[1].format('YYYY-MM-DD') + " 23:59:59"
|
||||
}
|
||||
]
|
||||
};
|
||||
tableRef.value?.getList(filter);
|
||||
}
|
||||
|
||||
const handleChange = (value: any) => {
|
||||
console.log(value)
|
||||
getEchartsData()
|
||||
// gerTableData()
|
||||
}
|
||||
const customTransform = (res: any) => {
|
||||
console.log('表格数据:', res);
|
||||
return {
|
||||
records: res?.data?.data || [],
|
||||
total: res?.data?.total || 0
|
||||
};
|
||||
};
|
||||
|
||||
// 过滤和处理图表数据
|
||||
const processChartData = (rawData: any[]) => {
|
||||
if (!rawData || !Array.isArray(rawData)) return [];
|
||||
|
||||
// 过滤掉 wt 或 beforeWt 为 null 的记录
|
||||
const filtered = rawData.filter(item =>
|
||||
item.wt !== null && item.wt !== undefined
|
||||
);
|
||||
// && item.beforeWt !== null && item.beforeWt !== undefined
|
||||
|
||||
// 按 dt 升序排序
|
||||
return filtered.sort((a, b) =>
|
||||
new Date(a.dt).getTime() - new Date(b.dt).getTime()
|
||||
);
|
||||
};
|
||||
|
||||
// 计算 Y 轴最大值(向上取整到个位)
|
||||
const calculateYAxisMax = (data: any[]) => {
|
||||
if (!data || data.length === 0) return 10;
|
||||
|
||||
const allValues = [
|
||||
...data.map(item => item.wt),
|
||||
...data.map(item => item.beforeWt)
|
||||
].filter(v => v !== null && v !== undefined);
|
||||
|
||||
const max = Math.max(...allValues);
|
||||
return Math.ceil(max);
|
||||
};
|
||||
|
||||
// 生成随机颜色(HSL转HEX)
|
||||
const generateRandomColor = () => {
|
||||
const hue = Math.random() * 360; // 色相:0-360°
|
||||
const saturation = 40 + Math.random() * 30; // 饱和度:40%-70%
|
||||
const lightness = 45 + Math.random() * 20; // 亮度:45%-65%
|
||||
|
||||
// HSL转RGB
|
||||
const c = (1 - Math.abs(2 * lightness / 100 - 1)) * saturation / 100;
|
||||
const x = c * (1 - Math.abs((hue / 60) % 2 - 1));
|
||||
const m = lightness / 100 - c / 2;
|
||||
|
||||
let r = 0, g = 0, b = 0;
|
||||
|
||||
if (hue < 60) { r = c; g = x; b = 0; }
|
||||
else if (hue < 120) { r = x; g = c; b = 0; }
|
||||
else if (hue < 180) { r = 0; g = c; b = x; }
|
||||
else if (hue < 240) { r = 0; g = x; b = c; }
|
||||
else if (hue < 300) { r = x; g = 0; b = c; }
|
||||
else { r = c; g = 0; b = x; }
|
||||
|
||||
// RGB转HEX
|
||||
const toHex = (value: number) => {
|
||||
const hex = Math.round((value + m) * 255).toString(16);
|
||||
return hex.length === 1 ? '0' + hex : hex;
|
||||
};
|
||||
|
||||
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
||||
};
|
||||
|
||||
// 计算选中鱼类的温度范围数组
|
||||
const calculateTempRanges = () => {
|
||||
if (!selectValue.value || selectValue.value.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// 从 selectOption 中找到选中的鱼类
|
||||
const selectedFish = selectOption.value.filter(fish =>
|
||||
selectValue.value.includes(fish.value)
|
||||
);
|
||||
|
||||
if (selectedFish.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// 为每个鱼类生成温度范围和随机颜色
|
||||
return selectedFish
|
||||
.map(fish => {
|
||||
if (!fish.pretemp || !Array.isArray(fish.pretemp) || fish.pretemp.length !== 2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const min = parseFloat(fish.pretemp[0]);
|
||||
const max = parseFloat(fish.pretemp[1]);
|
||||
|
||||
if (isNaN(min) || isNaN(max)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
name: fish.label,
|
||||
min,
|
||||
max,
|
||||
color: generateRandomColor()
|
||||
};
|
||||
})
|
||||
.filter(item => item !== null);
|
||||
};
|
||||
|
||||
// 生成 ECharts 配置
|
||||
const getChartOption = computed(() => {
|
||||
const data = processChartData(chartData.value);
|
||||
|
||||
if (data.length === 0) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// const yAxisMax = calculateYAxisMax(data);
|
||||
const tempRanges = calculateTempRanges();
|
||||
const dataMax = calculateYAxisMax(data);
|
||||
const tempMax = tempRanges.length > 0
|
||||
? Math.max(...tempRanges.map(r => r.max))
|
||||
: 0;
|
||||
const yAxisMax = Math.max(dataMax, tempMax);
|
||||
// 提取时间轴和数据
|
||||
const xAxisData = data.map(item => dayjs(item.dt).format('YYYY-MM-DD'));
|
||||
const wtData = data.map(item => item.wt);
|
||||
const beforeWtData = data.map(item => item.beforeWt);
|
||||
|
||||
// 构建 markArea 配置(为每个鱼类生成独立的背景区域)
|
||||
const markAreaConfig = tempRanges.length > 0 ? {
|
||||
silent: true,
|
||||
data: tempRanges.map(range => [
|
||||
{
|
||||
yAxis: range.min,
|
||||
name: `${range.name}: ${range.min}-${range.max}°C`,
|
||||
itemStyle: { color: `${range.color}26` }
|
||||
},
|
||||
{
|
||||
yAxis: range.max
|
||||
}
|
||||
])
|
||||
} : undefined;
|
||||
|
||||
return {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
backgroundColor: 'rgba(50, 50, 50, 0.9)',
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 14
|
||||
},
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
},
|
||||
formatter: (params: any) => {
|
||||
if (!params || params.length === 0) return '';
|
||||
|
||||
const date = params[0].axisValue;
|
||||
let html = `<div style="font-weight:bold;margin-bottom:8px;">${date}</div>`;
|
||||
|
||||
params.forEach((param: any) => {
|
||||
const dataIndex = param.dataIndex;
|
||||
const record = data[dataIndex];
|
||||
const value = param.value != null ? param.value : '-';
|
||||
|
||||
html += `
|
||||
<div style="display:flex;align-items:center;margin:4px 0;">
|
||||
<span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${param.color};margin-right:8px;"></span>
|
||||
<span>${param.seriesName}: ${value}°C</span>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
||||
});
|
||||
|
||||
return html;
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
top: 10,
|
||||
left: 'center',
|
||||
data: ['现在水温', '上一年同期水温'],
|
||||
textStyle: {
|
||||
fontSize: 13
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: 60,
|
||||
right: 40,
|
||||
top: 60,
|
||||
bottom: 50
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xAxisData,
|
||||
boundaryGap: false,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#000000'
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
interval: (() => {
|
||||
const dataLen = xAxisData.length;
|
||||
if (dataLen <= 8) return 0; // 数据少时全部显示
|
||||
|
||||
// 计算最大允许的间隔,确保首尾都能显示
|
||||
// 需要显示的首尾2个 + 中间最多6个 = 总共8个标签
|
||||
const maxLabels = 8;
|
||||
const minInterval = Math.ceil((dataLen - 1) / (maxLabels - 1));
|
||||
|
||||
// 如果原有计算的间隔更大,使用原有逻辑;否则使用最小间隔
|
||||
const calculatedInterval = Math.floor((dataLen - 1) / 7);
|
||||
return Math.max(calculatedInterval, minInterval);
|
||||
})(),
|
||||
fontSize: 12,
|
||||
rotate: 0,
|
||||
margin: 10
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#bfbfbf',
|
||||
type: 'solid'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '水温(°C)',
|
||||
min: 0,
|
||||
max: yAxisMax,
|
||||
scale: false,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#000000',
|
||||
width: 1
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: true,
|
||||
length: 4
|
||||
},
|
||||
axisLabel: {
|
||||
fontSize: 12,
|
||||
formatter: '{value}'
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#bfbfbf',
|
||||
type: 'solid'
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '现在水温',
|
||||
type: 'line',
|
||||
data: wtData,
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 6,
|
||||
lineStyle: { color: '#009dff', width: 2 },
|
||||
itemStyle: { color: '#009dff' },
|
||||
connectNulls: false,
|
||||
// 移除 markArea
|
||||
},
|
||||
{
|
||||
name: '上一年同期水温',
|
||||
type: 'line',
|
||||
data: beforeWtData,
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 6,
|
||||
lineStyle: { color: '#fee588', width: 2 },
|
||||
itemStyle: { color: '#fee588' },
|
||||
connectNulls: false
|
||||
},
|
||||
// 新增辅助系列,专门承载 markArea
|
||||
{
|
||||
name: '温度区间背景', // 名字不会被放入 legend,所以不显示
|
||||
type: 'line',
|
||||
data: new Array(xAxisData.length).fill(0), // 假数据,保证坐标匹配
|
||||
showSymbol: false,
|
||||
symbol: 'none',
|
||||
lineStyle: { opacity: 0 },
|
||||
itemStyle: { opacity: 0 },
|
||||
legendHoverLink: false, // 图例悬停时不联动
|
||||
silent: true, // 不响应鼠标事件
|
||||
markArea: markAreaConfig // 温度区间背景绑定于此
|
||||
}
|
||||
],
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
xAxisIndex: [0],
|
||||
throttle: 50,
|
||||
start: 0,
|
||||
end: 100
|
||||
}
|
||||
],
|
||||
toolbox: {
|
||||
show: true,
|
||||
feature: {
|
||||
saveAsImage: {
|
||||
title: '导出图片',
|
||||
type: 'png',
|
||||
pixelRatio: 2
|
||||
}
|
||||
},
|
||||
right: 20,
|
||||
top: 10
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// 初始化图表
|
||||
const initChart = () => {
|
||||
if (!chartRef.value) return;
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(chartRef.value);
|
||||
updateChart();
|
||||
|
||||
// 监听窗口resize
|
||||
window.addEventListener('resize', handleResize);
|
||||
};
|
||||
|
||||
// 更新图表
|
||||
const updateChart = () => {
|
||||
if (!chartInstance) return;
|
||||
|
||||
const option = getChartOption.value;
|
||||
if (Object.keys(option).length > 0) {
|
||||
chartInstance.setOption(option, true);
|
||||
} else {
|
||||
// 如果没有数据,清空图表或显示空状态
|
||||
chartInstance.clear();
|
||||
}
|
||||
};
|
||||
|
||||
// 处理窗口resize
|
||||
const handleResize = () => {
|
||||
if (chartInstance) {
|
||||
chartInstance.resize();
|
||||
}
|
||||
};
|
||||
|
||||
// 销毁图表
|
||||
const destroyChart = () => {
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
chartInstance = null;
|
||||
}
|
||||
window.removeEventListener('resize', handleResize);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getSelectOption()
|
||||
getEchartsData()
|
||||
gerTableData()
|
||||
// 初始化图表
|
||||
setTimeout(() => {
|
||||
initChart()
|
||||
}, 200)
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
destroyChart()
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.body_one {
|
||||
width: 100%;
|
||||
min-height: 600px;
|
||||
|
||||
.search_one {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.search_left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.body_body {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
height: 540px;
|
||||
|
||||
.echarts {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.table {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.quick-date-options {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
padding: 8px 0;
|
||||
|
||||
.ant-btn {
|
||||
border-color: #1890ff !important;
|
||||
color: #1890ff !important;
|
||||
background-color: #e6f7ff !important;
|
||||
font-size: 12px;
|
||||
|
||||
&:hover {
|
||||
border-color: #40a9ff !important;
|
||||
color: #40a9ff !important;
|
||||
background-color: #bae7ff !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,19 +1,15 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:open="visible"
|
||||
:title="title"
|
||||
width="80vw"
|
||||
:footer="null"
|
||||
:closable="true"
|
||||
@cancel="handleClose"
|
||||
:destroyOnClose="true"
|
||||
class="map-modal"
|
||||
>
|
||||
<a-modal :open="visible" :title="title" width="80vw" :footer="null" :closable="true" @cancel="handleClose"
|
||||
:destroyOnClose="true" class="map-modal">
|
||||
<a-tabs :active-key="currentActiveKey" @change="onTabChange">
|
||||
<a-tab-pane v-for="tab in tabsConfig" :key="tab.key" :tab="tab.name">
|
||||
<div class="content">
|
||||
<!-- 基本信息组件 -->
|
||||
<BasicInfo v-if="currentActiveKey === 'basicInfo'" :url="tab.url" />
|
||||
<!-- 水温-监测数据 -->
|
||||
<WaterTemperature v-if="currentActiveKey === 'WaterTemperature'" />
|
||||
<!-- 水温-鱼类繁殖适宜性分析 -->
|
||||
<WaterTemperatureContrast v-if="currentActiveKey === 'WaterTemperatureRep'" />
|
||||
<!-- 地图组件 -->
|
||||
<!-- <MapView v-else-if="currentActiveKey === 'mapView'" :data="modalData" /> -->
|
||||
<!-- 周边配套组件 -->
|
||||
@ -28,8 +24,7 @@
|
||||
<a-button type="primary" :disabled="isEngConfig">
|
||||
<i class="icon iconfont icon-topic mr-[5px]"></i>
|
||||
电站专题
|
||||
</a-button></a-tooltip
|
||||
>
|
||||
</a-button></a-tooltip>
|
||||
</template>
|
||||
</a-tabs>
|
||||
</a-modal>
|
||||
@ -39,6 +34,8 @@
|
||||
import { ref, watch } from "vue";
|
||||
// 导入预定义的 Tab 内容组件
|
||||
import BasicInfo from "./components/BasicInfo.vue";
|
||||
import WaterTemperature from "./components/WaterTemperature.vue";
|
||||
import WaterTemperatureContrast from "./components/WaterTemperatureContrast.vue";
|
||||
import { useModelStore } from "@/store/modules/model";
|
||||
import { handleTabs } from "./setting.config";
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ const ENGTabs: Array<any> = [
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/bbi/siteBipc/getSiteBasicInfo',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo',
|
||||
default: true // 默认显示
|
||||
},
|
||||
{
|
||||
@ -661,7 +661,7 @@ const WQFBTabs: Array<any> = [
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/bbi/siteBipc/getSiteBasicInfo'
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo'
|
||||
},
|
||||
{
|
||||
name: '监测数据',
|
||||
@ -724,7 +724,7 @@ const WTTabs: Array<any> = [
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/bbi/siteBipc/getSiteBasicInfo'
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo'
|
||||
},
|
||||
{
|
||||
name: '监测数据',
|
||||
@ -767,23 +767,24 @@ const DWTabs: Array<any> = [
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
default: true, // 默认显示
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo'
|
||||
},
|
||||
{
|
||||
name: '实时视频',
|
||||
key: 'videoInfo',
|
||||
type: 'video',
|
||||
url: '/video/dataStcdFrame/getVideoMonitorList'
|
||||
},
|
||||
{
|
||||
name: '监测数据',
|
||||
key: 'VerticalWaterTemperature',
|
||||
type: 'VerticalWaterTemperature',
|
||||
},
|
||||
{
|
||||
name: '叠梁门运行AI识别',
|
||||
key: 'AIYXSB',
|
||||
type: 'AIYXSB',
|
||||
}
|
||||
// {
|
||||
// name: '实时视频',
|
||||
// key: 'videoInfo',
|
||||
// type: 'video',
|
||||
// url: '/video/dataStcdFrame/getVideoMonitorList'
|
||||
// },
|
||||
// {
|
||||
// name: '监测数据',
|
||||
// key: 'VerticalWaterTemperature',
|
||||
// type: 'VerticalWaterTemperature',
|
||||
// },
|
||||
// {
|
||||
// name: '叠梁门运行AI识别',
|
||||
// key: 'AIYXSB',
|
||||
// type: 'AIYXSB',
|
||||
// }
|
||||
]
|
||||
// //低温水减缓设施这是旧的
|
||||
// const DWTabs2: Array<any> = [
|
||||
@ -887,7 +888,7 @@ const DEVICETABS: Array<any> = [
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/bbi/siteBipc/getSiteBasicInfo',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo',
|
||||
default: true, // 默认显示
|
||||
},
|
||||
]
|
||||
|
||||
@ -16,8 +16,7 @@
|
||||
</a-tooltip>
|
||||
</span>
|
||||
<span v-if="iconmap.show" class="title_icon">
|
||||
<a-tooltip placement="top" :title="iconmap.value"
|
||||
:get-popup-container="getPopupContainer">
|
||||
<a-tooltip placement="top" :title="iconmap.value" :get-popup-container="getPopupContainer">
|
||||
<span :class="iconmap.icon"></span>
|
||||
</a-tooltip>
|
||||
</span>
|
||||
@ -26,52 +25,38 @@
|
||||
<div v-if="select.show">
|
||||
<a-select v-model:value="selectValue" show-search placeholder="请选择" :size="'small'"
|
||||
style="width: 120px" :options="select.options" :filter-option="filterOption"
|
||||
@focus="handleFocus" @blur="handleBlur" @change="handleChange" ></a-select>
|
||||
@focus="handleFocus" @blur="handleBlur" @change="handleChange"></a-select>
|
||||
</div>
|
||||
<div v-if="shrink" class="title_shrink" @click="isExpand = !isExpand">
|
||||
<img v-if="isExpand" src="@/assets/components/arrow-up.png" alt="">
|
||||
<img v-else src="@/assets/components/arrow-down.png" alt="">
|
||||
</div>
|
||||
<div v-if="moreSelect.show">
|
||||
<a-tree-select v-model:value="moreSelectValue" show-search :size="'small'" style="width: 110px"
|
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto',minWidth: '180px' }" placeholder=" "
|
||||
:tree-data="processedMoreSelectOptions"
|
||||
<a-tree-select v-model:value="moreSelectValue" v-model:tree-expanded-keys="treeExpandedKeys"
|
||||
show-search :size="'small'" style="width: 110px"
|
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto', minWidth: '180px' }" placeholder=" "
|
||||
:tree-data="processedMoreSelectOptions"
|
||||
:field-names="{ label: 'title', value: 'value', children: 'children' }"
|
||||
tree-node-filter-prop="label"
|
||||
:expanded-keys="expandedKeys"
|
||||
popup-class-name="no-wrap-tree-select"
|
||||
@select="handleTreeSelect"
|
||||
@expand="handleTreeExpand"
|
||||
@dropdownVisibleChange="handleDropdownVisibleChange">
|
||||
tree-node-filter-prop="label" popup-class-name="no-wrap-tree-select" @select="handleTreeSelect"
|
||||
@expand="handleTreeExpand">
|
||||
</a-tree-select>
|
||||
</div>
|
||||
<div v-if="datetimePicker.show">
|
||||
<!-- 添加 locale 属性来设置语言 -->
|
||||
<a-date-picker
|
||||
v-model:value="datetimeValue"
|
||||
show-time
|
||||
:style="{ width: datetimePicker.picker === 'year' ? '80px' : '130px' }"
|
||||
<a-date-picker v-model:value="datetimeValue" show-time
|
||||
:style="{ width: datetimePicker.picker === 'year' ? '80px' : datetimePicker.picker === 'month' ? '90px' : '130px' }"
|
||||
:format="datetimePicker.format !== null ? datetimePicker.format : undefined"
|
||||
:picker="datetimePicker.picker"
|
||||
:allowClear="false"
|
||||
placeholder=" "
|
||||
@change="handleDateTimeChange"
|
||||
:size="'small'"
|
||||
:picker="datetimePicker.picker" :allowClear="false" placeholder=" "
|
||||
@change="handleDateTimeChange" :size="'small'"
|
||||
:disabledDate="createDisabledDateFn(datetimePicker.picker)"
|
||||
:disabledTime="disabledTimeForSinglePicker" />
|
||||
<!-- 修改为 locale 变量 -->
|
||||
</div>
|
||||
<div v-if="scopeDate.show" class="title_scopeDate">
|
||||
<a-range-picker
|
||||
v-model:value="scopeDateValue"
|
||||
:picker="scopeDate.picker"
|
||||
:allowClear="false"
|
||||
<a-range-picker v-model:value="scopeDateValue" :picker="scopeDate.picker" :allowClear="false"
|
||||
:style="{ width: scopeDate.picker === 'year' ? '80px' : (scopeDate.picker === 'month' ? '180px' : '') }"
|
||||
:format="scopeDate.format"
|
||||
:range-separator="' 至 '"
|
||||
:size="'small'"
|
||||
:presets="computedScopeDatePresets"
|
||||
:disabledDate="createDisabledDateFn(scopeDate.picker)" />
|
||||
:format="scopeDate.format" :range-separator="' 至 '" :size="'small'"
|
||||
:presets="computedScopeDatePresets" :disabledDate="createDisabledDateFn(scopeDate.picker)" />
|
||||
</div>
|
||||
<div v-if="tabs.show" class="typeOne">
|
||||
<div @click="handleTabClick('one')" :class="tabsValue == 'one' ? 'typezhong' : ''">图片</div>
|
||||
@ -86,7 +71,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch, computed } from 'vue';
|
||||
import { ref, onMounted, onUnmounted, watch, computed, nextTick } from 'vue';
|
||||
import {
|
||||
QuestionCircleOutlined,
|
||||
InfoCircleOutlined
|
||||
@ -144,7 +129,7 @@ const props = defineProps({
|
||||
default: () => ({
|
||||
show: false,
|
||||
value: '',
|
||||
icon:'iconfont icon-time',
|
||||
icon: 'iconfont icon-time',
|
||||
})
|
||||
},
|
||||
select: { // 选择框
|
||||
@ -201,8 +186,12 @@ const scopeDateValue = ref<[Dayjs, Dayjs] | undefined>(
|
||||
);
|
||||
const tabsValue = ref(props.tabs.value)
|
||||
|
||||
// 树选择器展开状态管理
|
||||
const expandedKeys = ref<string[]>([]);
|
||||
// 保存最后一次选择的月份值(用于从year切换回month时恢复月份)
|
||||
const lastMonthValue = ref<string | null>(null);
|
||||
|
||||
// 树形选择器展开状态管理
|
||||
const treeExpandedKeys = ref<string[]>([])
|
||||
const nodeMap = new Map<string, { node: any; parentKey: string | null }>()
|
||||
|
||||
/**
|
||||
* 创建针对不同 picker 类型的日期禁用函数
|
||||
@ -210,85 +199,89 @@ const expandedKeys = ref<string[]>([]);
|
||||
* @returns disabledDate 回调函数
|
||||
*/
|
||||
const createDisabledDateFn = (pickerType: string) => {
|
||||
return (current: Dayjs) => {
|
||||
if (!current) return false
|
||||
return (current: Dayjs) => {
|
||||
if (!current) return false
|
||||
|
||||
const now = dayjs()
|
||||
const now = dayjs()
|
||||
|
||||
switch (pickerType) {
|
||||
case 'year':
|
||||
// 年份选择器:禁用 > 当前年份
|
||||
return current.year() > now.year()
|
||||
switch (pickerType) {
|
||||
case 'year':
|
||||
// 年份选择器:禁用 > 当前年份
|
||||
return current.year() > now.year()
|
||||
|
||||
case 'month':
|
||||
// 月份选择器:禁用 > 当前年月
|
||||
return current.isAfter(now, 'month')
|
||||
case 'month':
|
||||
// 月份选择器:禁用 > 当前年月
|
||||
return current.isAfter(now, 'month')
|
||||
|
||||
case 'quarter':
|
||||
// 季度选择器:禁用 > 当前季度
|
||||
return current.isAfter(now, 'quarter')
|
||||
case 'quarter':
|
||||
// 季度选择器:禁用 > 当前季度
|
||||
return current.isAfter(now, 'quarter')
|
||||
|
||||
case 'week':
|
||||
// 周选择器:禁用 > 当前周
|
||||
return current.isAfter(now, 'week')
|
||||
case 'week':
|
||||
// 周选择器:禁用 > 当前周
|
||||
return current.isAfter(now, 'week')
|
||||
|
||||
case 'date':
|
||||
default:
|
||||
// 日期选择器:禁用 > 当前日期
|
||||
return current.isAfter(now, 'day')
|
||||
case 'date':
|
||||
default:
|
||||
// 日期选择器:禁用 > 当前日期
|
||||
return current.isAfter(now, 'day')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 单日期选择器的时间禁用函数(针对 show-time)
|
||||
* 精确限制到当前时刻的时分秒
|
||||
* @param current - 用户当前悬停或选择的日期(由 Ant Design Vue 自动传入)
|
||||
*/
|
||||
const disabledTimeForSinglePicker = () => {
|
||||
// 只在 datetimePicker 显示且为 date 类型时生效
|
||||
if (!props.datetimePicker.show || props.datetimePicker.picker !== 'date') {
|
||||
return undefined
|
||||
}
|
||||
|
||||
const now = dayjs()
|
||||
const selectedDate = datetimeValue.value
|
||||
|
||||
// 如果未选择日期,或选择的不是今天,则不限制时间
|
||||
if (!selectedDate || !selectedDate.isSame(now, 'day')) {
|
||||
return {}
|
||||
}
|
||||
|
||||
// 辅助函数:生成从 start 到 end-1 的数组
|
||||
const range = (start: number, end: number) => {
|
||||
const result: number[] = []
|
||||
for (let i = start; i < end; i++) {
|
||||
result.push(i)
|
||||
const disabledTimeForSinglePicker = (current?: Dayjs) => {
|
||||
// 只在 datetimePicker 显示且为 date 类型时生效
|
||||
if (!props.datetimePicker.show || props.datetimePicker.picker !== 'date') {
|
||||
return undefined
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
return {
|
||||
// 禁用当前小时之后的所有小时
|
||||
disabledHours: () => {
|
||||
return range(now.hour() + 1, 24)
|
||||
},
|
||||
const now = dayjs()
|
||||
|
||||
// 禁用当前分钟之后的所有分钟(仅在当前小时)
|
||||
disabledMinutes: (selectedHour: number) => {
|
||||
if (selectedHour === now.hour()) {
|
||||
return range(now.minute() + 1, 60)
|
||||
}
|
||||
return []
|
||||
},
|
||||
// 关键修复:使用传入的 current 参数,而不是 datetimeValue.value
|
||||
// current 是用户当前在面板中操作的日期,会实时响应面板内的日期切换
|
||||
const selectedDate = current || datetimeValue.value
|
||||
|
||||
// 禁用当前秒数之后的所有秒数(仅在当前小时和分钟)
|
||||
disabledSeconds: (selectedHour: number, selectedMinute: number) => {
|
||||
if (selectedHour === now.hour() && selectedMinute === now.minute()) {
|
||||
return range(now.second() + 1, 60)
|
||||
}
|
||||
return []
|
||||
// 如果未选择日期,或选择的不是今天,则不限制时间
|
||||
if (!selectedDate || !selectedDate.isSame(now, 'day')) {
|
||||
return {}
|
||||
}
|
||||
|
||||
// 辅助函数:生成从 start 到 end-1 的数组
|
||||
const range = (start: number, end: number) => {
|
||||
const result: number[] = []
|
||||
for (let i = start; i < end; i++) {
|
||||
result.push(i)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
return {
|
||||
// 禁用当前小时之后的所有小时
|
||||
disabledHours: () => {
|
||||
return range(now.hour() + 1, 24)
|
||||
},
|
||||
|
||||
// 禁用当前分钟之后的所有分钟(仅在当前小时)
|
||||
disabledMinutes: (selectedHour: number) => {
|
||||
if (selectedHour === now.hour()) {
|
||||
return range(now.minute() + 1, 60)
|
||||
}
|
||||
return []
|
||||
},
|
||||
|
||||
// 禁用当前秒数之后的所有秒数(仅在当前小时和分钟)
|
||||
disabledSeconds: (selectedHour: number, selectedMinute: number) => {
|
||||
if (selectedHour === now.hour() && selectedMinute === now.minute()) {
|
||||
return range(now.second() + 1, 60)
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// // 定义 locale 变量
|
||||
@ -326,6 +319,54 @@ const processedMoreSelectOptions = computed(() => {
|
||||
return processTreeData(props.moreSelect.options || []);
|
||||
});
|
||||
|
||||
/**
|
||||
* 构建树节点映射(建立父子关系)
|
||||
* @param treeData 树形数据
|
||||
* @param parentKey 父节点key
|
||||
*/
|
||||
const buildNodeMap = (treeData: any[], parentKey: string | null = null) => {
|
||||
if (!treeData || !Array.isArray(treeData)) return
|
||||
|
||||
treeData.forEach(node => {
|
||||
// 存储当前节点及其父节点信息
|
||||
nodeMap.set(node.value, {
|
||||
node,
|
||||
parentKey
|
||||
})
|
||||
|
||||
// 递归处理子节点
|
||||
if (node.children && node.children.length > 0) {
|
||||
buildNodeMap(node.children, node.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取目标节点的所有父节点keys
|
||||
* @param targetValue 目标节点value
|
||||
* @returns 父节点keys数组(从根到直接父节点)
|
||||
*/
|
||||
const getParentKeys = (targetValue: string): string[] => {
|
||||
const parentKeys: string[] = []
|
||||
let currentKey: string | null = targetValue
|
||||
|
||||
// 向上追溯所有父节点
|
||||
while (currentKey !== null && currentKey !== undefined) {
|
||||
const nodeInfo = nodeMap.get(currentKey)
|
||||
|
||||
// 如果节点不存在或已到达根节点,停止追溯
|
||||
if (!nodeInfo || nodeInfo.parentKey === null || nodeInfo.parentKey === undefined) {
|
||||
break
|
||||
}
|
||||
|
||||
// 将父节点插入到数组开头(保持从根到叶的顺序)
|
||||
parentKeys.unshift(nodeInfo.parentKey)
|
||||
currentKey = nodeInfo.parentKey
|
||||
}
|
||||
|
||||
return parentKeys
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算属性:根据 picker 类型动态生成快捷日期选项
|
||||
*/
|
||||
@ -469,56 +510,7 @@ const handleTreeSelect = (selectedKeys: string | string[], info: any) => {
|
||||
* @param keys 展开的节点键值数组
|
||||
*/
|
||||
const handleTreeExpand = (keys: string[]) => {
|
||||
expandedKeys.value = keys;
|
||||
};
|
||||
|
||||
/**
|
||||
* 查找节点的父节点路径
|
||||
* @param treeData 树数据
|
||||
* @param targetValue 目标节点的值
|
||||
* @returns 父节点值的数组(从根到直接父节点)
|
||||
*/
|
||||
const findParentKeys = (treeData: any[], targetValue: string): string[] => {
|
||||
const parentKeys: string[] = [];
|
||||
|
||||
const search = (nodes: any[], target: string, parents: string[]): boolean => {
|
||||
for (const node of nodes) {
|
||||
if (node.value === target) {
|
||||
// 找到目标节点,记录所有父节点
|
||||
parentKeys.push(...parents);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (node.children && node.children.length > 0) {
|
||||
// 递归搜索子节点,将当前节点加入父节点列表
|
||||
if (search(node.children, target, [...parents, node.value])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
search(treeData, targetValue, []);
|
||||
return parentKeys;
|
||||
};
|
||||
|
||||
/**
|
||||
* 处理下拉框显示/隐藏变化事件
|
||||
* 当下拉框打开且有选中值时,自动展开该节点的所有父节点
|
||||
* @param visible 下拉框是否可见
|
||||
*/
|
||||
const handleDropdownVisibleChange = (visible: boolean) => {
|
||||
if (visible && moreSelectValue.value && processedMoreSelectOptions.value.length > 0) {
|
||||
// 查找选中节点的所有父节点
|
||||
const parentKeys = findParentKeys(processedMoreSelectOptions.value, moreSelectValue.value);
|
||||
|
||||
if (parentKeys.length > 0) {
|
||||
// 合并现有的展开节点和父节点,去重
|
||||
const mergedKeys = Array.from(new Set([...expandedKeys.value, ...parentKeys]));
|
||||
expandedKeys.value = mergedKeys;
|
||||
}
|
||||
}
|
||||
// 保留事件处理函数以维持组件接口完整性
|
||||
};
|
||||
|
||||
// 下拉选择框事件处理
|
||||
@ -546,7 +538,10 @@ const getPopupContainer = (trigger: HTMLElement) => {
|
||||
|
||||
//时间选择框事件处理
|
||||
const handleDateTimeChange = (date: any | null, dateString: string) => {
|
||||
// Handle date time change
|
||||
// 当选择器为 month 时,保存当前选择的月份值
|
||||
if (props.datetimePicker.picker === 'month' && date) {
|
||||
lastMonthValue.value = dayjs(date).format('YYYY-MM');
|
||||
}
|
||||
};
|
||||
|
||||
const handleTabClick = (value: string) => {
|
||||
@ -619,19 +614,12 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
// 监听 moreSelectValue 的变化,移除了自动展开逻辑
|
||||
watch(
|
||||
() => props.moreSelect.value,
|
||||
(newVal) => {
|
||||
if (newVal !== moreSelectValue.value) {
|
||||
moreSelectValue.value = newVal;
|
||||
|
||||
// 如果有新值且树数据已加载,自动展开其父节点
|
||||
if (newVal && processedMoreSelectOptions.value.length > 0) {
|
||||
const parentKeys = findParentKeys(processedMoreSelectOptions.value, newVal);
|
||||
if (parentKeys.length > 0) {
|
||||
expandedKeys.value = Array.from(new Set([...expandedKeys.value, ...parentKeys]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
@ -676,18 +664,81 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
// 页面加载时执行的逻辑
|
||||
onMounted(() => {
|
||||
// 初始化时发送一次默认值
|
||||
emitAllValues();
|
||||
// 监听 datetimePicker.picker 的变化,处理从 year 切换到 month 时的月份恢复
|
||||
watch(
|
||||
() => props.datetimePicker.picker,
|
||||
(newPicker, oldPicker) => {
|
||||
// 当从 year 切换到 month 时,恢复之前保存的月份
|
||||
if (oldPicker === 'year' && newPicker === 'month' && lastMonthValue.value && datetimeValue.value) {
|
||||
const currentYear = datetimeValue.value.year(); // 获取当前选择的年份
|
||||
const lastMonth = dayjs(lastMonthValue.value); // 获取上次保存的月份值
|
||||
const lastMonthNum = lastMonth.month(); // 获取月份(0-11)
|
||||
|
||||
// 如果 tree-select 有默认值,预先展开其父节点
|
||||
if (moreSelectValue.value && processedMoreSelectOptions.value.length > 0) {
|
||||
const parentKeys = findParentKeys(processedMoreSelectOptions.value, moreSelectValue.value);
|
||||
if (parentKeys.length > 0) {
|
||||
expandedKeys.value = parentKeys;
|
||||
// 组合:新选择的年份 + 上次选择的月份
|
||||
let newValue = dayjs().year(currentYear).month(lastMonthNum);
|
||||
|
||||
// 检查组合后的时间是否超过当前时间
|
||||
const now = dayjs();
|
||||
if (newValue.isAfter(now, 'month')) {
|
||||
// 超过当前月份,修正为当前月份
|
||||
newValue = now.startOf('month');
|
||||
}
|
||||
|
||||
datetimeValue.value = newValue;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 监听 moreSelectValue 变化(包括默认值和用户选择)
|
||||
watch(() => moreSelectValue.value, (newValue) => {
|
||||
console.log('moreSelectValue 变化:', newValue)
|
||||
|
||||
if (newValue && nodeMap.size > 0) {
|
||||
// 只有当 nodeMap 已构建时才执行
|
||||
const parentKeys = getParentKeys(newValue as string)
|
||||
treeExpandedKeys.value = parentKeys
|
||||
console.log('自动展开父节点:', parentKeys)
|
||||
} else {
|
||||
treeExpandedKeys.value = []
|
||||
}
|
||||
}, { immediate: true }) // immediate: true 确保默认值也能触发
|
||||
|
||||
// 监听树数据变化,重新构建映射
|
||||
watch(() => processedMoreSelectOptions.value, (newData) => {
|
||||
console.log('树数据变化,重新构建映射')
|
||||
|
||||
if (newData && newData.length > 0) {
|
||||
// 清空旧映射
|
||||
nodeMap.clear()
|
||||
// 重新构建映射
|
||||
buildNodeMap(newData)
|
||||
|
||||
// 数据加载完成后,如果已有默认值,重新触发一次
|
||||
if (moreSelectValue.value) {
|
||||
nextTick(() => {
|
||||
const parentKeys = getParentKeys(moreSelectValue.value as string)
|
||||
treeExpandedKeys.value = parentKeys
|
||||
console.log('数据加载后自动展开父节点:', parentKeys)
|
||||
})
|
||||
}
|
||||
}
|
||||
}, { deep: true })
|
||||
|
||||
// 页面加载时执行的逻辑
|
||||
onMounted(() => {
|
||||
// 如果初始 picker 是 month,保存初始月份值
|
||||
if (props.datetimePicker.picker === 'month' && datetimeValue.value) {
|
||||
lastMonthValue.value = datetimeValue.value.format('YYYY-MM');
|
||||
}
|
||||
|
||||
// 初始化时发送一次默认值
|
||||
emitAllValues();
|
||||
});
|
||||
|
||||
// 组件卸载时清空状态,避免影响其他页面
|
||||
onUnmounted(() => {
|
||||
// 清空月份记忆,防止组件复用时的状态污染
|
||||
lastMonthValue.value = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
289
frontend/src/components/carouselIntroduce/ArtsDetail.vue
Normal file
289
frontend/src/components/carouselIntroduce/ArtsDetail.vue
Normal file
@ -0,0 +1,289 @@
|
||||
<!-- ArtsDetail.vue -->
|
||||
<template>
|
||||
<div class="arts-detail">
|
||||
<div class="card-container">
|
||||
<div class="card_left">
|
||||
<div class="card_img">
|
||||
<div class="carousel-wrapper">
|
||||
<div class="carousel-inner">
|
||||
<div class="carousel-track" :style="trackStyle">
|
||||
<div v-for="(item, index) in originalMediaData" :key="index" class="carousel-item">
|
||||
<a-image :src="item.url" />
|
||||
<!-- <img :src="item.url" :alt="item.title" /> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card_right">
|
||||
<div class="card_text_title"></div>
|
||||
<div class="card_text_content">
|
||||
{{ currentDescription }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%;display: flex;justify-content: center;">
|
||||
<div class="card_button">
|
||||
<LeftOutlined @click="prevSlide" :class="{ 'disabled': currentIndex === 0 }"
|
||||
:style="{ cursor: currentIndex === 0 ? 'not-allowed' : 'pointer' }" />
|
||||
<div class="pagination-dots">
|
||||
<span v-for="(item, index) in originalMediaData" :key="index" class="dot-item"
|
||||
:class="{ 'active': currentIndex === index }" @click="jumpToSlide(index)" />
|
||||
</div>
|
||||
<RightOutlined @click="nextSlide" :class="{ 'disabled': currentIndex === originalMediaData.length - 1 }"
|
||||
:style="{ cursor: currentIndex === originalMediaData.length - 1 ? 'not-allowed' : 'pointer' }" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted, watch } from 'vue';
|
||||
import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
defineOptions({
|
||||
name: 'ArtsDetail'
|
||||
});
|
||||
|
||||
const props = defineProps<{
|
||||
dataSource: Array<{
|
||||
title: string;
|
||||
description: string;
|
||||
url: string;
|
||||
}>;
|
||||
index:any
|
||||
}>();
|
||||
|
||||
interface MediaItem {
|
||||
title: string;
|
||||
description: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
const originalMediaData = ref<MediaItem[]>([]);
|
||||
const currentIndex = ref(0);
|
||||
|
||||
// 初始化数据
|
||||
const initOriginalData = () => {
|
||||
if (props.dataSource && props.dataSource.length > 0) {
|
||||
originalMediaData.value = props.dataSource.map(item => ({
|
||||
title: item.title,
|
||||
description: item.description,
|
||||
url: item.url
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
// 根据 index prop 设置当前索引
|
||||
const setCurrentIndexFromProps = () => {
|
||||
if (props.index !== undefined && props.index !== null && originalMediaData.value.length > 0) {
|
||||
const validIndex = Math.max(0, Math.min(props.index, originalMediaData.value.length - 1));
|
||||
currentIndex.value = validIndex;
|
||||
} else {
|
||||
currentIndex.value = 0;
|
||||
}
|
||||
};
|
||||
|
||||
// 计算轨道样式 - 完全按照 React 版本的逻辑
|
||||
const trackStyle = computed(() => {
|
||||
return {
|
||||
transform: `translateX(calc((68.8px - 48vw) * ${currentIndex.value}))`
|
||||
};
|
||||
});
|
||||
|
||||
// 切换到下一张
|
||||
const nextSlide = () => {
|
||||
if (currentIndex.value < originalMediaData.value.length - 1) {
|
||||
currentIndex.value++;
|
||||
}
|
||||
};
|
||||
|
||||
// 切换到上一张
|
||||
const prevSlide = () => {
|
||||
if (currentIndex.value > 0) {
|
||||
currentIndex.value--;
|
||||
}
|
||||
};
|
||||
|
||||
// 跳转到指定页面
|
||||
const jumpToSlide = (targetIndex: number) => {
|
||||
currentIndex.value = targetIndex;
|
||||
};
|
||||
|
||||
// 计算当前显示的描述文字
|
||||
const currentDescription = computed(() => {
|
||||
return originalMediaData.value[currentIndex.value]?.description || '';
|
||||
});
|
||||
|
||||
// 页面加载时执行
|
||||
onMounted(() => {
|
||||
console.log('ArtsDetail mounted - props.index:', props.index, 'props.dataSource.length:', props.dataSource?.length);
|
||||
initOriginalData();
|
||||
setCurrentIndexFromProps();
|
||||
console.log('After setCurrentIndexFromProps - currentIndex.value:', currentIndex.value);
|
||||
});
|
||||
|
||||
// 只监听 dataSource 变化,不监听 index 变化
|
||||
watch(
|
||||
() => props.dataSource,
|
||||
(newData) => {
|
||||
if (newData && newData.length > 0) {
|
||||
// 数据更新时重新初始化
|
||||
initOriginalData();
|
||||
// 重置索引为 0 或根据当前 props.index 设置
|
||||
setCurrentIndexFromProps();
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.arts-detail {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.card-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.card_left {
|
||||
// flex: 6;
|
||||
width: 60%;
|
||||
height: 630px;
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||
box-sizing: border-box;
|
||||
|
||||
.card_img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.carousel-wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.carousel-inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.carousel-track {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
transition: transform 0.3s ease-in-out;
|
||||
|
||||
.carousel-item {
|
||||
width: calc(48vw - 80.8px);
|
||||
flex: 0 0 calc(48vw - 80.8px);
|
||||
height: 100%;
|
||||
margin-right: 12px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
border: none;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card_right {
|
||||
// flex: 4;
|
||||
width: 40%;
|
||||
height: 630px;
|
||||
padding-left: 40px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.card_text_title {
|
||||
width: 6px;
|
||||
height: 24px;
|
||||
background-color: rgb(108, 164, 247);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.card_text_content {
|
||||
width: 100%;
|
||||
height: 96%;
|
||||
padding: 0px 16px 16px 0px;
|
||||
box-sizing: border-box;
|
||||
line-height: 1.5;
|
||||
overflow: auto;
|
||||
font-size: 20px;
|
||||
text-indent: 2em;
|
||||
}
|
||||
}
|
||||
|
||||
.card_button {
|
||||
display: flex;
|
||||
// justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16px 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
.pagination-dots {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.dot-item {
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
background-color: #adaaaa;
|
||||
margin: 0 6px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
background-color: #8a8a8a;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: #5E9BFE;
|
||||
transform: scale(1.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.anticon) {
|
||||
font-size: 24px;
|
||||
cursor: pointer;
|
||||
color: #6c8cf7;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover:not(.disabled) {
|
||||
color: #4a6fd4;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: #d9d9d9;
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,844 @@
|
||||
<template>
|
||||
<div class="environmental-quality-container">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form ref="formRef" :model="formState" layout="inline" class="search-form">
|
||||
<a-space wrap>
|
||||
<a-form-item label="所属基地" name="dataDimensionVal">
|
||||
<a-select
|
||||
v-model:value="formState.dataDimensionVal"
|
||||
placeholder="请选择"
|
||||
style="width: 120px"
|
||||
show-search
|
||||
:filter-option="filterBaseOption"
|
||||
option-filter-prop="label"
|
||||
@change="handleBaseChange"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="item in baseList"
|
||||
:key="item.baseid"
|
||||
:value="item.baseid"
|
||||
:label="item.basename"
|
||||
>
|
||||
{{ item.basename }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item v-if="formState.dataDimensionVal === 'all'" label="测站类型" name="dtinType">
|
||||
<a-select
|
||||
v-model:value="formState.dtinType"
|
||||
placeholder="请选择"
|
||||
style="width: 100px"
|
||||
show-search
|
||||
:filter-option="filterOption"
|
||||
option-filter-prop="label"
|
||||
>
|
||||
<a-select-option value="" label="全部">全部</a-select-option>
|
||||
<a-select-option value="0" label="自建水质站">自建水质站</a-select-option>
|
||||
<a-select-option value="1" label="国家水质站">国家水质站</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="时间维度" name="types">
|
||||
<a-select
|
||||
v-model:value="formState.types"
|
||||
placeholder="请选择"
|
||||
style="width: 80px"
|
||||
show-search
|
||||
:filter-option="filterOption"
|
||||
option-filter-prop="label"
|
||||
>
|
||||
<a-select-option value="year" label="年度">年度</a-select-option>
|
||||
<a-select-option value="month" label="月度">月度</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="达标状态" name="sfdb">
|
||||
<a-select
|
||||
v-model:value="formState.sfdb"
|
||||
placeholder="请选择"
|
||||
style="width: 100px"
|
||||
show-search
|
||||
:filter-option="filterOption"
|
||||
option-filter-prop="label"
|
||||
>
|
||||
<a-select-option value="" label="全部">全部</a-select-option>
|
||||
<a-select-option value="0" label="不达标">不达标</a-select-option>
|
||||
<a-select-option value="1" label="达标">达标</a-select-option>
|
||||
<a-select-option value="2" label="无目标等级/无数据">无目标等级/无数据</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="时间" name="dateValues">
|
||||
<a-month-picker
|
||||
v-if="formState.types === 'month'"
|
||||
v-model:value="formState.dateValues"
|
||||
format="YYYY-MM"
|
||||
placeholder="请选择月份"
|
||||
style="width: 160px"
|
||||
:disabled-date="disabledMonthDate"
|
||||
/>
|
||||
<a-year-picker
|
||||
v-else
|
||||
v-model:value="formState.dateValues"
|
||||
format="YYYY"
|
||||
placeholder="请选择年份"
|
||||
style="width: 160px"
|
||||
:disabled-date="disabledYearDate"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="断面名称" name="stnm">
|
||||
<a-input
|
||||
v-model:value="formState.stnm"
|
||||
placeholder="请输入断面名称"
|
||||
style="width: 200px"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item>
|
||||
<a-space>
|
||||
<a-button type="primary" @click="handleSearch">查询</a-button>
|
||||
<a-button @click="handleReset">重置</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-space>
|
||||
</a-form>
|
||||
|
||||
<!-- 图表和表格布局区域 -->
|
||||
<div class="content-layout">
|
||||
<!-- 左侧饼图区域 -->
|
||||
<div class="chart-section">
|
||||
<a-spin :spinning="pieLoading" tip="加载中...">
|
||||
<div ref="pieChartRef" class="pie-chart-container"></div>
|
||||
<div v-if="!showPieChart && !pieLoading" class="empty-overlay">
|
||||
<a-empty description="暂无数据" />
|
||||
</div>
|
||||
</a-spin>
|
||||
</div>
|
||||
|
||||
<!-- 右侧表格区域 -->
|
||||
<div class="table-section">
|
||||
<BasicTable
|
||||
ref="tableRef"
|
||||
:scrollY="360"
|
||||
:columns="columns"
|
||||
:list-url="wqGetKendoList"
|
||||
:search-params="{ sort: sortConfig }"
|
||||
:transform-data="customTransform"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<!-- 断面名称列 - 可点击 -->
|
||||
<template v-if="column.key === 'stnm'">
|
||||
<a @click="handleViewStnmDetail(record)" class="text-link">
|
||||
{{ record.stnm }}
|
||||
</a>
|
||||
</template>
|
||||
<!-- 操作列 -->
|
||||
<template v-if="column.key === 'action'">
|
||||
<a @click="handleViewDetail(record)" class="text-link">
|
||||
查看详情
|
||||
</a>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
<a-modal
|
||||
v-model:open="detailModalVisible"
|
||||
:title="`${detailData.stnm || ''} 详细信息`"
|
||||
width="80%"
|
||||
:footer="null"
|
||||
@cancel="handleDetailModalClose"
|
||||
>
|
||||
<div class="modal-content">
|
||||
<!-- TODO: 这里放置详情组件,待后续实现 -->
|
||||
<p>详情内容待实现...</p>
|
||||
<pre>{{ detailData }}</pre>
|
||||
</div>
|
||||
</a-modal>
|
||||
|
||||
<!-- 地图弹窗(断面名称点击) -->
|
||||
<a-modal
|
||||
v-model:open="mapModalVisible"
|
||||
:title="`${mapModalData.titleName || ''} 详情信息`"
|
||||
width="80%"
|
||||
:footer="null"
|
||||
@cancel="handleMapModalClose"
|
||||
>
|
||||
<div class="modal-content">
|
||||
<!-- TODO: 这里放置地图标签页组件,待后续实现 -->
|
||||
<p>地图详情内容待实现...</p>
|
||||
<pre>{{ mapModalData }}</pre>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted, onBeforeUnmount, watch, nextTick } from 'vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import * as echarts from 'echarts'
|
||||
import dayjs, { Dayjs } from 'dayjs'
|
||||
import BasicTable from '@/components/BasicTable/index.vue'
|
||||
import { wqGetKendoList } from '@/api/sz'
|
||||
|
||||
// Props 定义
|
||||
const props = defineProps<{
|
||||
datas?: Array<{ baseid: string; basename: string }> // 基地列表
|
||||
type?: 'month' | 'year' // 时间维度
|
||||
modalData?: string // 模态框数据
|
||||
dateValue?: string | Dayjs // 日期值
|
||||
dataDimensionVal?: string // 数据维度值
|
||||
buildType?: string | number // 建设类型
|
||||
}>()
|
||||
|
||||
// Refs
|
||||
const formRef = ref()
|
||||
const tableRef = ref()
|
||||
const pieChartRef = ref<HTMLElement | null>(null)
|
||||
let pieChartInstance: echarts.ECharts | null = null
|
||||
|
||||
// State
|
||||
const formState = reactive({
|
||||
dataDimensionVal: props.dataDimensionVal || '',
|
||||
dtinType: '',
|
||||
types: props.type || 'month',
|
||||
sfdb: '',
|
||||
dateValues: props.dateValue ? (typeof props.dateValue === 'string' ? dayjs(props.dateValue, props.type === 'month' ? 'YYYY-MM' : 'YYYY') : props.dateValue) : dayjs(),
|
||||
stnm: ''
|
||||
})
|
||||
|
||||
const baseList = computed(() => props.datas || [])
|
||||
const pieLoading = ref(false)
|
||||
const showPieChart = ref(true)
|
||||
const pieCode = ref<string[]>([]) // 饼图选中的代码,用于过滤表格
|
||||
|
||||
// 弹窗相关
|
||||
const detailModalVisible = ref(false)
|
||||
const detailData = ref<any>({})
|
||||
const mapModalVisible = ref(false)
|
||||
const mapModalData = ref<any>({})
|
||||
|
||||
// 排序配置
|
||||
const sortConfig = computed(() => [
|
||||
{ field: 'rstcdStepSort', dir: 'asc' },
|
||||
{ field: 'stnm', dir: 'asc' },
|
||||
{ field: 'tm', dir: 'desc' }
|
||||
])
|
||||
|
||||
// 获取列表URL
|
||||
const getListUrl = async (params: any) => {
|
||||
try {
|
||||
const res = await wqGetKendoList(params)
|
||||
return res
|
||||
} catch (error) {
|
||||
console.error('获取表格数据失败:', error)
|
||||
message.error('获取表格数据失败')
|
||||
return { data: { data: [], total: 0 } }
|
||||
}
|
||||
}
|
||||
|
||||
// 自定义数据转换
|
||||
const customTransform = (res: any) => {
|
||||
return {
|
||||
records: res?.data?.data || [],
|
||||
total: res?.data?.total || 0
|
||||
}
|
||||
}
|
||||
|
||||
// 表格列定义
|
||||
const columns = [
|
||||
{
|
||||
title: '日期',
|
||||
dataIndex: 'tm',
|
||||
key: 'tm',
|
||||
width: 120,
|
||||
customRender: ({ record }: any) => {
|
||||
const date = record.tm
|
||||
if (!date) return '-'
|
||||
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(date)) {
|
||||
return date
|
||||
}
|
||||
if (typeof date === 'string' && date.includes(' ')) {
|
||||
return date.split(' ')[0]
|
||||
}
|
||||
return date
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '断面名称',
|
||||
dataIndex: 'stnm',
|
||||
key: 'stnm',
|
||||
width: 150,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '断面编码',
|
||||
dataIndex: 'stcd',
|
||||
key: 'stcd',
|
||||
width: 120,
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
title: '测站类型',
|
||||
dataIndex: 'sttypeName',
|
||||
key: 'sttypeName',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '达标状态',
|
||||
dataIndex: 'sfdbName',
|
||||
key: 'sfdbName',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '水质要求',
|
||||
dataIndex: 'wwqtgName',
|
||||
key: 'wwqtgName',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '当前水质',
|
||||
dataIndex: 'wqGrdName',
|
||||
key: 'wqGrdName',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '去年同期水质',
|
||||
dataIndex: 'beforeWqGrdName',
|
||||
key: 'beforeWqGrdName',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 100,
|
||||
fixed: 'right'
|
||||
}
|
||||
]
|
||||
|
||||
// 禁用未来月份
|
||||
const disabledMonthDate = (current: Dayjs) => {
|
||||
if (!current) return false
|
||||
const now = dayjs()
|
||||
return current.isAfter(now, 'month')
|
||||
}
|
||||
|
||||
// 禁用未去年份
|
||||
const disabledYearDate = (current: Dayjs) => {
|
||||
if (!current) return false
|
||||
const now = dayjs()
|
||||
return current.year() > now.year()
|
||||
}
|
||||
|
||||
// 基地选择器搜索过滤函数
|
||||
const filterBaseOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
}
|
||||
|
||||
// 通用下拉框搜索过滤函数
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
}
|
||||
|
||||
// 获取饼图数据
|
||||
const fetchPieData = async () => {
|
||||
pieLoading.value = true
|
||||
|
||||
try {
|
||||
// 计算时间参数
|
||||
const timeFormat = formState.types === 'month' ? 'YYYY-MM' : 'YYYY'
|
||||
const startTime = formState.dateValues ? formState.dateValues.format(timeFormat) : ''
|
||||
|
||||
if (!startTime || !formState.dataDimensionVal) {
|
||||
showPieChart.value = false
|
||||
return
|
||||
}
|
||||
|
||||
// 构建请求参数
|
||||
const filters: any[] = [
|
||||
{
|
||||
field: 'baseId',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: formState.dataDimensionVal
|
||||
},
|
||||
{
|
||||
field: 'type',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'DAY'
|
||||
},
|
||||
formState.types === 'month' ? {
|
||||
field: 'drMonth',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: startTime
|
||||
} : {
|
||||
field: 'drYear',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: startTime
|
||||
},
|
||||
formState.dataDimensionVal !== 'all' ? {
|
||||
field: 'rstcd',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: formState.dataDimensionVal
|
||||
} : null,
|
||||
formState.sfdb ? {
|
||||
field: 'sfdb',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: formState.sfdb
|
||||
} : null,
|
||||
formState.stnm ? {
|
||||
field: 'stnm',
|
||||
operator: 'contains',
|
||||
dataType: 'string',
|
||||
value: formState.stnm
|
||||
} : null,
|
||||
formState.dataDimensionVal == 'all' && formState.dtinType ? {
|
||||
field: 'dtinType',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: formState.dtinType
|
||||
} : null
|
||||
].filter(Boolean)
|
||||
|
||||
const params = {
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters
|
||||
}
|
||||
}
|
||||
|
||||
// 调用API获取饼图数据
|
||||
const res = await wqGetKendoList(params)
|
||||
|
||||
let data = res?.data?.data || res?.data || []
|
||||
|
||||
if (data.length === 0) {
|
||||
showPieChart.value = false
|
||||
return
|
||||
}
|
||||
|
||||
// 转换数据格式
|
||||
const dataSource = data.map((item: any) => ({
|
||||
name: item.keyName || 'null',
|
||||
value: item.count,
|
||||
key: item.keyName === '达标' ? 'DB_STATUS_1' : item.keyName === '不达标' ? 'DB_STATUS_0' : 'CURNODATA',
|
||||
keyData: item?.key
|
||||
}))
|
||||
|
||||
// 过滤掉"无数据"项
|
||||
const filteredDataSource = dataSource.filter(item => item.name !== '无数据')
|
||||
|
||||
if (filteredDataSource.length === 0) {
|
||||
showPieChart.value = false
|
||||
return
|
||||
}
|
||||
|
||||
showPieChart.value = true
|
||||
|
||||
// 初始化或更新饼图
|
||||
await nextTick()
|
||||
initPieChart(filteredDataSource)
|
||||
|
||||
} catch (error) {
|
||||
console.error('获取饼图数据失败:', error)
|
||||
message.error('获取饼图数据失败')
|
||||
showPieChart.value = false
|
||||
} finally {
|
||||
pieLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化饼图
|
||||
const initPieChart = (data: any[]) => {
|
||||
if (!pieChartRef.value) return
|
||||
|
||||
// 如果实例已存在,先销毁
|
||||
if (pieChartInstance) {
|
||||
pieChartInstance.dispose()
|
||||
pieChartInstance = null
|
||||
}
|
||||
|
||||
pieChartInstance = echarts.init(pieChartRef.value)
|
||||
|
||||
// 计算总数
|
||||
const total = data.reduce((sum, item) => sum + item.value, 0)
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} 次 ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
right: '10%',
|
||||
top: '10%',
|
||||
data: data.map(item => item.name)
|
||||
},
|
||||
title: [
|
||||
{
|
||||
text: total.toString(),
|
||||
left: '45%',
|
||||
top: '50%',
|
||||
textAlign: 'center',
|
||||
textStyle: {
|
||||
fontSize: 20,
|
||||
fontWeight: 'bold',
|
||||
color: '#333'
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '监测总次数',
|
||||
left: '45%',
|
||||
top: '56%',
|
||||
textAlign: 'center',
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '(次)',
|
||||
left: '45%',
|
||||
top: '61%',
|
||||
textAlign: 'center',
|
||||
textStyle: {
|
||||
fontSize: 10,
|
||||
color: '#999'
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '断面总数量',
|
||||
type: 'pie',
|
||||
radius: ['20%', '35%'],
|
||||
center: ['45%', '55%'],
|
||||
avoidLabelOverlap: false,
|
||||
itemStyle: {
|
||||
borderRadius: 10,
|
||||
borderColor: '#fff',
|
||||
borderWidth: 2
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
formatter: '{b}: {c} ({d}%)'
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: 14,
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
data: data
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// 颜色配置(根据数据类型动态设置)
|
||||
const colorConfig: any = {
|
||||
color: ['#52c41a', '#ff4d4f', '#d9d9d9']
|
||||
}
|
||||
|
||||
pieChartInstance.setOption({ ...option, ...colorConfig })
|
||||
|
||||
// 绑定点击事件 - 过滤表格数据
|
||||
pieChartInstance.on('legendselectchanged', (params: any) => {
|
||||
const selectedKeys = Object.keys(params.selected).filter(key => params.selected[key])
|
||||
const allFalse = Object.values(params.selected).every(value => value === false)
|
||||
|
||||
// 映射到后端需要的keyData
|
||||
const dataMap: Record<string, string> = {
|
||||
'达标': 'DB_STATUS_1',
|
||||
'不达标': 'DB_STATUS_0',
|
||||
'无数据': 'CURNODATA'
|
||||
}
|
||||
|
||||
const selectedCodes = data
|
||||
.filter(item => selectedKeys.includes(item.name))
|
||||
.map(item => item.keyData)
|
||||
|
||||
pieCode.value = allFalse ? ['5'] : selectedCodes
|
||||
|
||||
// 刷新表格
|
||||
handleSearch()
|
||||
})
|
||||
}
|
||||
|
||||
// 基地变化处理
|
||||
const handleBaseChange = () => {
|
||||
formState.stnm = ''
|
||||
fetchPieData()
|
||||
handleSearch()
|
||||
}
|
||||
|
||||
// 查询处理
|
||||
const handleSearch = () => {
|
||||
const timeFormat = formState.types === 'month' ? 'YYYY-MM' : 'YYYY'
|
||||
const startTime = formState.dateValues ? formState.dateValues.format(timeFormat) : ''
|
||||
|
||||
const filters: any[] = [
|
||||
{
|
||||
field: 'baseId',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: formState.dataDimensionVal
|
||||
},
|
||||
formState.types === 'month' ? {
|
||||
field: 'drMonth',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: startTime
|
||||
} : {
|
||||
field: 'drYear',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: startTime
|
||||
},
|
||||
{
|
||||
field: 'type',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'DAY'
|
||||
},
|
||||
formState.dataDimensionVal !== 'all' ? {
|
||||
field: 'rstcd',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: formState.dataDimensionVal
|
||||
} : null,
|
||||
pieCode.value.length > 0 ? {
|
||||
field: 'sfdb',
|
||||
operator: 'in',
|
||||
dataType: 'string',
|
||||
value: pieCode.value
|
||||
} : (formState.sfdb ? {
|
||||
field: 'sfdb',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: formState.sfdb
|
||||
} : null),
|
||||
formState.stnm ? {
|
||||
field: 'stnm',
|
||||
operator: 'contains',
|
||||
dataType: 'string',
|
||||
value: formState.stnm
|
||||
} : null,
|
||||
formState.dataDimensionVal === 'all' && formState.dtinType ? {
|
||||
field: 'dtinType',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: formState.dtinType
|
||||
} : null
|
||||
].filter(Boolean)
|
||||
|
||||
const filter = {
|
||||
logic: 'and',
|
||||
filters
|
||||
}
|
||||
|
||||
// 刷新表格
|
||||
tableRef.value?.getList(filter)
|
||||
}
|
||||
|
||||
// 重置处理
|
||||
const handleReset = () => {
|
||||
formState.dataDimensionVal = props.dataDimensionVal || ''
|
||||
formState.dtinType = ''
|
||||
formState.types = props.type || 'month'
|
||||
formState.sfdb = ''
|
||||
formState.dateValues = dayjs()
|
||||
formState.stnm = ''
|
||||
pieCode.value = []
|
||||
|
||||
fetchPieData()
|
||||
handleSearch()
|
||||
}
|
||||
|
||||
// 查看详情
|
||||
const handleViewDetail = (record: any) => {
|
||||
detailData.value = { ...record }
|
||||
detailModalVisible.value = true
|
||||
}
|
||||
|
||||
// 详情弹窗关闭
|
||||
const handleDetailModalClose = () => {
|
||||
detailModalVisible.value = false
|
||||
detailData.value = {}
|
||||
}
|
||||
|
||||
// 查看断面名称详情(地图)
|
||||
const handleViewStnmDetail = (record: any) => {
|
||||
const timeRange = formState.dateValues
|
||||
? [dayjs(formState.dateValues).startOf(formState.types === 'month' ? 'month' : 'year'),
|
||||
dayjs(formState.dateValues).endOf(formState.types === 'month' ? 'month' : 'year')]
|
||||
: []
|
||||
|
||||
mapModalData.value = {
|
||||
sttp: 'wq',
|
||||
stcd: record.stcd,
|
||||
titleName: record.stnm,
|
||||
timeRange,
|
||||
calculateFlag: null // TODO: 根据实际情况设置
|
||||
}
|
||||
mapModalVisible.value = true
|
||||
}
|
||||
|
||||
// 地图弹窗关闭
|
||||
const handleMapModalClose = () => {
|
||||
mapModalVisible.value = false
|
||||
mapModalData.value = {}
|
||||
}
|
||||
|
||||
// 监听表单变化,自动查询
|
||||
watch(
|
||||
() => [formState.dataDimensionVal, formState.types, formState.sfdb, formState.stnm, formState.dtinType],
|
||||
() => {
|
||||
fetchPieData()
|
||||
handleSearch()
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
// 监听日期变化
|
||||
watch(
|
||||
() => formState.dateValues,
|
||||
() => {
|
||||
fetchPieData()
|
||||
handleSearch()
|
||||
}
|
||||
)
|
||||
|
||||
// 初始化
|
||||
onMounted(async () => {
|
||||
await nextTick()
|
||||
fetchPieData()
|
||||
handleSearch()
|
||||
|
||||
// 监听窗口resize
|
||||
window.addEventListener('resize', () => {
|
||||
pieChartInstance?.resize()
|
||||
})
|
||||
})
|
||||
|
||||
// 组件卸载时清理
|
||||
onBeforeUnmount(() => {
|
||||
pieChartInstance?.dispose()
|
||||
pieChartInstance = null
|
||||
window.removeEventListener('resize', () => {
|
||||
pieChartInstance?.resize()
|
||||
})
|
||||
})
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
handleSearch
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.environmental-quality-container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.search-form {
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 16px;
|
||||
|
||||
:deep(.ant-space) {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
:deep(.ant-form-item) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.content-layout {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
overflow: hidden;
|
||||
|
||||
.chart-section {
|
||||
width: 35%;
|
||||
min-width: 300px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 16px;
|
||||
position: relative;
|
||||
|
||||
.pie-chart-container {
|
||||
width: 100%;
|
||||
height: 482px;
|
||||
}
|
||||
|
||||
.empty-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
|
||||
.table-section {
|
||||
flex: 1;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.text-link {
|
||||
color: #2f6b98;
|
||||
|
||||
&:hover {
|
||||
color: #40a9ff;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
padding: 20px;
|
||||
max-height: 600px;
|
||||
overflow-y: auto;
|
||||
|
||||
pre {
|
||||
background: #f5f5f5;
|
||||
padding: 12px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-spin-nested-loading) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-spin-container) {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@ -1,80 +1,573 @@
|
||||
<!-- SidePanelItem.vue -->
|
||||
<template>
|
||||
<SidePanelItem title="地表水水质达标率">
|
||||
<SidePanelItem title="地表水水质达标率" :select="select" :datetimePicker="datetimePicker"
|
||||
@update-values="handlePanelChange1" style="height: 650px;">
|
||||
<div class="body_item">
|
||||
<div class="tabs_all">
|
||||
<div :class="tabs == 1 ? 'zhong_tabs' : 'no_tabs'" @click="handleTabChange(1)">自建水质站</div>
|
||||
<div :class="tabs == 2 ? 'zhong_tabs' : 'no_tabs'" @click="handleTabChange(2)">国家水质站</div>
|
||||
<div v-if="baseid == 'all'" class="tabs_all">
|
||||
<div :class="tabs == 0 ? 'zhong_tabs' : 'no_tabs'" @click="handleTabChange(0)">自建水质站</div>
|
||||
<div :class="tabs == 1 ? 'zhong_tabs' : 'no_tabs'" @click="handleTabChange(1)">国家水质站</div>
|
||||
</div>
|
||||
<div v-show="tabs == 1 || tabs == 2" class="tabs_body">
|
||||
<div ref="chartRef" class="chart-container"></div>
|
||||
<div v-show="tabs == 0 || tabs == 1" class="tabs_body">
|
||||
<a-spin :spinning="loading">
|
||||
<!-- 始终渲染图表容器,确保有固定宽高 -->
|
||||
<div ref="chartRef" class="chart-container"></div>
|
||||
<!-- 无数据时显示Empty,但不影响容器尺寸 -->
|
||||
<div v-if="chartData.length === 0 && !loading" class="empty-overlay">
|
||||
<a-empty description="暂无数据" />
|
||||
</div>
|
||||
</a-spin>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</SidePanelItem>
|
||||
|
||||
<!-- 环境质量满足度弹框 -->
|
||||
<a-modal
|
||||
v-model:open="modalVisible"
|
||||
title="环境质量满足度"
|
||||
width="1536px"
|
||||
:footer="null"
|
||||
centered
|
||||
>
|
||||
<EnvironmentalQualityTwoLayers
|
||||
:datas="jiDiList"
|
||||
:type="select.value "
|
||||
:dateValue="datetimePicker.value"
|
||||
:dataDimensionVal="baseid"
|
||||
:buildType="tabs"
|
||||
/>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
|
||||
import { ref, onMounted, onUnmounted, watch, nextTick, computed } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||
|
||||
import { wqGetKendoListCust } from '@/api/sz'
|
||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
||||
import EnvironmentalQualityTwoLayers from "./TwoLayers/EnvironmentalQualityTwoLayers.vue"
|
||||
// 定义组件名(便于调试和递归)
|
||||
defineOptions({
|
||||
name: 'EnvironmentalQuality'
|
||||
});
|
||||
|
||||
const tabs = ref(1);
|
||||
const JidiSelectEventStore = useJidiSelectEventStore();
|
||||
const tabs = ref(0);
|
||||
const chartRef = ref<HTMLElement | null>(null);
|
||||
let chartInstance: echarts.ECharts | null = null;
|
||||
const loading = ref(false);
|
||||
|
||||
// 静态数据 - 自建水质站(第1页)
|
||||
const selfBuiltData = [
|
||||
{ name: '雅砻江\n干流', current: 99, lastYear: 100 },
|
||||
{ name: '大渡河\n干流', current: 99, lastYear: 100 },
|
||||
{ name: '黄河上游\n干流', current: 99, lastYear: 100 }
|
||||
];
|
||||
// 响应式图表数据
|
||||
const chartData = ref<Array<{ name: string; current: number | null; lastYear: number | null }>>([]);
|
||||
|
||||
// 静态数据 - 国家水质站(第2页)
|
||||
const nationalData = [
|
||||
{ name: '长江\n干流', current: 98, lastYear: 99 },
|
||||
{ name: '珠江\n干流', current: 97, lastYear: 98 },
|
||||
{ name: '淮河\n干流', current: 96, lastYear: 97 }
|
||||
];
|
||||
const select = ref({
|
||||
show: true,
|
||||
value: 'month',
|
||||
options: [
|
||||
{ value: 'month', label: '月度' },
|
||||
{ value: 'year', label: '年度' }
|
||||
],
|
||||
picker: undefined,
|
||||
format: undefined,
|
||||
});
|
||||
|
||||
// 根据tab获取对应数据
|
||||
const getCurrentData = () => {
|
||||
return tabs.value === 1 ? selfBuiltData : nationalData;
|
||||
// 日期选择器配置
|
||||
const datetimePicker = ref({
|
||||
show: true,
|
||||
value: (() => {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
return `${year}-${month}`;
|
||||
})(),
|
||||
format: "YYYY-MM",
|
||||
picker: "month" as const,
|
||||
options: [],
|
||||
});
|
||||
const baseid = ref("")
|
||||
const jiDiList: any = ref([
|
||||
{
|
||||
"baseid": "all",
|
||||
"basename": "当前全部",
|
||||
"id": "9BFEC848-83EA-AD22-6DE2-10E969476693"
|
||||
},
|
||||
{
|
||||
"baseid": "01",
|
||||
"basename": "金沙江干流",
|
||||
"id": "A33040B7-8977-D9F1-5E02-D7F0241AB8AA"
|
||||
},
|
||||
{
|
||||
"baseid": "02",
|
||||
"basename": "雅砻江干流",
|
||||
"id": "C63D6020-995D-FE97-2F4A-F619A7142C79"
|
||||
},
|
||||
{
|
||||
"baseid": "03",
|
||||
"basename": "大渡河干流",
|
||||
"id": "CCB0766B-F1D4-7DD6-650F-5C556B7231B3"
|
||||
},
|
||||
{
|
||||
"baseid": "04",
|
||||
"basename": "乌江干流",
|
||||
"id": "E8A66641-B4F4-CC85-0815-38C5B2F93DBD"
|
||||
},
|
||||
{
|
||||
"baseid": "05",
|
||||
"basename": "长江上游干流",
|
||||
"id": "E02C11E9-CEA5-A030-202F-3BFE84465D03"
|
||||
},
|
||||
{
|
||||
"baseid": "10",
|
||||
"basename": "湘西",
|
||||
"id": "B1D1D52D-CEEF-6DC4-27DF-9990EB572F8D"
|
||||
},
|
||||
{
|
||||
"baseid": "08",
|
||||
"basename": "黄河上游干流",
|
||||
"id": "BC6AF135-263D-09A9-D5CA-C99B2598FE6E"
|
||||
},
|
||||
{
|
||||
"baseid": "09",
|
||||
"basename": "黄河中游干流",
|
||||
"id": "60EEEC28-128F-A2A8-44F3-6EAAC8FD8BB6"
|
||||
},
|
||||
{
|
||||
"baseid": "06",
|
||||
"basename": "南盘江-红水河",
|
||||
"id": "7BB9A8F4-34B5-42B4-A7FC-CE910AD7F203"
|
||||
},
|
||||
{
|
||||
"baseid": "12",
|
||||
"basename": "东北",
|
||||
"id": "47F8EF06-924E-E161-FCAF-62A66BBF252D"
|
||||
},
|
||||
{
|
||||
"baseid": "07",
|
||||
"basename": "澜沧江干流",
|
||||
"id": "A966A4C9-278C-B0DA-2B97-2D10B7A6E96A"
|
||||
},
|
||||
{
|
||||
"baseid": "13",
|
||||
"basename": "怒江干流",
|
||||
"id": "FA89E8CB-67A8-76DA-DC1E-23AE4C54F9E4"
|
||||
},
|
||||
{
|
||||
"baseid": "11",
|
||||
"basename": "闽浙赣",
|
||||
"id": "CD98F995-EEB2-1021-D807-DA1B1AD9E49A"
|
||||
},
|
||||
{
|
||||
"baseid": "other",
|
||||
"basename": "其他",
|
||||
"id": "AFBDFC67-B955-4EFD-959A-014CFB59EBFC"
|
||||
}
|
||||
])
|
||||
// 基地列表(从 Store 或其他来源获取)
|
||||
const baseList = computed(() => {
|
||||
// TODO: 根据实际情况返回基地列表
|
||||
// 这里需要根据项目实际情况从 Store 或 API 获取
|
||||
// 示例结构:
|
||||
// return [
|
||||
// { baseid: 'all', basename: '全部' },
|
||||
// { baseid: '01', basename: '金沙江干流' },
|
||||
// ...
|
||||
// ]
|
||||
|
||||
// 临时返回空数组,待后续补充实际数据源
|
||||
return []
|
||||
})
|
||||
|
||||
// 解析API返回的嵌套数据(支持两种结构)
|
||||
const parseApiResponse = (items: any[], currentValueForApi: string, lastYearValue: string) => {
|
||||
const result: Array<{ name: string; current: number | null; lastYear: number | null }> = [];
|
||||
|
||||
console.log('=== parseApiResponse 开始解析 ===');
|
||||
console.log('currentValueForApi:', currentValueForApi);
|
||||
console.log('lastYearValue:', lastYearValue);
|
||||
console.log('items数量:', items?.length);
|
||||
|
||||
items.forEach((group, groupIndex) => {
|
||||
console.log(`\n--- 处理第${groupIndex + 1}个group ---`);
|
||||
console.log('group.key:', group.key);
|
||||
console.log('group.items数量:', group.items?.length);
|
||||
|
||||
group.items?.forEach((mainGroup, mainIndex) => {
|
||||
console.log(` → 第${mainIndex + 1}个mainGroup:`);
|
||||
console.log(' field:', mainGroup.field);
|
||||
console.log(' key:', mainGroup.key);
|
||||
|
||||
// 判断是哪种结构:检查第二层的field字段
|
||||
const field = mainGroup.field;
|
||||
|
||||
if (field === 'ennm' || field === 'baseId') {
|
||||
// 提取中文名称:从mainGroup.key获取(站点名或基地ID)
|
||||
let displayName = '';
|
||||
|
||||
// mainGroup.key 可能是站点名(如"两河口")或基地ID(如"02")
|
||||
if (mainGroup.key && typeof mainGroup.key === 'string') {
|
||||
displayName = mainGroup.key;
|
||||
console.log(' 从mainGroup.key获取名称:', displayName);
|
||||
}
|
||||
|
||||
// 如果mainGroup.key不是有效的中文名称,尝试从subGroup.key获取
|
||||
if (!displayName || !/[\u4e00-\u9fa5]/.test(displayName)) {
|
||||
const subGroup = mainGroup.items?.[0];
|
||||
console.log(' subGroup.key:', subGroup?.key);
|
||||
if (subGroup && subGroup.key && typeof subGroup.key === 'string') {
|
||||
displayName = subGroup.key; // 这里应该是中文名(如"雅砻江干流")
|
||||
console.log(' 从subGroup.key获取名称:', displayName);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果还是没有,尝试从最内层数据获取
|
||||
if (!displayName) {
|
||||
const subGroup = mainGroup.items?.[0];
|
||||
const firstMonthGroup = subGroup?.items?.[0];
|
||||
const dataItem = firstMonthGroup?.items?.[0];
|
||||
if (dataItem) {
|
||||
if (field === 'ennm') {
|
||||
displayName = dataItem.ENNM || '';
|
||||
} else if (field === 'baseId') {
|
||||
displayName = dataItem.BASENAME || '';
|
||||
}
|
||||
console.log(' 从最内层数据获取名称:', displayName);
|
||||
}
|
||||
}
|
||||
|
||||
if (!displayName) {
|
||||
console.log(' ⚠️ 跳过:没有名称');
|
||||
return; // 跳过没有名称的数据
|
||||
}
|
||||
|
||||
let currentPeriodValue: number | null = null;
|
||||
let lastYearPeriodValue: number | null = null;
|
||||
|
||||
// 遍历时间分组:需要深入到第3层
|
||||
const subGroup = mainGroup.items?.[0];
|
||||
console.log(' subGroup.items数量:', subGroup?.items?.length);
|
||||
|
||||
subGroup?.items?.forEach(monthGroup => {
|
||||
const periodKey = monthGroup.key; // "2026-05" 或 "2025-05"
|
||||
const dataItem = monthGroup.items?.[0];
|
||||
|
||||
if (dataItem) {
|
||||
const value = dataItem.COUNT_DRMONTH ?? dataItem.wqRate;
|
||||
console.log(` 时间:${periodKey}, 值:${value}`);
|
||||
|
||||
// 判断是当前期还是去年同期
|
||||
if (periodKey === currentValueForApi) {
|
||||
currentPeriodValue = value != null ? Number(value) : null;
|
||||
console.log(` ✓ 当前期值: ${currentPeriodValue}`);
|
||||
} else if (periodKey === lastYearValue) {
|
||||
lastYearPeriodValue = value != null ? Number(value) : null;
|
||||
console.log(` ✓ 去年同期值: ${lastYearPeriodValue}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 添加换行符:在"干流"前添加\n
|
||||
const finalDisplayName = displayName.replace(/干流$/, '\n干流');
|
||||
|
||||
console.log(` → 最终数据: {name: "${finalDisplayName}", current: ${currentPeriodValue}, lastYear: ${lastYearPeriodValue}}`);
|
||||
|
||||
result.push({
|
||||
name: finalDisplayName,
|
||||
current: currentPeriodValue,
|
||||
lastYear: lastYearPeriodValue
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
console.log('\n=== parseApiResponse 解析完成 ===');
|
||||
console.log('result数量:', result.length);
|
||||
console.log('result:', result);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
// 处理tab切换
|
||||
const handleTabChange = (tab: number) => {
|
||||
tabs.value = tab;
|
||||
getEchartsData()
|
||||
};
|
||||
|
||||
// 监听tabs变化,处理图表刷新
|
||||
//监听tabs变化,处理图表刷新
|
||||
watch(tabs, (newVal) => {
|
||||
if (newVal === 1 || newVal === 2) {
|
||||
if (newVal === 0 || newVal === 1) {
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
if (!chartInstance) {
|
||||
initChart();
|
||||
} else {
|
||||
// 更新图表数据
|
||||
updateChartData();
|
||||
}
|
||||
getEchartsData();
|
||||
|
||||
}, 50);
|
||||
});
|
||||
}
|
||||
});
|
||||
watch(
|
||||
() => JidiSelectEventStore.selectedItem,
|
||||
(newVal) => {
|
||||
if (newVal && newVal.wbsCode) {
|
||||
baseid.value = newVal.wbsCode;
|
||||
getEchartsData();
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
// 初始化图表
|
||||
const initChart = () => {
|
||||
if (!chartRef.value) return;
|
||||
// 初始化图表实例(仅创建实例,不设置option)
|
||||
const initChart = (): Promise<void> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!chartRef.value) {
|
||||
console.error('图表容器ref不存在');
|
||||
reject(new Error('图表容器不存在'));
|
||||
return;
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(chartRef.value);
|
||||
if (chartInstance) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const currentData = getCurrentData();
|
||||
const domElement = chartRef.value;
|
||||
|
||||
// 检查 DOM 尺寸
|
||||
if (domElement.clientWidth === 0 || domElement.clientHeight === 0) {
|
||||
console.warn('图表容器尺寸为0,等待DOM布局完成...', {
|
||||
clientWidth: domElement.clientWidth,
|
||||
clientHeight: domElement.clientHeight,
|
||||
offsetWidth: domElement.offsetWidth,
|
||||
offsetHeight: domElement.offsetHeight
|
||||
});
|
||||
|
||||
// 使用多次重试机制
|
||||
let retryCount = 0;
|
||||
const maxRetries = 10;
|
||||
|
||||
const tryInit = () => {
|
||||
retryCount++;
|
||||
|
||||
if (domElement.clientWidth > 0 && domElement.clientHeight > 0) {
|
||||
chartInstance = echarts.init(domElement);
|
||||
console.log('图表实例已创建(第' + retryCount + '次尝试)');
|
||||
resolve();
|
||||
} else if (retryCount < maxRetries) {
|
||||
console.log(`第${retryCount}次尝试,容器尺寸仍为0,继续等待...`);
|
||||
requestAnimationFrame(tryInit);
|
||||
} else {
|
||||
console.error('图表容器尺寸仍为0,已达到最大重试次数', {
|
||||
clientWidth: domElement.clientWidth,
|
||||
clientHeight: domElement.clientHeight
|
||||
});
|
||||
reject(new Error('图表容器尺寸为0'));
|
||||
}
|
||||
};
|
||||
|
||||
// 开始重试
|
||||
requestAnimationFrame(tryInit);
|
||||
} else {
|
||||
// 尺寸正常,直接初始化
|
||||
chartInstance = echarts.init(domElement);
|
||||
console.log('图表实例已创建');
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//获取图表数据
|
||||
const getEchartsData = async () => {
|
||||
// 1. 格式验证
|
||||
const currentValue = datetimePicker.value.value;
|
||||
// debugger
|
||||
if (select.value.value === 'year') {
|
||||
// 年度模式:验证是否为 YYYY 格式(4位数字)
|
||||
if (!/^\d{4}$/.test(currentValue)) {
|
||||
console.warn('年度模式下日期格式不正确,应为 YYYY 格式');
|
||||
return;
|
||||
}
|
||||
} else if (select.value.value === 'month') {
|
||||
// 月度模式:验证是否为 YYYY-MM 格式
|
||||
if (!/^\d{4}-\d{2}$/.test(currentValue)) {
|
||||
console.warn('月度模式下日期格式不正确,应为 YYYY-MM 格式');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
console.warn('未知的选择器类型');
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 计算当前值和上一年的值
|
||||
let currentValueForApi: string; // 第一个值:当前选择
|
||||
let lastYearValue: string; // 第二个值:上一年同期
|
||||
|
||||
if (select.value.value === 'year') {
|
||||
// 年模式
|
||||
currentValueForApi = currentValue; // "2025"
|
||||
lastYearValue = String(Number(currentValue) - 1); // "2024"
|
||||
} else {
|
||||
// 月模式
|
||||
currentValueForApi = currentValue; // "2025-03"
|
||||
|
||||
// 提取年份和月份
|
||||
const [year, month] = currentValue.split('-');
|
||||
// 年份减1,月份保持不变
|
||||
const lastYear = String(Number(year) - 1);
|
||||
lastYearValue = `${lastYear}-${month}`; // "2024-03"
|
||||
}
|
||||
|
||||
// 3. 构建请求参数
|
||||
let params = {
|
||||
"filter": {
|
||||
"logic": "and",
|
||||
"filters": [
|
||||
baseid.value != 'all' ? {
|
||||
"field": "baseId",
|
||||
"operator": "eq",
|
||||
"value": baseid.value
|
||||
} : null,
|
||||
{
|
||||
"field": "type",
|
||||
"operator": "eq",
|
||||
"value": select.value.value == "year" ? "YEAR" : "MON"
|
||||
},
|
||||
{
|
||||
"field": "dtinType",
|
||||
"operator": "eq",
|
||||
"value": tabs.value
|
||||
},
|
||||
{
|
||||
"logic": "or",
|
||||
"filters": [
|
||||
{
|
||||
"field": select.value.value == "year" ? "drYear" : "drMonth",
|
||||
"operator": "eq",
|
||||
"value": currentValueForApi, // 当前值(年或年月)
|
||||
"dataType": "string"
|
||||
},
|
||||
{
|
||||
"field": select.value.value == "year" ? "drYear" : "drMonth",
|
||||
"operator": "eq",
|
||||
"value": lastYearValue, // 上一年同期
|
||||
"dataType": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
].filter(Boolean)
|
||||
},
|
||||
"group": [
|
||||
{
|
||||
"dir": "des",
|
||||
"field": "baseStepSort"
|
||||
},
|
||||
baseid.value == 'all' ? {
|
||||
"dir": "des",
|
||||
"field": "baseId"
|
||||
} : {
|
||||
"dir": "asc",
|
||||
"field": "ennm"
|
||||
},
|
||||
baseid.value == 'all' ? {
|
||||
"dir": "des",
|
||||
"field": "baseName"
|
||||
} : {
|
||||
"dir": "des",
|
||||
"field": "rstcd"
|
||||
},
|
||||
{
|
||||
"dir": "desc",
|
||||
"field": select.value.value == "year" ? "drYear" : "drMonth"
|
||||
}
|
||||
],
|
||||
"groupResultFlat": false,
|
||||
"aggregate": [
|
||||
{
|
||||
"aggregate": "sum",
|
||||
"field": "wqRate"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// 4. 调用API并处理数据
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await wqGetKendoListCust(params);
|
||||
|
||||
console.log('=== API返回数据调试 ===');
|
||||
console.log('res:', res);
|
||||
console.log('res.data:', res?.data);
|
||||
console.log('res.data.data:', res?.data?.data);
|
||||
console.log('currentValueForApi:', currentValueForApi);
|
||||
console.log('lastYearValue:', lastYearValue);
|
||||
|
||||
if (!res?.data?.data) {
|
||||
console.warn('数据获取失败或数据为空');
|
||||
chartData.value = [];
|
||||
// 清空图表中原有的数据
|
||||
if (chartInstance) {
|
||||
chartInstance.clear();
|
||||
console.log('图表已清空(数据获取失败)');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析数据
|
||||
const parsedData = parseApiResponse(res.data.data, currentValueForApi, lastYearValue);
|
||||
|
||||
console.log('解析后的数据 parsedData:', parsedData);
|
||||
|
||||
// 只有当有数据时才更新
|
||||
if (parsedData.length > 0) {
|
||||
chartData.value = parsedData;
|
||||
|
||||
console.log('chartData.value:', chartData.value);
|
||||
|
||||
// 等待 DOM 更新后,再初始化和更新图表
|
||||
await nextTick();
|
||||
|
||||
try {
|
||||
// 如果图表实例不存在,先初始化(等待完成)
|
||||
if (!chartInstance) {
|
||||
await initChart();
|
||||
}
|
||||
|
||||
// 更新图表
|
||||
if (chartInstance) {
|
||||
updateChartData(currentValueForApi, lastYearValue);
|
||||
console.log('图表已更新');
|
||||
} else {
|
||||
console.error('图表实例创建失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('图表初始化失败:', error);
|
||||
}
|
||||
} else {
|
||||
chartData.value = [];
|
||||
console.warn('解析后数据为空');
|
||||
// 清空图表中原有的数据
|
||||
if (chartInstance) {
|
||||
chartInstance.clear();
|
||||
console.log('图表已清空(解析后数据为空)');
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取图表数据失败:', error);
|
||||
chartData.value = [];
|
||||
// 清空图表中原有的数据
|
||||
if (chartInstance) {
|
||||
chartInstance.clear();
|
||||
console.log('图表已清空(发生错误)');
|
||||
}
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 更新图表数据
|
||||
const updateChartData = (currentLabel: string, lastYearLabel: string) => {
|
||||
if (!chartInstance) return;
|
||||
|
||||
// 动态生成图例标签
|
||||
const modeText = select.value.value === 'year' ? '' : ' 月度';
|
||||
const legendCurrentLabel = currentLabel + modeText;
|
||||
const legendLastYearLabel = ' 去年同期';
|
||||
|
||||
const option = {
|
||||
// 图例配置
|
||||
@ -85,8 +578,8 @@ const initChart = () => {
|
||||
itemGap: 20,
|
||||
icon: 'roundRect',
|
||||
data: [
|
||||
{ name: '2026-04 月度', itemStyle: { color: '#4A8BC2' } },
|
||||
{ name: '去年同期', itemStyle: { color: '#9B59B6' } }
|
||||
{ name: legendCurrentLabel, itemStyle: { color: '#4A8BC2' } },
|
||||
{ name: legendLastYearLabel, itemStyle: { color: '#9B59B6' } }
|
||||
],
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
@ -118,10 +611,11 @@ const initChart = () => {
|
||||
const name = params[0].name.replace('\n', '');
|
||||
let result = `<div style="font-weight: bold; margin-bottom: 8px;">${name}</div>`;
|
||||
params.forEach((item: any) => {
|
||||
const value = item.value != null ? Number(item.value).toFixed(1) : '-';
|
||||
result += `<div style="display: flex; align-items: center; margin-bottom: 4px;">
|
||||
<span style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: ${item.color}; margin-right: 8px;"></span>
|
||||
<span>${item.seriesName}:</span>
|
||||
<span style="margin-left: auto; font-weight: bold;">${item.value} %</span>
|
||||
<span style="margin-left: auto; font-weight: bold;">${value}%</span>
|
||||
</div>`;
|
||||
});
|
||||
return result;
|
||||
@ -133,7 +627,7 @@ const initChart = () => {
|
||||
left: 60,
|
||||
right: 10,
|
||||
top: 60,
|
||||
bottom: 50
|
||||
bottom: 60
|
||||
},
|
||||
|
||||
// X轴配置
|
||||
@ -163,7 +657,7 @@ const initChart = () => {
|
||||
// Y轴配置
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
data: currentData.map(item => item.name),
|
||||
data: chartData.value.map(item => item.name),
|
||||
inverse: true,
|
||||
axisLine: {
|
||||
show: true,
|
||||
@ -199,29 +693,20 @@ const initChart = () => {
|
||||
// 系列配置
|
||||
series: [
|
||||
{
|
||||
name: '2026-04 月度',
|
||||
name: legendCurrentLabel,
|
||||
type: 'bar',
|
||||
data: currentData.map(item => item.current),
|
||||
data: chartData.value.map(item => item.current != null ? Number(item.current).toFixed(1) : null),
|
||||
barWidth: 10,
|
||||
barGap: '20%',
|
||||
itemStyle: {
|
||||
color: '#4A8BC2',
|
||||
borderRadius: [0, 3, 3, 0]
|
||||
},
|
||||
markArea: {
|
||||
silent: true,
|
||||
itemStyle: {
|
||||
color: 'rgba(240, 245, 250, 0.5)'
|
||||
},
|
||||
data: [
|
||||
[{ yAxis: 1 }, { yAxis: 2 }]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '去年同期',
|
||||
name: legendLastYearLabel,
|
||||
type: 'bar',
|
||||
data: currentData.map(item => item.lastYear),
|
||||
data: chartData.value.map(item => item.lastYear != null ? Number(item.lastYear).toFixed(1) : null),
|
||||
barWidth: 10,
|
||||
barGap: '20%',
|
||||
itemStyle: {
|
||||
@ -232,38 +717,69 @@ const initChart = () => {
|
||||
]
|
||||
};
|
||||
|
||||
chartInstance.setOption(option);
|
||||
};
|
||||
chartInstance.setOption(option, { notMerge: true });
|
||||
|
||||
// 更新图表数据
|
||||
const updateChartData = () => {
|
||||
if (!chartInstance) return;
|
||||
// 移除旧的点击事件监听
|
||||
chartInstance.off('click');
|
||||
|
||||
const currentData = getCurrentData();
|
||||
// 绑定点击事件
|
||||
chartInstance.on('click', (params: any) => {
|
||||
if (params.componentType === 'series' && params.seriesType === 'bar') {
|
||||
// 获取点击的柱子对应的数据
|
||||
const dataIndex = params.dataIndex;
|
||||
const barData = chartData.value[dataIndex];
|
||||
|
||||
chartInstance.setOption({
|
||||
yAxis: {
|
||||
data: currentData.map(item => item.name)
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: currentData.map(item => item.current)
|
||||
},
|
||||
{
|
||||
data: currentData.map(item => item.lastYear)
|
||||
if (barData) {
|
||||
clickedBarData.value = {
|
||||
name: barData.name.replace('\n', ''), // 去除换行符
|
||||
current: barData.current,
|
||||
lastYear: barData.lastYear
|
||||
};
|
||||
modalVisible.value = true;
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
// 强制重新计算尺寸
|
||||
chartInstance.resize();
|
||||
};
|
||||
|
||||
// 监听 datetimePicker.value.value 的变化
|
||||
watch(
|
||||
() => datetimePicker.value.value,
|
||||
async (newValue, oldValue) => {
|
||||
// 确保新值和旧值不同,且图表已初始化
|
||||
if (newValue !== oldValue && chartInstance) {
|
||||
await nextTick();
|
||||
getEchartsData();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//监听子组件的数据变化
|
||||
const handlePanelChange1 = async (data) => {
|
||||
console.log('当前所有控件状态:', data);
|
||||
// debugger
|
||||
// 当选择器或日期变化时,重新加载图表数据
|
||||
if (data.select || data.datetime) {
|
||||
await (select.value.value = data.select)
|
||||
await (datetimePicker.value.value = data.datetime)
|
||||
await (datetimePicker.value.picker = data.select)
|
||||
await (datetimePicker.value.format = data.select == 'month' ? 'YYYY-MM' : 'YYYY')
|
||||
getEchartsData()
|
||||
}
|
||||
}
|
||||
//获取图表数据
|
||||
|
||||
|
||||
|
||||
// 页面加载时执行
|
||||
onMounted(() => {
|
||||
// 延迟初始化,确保容器已渲染
|
||||
setTimeout(() => {
|
||||
initChart();
|
||||
// 如果已有 selectedItem,触发数据加载
|
||||
if (JidiSelectEventStore.selectedItem?.wbsCode) {
|
||||
baseid.value = JidiSelectEventStore.selectedItem.wbsCode;
|
||||
getEchartsData();
|
||||
}
|
||||
}, 100);
|
||||
|
||||
// 监听窗口resize
|
||||
@ -275,10 +791,55 @@ onMounted(() => {
|
||||
// 组件卸载时清理
|
||||
onUnmounted(() => {
|
||||
chartInstance?.dispose();
|
||||
chartInstance = null;
|
||||
chartData.value = [];
|
||||
window.removeEventListener('resize', () => {
|
||||
chartInstance?.resize();
|
||||
});
|
||||
});
|
||||
|
||||
// 弹框相关状态
|
||||
const modalVisible = ref(false);
|
||||
const clickedBarData = ref<{ name: string; current: number | null; lastYear: number | null } | null>(null);
|
||||
|
||||
// 计算弹框中的时间信息
|
||||
const modalTimeInfo = computed(() => {
|
||||
if (!datetimePicker.value.value) return '';
|
||||
|
||||
const currentValue = datetimePicker.value.value;
|
||||
const modeText = select.value.value === 'year' ? '年度' : '月度';
|
||||
|
||||
if (select.value.value === 'year') {
|
||||
return `${currentValue}年 ${modeText}`;
|
||||
} else {
|
||||
const [year, month] = currentValue.split('-');
|
||||
return `${year}年${month}月 ${modeText}`;
|
||||
}
|
||||
});
|
||||
|
||||
// 计算同比变化值
|
||||
const getChangeValue = () => {
|
||||
if (!clickedBarData.value || clickedBarData.value.current == null || clickedBarData.value.lastYear == null) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
const change = Number(clickedBarData.value.current) - Number(clickedBarData.value.lastYear);
|
||||
const symbol = change > 0 ? '+' : '';
|
||||
return `${symbol}${change.toFixed(1)}%`;
|
||||
};
|
||||
|
||||
// 获取变化值的样式类
|
||||
const getChangeClass = () => {
|
||||
if (!clickedBarData.value || clickedBarData.value.current == null || clickedBarData.value.lastYear == null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const change = Number(clickedBarData.value.current) - Number(clickedBarData.value.lastYear);
|
||||
if (change > 0) return 'positive';
|
||||
if (change < 0) return 'negative';
|
||||
return 'neutral';
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -291,7 +852,7 @@ onUnmounted(() => {
|
||||
|
||||
.tabs_all {
|
||||
width: 28px;
|
||||
height: 600px;
|
||||
height: 500px;
|
||||
box-sizing: border-box;
|
||||
border: 2px solid #2f6b98;
|
||||
border-radius: 5px;
|
||||
@ -322,8 +883,9 @@ onUnmounted(() => {
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
}
|
||||
.no_tabs:hover {
|
||||
color: #40a9ff;
|
||||
|
||||
.no_tabs:hover {
|
||||
color: #40a9ff;
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,10 +895,119 @@ onUnmounted(() => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
/* 为empty-overlay提供定位上下文 */
|
||||
|
||||
.chart-container {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
min-width: 368px;
|
||||
/* 强制最小宽度 */
|
||||
min-height: 600px;
|
||||
/* 强制最小高度 */
|
||||
}
|
||||
|
||||
.empty-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
padding: 20px;
|
||||
|
||||
.detail-info {
|
||||
.info-header {
|
||||
margin-bottom: 24px;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 2px solid #e8e8e8;
|
||||
|
||||
h3 {
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 20px;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.time-info {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.info-body {
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
padding: 12px 16px;
|
||||
background: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
|
||||
.label {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
min-width: 140px;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
|
||||
&.current {
|
||||
color: #4A8BC2;
|
||||
}
|
||||
|
||||
&.last-year {
|
||||
color: #9B59B6;
|
||||
}
|
||||
|
||||
&.change {
|
||||
&.positive {
|
||||
color: #52c41a;
|
||||
}
|
||||
|
||||
&.negative {
|
||||
color: #ff4d4f;
|
||||
}
|
||||
|
||||
&.neutral {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.custom-section {
|
||||
margin-top: 24px;
|
||||
padding: 16px;
|
||||
background: #fafafa;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #e8e8e8;
|
||||
|
||||
h4 {
|
||||
margin: 0 0 12px 0;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user