Merge branch 'dev-tw'
This commit is contained in:
commit
47fa1688d6
@ -40,6 +40,12 @@ public class FishPassageController {
|
|||||||
return ResponseResult.successData(fpRunService.processQgcSdfpssrKendoList(dataSourceRequest));
|
return ResponseResult.successData(fpRunService.processQgcSdfpssrKendoList(dataSourceRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/query/qgc/GetKendoListCust")
|
||||||
|
@Operation(summary = "全过程过鱼自动与人工监测数据查询")
|
||||||
|
public ResponseResult getQgcFpssrlQueryKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(fpRunService.processQgcFpssrlQueryKendoList(dataSourceRequest));
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/fpssTable/qgc/GetKendoListCust")
|
@PostMapping("/fpssTable/qgc/GetKendoListCust")
|
||||||
@Operation(summary = "过鱼设施监测数据查询")
|
@Operation(summary = "过鱼设施监测数据查询")
|
||||||
public ResponseResult getQgcFpssTableKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult getQgcFpssTableKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
|||||||
@ -0,0 +1,29 @@
|
|||||||
|
package com.yfd.platform.qgc_env.fp.controller;
|
||||||
|
|
||||||
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
|
import com.yfd.platform.config.ResponseResult;
|
||||||
|
import com.yfd.platform.qgc_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.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/fp/fishrun")
|
||||||
|
@Tag(name = "鱼类运行数据")
|
||||||
|
@Validated
|
||||||
|
public class FishRunController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FpRunService fpRunService;
|
||||||
|
|
||||||
|
@PostMapping("/qgc/GetKendoListCust")
|
||||||
|
@Operation(summary = "全过程鱼类放流运行数据查询")
|
||||||
|
public ResponseResult getQgcKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(fpRunService.processFbFishRunQgcKendoList(dataSourceRequest));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
package com.yfd.platform.qgc_env.fp.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "鱼类放流运行数据")
|
||||||
|
public class FbFishRunVo {
|
||||||
|
|
||||||
|
@Schema(description = "电站编码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@Schema(description = "电站名称")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@Schema(description = "鱼类编码")
|
||||||
|
private String ftp;
|
||||||
|
|
||||||
|
@Schema(description = "鱼类名称")
|
||||||
|
private String ftpName;
|
||||||
|
|
||||||
|
@Schema(description = "基地编码")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "基地名称")
|
||||||
|
private String baseName;
|
||||||
|
|
||||||
|
@Schema(description = "年份")
|
||||||
|
private String flyr;
|
||||||
|
|
||||||
|
@Schema(description = "放鱼数")
|
||||||
|
private Long fcnt;
|
||||||
|
|
||||||
|
@Schema(description = "放鱼总数")
|
||||||
|
private Long totalFcnt;
|
||||||
|
|
||||||
|
@Schema(description = "文件ids")
|
||||||
|
private String fid;
|
||||||
|
|
||||||
|
@Schema(description = "放流来源")
|
||||||
|
private String release;
|
||||||
|
|
||||||
|
@Schema(description = "基地排序")
|
||||||
|
private Integer baseStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "站点排序")
|
||||||
|
private Integer siteStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "流域排序")
|
||||||
|
private Integer rvcdStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "电站排序")
|
||||||
|
private Integer rstcdStepSort;
|
||||||
|
}
|
||||||
@ -0,0 +1,107 @@
|
|||||||
|
package com.yfd.platform.qgc_env.fp.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "全过程过鱼自动/人工监测合并查询数据")
|
||||||
|
public class FpFpssrlQueryVo {
|
||||||
|
|
||||||
|
@Schema(description = "数据ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "过鱼年份")
|
||||||
|
private String yr;
|
||||||
|
|
||||||
|
@Schema(description = "过鱼设施编码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@Schema(description = "设施名称")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@Schema(description = "基地编码")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "基地名称")
|
||||||
|
private String baseName;
|
||||||
|
|
||||||
|
@Schema(description = "电站编码")
|
||||||
|
private String rstcd;
|
||||||
|
|
||||||
|
@Schema(description = "电站名称")
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
@Schema(description = "基地流域编码")
|
||||||
|
private String hbrvcd;
|
||||||
|
|
||||||
|
@Schema(description = "基地排序")
|
||||||
|
private Integer baseStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "流域排序")
|
||||||
|
private Integer rvcdStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "站点排序")
|
||||||
|
private Integer siteStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "电站排序")
|
||||||
|
private Integer rstcdStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "时间")
|
||||||
|
private Date tm;
|
||||||
|
|
||||||
|
@Schema(description = "鱼类名称")
|
||||||
|
private String ftp;
|
||||||
|
|
||||||
|
@Schema(description = "鱼类编码")
|
||||||
|
private String fishId;
|
||||||
|
|
||||||
|
@Schema(description = "大小")
|
||||||
|
private String fsz;
|
||||||
|
|
||||||
|
@Schema(description = "长度")
|
||||||
|
private String length;
|
||||||
|
|
||||||
|
@Schema(description = "宽度")
|
||||||
|
private String width;
|
||||||
|
|
||||||
|
@Schema(description = "鱼速")
|
||||||
|
private String fishspeed;
|
||||||
|
|
||||||
|
@Schema(description = "游向")
|
||||||
|
private String direction;
|
||||||
|
|
||||||
|
@Schema(description = "水温")
|
||||||
|
private String temperature;
|
||||||
|
|
||||||
|
@Schema(description = "流速")
|
||||||
|
private String speed;
|
||||||
|
|
||||||
|
@Schema(description = "通道")
|
||||||
|
private String channelno;
|
||||||
|
|
||||||
|
@Schema(description = "数量")
|
||||||
|
private String fcnt;
|
||||||
|
|
||||||
|
@Schema(description = "图片")
|
||||||
|
private String firstimgurl;
|
||||||
|
|
||||||
|
@Schema(description = "视频")
|
||||||
|
private String videourl;
|
||||||
|
|
||||||
|
@Schema(description = "监测方式")
|
||||||
|
private Integer mway;
|
||||||
|
|
||||||
|
@Schema(description = "人工开始时间")
|
||||||
|
private Date strdt;
|
||||||
|
|
||||||
|
@Schema(description = "人工结束时间")
|
||||||
|
private Date enddt;
|
||||||
|
|
||||||
|
@Schema(description = "站点分类编码")
|
||||||
|
private String stCode;
|
||||||
|
|
||||||
|
@Schema(description = "站点分类名称")
|
||||||
|
private String stName;
|
||||||
|
}
|
||||||
@ -2,7 +2,9 @@ package com.yfd.platform.qgc_env.fp.service;
|
|||||||
|
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
|
import com.yfd.platform.qgc_env.fp.entity.vo.FbFishRunVo;
|
||||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpFishSelectVo;
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpFishSelectVo;
|
||||||
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpFpssrlQueryVo;
|
||||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpRunAnalysisTableVo;
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpRunAnalysisTableVo;
|
||||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpSdfpssrVo;
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpSdfpssrVo;
|
||||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpTableVo;
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpTableVo;
|
||||||
@ -17,6 +19,10 @@ public interface FpRunService {
|
|||||||
|
|
||||||
DataSourceResult<FpSdfpssrVo> processQgcSdfpssrKendoList(DataSourceRequest dataSourceRequest);
|
DataSourceResult<FpSdfpssrVo> processQgcSdfpssrKendoList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<FbFishRunVo> processFbFishRunQgcKendoList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<FpFpssrlQueryVo> processQgcFpssrlQueryKendoList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
DataSourceResult<FpTableVo> processQgcFpssTableKendoList(DataSourceRequest dataSourceRequest);
|
DataSourceResult<FpTableVo> processQgcFpssTableKendoList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
DataSourceResult<FpRunAnalysisTableVo> getAnalysisData(DataSourceRequest dataSourceRequest);
|
DataSourceResult<FpRunAnalysisTableVo> getAnalysisData(DataSourceRequest dataSourceRequest);
|
||||||
|
|||||||
@ -141,8 +141,9 @@ public class FpBuildServiceImpl implements FpBuildService {
|
|||||||
.append("fp.DTIN_TM AS dtinTm, ")
|
.append("fp.DTIN_TM AS dtinTm, ")
|
||||||
.append("fp.BLDSTT_CODE AS bldsttCcode, ")
|
.append("fp.BLDSTT_CODE AS bldsttCcode, ")
|
||||||
.append("CASE ")
|
.append("CASE ")
|
||||||
.append("WHEN fp.BLDSTT_CODE IN (1, 10, 11) THEN '已建' ")
|
.append("WHEN fp.BLDSTT_CODE = 0 THEN '未建/规划' ")
|
||||||
.append("WHEN fp.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ")
|
.append("WHEN fp.BLDSTT_CODE = 1 THEN '在建' ")
|
||||||
|
.append("WHEN fp.BLDSTT_CODE = 2 THEN '已建' ")
|
||||||
.append("ELSE '未建/规划' END AS bldsttCcodeName, ")
|
.append("ELSE '未建/规划' END AS bldsttCcodeName, ")
|
||||||
.append("fp.STDSDT AS stdsdt, ")
|
.append("fp.STDSDT AS stdsdt, ")
|
||||||
.append("fp.PSTSTDT AS pststdt, ")
|
.append("fp.PSTSTDT AS pststdt, ")
|
||||||
@ -462,7 +463,12 @@ public class FpBuildServiceImpl implements FpBuildService {
|
|||||||
columnMap.put("dtinName", "CASE WHEN NVL(fp.DTIN, 0) = 1 THEN '已接入' ELSE '未接入' END");
|
columnMap.put("dtinName", "CASE WHEN NVL(fp.DTIN, 0) = 1 THEN '已接入' ELSE '未接入' END");
|
||||||
columnMap.put("dtinTm", "fp.DTIN_TM");
|
columnMap.put("dtinTm", "fp.DTIN_TM");
|
||||||
columnMap.put("bldsttCcode", "fp.BLDSTT_CODE");
|
columnMap.put("bldsttCcode", "fp.BLDSTT_CODE");
|
||||||
columnMap.put("bldsttCcodeName", "CASE WHEN fp.BLDSTT_CODE IN (1, 10, 11) THEN '已建' WHEN fp.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END");
|
columnMap.put("bldsttCcodeName",
|
||||||
|
"CASE WHEN fp.BLDSTT_CODE = 0 THEN '未建/规划' " +
|
||||||
|
"WHEN fp.BLDSTT_CODE = 1 THEN '在建' " +
|
||||||
|
"WHEN fp.BLDSTT_CODE = 2 THEN '已建' " +
|
||||||
|
"ELSE '未知' END");
|
||||||
|
// columnMap.put("bldsttCcodeName", "CASE WHEN fp.BLDSTT_CODE IN (1, 10, 11) THEN '已建' WHEN fp.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END");
|
||||||
columnMap.put("stdsdt", "fp.STDSDT");
|
columnMap.put("stdsdt", "fp.STDSDT");
|
||||||
columnMap.put("pststdt", "fp.PSTSTDT");
|
columnMap.put("pststdt", "fp.PSTSTDT");
|
||||||
columnMap.put("pesstdt", "fp.PESSTDT");
|
columnMap.put("pesstdt", "fp.PESSTDT");
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -787,8 +787,10 @@ public class VpConstructionServiceImpl implements VpConstructionService {
|
|||||||
"vb.HBRVCD AS hbrvcd, " +
|
"vb.HBRVCD AS hbrvcd, " +
|
||||||
"hbrv.HBRVNM AS hbrvcdName, " +
|
"hbrv.HBRVNM AS hbrvcdName, " +
|
||||||
"TO_CHAR(vb.BLDSTT_CODE) AS bldsttCcode, " +
|
"TO_CHAR(vb.BLDSTT_CODE) AS bldsttCcode, " +
|
||||||
"CASE WHEN vb.BLDSTT_CODE IN (1, 10, 11) THEN '已建' " +
|
"CASE WHEN vb.BLDSTT_CODE = 1 THEN '在建' " +
|
||||||
"WHEN vb.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END AS bldsttCcodeName, " +
|
"WHEN vb.BLDSTT_CODE = 2 THEN '已建' ELSE '未建/规划' END AS bldsttCcodeName, " +
|
||||||
|
// "CASE WHEN vb.BLDSTT_CODE IN (1, 10, 11) THEN '已建' " +
|
||||||
|
// "WHEN vb.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END AS bldsttCcodeName, " +
|
||||||
"va.TETP AS tetp, " +
|
"va.TETP AS tetp, " +
|
||||||
"va.TECNT AS tecnt, " +
|
"va.TECNT AS tecnt, " +
|
||||||
"va.STLC AS stlc, " +
|
"va.STLC AS stlc, " +
|
||||||
@ -989,7 +991,12 @@ public class VpConstructionServiceImpl implements VpConstructionService {
|
|||||||
columnMap.put("hbrvcdName", "hbrv.HBRVNM");
|
columnMap.put("hbrvcdName", "hbrv.HBRVNM");
|
||||||
columnMap.put("bldsttCcode", "vb.BLDSTT_CODE");
|
columnMap.put("bldsttCcode", "vb.BLDSTT_CODE");
|
||||||
columnMap.put("bldsttCcodeName",
|
columnMap.put("bldsttCcodeName",
|
||||||
"CASE WHEN vb.BLDSTT_CODE IN (1, 10, 11) THEN '已建' WHEN vb.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END");
|
"CASE WHEN vb.BLDSTT_CODE = 0 THEN '未建/规划' " +
|
||||||
|
"WHEN vb.BLDSTT_CODE = 1 THEN '在建' " +
|
||||||
|
"WHEN vb.BLDSTT_CODE = 2 THEN '已建' " +
|
||||||
|
"ELSE '未知' END");
|
||||||
|
// columnMap.put("bldsttCcodeName",
|
||||||
|
// "CASE WHEN vb.BLDSTT_CODE IN (1, 10, 11) THEN '已建' WHEN vb.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END");
|
||||||
columnMap.put("tetp", "va.TETP");
|
columnMap.put("tetp", "va.TETP");
|
||||||
columnMap.put("tecnt", "va.TECNT");
|
columnMap.put("tecnt", "va.TECNT");
|
||||||
columnMap.put("stlc", "va.STLC");
|
columnMap.put("stlc", "va.STLC");
|
||||||
@ -1717,7 +1724,12 @@ public class VpConstructionServiceImpl implements VpConstructionService {
|
|||||||
columnMap.put("bldstt", "vp.BLPRD");
|
columnMap.put("bldstt", "vp.BLPRD");
|
||||||
columnMap.put("bldsttCcode", "vp.BLDSTT_CODE");
|
columnMap.put("bldsttCcode", "vp.BLDSTT_CODE");
|
||||||
columnMap.put("bldsttName", "CASE WHEN vp.BLDSTT_CODE IN (1, 10, 11) THEN '已建' WHEN vp.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END");
|
columnMap.put("bldsttName", "CASE WHEN vp.BLDSTT_CODE IN (1, 10, 11) THEN '已建' WHEN vp.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END");
|
||||||
columnMap.put("bldsttCcodeName", "CASE WHEN vp.BLDSTT_CODE IN (1, 10, 11) THEN '已建' WHEN vp.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END");
|
// columnMap.put("bldsttCcodeName", "CASE WHEN vp.BLDSTT_CODE IN (1, 10, 11) THEN '已建' WHEN vp.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END");
|
||||||
|
columnMap.put("bldsttCcodeName",
|
||||||
|
"CASE WHEN vp.BLDSTT_CODE = 0 THEN '未建/规划' " +
|
||||||
|
"WHEN vp.BLDSTT_CODE = 1 THEN '在建' " +
|
||||||
|
"WHEN vp.BLDSTT_CODE = 2 THEN '已建' " +
|
||||||
|
"ELSE '未知' END");
|
||||||
columnMap.put("stdsdt", "vp.STDSDT");
|
columnMap.put("stdsdt", "vp.STDSDT");
|
||||||
columnMap.put("ststdt", "vp.STDSDT");
|
columnMap.put("ststdt", "vp.STDSDT");
|
||||||
columnMap.put("pststdt", "vp.PSTSTDT");
|
columnMap.put("pststdt", "vp.PSTSTDT");
|
||||||
|
|||||||
@ -211,7 +211,12 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
|||||||
selectMap.put("dtinName", "CASE WHEN NVL(t.dtin, 0) = 1 THEN '已接入' ELSE '未接入' END AS dtinName");
|
selectMap.put("dtinName", "CASE WHEN NVL(t.dtin, 0) = 1 THEN '已接入' ELSE '未接入' END AS dtinName");
|
||||||
selectMap.put("usfl", "t.usfl AS usfl");
|
selectMap.put("usfl", "t.usfl AS usfl");
|
||||||
selectMap.put("bldsttCcode", "t.bldsttCcode AS bldsttCcode");
|
selectMap.put("bldsttCcode", "t.bldsttCcode AS bldsttCcode");
|
||||||
selectMap.put("bldsttCcodeName", "CASE WHEN t.bldsttCcode IN (1, 10, 11) THEN '已建' WHEN t.bldsttCcode IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END AS bldsttCcodeName");
|
selectMap.put("bldsttCcodeName",
|
||||||
|
"CASE WHEN t.bldsttCcode = 0 THEN '未建/规划' " +
|
||||||
|
"WHEN t.bldsttCcode = 1 THEN '在建' " +
|
||||||
|
"WHEN t.bldsttCcode = 2 THEN '已建' " +
|
||||||
|
"ELSE '未知' END");
|
||||||
|
// selectMap.put("bldsttCcodeName", "CASE WHEN t.bldsttCcode IN (1, 10, 11) THEN '已建' WHEN t.bldsttCcode IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END AS bldsttCcodeName");
|
||||||
selectMap.put("stindx", "t.stindx AS stindx");
|
selectMap.put("stindx", "t.stindx AS stindx");
|
||||||
selectMap.put("introduce", "t.introduce AS introduce");
|
selectMap.put("introduce", "t.introduce AS introduce");
|
||||||
selectMap.put("logo", "t.logo AS logo");
|
selectMap.put("logo", "t.logo AS logo");
|
||||||
|
|||||||
@ -215,6 +215,20 @@ public class SdWTMonitorController {
|
|||||||
return ResponseResult.successData(sdWtMonitorService.getCxDetailList(dataSourceRequest));
|
return ResponseResult.successData(sdWtMonitorService.getCxDetailList(dataSourceRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/cxDetail/removeKendoByIds")
|
||||||
|
@Operation(summary = "删除垂向水温数据")
|
||||||
|
public ResponseResult removeCxDetailByIds(@RequestBody BatchDeleteAo batchDeleteAo) {
|
||||||
|
sdWtvtRService.removeKendoByIds(batchDeleteAo);
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/cxDetail/updateWtvtRData")
|
||||||
|
@Operation(summary = "修改垂向水温数据")
|
||||||
|
public ResponseResult updateWtvtRData(@RequestBody Map<String, Object> updateData) {
|
||||||
|
sdWtvtRService.updateWtvtRData(updateData);
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/wtvt/defaultYear/GetKendoListCust")
|
@PostMapping("/wtvt/defaultYear/GetKendoListCust")
|
||||||
@Operation(summary = "获取垂向水温有数据的年份")
|
@Operation(summary = "获取垂向水温有数据的年份")
|
||||||
public ResponseResult getWtrvDefaultYear(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult getWtrvDefaultYear(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
|||||||
@ -2,6 +2,9 @@ package com.yfd.platform.qgc_env.wt.service;
|
|||||||
|
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
|
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 垂向水温Service接口
|
* 垂向水温Service接口
|
||||||
@ -18,4 +21,8 @@ public interface SdWtvtRService {
|
|||||||
* @return 数据源结果
|
* @return 数据源结果
|
||||||
*/
|
*/
|
||||||
DataSourceResult getWtrvDefaultYear(DataSourceRequest dataSourceRequest);
|
DataSourceResult getWtrvDefaultYear(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
boolean removeKendoByIds(BatchDeleteAo batchDeleteAo);
|
||||||
|
|
||||||
|
void updateWtvtRData(Map<String, Object> updateData);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -816,9 +816,7 @@ public class AlongDetailServiceImpl extends ServiceImpl<AlongDetailMapper, SdAlo
|
|||||||
|
|
||||||
}
|
}
|
||||||
if ("TIME".equals(dataType)) {
|
if ("TIME".equals(dataType)) {
|
||||||
// SecurityUtils.getCurrentUsername()
|
sdWtrvdrtpSMapper.deleteWtrvRData(subList, DateUtil.now(), SecurityUtils.getCurrentUsername());
|
||||||
sdWtrvdrtpSMapper.deleteWtrvRData(subList, DateUtil.now(), "admin");
|
|
||||||
|
|
||||||
// 删除小时数据后,需要重新统计对应的日数据和月数据
|
// 删除小时数据后,需要重新统计对应的日数据和月数据
|
||||||
Map<String, String[]> dateRangeMap = new HashMap<>();
|
Map<String, String[]> dateRangeMap = new HashMap<>();
|
||||||
Map<String, String[]> monthRangeMap = new HashMap<>();
|
Map<String, String[]> monthRangeMap = new HashMap<>();
|
||||||
|
|||||||
@ -104,7 +104,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
"t.JCDT AS jcdt, " +
|
"t.JCDT AS jcdt, " +
|
||||||
"t.WDDT AS wddt, " +
|
"t.WDDT AS wddt, " +
|
||||||
"t.BLDSTT_CODE AS bldsttCode, " +
|
"t.BLDSTT_CODE AS bldsttCode, " +
|
||||||
"CASE WHEN t.BLDSTT_CODE IN ('1', '10', '11') THEN '已建' WHEN t.BLDSTT_CODE IN ('2', '7', '8') THEN '在建' ELSE '未建/规划' END AS bldsttCcodeName, "+
|
"CASE WHEN t.BLDSTT_CODE =2 THEN '已建' WHEN t.BLDSTT_CODE =1 THEN '在建' ELSE '未建/规划' END AS bldsttCcodeName, "+
|
||||||
"t.INV AS inv, " +
|
"t.INV AS inv, " +
|
||||||
"t.INVINMN AS invinmn, " +
|
"t.INVINMN AS invinmn, " +
|
||||||
"t.INTRODUCE AS introduce, " +
|
"t.INTRODUCE AS introduce, " +
|
||||||
@ -671,6 +671,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
.append("hb.ORDER_INDEX AS baseStepSort, ")
|
.append("hb.ORDER_INDEX AS baseStepSort, ")
|
||||||
.append("eng.HBRVCD AS hbrvcd, ")
|
.append("eng.HBRVCD AS hbrvcd, ")
|
||||||
.append("eng.ORDER_INDEX AS rstcdStepSort, ")
|
.append("eng.ORDER_INDEX AS rstcdStepSort, ")
|
||||||
|
.append("hb.ORDER_INDEX AS rvcdStepSort, ")
|
||||||
.append("eng.ORDER_INDEX AS siteStepSort ")
|
.append("eng.ORDER_INDEX AS siteStepSort ")
|
||||||
.append("FROM SD_ENGINFO_B_H eng ")
|
.append("FROM SD_ENGINFO_B_H eng ")
|
||||||
.append("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = eng.BASE_ID ")
|
.append("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = eng.BASE_ID ")
|
||||||
@ -715,7 +716,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
.append("hb.BASENAME AS baseName, ")
|
.append("hb.BASENAME AS baseName, ")
|
||||||
.append("hb.BASEID AS baseId, ")
|
.append("hb.BASEID AS baseId, ")
|
||||||
.append("hb.ORDER_INDEX AS baseStepSort, ")
|
.append("hb.ORDER_INDEX AS baseStepSort, ")
|
||||||
.append("NVL(hbrv.ORDER_INDEX, 999999) AS rvcdStepSort, ")
|
// .append("NVL(hbrv.ORDER_INDEX, 999999) AS rvcdStepSort, ")
|
||||||
.append("eng.ORDER_INDEX AS rstcdStepSort, ")
|
.append("eng.ORDER_INDEX AS rstcdStepSort, ")
|
||||||
.append("wt.ORDER_INDEX AS siteStepSort, ")
|
.append("wt.ORDER_INDEX AS siteStepSort, ")
|
||||||
.append("wt.STNM AS stnm, ")
|
.append("wt.STNM AS stnm, ")
|
||||||
@ -943,8 +944,8 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
.append("AND t1.IS_DELETED = 0 ")
|
.append("AND t1.IS_DELETED = 0 ")
|
||||||
.append("AND wt.IS_DELETED = 0 ")
|
.append("AND wt.IS_DELETED = 0 ")
|
||||||
.append("AND wt.STTP = 'WTVT' ")
|
.append("AND wt.STTP = 'WTVT' ")
|
||||||
.append("AND t1.DT <= #{map.endTime} ")
|
.append("AND t1.DT <= TO_DATE(#{map.endTime}, 'YYYY-MM-DD HH24:MI:SS') ")
|
||||||
.append("AND t1.DT >= #{map.startTime} ")
|
.append("AND t1.DT >= TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS') ")
|
||||||
.append("AND t1.WTHG IS NOT NULL ")
|
.append("AND t1.WTHG IS NOT NULL ")
|
||||||
.append("AND t1.VWT IS NOT NULL ")
|
.append("AND t1.VWT IS NOT NULL ")
|
||||||
.append("GROUP BY t1.DT, t1.STCD, wt.STNM ");
|
.append("GROUP BY t1.DT, t1.STCD, wt.STNM ");
|
||||||
@ -2002,7 +2003,12 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
columnMap.put("stcd", "wt.STCD AS stcd");
|
columnMap.put("stcd", "wt.STCD AS stcd");
|
||||||
columnMap.put("fhstcd", "wt.FHSTCD AS fhstcd");
|
columnMap.put("fhstcd", "wt.FHSTCD AS fhstcd");
|
||||||
columnMap.put("rstcd", "wt.RSTCD AS rstcd");
|
columnMap.put("rstcd", "wt.RSTCD AS rstcd");
|
||||||
columnMap.put("bldsttCcodeName", "CASE WHEN wt.BLDSTT_CODE IN ('1', '10', '11') THEN '已建' WHEN wt.BLDSTT_CODE IN ('2', '7', '8') THEN '在建' ELSE '未建/规划' END AS bldsttCcodeName");
|
// columnMap.put("bldsttCcodeName", "CASE WHEN wt.BLDSTT_CODE IN ('1', '10', '11') THEN '已建' WHEN wt.BLDSTT_CODE IN ('2', '7', '8') THEN '在建' ELSE '未建/规划' END AS bldsttCcodeName");
|
||||||
|
columnMap.put("bldsttCcodeName",
|
||||||
|
"CASE WHEN wt.BLDSTT_CODE = 0 THEN '未建/规划' " +
|
||||||
|
"WHEN wt.BLDSTT_CODE = 1 THEN '在建' " +
|
||||||
|
"WHEN wt.BLDSTT_CODE = 2 THEN '已建' " +
|
||||||
|
"ELSE '未知' END");
|
||||||
columnMap.put("bldsttCcode", "wt.BLDSTT_CODE AS bldsttCcode");
|
columnMap.put("bldsttCcode", "wt.BLDSTT_CODE AS bldsttCcode");
|
||||||
columnMap.put("stCode", "NULL AS stCode");
|
columnMap.put("stCode", "NULL AS stCode");
|
||||||
columnMap.put("stName", "NULL AS stName");
|
columnMap.put("stName", "NULL AS stName");
|
||||||
|
|||||||
@ -1,21 +1,33 @@
|
|||||||
package com.yfd.platform.qgc_env.wt.service.impl;
|
package com.yfd.platform.qgc_env.wt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||||
|
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||||
|
import com.yfd.platform.qgc_base.entity.vo.DataParam;
|
||||||
import com.yfd.platform.qgc_env.wt.entity.vo.SdWtvtYearVo;
|
import com.yfd.platform.qgc_env.wt.entity.vo.SdWtvtYearVo;
|
||||||
import com.yfd.platform.qgc_env.wt.mapper.SdWtvtRMapper;
|
import com.yfd.platform.qgc_env.wt.mapper.SdWtvtRMapper;
|
||||||
import com.yfd.platform.qgc_env.wt.service.SdWtvtRService;
|
import com.yfd.platform.qgc_env.wt.service.SdWtvtRService;
|
||||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||||
|
import com.yfd.platform.utils.SecurityUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 垂向水温Service实现类
|
* 垂向水温Service实现类
|
||||||
@ -32,6 +44,9 @@ public class SdWtvtRServiceImpl extends ServiceImpl<SdWtvtRMapper, SdWtvtYearVo>
|
|||||||
@Resource
|
@Resource
|
||||||
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataSourceResult getWtrvDefaultYear(DataSourceRequest dataSourceRequest) {
|
public DataSourceResult getWtrvDefaultYear(DataSourceRequest dataSourceRequest) {
|
||||||
DataSourceResult<SdWtvtYearVo> dataSourceResult = new DataSourceResult<>();
|
DataSourceResult<SdWtvtYearVo> dataSourceResult = new DataSourceResult<>();
|
||||||
@ -70,4 +85,282 @@ public class SdWtvtRServiceImpl extends ServiceImpl<SdWtvtRMapper, SdWtvtYearVo>
|
|||||||
List<Map<String, Object>> result = microservicDynamicSQLMapper.pageAllList(null, sql, paramMap);
|
List<Map<String, Object>> result = microservicDynamicSQLMapper.pageAllList(null, sql, paramMap);
|
||||||
return result != null && !result.isEmpty();
|
return result != null && !result.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean removeKendoByIds(BatchDeleteAo batchDeleteAo) {
|
||||||
|
String dataType = batchDeleteAo == null ? null : batchDeleteAo.getDataType();
|
||||||
|
List<DataParam> dataList = batchDeleteAo == null ? null : batchDeleteAo.getDataList();
|
||||||
|
if (CollUtil.isEmpty(dataList)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
int batchSize = 500;
|
||||||
|
for (int i = 0; i < dataList.size(); i += batchSize) {
|
||||||
|
List<DataParam> subList = dataList.subList(i, Math.min(i + batchSize, dataList.size()));
|
||||||
|
if ("MON".equalsIgnoreCase(dataType)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ("DATE".equalsIgnoreCase(dataType)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ("TIME".equalsIgnoreCase(dataType)) {
|
||||||
|
deleteWtvtRData(subList);
|
||||||
|
Map<String, String[]> dateRangeMap = new HashMap<>();
|
||||||
|
Map<String, String[]> monthRangeMap = new HashMap<>();
|
||||||
|
for (DataParam param : subList) {
|
||||||
|
if (param == null || param.getId() == null || param.getDt() == null || param.getDt().length() < 10) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String stcd = param.getId();
|
||||||
|
String tm = param.getDt();
|
||||||
|
String dateStr = tm.substring(0, 10);
|
||||||
|
if (!dateRangeMap.containsKey(stcd)) {
|
||||||
|
dateRangeMap.put(stcd, new String[]{dateStr, dateStr});
|
||||||
|
} else {
|
||||||
|
String[] range = dateRangeMap.get(stcd);
|
||||||
|
if (dateStr.compareTo(range[0]) < 0) {
|
||||||
|
range[0] = dateStr;
|
||||||
|
}
|
||||||
|
if (dateStr.compareTo(range[1]) > 0) {
|
||||||
|
range[1] = dateStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] ym = tm.substring(0, 7).split("-");
|
||||||
|
if (ym.length == 2) {
|
||||||
|
Integer year = Integer.parseInt(ym[0]);
|
||||||
|
Integer month = Integer.parseInt(ym[1]);
|
||||||
|
String monthStart = year + "-" + String.format("%02d", month) + "-01";
|
||||||
|
String monthEnd = getMonthEndDate(year, month);
|
||||||
|
String monthKey = stcd + "_" + year + "_" + month;
|
||||||
|
if (!monthRangeMap.containsKey(monthKey)) {
|
||||||
|
monthRangeMap.put(monthKey, new String[]{stcd, monthStart, monthEnd});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Map.Entry<String, String[]> entry : dateRangeMap.entrySet()) {
|
||||||
|
statisticsDayDataFromHour(entry.getKey(), entry.getValue()[0], entry.getValue()[1]);
|
||||||
|
}
|
||||||
|
Set<String> processedMonths = new HashSet<>();
|
||||||
|
for (String[] values : monthRangeMap.values()) {
|
||||||
|
String stcd = values[0];
|
||||||
|
String startDate = values[1];
|
||||||
|
String endDate = values[2];
|
||||||
|
String monthKey = stcd + "_" + startDate;
|
||||||
|
if (!processedMonths.contains(monthKey)) {
|
||||||
|
statisticsMonthDataFromDay(stcd, startDate, endDate);
|
||||||
|
processedMonths.add(monthKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void updateWtvtRData(Map<String, Object> updateData) {
|
||||||
|
if (updateData == null || updateData.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String stcd = asString(updateData.get("stcd"));
|
||||||
|
String dt = asString(updateData.get("dt"));
|
||||||
|
Object mapObj = updateData.get("map");
|
||||||
|
if (StringUtils.isBlank(stcd) || StringUtils.isBlank(dt) || !(mapObj instanceof Map<?, ?> rawMap)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||||
|
rawMap.forEach((wthgObj, vwtObj) -> {
|
||||||
|
if (wthgObj == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String wthgStr = String.valueOf(wthgObj).trim();
|
||||||
|
if (StringUtils.isBlank(wthgStr) || vwtObj == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String vwtStr = String.valueOf(vwtObj).trim();
|
||||||
|
if ("-".equals(vwtStr) || "".equals(vwtStr)) {
|
||||||
|
vwtStr = null;
|
||||||
|
}
|
||||||
|
Map<String, Object> item = new HashMap<>();
|
||||||
|
item.put("stcd", stcd);
|
||||||
|
item.put("tm", dt);
|
||||||
|
item.put("wthg", parseBigDecimal(wthgStr));
|
||||||
|
item.put("vwt", parseBigDecimal(vwtStr));
|
||||||
|
// item.put("recordUser", "admin");
|
||||||
|
item.put("recordUser", SecurityUtils.getUserId());
|
||||||
|
dataList.add(item);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (dataList.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
batchUpdateWtvtRData(dataList);
|
||||||
|
|
||||||
|
String dateStr = dt.substring(0, 10);
|
||||||
|
statisticsDayDataFromHour(stcd, dateStr, dateStr);
|
||||||
|
|
||||||
|
String[] ym = dateStr.substring(0, 7).split("-");
|
||||||
|
if (ym.length == 2) {
|
||||||
|
Integer year = Integer.parseInt(ym[0]);
|
||||||
|
Integer month = Integer.parseInt(ym[1]);
|
||||||
|
String startDate = year + "-" + String.format("%02d", month) + "-01";
|
||||||
|
String endDate = getMonthEndDate(year, month);
|
||||||
|
statisticsMonthDataFromDay(stcd, startDate, endDate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteWtvtRData(List<DataParam> dataParamList) {
|
||||||
|
if (CollUtil.isEmpty(dataParamList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
StringBuilder sql = new StringBuilder("DELETE FROM SD_WTVT_R WHERE ");
|
||||||
|
List<Object> params = new ArrayList<>();
|
||||||
|
for (int i = 0; i < dataParamList.size(); i++) {
|
||||||
|
if (i > 0) {
|
||||||
|
sql.append(" OR ");
|
||||||
|
}
|
||||||
|
sql.append("(STCD = ? AND TM = TO_DATE(SUBSTR(?, 1, 19), 'YYYY-MM-DD HH24:MI:SS'))");
|
||||||
|
DataParam item = dataParamList.get(i);
|
||||||
|
params.add(item == null ? null : item.getId());
|
||||||
|
params.add(item == null ? null : item.getDt());
|
||||||
|
}
|
||||||
|
jdbcTemplate.update(sql.toString(), params.toArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void batchUpdateWtvtRData(List<Map<String, Object>> dataList) {
|
||||||
|
if (CollUtil.isEmpty(dataList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
StringBuilder sql = new StringBuilder("MERGE INTO SD_WTVT_R target USING (");
|
||||||
|
List<Object> params = new ArrayList<>();
|
||||||
|
for (int i = 0; i < dataList.size(); i++) {
|
||||||
|
if (i > 0) {
|
||||||
|
sql.append(" UNION ALL ");
|
||||||
|
}
|
||||||
|
sql.append("SELECT ? AS STCD, ? AS VWT, ? AS RECORD_USER, ? AS WTHG, ")
|
||||||
|
.append("TO_DATE(SUBSTR(?, 1, 19), 'YYYY-MM-DD HH24:MI:SS') AS TM FROM DUAL");
|
||||||
|
Map<String, Object> item = dataList.get(i);
|
||||||
|
params.add(item.get("stcd"));
|
||||||
|
params.add(item.get("vwt"));
|
||||||
|
params.add(item.get("recordUser"));
|
||||||
|
params.add(item.get("wthg"));
|
||||||
|
params.add(item.get("tm"));
|
||||||
|
}
|
||||||
|
sql.append(") source ON (target.STCD = source.STCD AND target.TM = source.TM AND target.WTHG = source.WTHG) ")
|
||||||
|
.append("WHEN MATCHED THEN UPDATE SET target.VWT = source.VWT, target.MODIFY_USER = source.RECORD_USER, target.MODIFY_TIME = SYSDATE ")
|
||||||
|
.append("WHEN NOT MATCHED THEN INSERT (STCD, VWT, WTHG, TM, RECORD_USER, RECORD_TIME, IS_DELETED) ")
|
||||||
|
.append("VALUES (source.STCD, source.VWT, source.WTHG, source.TM, source.RECORD_USER, SYSDATE, 0)");
|
||||||
|
jdbcTemplate.update(sql.toString(), params.toArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getMonthEndDate(Integer year, Integer month) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(year, month - 1, 1);
|
||||||
|
int lastDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||||
|
return year + "-" + String.format("%02d", month) + "-" + String.format("%02d", lastDay);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void statisticsDayDataFromHour(String stcd, String startDate, String endDate) {
|
||||||
|
String deleteSql = "DELETE FROM SD_WTVTDAY_S T " +
|
||||||
|
"WHERE T.STCD = ? " +
|
||||||
|
"AND T.DT BETWEEN TO_DATE(?, 'YYYY-MM-DD') " +
|
||||||
|
"AND TO_DATE(?, 'YYYY-MM-DD') " +
|
||||||
|
"AND NOT EXISTS ( " +
|
||||||
|
" SELECT 1 FROM SD_WTVT_R S " +
|
||||||
|
" WHERE S.STCD = T.STCD " +
|
||||||
|
" AND S.WTHG = T.WTHG " +
|
||||||
|
" AND TRUNC(S.TM) = T.DT " +
|
||||||
|
" AND S.TM >= TO_DATE(? || ' 00:00:00', 'YYYY-MM-DD HH24:MI:SS') " +
|
||||||
|
" AND S.TM <= TO_DATE(? || ' 23:59:59', 'YYYY-MM-DD HH24:MI:SS') " +
|
||||||
|
" AND S.IS_DELETED = 0)";
|
||||||
|
jdbcTemplate.update(deleteSql, stcd, startDate, endDate, startDate, endDate);
|
||||||
|
|
||||||
|
String mergeSql = "MERGE INTO SD_WTVTDAY_S T " +
|
||||||
|
"USING ( " +
|
||||||
|
" SELECT STCD, TRUNC(TM) AS DT, WTHG, AVG(VWT) AS VWT " +
|
||||||
|
" FROM SD_WTVT_R " +
|
||||||
|
" WHERE STCD = ? " +
|
||||||
|
" AND TM >= TO_DATE(? || ' 00:00:00', 'YYYY-MM-DD HH24:MI:SS') " +
|
||||||
|
" AND TM <= TO_DATE(? || ' 23:59:59', 'YYYY-MM-DD HH24:MI:SS') " +
|
||||||
|
" AND IS_DELETED = 0 " +
|
||||||
|
" GROUP BY STCD, TRUNC(TM), WTHG " +
|
||||||
|
") S " +
|
||||||
|
"ON (T.STCD = S.STCD AND T.DT = S.DT AND T.WTHG = S.WTHG) " +
|
||||||
|
"WHEN MATCHED THEN UPDATE SET " +
|
||||||
|
" T.VWT = S.VWT, " +
|
||||||
|
" T.IS_DELETED = 0, " +
|
||||||
|
" T.DELETE_USER = NULL, " +
|
||||||
|
" T.DELETE_TIME = NULL, " +
|
||||||
|
" T.MODIFY_TIME = SYSDATE " +
|
||||||
|
"WHEN NOT MATCHED THEN INSERT (ID, STCD, DT, WTHG, VWT, RECORD_TIME, IS_DELETED) " +
|
||||||
|
"VALUES (SYS_GUID(), S.STCD, S.DT, S.WTHG, S.VWT, SYSDATE, 0)";
|
||||||
|
jdbcTemplate.update(mergeSql, stcd, startDate, endDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void statisticsMonthDataFromDay(String stcd, String startDate, String endDate) {
|
||||||
|
Integer startYearInt = Integer.parseInt(startDate.substring(0, 4));
|
||||||
|
Integer startMonthInt = Integer.parseInt(startDate.substring(5, 7));
|
||||||
|
Integer endMonthInt = Integer.parseInt(endDate.substring(5, 7));
|
||||||
|
|
||||||
|
String deleteSql = "DELETE FROM SD_WTVTDRTP_S T " +
|
||||||
|
"WHERE T.DRTP = 'MON' " +
|
||||||
|
"AND T.STCD = ? " +
|
||||||
|
"AND T.YEAR = ? " +
|
||||||
|
"AND T.MONTH BETWEEN ? AND ? " +
|
||||||
|
"AND EXISTS ( " +
|
||||||
|
" SELECT 1 " +
|
||||||
|
" FROM SD_WTVTDAY_S D " +
|
||||||
|
" WHERE D.STCD = T.STCD " +
|
||||||
|
" AND D.WTHG = T.WTHG " +
|
||||||
|
" AND D.IS_DELETED = 0 " +
|
||||||
|
" AND EXTRACT(YEAR FROM D.DT) = T.YEAR " +
|
||||||
|
" AND EXTRACT(MONTH FROM D.DT) = T.MONTH " +
|
||||||
|
" AND D.DT >= TO_DATE(?, 'YYYY-MM-DD') " +
|
||||||
|
" AND D.DT < TO_DATE(?, 'YYYY-MM-DD') + 1 " +
|
||||||
|
" GROUP BY D.STCD, EXTRACT(YEAR FROM D.DT), EXTRACT(MONTH FROM D.DT), D.WTHG " +
|
||||||
|
" HAVING AVG(D.VWT) IS NULL)";
|
||||||
|
jdbcTemplate.update(deleteSql, stcd, startYearInt, startMonthInt, endMonthInt, startDate, endDate);
|
||||||
|
|
||||||
|
String mergeSql = "MERGE INTO SD_WTVTDRTP_S T " +
|
||||||
|
"USING ( " +
|
||||||
|
" SELECT STCD, EXTRACT(YEAR FROM DT) AS YEAR, EXTRACT(MONTH FROM DT) AS MONTH, WTHG, 'MON' AS DRTP, AVG(VWT) AS VWT " +
|
||||||
|
" FROM SD_WTVTDAY_S " +
|
||||||
|
" WHERE STCD = ? " +
|
||||||
|
" AND DT >= TO_DATE(?, 'YYYY-MM-DD') " +
|
||||||
|
" AND DT < TO_DATE(?, 'YYYY-MM-DD') + 1 " +
|
||||||
|
" AND IS_DELETED = 0 " +
|
||||||
|
" GROUP BY STCD, EXTRACT(YEAR FROM DT), EXTRACT(MONTH FROM DT), WTHG " +
|
||||||
|
" HAVING AVG(VWT) IS NOT NULL " +
|
||||||
|
") S " +
|
||||||
|
"ON (T.STCD = S.STCD AND T.DRTP = 'MON' AND T.YEAR = S.YEAR AND T.MONTH = S.MONTH AND T.WTHG = S.WTHG) " +
|
||||||
|
"WHEN MATCHED THEN UPDATE SET " +
|
||||||
|
" T.VWT = S.VWT, " +
|
||||||
|
" T.IS_DELETED = 0, " +
|
||||||
|
" T.DELETE_USER = NULL, " +
|
||||||
|
" T.DELETE_TIME = NULL, " +
|
||||||
|
" T.MODIFY_USER = USER, " +
|
||||||
|
" T.MODIFY_TIME = SYSDATE, " +
|
||||||
|
" T.TM = SYSDATE " +
|
||||||
|
"WHEN NOT MATCHED THEN INSERT (ID, STCD, VWT, DRTP, YEAR, MONTH, DR, WTHG, TM, RECORD_USER, RECORD_TIME, IS_DELETED) " +
|
||||||
|
"VALUES (SYS_GUID(), S.STCD, S.VWT, 'MON', S.YEAR, S.MONTH, NULL, S.WTHG, SYSDATE, USER, SYSDATE, 0)";
|
||||||
|
jdbcTemplate.update(mergeSql, stcd, startDate, endDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
private BigDecimal parseBigDecimal(String str) {
|
||||||
|
try {
|
||||||
|
if (StringUtils.isBlank(str)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new BigDecimal(str);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String asString(Object value) {
|
||||||
|
return value == null ? null : String.valueOf(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.yfd.platform.qgc_env.zq.controller;
|
|||||||
|
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.config.ResponseResult;
|
import com.yfd.platform.config.ResponseResult;
|
||||||
|
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||||
import com.yfd.platform.qgc_env.zq.service.ZqMonitorService;
|
import com.yfd.platform.qgc_env.zq.service.ZqMonitorService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@ -14,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/zq")
|
@RequestMapping("/zq")
|
||||||
@Tag(name = "水文流量站监测")
|
@Tag(name = "水文流量站监测")
|
||||||
@ -29,12 +32,44 @@ public class ZqMonitorController {
|
|||||||
return ResponseResult.successData(zqMonitorService.getMsstbprptList(dataSourceRequest));
|
return ResponseResult.successData(zqMonitorService.getMsstbprptList(dataSourceRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/msstbprpt/eng/GetKendoList")
|
||||||
|
@Operation(summary = "根据条件查询水文流量站基础数据(工程专题)")
|
||||||
|
public ResponseResult getEngMsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(zqMonitorService.getEngMsstbprptList(dataSourceRequest));
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/river/GetKendoListCust")
|
@PostMapping("/river/GetKendoListCust")
|
||||||
@Operation(summary = "查询流量站实时数据")
|
@Operation(summary = "查询流量站实时数据")
|
||||||
public ResponseResult getRiverKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult getRiverKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
return ResponseResult.successData(zqMonitorService.getRiverKendoListCust(dataSourceRequest));
|
return ResponseResult.successData(zqMonitorService.getRiverKendoListCust(dataSourceRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/river/day/GetKendoListCust")
|
||||||
|
@Operation(summary = "查询流量站日数据")
|
||||||
|
public ResponseResult getRiverDayKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(zqMonitorService.getRiverDayKendoListCust(dataSourceRequest));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/river/drtp/GetKendoListCust")
|
||||||
|
@Operation(summary = "查询流量站周旬月季年数据")
|
||||||
|
public ResponseResult getRiverDrtpKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(zqMonitorService.getRiverDrtpKendoListCust(dataSourceRequest));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/river/removeKendoByIds")
|
||||||
|
@Operation(summary = "删除流量站小时/日/月数据")
|
||||||
|
public ResponseResult removeKendoByIds(@RequestBody BatchDeleteAo batchDeleteAo) {
|
||||||
|
zqMonitorService.removeKendoByIds(batchDeleteAo);
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/river/updateRiverRData")
|
||||||
|
@Operation(summary = "修改流量站小时数据")
|
||||||
|
public ResponseResult updateRiverRData(@RequestBody Map<String, Object> updateData) {
|
||||||
|
zqMonitorService.updateRiverRData(updateData);
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/msstbprpt/getStcdInfo")
|
@GetMapping("/msstbprpt/getStcdInfo")
|
||||||
@Operation(summary = "根据站码查询单条水文站基础数据")
|
@Operation(summary = "根据站码查询单条水文站基础数据")
|
||||||
public ResponseResult getStcdInfo(@RequestParam String stcd) {
|
public ResponseResult getStcdInfo(@RequestParam String stcd) {
|
||||||
|
|||||||
@ -30,6 +30,9 @@ public class ZqBaseInfoVo {
|
|||||||
@Schema(description = "纬度")
|
@Schema(description = "纬度")
|
||||||
private Double lttd;
|
private Double lttd;
|
||||||
|
|
||||||
|
@Schema(description = "水温设备类型")
|
||||||
|
private Integer wtDeviceType;
|
||||||
|
|
||||||
@Schema(description = "海拔")
|
@Schema(description = "海拔")
|
||||||
private Double elev;
|
private Double elev;
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,77 @@
|
|||||||
|
package com.yfd.platform.qgc_env.zq.entity.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "流量站日数据")
|
||||||
|
public class ZqRiverDayDataVo {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "站码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@Schema(description = "所属电站编码")
|
||||||
|
private String rstcd;
|
||||||
|
|
||||||
|
@Schema(description = "所属电站名称")
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
@Schema(description = "站点名称")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@Schema(description = "基地编码")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "基地名称")
|
||||||
|
private String baseName;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@Schema(description = "日期")
|
||||||
|
private Date dt;
|
||||||
|
|
||||||
|
@Schema(description = "水位")
|
||||||
|
private BigDecimal z;
|
||||||
|
|
||||||
|
@Schema(description = "流量")
|
||||||
|
private BigDecimal q;
|
||||||
|
|
||||||
|
@Schema(description = "流速")
|
||||||
|
private BigDecimal v;
|
||||||
|
|
||||||
|
@Schema(description = "测流方法")
|
||||||
|
private String msqmt;
|
||||||
|
|
||||||
|
@Schema(description = "站址")
|
||||||
|
private String stlc;
|
||||||
|
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String recordUser;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private Date recordTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String modifyUser;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
private Date modifyTime;
|
||||||
|
|
||||||
|
@Schema(description = "基地排序")
|
||||||
|
private Integer baseStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "流域排序")
|
||||||
|
private Integer rvcdStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "电站排序")
|
||||||
|
private Integer rstcdStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "站点排序")
|
||||||
|
private Integer siteStepSort;
|
||||||
|
}
|
||||||
@ -0,0 +1,87 @@
|
|||||||
|
package com.yfd.platform.qgc_env.zq.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 ZqRiverDrtpDataVo {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "站码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@Schema(description = "所属电站编码")
|
||||||
|
private String rstcd;
|
||||||
|
|
||||||
|
@Schema(description = "所属电站名称")
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
@Schema(description = "站点名称")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@Schema(description = "基地编码")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "基地名称")
|
||||||
|
private String baseName;
|
||||||
|
|
||||||
|
@Schema(description = "数据时间")
|
||||||
|
private Date tm;
|
||||||
|
|
||||||
|
@Schema(description = "水位")
|
||||||
|
private BigDecimal z;
|
||||||
|
|
||||||
|
@Schema(description = "流量")
|
||||||
|
private BigDecimal q;
|
||||||
|
|
||||||
|
@Schema(description = "流速")
|
||||||
|
private BigDecimal v;
|
||||||
|
|
||||||
|
@Schema(description = "月")
|
||||||
|
private Integer month;
|
||||||
|
|
||||||
|
@Schema(description = "年")
|
||||||
|
private Integer year;
|
||||||
|
|
||||||
|
@Schema(description = "维度类型")
|
||||||
|
private String drtp;
|
||||||
|
|
||||||
|
@Schema(description = "时段类型")
|
||||||
|
private Integer dr;
|
||||||
|
|
||||||
|
@Schema(description = "测流方法")
|
||||||
|
private String msqmt;
|
||||||
|
|
||||||
|
@Schema(description = "站址")
|
||||||
|
private String stlc;
|
||||||
|
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String recordUser;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private Date recordTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String modifyUser;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
private Date modifyTime;
|
||||||
|
|
||||||
|
@Schema(description = "基地排序")
|
||||||
|
private Integer baseStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "流域排序")
|
||||||
|
private Integer rvcdStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "电站排序")
|
||||||
|
private Integer rstcdStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "站点排序")
|
||||||
|
private Integer siteStepSort;
|
||||||
|
}
|
||||||
@ -2,14 +2,27 @@ package com.yfd.platform.qgc_env.zq.service;
|
|||||||
|
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
|
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||||
import com.yfd.platform.qgc_env.zq.entity.vo.ZqBaseInfoVo;
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqBaseInfoVo;
|
||||||
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDayDataVo;
|
||||||
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDrtpDataVo;
|
||||||
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDataVo;
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDataVo;
|
||||||
|
|
||||||
public interface ZqMonitorService {
|
public interface ZqMonitorService {
|
||||||
|
|
||||||
DataSourceResult getMsstbprptList(DataSourceRequest dataSourceRequest);
|
DataSourceResult getMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult getEngMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
DataSourceResult<ZqRiverDataVo> getRiverKendoListCust(DataSourceRequest dataSourceRequest);
|
DataSourceResult<ZqRiverDataVo> getRiverKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<ZqRiverDayDataVo> getRiverDayKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<ZqRiverDrtpDataVo> getRiverDrtpKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
boolean removeKendoByIds(BatchDeleteAo batchDeleteAo);
|
||||||
|
|
||||||
|
boolean updateRiverRData(java.util.Map<String, Object> updateData);
|
||||||
|
|
||||||
ZqBaseInfoVo getStcdInfo(String stcd);
|
ZqBaseInfoVo getStcdInfo(String stcd);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user