feat: 水文站模块新增
This commit is contained in:
parent
d4eb75bea8
commit
25bb50533d
@ -60,6 +60,7 @@ public class SecurityConfig {
|
|||||||
.requestMatchers("/eng/**").permitAll()
|
.requestMatchers("/eng/**").permitAll()
|
||||||
.requestMatchers("/env/**").permitAll()
|
.requestMatchers("/env/**").permitAll()
|
||||||
.requestMatchers("/wt/**").permitAll()
|
.requestMatchers("/wt/**").permitAll()
|
||||||
|
.requestMatchers("/zq/**").permitAll()
|
||||||
.requestMatchers("/wq/**").permitAll()
|
.requestMatchers("/wq/**").permitAll()
|
||||||
.requestMatchers("/fp/**").permitAll()
|
.requestMatchers("/fp/**").permitAll()
|
||||||
.requestMatchers("/fh/**").permitAll()
|
.requestMatchers("/fh/**").permitAll()
|
||||||
|
|||||||
@ -92,6 +92,14 @@ public class SwaggerConfig {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public GroupedOpenApi groupEnvZQApi() {
|
||||||
|
return GroupedOpenApi.builder()
|
||||||
|
.group("3.4.1 全过程-生态环保数据服务-栖息地-水文模块")
|
||||||
|
.packagesToScan("com.yfd.platform.env.zq.controller")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
28
backend/src/main/java/com/yfd/platform/env/zq/controller/ZqMonitorController.java
vendored
Normal file
28
backend/src/main/java/com/yfd/platform/env/zq/controller/ZqMonitorController.java
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package com.yfd.platform.env.zq.controller;
|
||||||
|
|
||||||
|
import com.yfd.platform.config.ResponseResult;
|
||||||
|
import com.yfd.platform.env.zq.service.ZqMonitorService;
|
||||||
|
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.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/zq")
|
||||||
|
@Tag(name = "水文流量站监测")
|
||||||
|
@Validated
|
||||||
|
public class ZqMonitorController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ZqMonitorService zqMonitorService;
|
||||||
|
|
||||||
|
@GetMapping("/msstbprpt/getStcdInfo")
|
||||||
|
@Operation(summary = "根据站码查询单条水文站基础数据")
|
||||||
|
public ResponseResult getStcdInfo(@RequestParam String stcd) {
|
||||||
|
return ResponseResult.successData(zqMonitorService.getStcdInfo(stcd));
|
||||||
|
}
|
||||||
|
}
|
||||||
158
backend/src/main/java/com/yfd/platform/env/zq/entity/vo/ZqBaseInfoVo.java
vendored
Normal file
158
backend/src/main/java/com/yfd/platform/env/zq/entity/vo/ZqBaseInfoVo.java
vendored
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
package com.yfd.platform.env.zq.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "水文站基础站点信息")
|
||||||
|
public class ZqBaseInfoVo {
|
||||||
|
|
||||||
|
@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 Date jcdt;
|
||||||
|
|
||||||
|
@Schema(description = "撤站日期")
|
||||||
|
private Date wddt;
|
||||||
|
|
||||||
|
@Schema(description = "建设状态分类")
|
||||||
|
private Integer bldsttCode;
|
||||||
|
|
||||||
|
@Schema(description = "建设状态名称")
|
||||||
|
private String bldsttCcodeName;
|
||||||
|
|
||||||
|
@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 mwayName;
|
||||||
|
|
||||||
|
@Schema(description = "监测指标")
|
||||||
|
private String stindx;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer orderIndex;
|
||||||
|
|
||||||
|
@Schema(description = "所属断面编码")
|
||||||
|
private String dmstcd;
|
||||||
|
|
||||||
|
@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 String project;
|
||||||
|
|
||||||
|
@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;
|
||||||
|
}
|
||||||
8
backend/src/main/java/com/yfd/platform/env/zq/service/ZqMonitorService.java
vendored
Normal file
8
backend/src/main/java/com/yfd/platform/env/zq/service/ZqMonitorService.java
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package com.yfd.platform.env.zq.service;
|
||||||
|
|
||||||
|
import com.yfd.platform.env.zq.entity.vo.ZqBaseInfoVo;
|
||||||
|
|
||||||
|
public interface ZqMonitorService {
|
||||||
|
|
||||||
|
ZqBaseInfoVo getStcdInfo(String stcd);
|
||||||
|
}
|
||||||
95
backend/src/main/java/com/yfd/platform/env/zq/service/impl/ZqMonitorServiceImpl.java
vendored
Normal file
95
backend/src/main/java/com/yfd/platform/env/zq/service/impl/ZqMonitorServiceImpl.java
vendored
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
package com.yfd.platform.env.zq.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||||
|
import com.yfd.platform.common.exception.BizException;
|
||||||
|
import com.yfd.platform.env.zq.entity.vo.ZqBaseInfoVo;
|
||||||
|
import com.yfd.platform.env.zq.service.ZqMonitorService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ZqMonitorServiceImpl implements ZqMonitorService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ZqBaseInfoVo getStcdInfo(String stcd) {
|
||||||
|
if (StrUtil.isBlank(stcd)) {
|
||||||
|
throw new BizException("站点编码不能为空!");
|
||||||
|
}
|
||||||
|
String sql = "SELECT " +
|
||||||
|
"t.STCD AS stcd, " +
|
||||||
|
"t.STNM AS stnm, " +
|
||||||
|
"t.TM AS tm, " +
|
||||||
|
"t.STTP AS sttp, " +
|
||||||
|
"t.LGTD AS lgtd, " +
|
||||||
|
"t.LTTD AS lttd, " +
|
||||||
|
"t.ELEV AS elev, " +
|
||||||
|
"t.STLC AS stlc, " +
|
||||||
|
"t.JCDT AS jcdt, " +
|
||||||
|
"t.WDDT AS wddt, " +
|
||||||
|
"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, " +
|
||||||
|
"t.INTRODUCE AS introduce, " +
|
||||||
|
"t.LOGO AS logo, " +
|
||||||
|
"t.INFFILE AS inffile, " +
|
||||||
|
"t.USFL AS usfl, " +
|
||||||
|
"t.DTIN AS dtin, " +
|
||||||
|
"t.DTIN_SRC AS dtinSrc, " +
|
||||||
|
"t.DTIN_TYPE AS dtinType, " +
|
||||||
|
"t.DTIN_TM AS dtinTm, " +
|
||||||
|
"t.MWAY AS mway, " +
|
||||||
|
"CASE NVL(t.MWAY, 0) WHEN 1 THEN '人工' WHEN 2 THEN '自动' ELSE '未知' END AS mwayName, " +
|
||||||
|
"t.STINDX AS stindx, " +
|
||||||
|
"t.ORDER_INDEX AS orderIndex, " +
|
||||||
|
"t.DMSTCD AS dmstcd, " +
|
||||||
|
"t.RSTCD AS rstcd, " +
|
||||||
|
"eng.ENNM AS ennm, " +
|
||||||
|
"eng.BASE_ID AS baseId, " +
|
||||||
|
"base.BASENAME AS baseName, " +
|
||||||
|
"eng.HBRVCD AS hbrvcd, " +
|
||||||
|
"hbrv.HBRVNM AS hbrvcdName, " +
|
||||||
|
"eng.RVCD AS rvcd, " +
|
||||||
|
"rv.RVNM AS rvcdName, " +
|
||||||
|
"eng.ADDVCD AS addvcd, " +
|
||||||
|
"addv.ADDVNM AS addvcdName, " +
|
||||||
|
"t.FHSTCD AS fhstcd, " +
|
||||||
|
"t.ISPRO AS ispro, " +
|
||||||
|
"t.PROJECT AS project, " +
|
||||||
|
"t.DTFRQCY AS dtfrqcy, " +
|
||||||
|
"t.REMARK AS remark, " +
|
||||||
|
"t.VLSR AS vlsr, " +
|
||||||
|
"t.VLSR_TM AS vlsrTm, " +
|
||||||
|
"t.RECORD_USER AS recordUser, " +
|
||||||
|
"t.RECORD_TIME AS recordTime, " +
|
||||||
|
"t.MODIFY_USER AS modifyUser, " +
|
||||||
|
"t.MODIFY_TIME AS modifyTime, " +
|
||||||
|
"t.IS_DELETED AS isDeleted, " +
|
||||||
|
"t.DELETE_USER AS deleteUser, " +
|
||||||
|
"t.DELETE_TIME AS deleteTime " +
|
||||||
|
"FROM SD_RIVER_B_H t " +
|
||||||
|
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = t.RSTCD " +
|
||||||
|
"LEFT JOIN SD_HYDROBASE base ON base.BASEID = eng.BASE_ID AND NVL(base.IS_DELETED, 0) = 0 " +
|
||||||
|
"LEFT JOIN SD_HBRV_DIC hbrv ON hbrv.HBRVCD = eng.HBRVCD " +
|
||||||
|
" AND hbrv.BASEID = eng.BASE_ID " +
|
||||||
|
" AND NVL(hbrv.IS_DELETED, 0) = 0 " +
|
||||||
|
" AND NVL(hbrv.ENABLED, 1) = 1 " +
|
||||||
|
"LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = eng.RVCD " +
|
||||||
|
"LEFT JOIN SD_ADDVCD_DIC addv ON addv.ADDVCD = eng.ADDVCD " +
|
||||||
|
"WHERE t.STCD = #{map.stcd} " +
|
||||||
|
" AND NVL(t.IS_DELETED, 0) = 0 ";
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("stcd", stcd);
|
||||||
|
List<ZqBaseInfoVo> list = microservicDynamicSQLMapper.getAllListWithResultType(sql, paramMap, ZqBaseInfoVo.class);
|
||||||
|
if (list == null || list.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return list.get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user