Merge branch 'main' into dev-tw
This commit is contained in:
commit
a69115baec
@ -99,4 +99,10 @@ public class SdHbrvDic implements Serializable {
|
||||
* 删除时间
|
||||
*/
|
||||
private Date deleteTime;
|
||||
|
||||
/**
|
||||
* 基地名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String basename;
|
||||
}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.yfd.platform.qgc_base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdHbrvDic;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -27,4 +29,16 @@ public interface SdHbrvDicMapper extends BaseMapper<SdHbrvDic> {
|
||||
* 查询所有启用的流域
|
||||
*/
|
||||
List<SdHbrvDic> selectEnabledList();
|
||||
|
||||
@Select("SELECT\n" +
|
||||
" shd.*,\n" +
|
||||
" sh.BASENAME\n" +
|
||||
"FROM\n" +
|
||||
" SD_HBRV_DIC shd\n" +
|
||||
" LEFT JOIN SD_HYDROBASE sh ON sh.BASEID = shd.BASEID\n" +
|
||||
"WHERE\n" +
|
||||
" 1 = 1 \n" +
|
||||
" AND shd.IS_DELETED = 0 \n" +
|
||||
" AND sh.IS_DELETED = 0")
|
||||
List<SdHbrvDic> getWbsbList(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
@ -62,4 +62,5 @@ public interface ISdHbrvDicService extends IService<SdHbrvDic> {
|
||||
|
||||
List<HbrvWbsVo> getHbrvdList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
List<SdHbrvDic> getWbsbList(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
|
||||
@ -52,6 +52,7 @@ public class SdHbrvDicServiceImpl extends ServiceImpl<SdHbrvDicMapper, SdHbrvDic
|
||||
@Resource
|
||||
private IAdminAuthService adminAuthService;
|
||||
|
||||
@Resource
|
||||
private SdHbrvDicMapper hbrvDicMapper;
|
||||
|
||||
|
||||
@ -294,4 +295,10 @@ public class SdHbrvDicServiceImpl extends ServiceImpl<SdHbrvDicMapper, SdHbrvDic
|
||||
vo.setBaseName(baseName);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SdHbrvDic> getWbsbList(DataSourceRequest dataSourceRequest) {
|
||||
List<SdHbrvDic> sdHbrvDics = hbrvDicMapper.getWbsbList(dataSourceRequest);
|
||||
return sdHbrvDics;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,16 +7,18 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.service.ISdHbrvDicService;
|
||||
import com.yfd.platform.qgc_env.wt.service.SdWtMonitorService;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongBService;
|
||||
import com.yfd.platform.qgc_sys.mapcfg.service.IMapmoduleBService;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -32,6 +34,12 @@ public class MsAlongBController {
|
||||
|
||||
@Resource
|
||||
private IMsAlongBService msAlongBService;
|
||||
|
||||
@Resource
|
||||
private SdWtMonitorService sdWtMonitorService;
|
||||
|
||||
@Resource
|
||||
private ISdHbrvDicService hbrvDicService;
|
||||
/**
|
||||
* 条件过滤数据列表
|
||||
*/
|
||||
@ -57,14 +65,29 @@ public class MsAlongBController {
|
||||
if (StrUtil.isBlank(msAlongB.getCode())) {
|
||||
throw new BizException("沿程配置编码(code)不能为空.");
|
||||
}
|
||||
msAlongB.setRecordUser(SecurityUtils.getUserId());
|
||||
//msAlongB.setRecordUser(SecurityUtils.getCurrentUsername());
|
||||
msAlongBService.saveOrUpdate(msAlongB);
|
||||
return ResponseResult.success("保存成功.");
|
||||
return ResponseResult.successData(msAlongB.getId());
|
||||
|
||||
}
|
||||
|
||||
// @Operation(summary = "沿程配置删除")
|
||||
// @PostMapping("/delete")
|
||||
// public ResponseResult deleteData(@RequestBody List<String> ids) {
|
||||
// mapmoduleBService.delelteByIds(ids);
|
||||
// return ResponseResult.success("删除成功.");
|
||||
// }
|
||||
@PostMapping("/wbsb/GetKendoList")
|
||||
@Operation(summary = "查询水电基地流域字典列表")
|
||||
public ResponseResult getWbsbList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(hbrvDicService.getWbsbList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@Operation(summary = "沿程配置删除")
|
||||
@PostMapping("/delete")
|
||||
public ResponseResult deleteData(@RequestBody List<String> ids) {
|
||||
msAlongBService.delelteByIds(ids);
|
||||
return ResponseResult.success("删除成功.");
|
||||
}
|
||||
|
||||
@PostMapping("/noAuth/GetKendoList")
|
||||
@Operation(summary = "查询水电基地流域字典列表")
|
||||
public ResponseResult getWbsbList(@RequestParam String stcd) {
|
||||
return ResponseResult.successData(msAlongBService.getWbsbList(stcd));
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.yfd.platform.qgc_lygk.along.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
@ -7,6 +8,7 @@ import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetTreeDto;
|
||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongDetBService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -16,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 沿程配置明细表控制器
|
||||
*
|
||||
@ -44,11 +48,21 @@ public class MsAlongDetBController {
|
||||
*/
|
||||
@Operation(summary = "保存或修改")
|
||||
@PostMapping("/save")
|
||||
public ResponseResult save(@RequestBody MsAlongDetB msAlongDetB) {
|
||||
if (msAlongDetB == null) {
|
||||
return ResponseResult.error("沿程配置明细信息不能为空.");
|
||||
public ResponseResult save(@RequestBody List<MsAlongDetTreeDto> treeList) {
|
||||
if (CollUtil.isEmpty(treeList)) {
|
||||
return ResponseResult.error("数据不能为空.");
|
||||
}
|
||||
msAlongDetBService.saveOrUpdate(msAlongDetB);
|
||||
msAlongDetBService.saveOrUpdateBatchData(treeList);
|
||||
return ResponseResult.success("保存成功.");
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件过滤数据列表定制
|
||||
*/
|
||||
@Operation(summary = "条件过滤数据列表定制")
|
||||
@PostMapping("/GetKendoListCust")
|
||||
public ResponseResult getKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<MsAlongDetB> result = msAlongDetBService.getKendoList(dataSourceRequest);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.yfd.platform.qgc_lygk.along.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class MsAlongDetTreeDto {
|
||||
private String id; // 记录ID(更新时传)
|
||||
private String alongId; // 关联主表ID
|
||||
private String stcd; // 断面编码
|
||||
private String sttp; // 类型编码
|
||||
private Integer sort; // 排序
|
||||
private String stnm; // 仅用于显示,不存表
|
||||
private String rstcd; // 仅用于显示,不存表
|
||||
private String parentId; // 前端用,不存表
|
||||
private List<MsAlongDetTreeDto> children; // 子节点
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.yfd.platform.qgc_lygk.along.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class PowerDto {
|
||||
// 水电水利工程编码
|
||||
private String stcd;
|
||||
|
||||
// 水电水利工程名称
|
||||
private String stnm;
|
||||
|
||||
// 水电水利工程名称
|
||||
private String sttp;
|
||||
|
||||
// 主表实体
|
||||
private String sttpCode;
|
||||
|
||||
// 主表实体
|
||||
private String sttpName;
|
||||
|
||||
// 主表实体
|
||||
private String rstcd;
|
||||
|
||||
}
|
||||
@ -2,7 +2,10 @@ package com.yfd.platform.qgc_lygk.along.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.PowerDto;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 沿程配置表 Mapper 接口
|
||||
@ -12,4 +15,16 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface MsAlongBMapper extends BaseMapper<MsAlongB> {
|
||||
|
||||
@Select("SELECT STCD, STNM, STTP, STTP_CODE, STTP_NAME, RSTCD " +
|
||||
"FROM V_MS_STBPRP_T " +
|
||||
"WHERE RSTCD = #{stcd}")
|
||||
@Results({
|
||||
@Result(column = "STCD", property = "stcd"),
|
||||
@Result(column = "STNM", property = "stnm"),
|
||||
@Result(column = "STTP", property = "sttp"),
|
||||
@Result(column = "STTP_CODE", property = "sttpCode"),
|
||||
@Result(column = "STTP_NAME", property = "sttpName"),
|
||||
@Result(column = "RSTCD", property = "rstcd")
|
||||
})
|
||||
List<PowerDto> getWbsbList(@Param("stcd") String stcd);
|
||||
}
|
||||
@ -2,7 +2,10 @@ package com.yfd.platform.qgc_lygk.along.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.PowerDto;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 沿程配置明细表 Mapper 接口
|
||||
@ -12,4 +15,16 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface MsAlongDetBMapper extends BaseMapper<MsAlongDetB> {
|
||||
|
||||
@Select("SELECT STCD, STNM, STTP, STTP_CODE, STTP_NAME, RSTCD " +
|
||||
"FROM V_MS_STBPRP_T " +
|
||||
"WHERE STCD = #{stcd}")
|
||||
@Results({
|
||||
@Result(column = "STCD", property = "stcd"),
|
||||
@Result(column = "STNM", property = "stnm"),
|
||||
@Result(column = "STTP", property = "sttp"),
|
||||
@Result(column = "STTP_CODE", property = "sttpCode"),
|
||||
@Result(column = "STTP_NAME", property = "sttpName"),
|
||||
@Result(column = "RSTCD", property = "rstcd")
|
||||
})
|
||||
List<PowerDto> getWbsbList(@Param("stcd") String stcd);
|
||||
}
|
||||
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.PowerDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 沿程配置表 Service 接口
|
||||
@ -19,6 +22,10 @@ public interface IMsAlongBService extends IService<MsAlongB> {
|
||||
*/
|
||||
DataSourceResult<MsAlongB> getKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
void delelteByIds(List<String> ids);
|
||||
|
||||
List<PowerDto> getWbsbList(String stcd);
|
||||
|
||||
// /**
|
||||
// * 保存或更新沿程配置
|
||||
// *
|
||||
|
||||
@ -3,7 +3,11 @@ package com.yfd.platform.qgc_lygk.along.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetTreeDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 沿程配置明细表 Service 接口
|
||||
@ -19,4 +23,6 @@ public interface IMsAlongDetBService extends IService<MsAlongDetB> {
|
||||
* @return 数据源结果
|
||||
*/
|
||||
DataSourceResult<MsAlongDetB> getKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
ResponseResult saveOrUpdateBatchData(List<MsAlongDetTreeDto> treeList);
|
||||
}
|
||||
@ -1,19 +1,28 @@
|
||||
package com.yfd.platform.qgc_lygk.along.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.qgc_base.domain.SdRvcdDic;
|
||||
import com.yfd.platform.qgc_base.mapper.SdRvcdDicMapper;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.PowerDto;
|
||||
import com.yfd.platform.qgc_lygk.along.mapper.MsAlongBMapper;
|
||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongBService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 沿程配置表 Service 实现类
|
||||
@ -23,6 +32,11 @@ import java.util.List;
|
||||
@Service
|
||||
public class MsAlongBServiceImpl extends ServiceImpl<MsAlongBMapper, MsAlongB> implements IMsAlongBService {
|
||||
|
||||
@Resource
|
||||
private MsAlongBMapper msAlongBMapper;
|
||||
@Resource
|
||||
private SdRvcdDicMapper sdRvcdDicMapper;
|
||||
|
||||
@Override
|
||||
public DataSourceResult<MsAlongB> getKendoList(DataSourceRequest dataSourceRequest) {
|
||||
// 1. 构建查询条件
|
||||
@ -45,13 +59,48 @@ public class MsAlongBServiceImpl extends ServiceImpl<MsAlongBMapper, MsAlongB> i
|
||||
resultPage.setTotal(list.size());
|
||||
}
|
||||
|
||||
// 4. 构建结果
|
||||
// 4. 循环填充 rvnm
|
||||
List<MsAlongB> records = resultPage.getRecords();
|
||||
if (CollUtil.isNotEmpty(records)) {
|
||||
for (MsAlongB record : records) {
|
||||
String rvcd = record.getRvcd();
|
||||
if (StrUtil.isNotBlank(rvcd)) {
|
||||
// 调用现有 Mapper 方法,查询单个 rvcd
|
||||
List<SdRvcdDic> dictList = sdRvcdDicMapper.selectRegDropdown(null, rvcd);
|
||||
if (CollUtil.isNotEmpty(dictList)) {
|
||||
// 取第一条记录的 RVNM(即 DISPLAY_RVNM)
|
||||
String displayRvnm = dictList.get(0).getRvnm();
|
||||
// 如果只需要末级名称,可截取最后一个 '-' 后的部分
|
||||
// 如果直接使用完整路径,则直接赋值
|
||||
record.setRvnm(displayRvnm);
|
||||
// 若需要末级名称:
|
||||
// int lastDash = displayRvnm.lastIndexOf('-');
|
||||
// record.setRvnm(lastDash > 0 ? displayRvnm.substring(lastDash + 1) : displayRvnm);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 5. 构建结果
|
||||
DataSourceResult<MsAlongB> dataSourceResult = new DataSourceResult<>();
|
||||
dataSourceResult.setData(resultPage.getRecords());
|
||||
dataSourceResult.setTotal(resultPage.getTotal());
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delelteByIds(List<String> ids) {
|
||||
for (String id : ids) {
|
||||
this.removeById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PowerDto> getWbsbList(String stcd) {
|
||||
List<PowerDto> powerDtos = msAlongBMapper.getWbsbList(stcd);
|
||||
return powerDtos;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean saveOrUpdate(MsAlongB msAlongB) {
|
||||
// super.saveOrUpdate(msAlongB);
|
||||
|
||||
@ -1,23 +1,29 @@
|
||||
package com.yfd.platform.qgc_lygk.along.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetTreeDto;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.PowerDto;
|
||||
import com.yfd.platform.qgc_lygk.along.mapper.MsAlongBMapper;
|
||||
import com.yfd.platform.qgc_lygk.along.mapper.MsAlongDetBMapper;
|
||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongDetBService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 沿程配置明细表 Service 实现类
|
||||
@ -30,6 +36,9 @@ public class MsAlongDetBServiceImpl extends ServiceImpl<MsAlongDetBMapper, MsAlo
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
|
||||
@Resource
|
||||
private MsAlongDetBMapper msAlongDetBMapper;
|
||||
|
||||
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
||||
|
||||
static {
|
||||
@ -62,10 +71,99 @@ public class MsAlongDetBServiceImpl extends ServiceImpl<MsAlongDetBMapper, MsAlo
|
||||
resultPage.setTotal(list.size());
|
||||
}
|
||||
|
||||
// ========== 新增:填充 stnm ==========
|
||||
List<MsAlongDetB> records = resultPage.getRecords();
|
||||
if (CollUtil.isNotEmpty(records)) {
|
||||
for (MsAlongDetB record : records) {
|
||||
String stcd = record.getStcd();
|
||||
if (StrUtil.isNotBlank(stcd)) {
|
||||
// 调用 Mapper 方法查询测站信息
|
||||
List<PowerDto> powerDtos = msAlongDetBMapper.getWbsbList(stcd);
|
||||
if (CollUtil.isNotEmpty(powerDtos)) {
|
||||
// 取第一个结果(通常一个 STCD 只对应一条记录)
|
||||
String stnm = powerDtos.get(0).getStnm();
|
||||
record.setStnm(stnm);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 构建结果
|
||||
DataSourceResult<MsAlongDetB> dataSourceResult = new DataSourceResult<>();
|
||||
dataSourceResult.setData(resultPage.getRecords());
|
||||
dataSourceResult.setTotal(resultPage.getTotal());
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult saveOrUpdateBatchData(List<MsAlongDetTreeDto> treeList) {
|
||||
// 1. 递归扁平化:将树形结构转为平铺的实体列表
|
||||
List<MsAlongDetB> flatList = new ArrayList<>();
|
||||
for (MsAlongDetTreeDto root : treeList) {
|
||||
flattenTree(root, flatList);
|
||||
}
|
||||
|
||||
if (flatList.isEmpty()) {
|
||||
return ResponseResult.error("没有有效数据.");
|
||||
}
|
||||
|
||||
// 2. 校验每条记录的 alongId 不为空
|
||||
for (MsAlongDetB item : flatList) {
|
||||
if (StrUtil.isBlank(item.getAlongId())) {
|
||||
return ResponseResult.error("沿程配置ID(alongId)不能为空.");
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 【新增】提取所有不同的 alongId,删除这些主键下的旧明细
|
||||
Set<String> alongIdSet = flatList.stream()
|
||||
.map(MsAlongDetB::getAlongId)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
if (CollUtil.isNotEmpty(alongIdSet)) {
|
||||
LambdaUpdateWrapper<MsAlongDetB> deleteWrapper = new LambdaUpdateWrapper<>();
|
||||
deleteWrapper.in(MsAlongDetB::getAlongId, alongIdSet)
|
||||
.set(MsAlongDetB::getIsDeleted, "1"); // 逻辑删除标记
|
||||
this.update(deleteWrapper);
|
||||
}
|
||||
|
||||
// 4. 插入新数据(注意:需要清空旧记录的主键ID,让数据库自增或雪花ID生成)
|
||||
for (MsAlongDetB item : flatList) {
|
||||
item.setId(null); // 确保都是新增
|
||||
}
|
||||
|
||||
// 5. 批量保存(有则更新,无则新增)
|
||||
this.saveOrUpdateBatch(flatList);
|
||||
|
||||
return ResponseResult.success("保存成功.");
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归展开树形节点,将每个节点转换为 MsAlongDetB 实体
|
||||
*/
|
||||
private void flattenTree(MsAlongDetTreeDto node, List<MsAlongDetB> flatList) {
|
||||
// 1. 将当前节点转为实体
|
||||
MsAlongDetB entity = new MsAlongDetB();
|
||||
// 仅复制表中存在的字段
|
||||
entity.setId(node.getId());
|
||||
entity.setAlongId(node.getAlongId());
|
||||
entity.setStcd(node.getStcd());
|
||||
entity.setSttp(node.getSttp());
|
||||
entity.setRstcd(node.getRstcd());
|
||||
entity.setRecordUser(SecurityUtils.getUserId()); // 创建人
|
||||
//entity.setRecordUser(SecurityUtils.getCurrentUsername()); // 创建人
|
||||
if (node.getSort() != null){
|
||||
entity.setSort(String.valueOf(node.getSort())); // 若传了排序
|
||||
}
|
||||
if (StrUtil.isBlank(entity.getId())) {
|
||||
entity.setId(null);
|
||||
}
|
||||
flatList.add(entity);
|
||||
// 2. 递归处理子节点
|
||||
if (CollUtil.isNotEmpty(node.getChildren())) {
|
||||
for (MsAlongDetTreeDto child : node.getChildren()) {
|
||||
flattenTree(child, flatList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -109,6 +109,27 @@ public interface MsMapmoduleBMapper extends BaseMapper<MsMapmoduleB> {
|
||||
+ "</choose>"
|
||||
+ "ORDER BY BMM.ORDER_INDEX, BML.ORDER_INDEX"
|
||||
+ "</script>")
|
||||
List<MapLegendVo> getModuleMapLegendList(@Param("moduleId") String moduleId);
|
||||
List<MapLegendVo> getModuleMapLegendListData(@Param("moduleId") String moduleId);
|
||||
|
||||
@Select("SELECT *\n" +
|
||||
"FROM MS_MAPMODULE_B\n" +
|
||||
"WHERE MODULE_ID = (\n" +
|
||||
" SELECT msdmb.MODULE_ID\n" +
|
||||
" FROM MS_MAPMODULE_B msdmb\n" +
|
||||
" LEFT JOIN MS_MAPLEGEND_B mslmb ON msdmb.RES_ID = mslmb.ID\n" +
|
||||
" LEFT JOIN MS_MAPLAYER_B msmab ON msmab.CODE = mslmb.LAYER_CODE\n" +
|
||||
" WHERE msdmb.ID = #{id}\n" +
|
||||
" AND msdmb.IS_DELETED = 0\n" +
|
||||
")\n" +
|
||||
"AND RES_TYPE = 'layer'\n" +
|
||||
"AND RES_ID = (\n" +
|
||||
" SELECT msmab.id\n" +
|
||||
" FROM MS_MAPMODULE_B msdmb\n" +
|
||||
" LEFT JOIN MS_MAPLEGEND_B mslmb ON msdmb.RES_ID = mslmb.ID\n" +
|
||||
" LEFT JOIN MS_MAPLAYER_B msmab ON msmab.CODE = mslmb.LAYER_CODE\n" +
|
||||
" WHERE msdmb.ID = #{id}\n" +
|
||||
" AND msdmb.IS_DELETED = 0\n" +
|
||||
")\n" +
|
||||
"AND IS_DELETED = 0")
|
||||
MsMapmoduleB selectLayerById(@Param("id") String id);
|
||||
}
|
||||
@ -148,7 +148,7 @@ public class MapLegendBizServiceImpl implements IMapLegendBizService {
|
||||
public List<MapLegendVo> getModuleMapLegendList(String moduleId) {
|
||||
List<MapLegendVo> list = new ArrayList<>();
|
||||
// 通过 JOIN 查询 MS_MAPLEGEND_B 和 MS_MAPMODULE_B(单参数版本)
|
||||
List<MapLegendVo> bbiMapLegendList = msMapmoduleBMapper.getModuleMapLegendList(moduleId);
|
||||
List<MapLegendVo> bbiMapLegendList = msMapmoduleBMapper.getModuleMapLegendListData(moduleId);
|
||||
|
||||
if (bbiMapLegendList == null || bbiMapLegendList.isEmpty()) {
|
||||
return list;
|
||||
|
||||
@ -62,10 +62,12 @@ public class MapmoduleBServiceImpl extends ServiceImpl<MsMapmoduleBMapper, MsMap
|
||||
|
||||
@Override
|
||||
public void delelteByIds(List<String> ids) {
|
||||
if (ids != null) {
|
||||
for (String id : ids) {
|
||||
this.baseMapper.deleteById(id);
|
||||
MsMapmoduleB msMapmoduleB = baseMapper.selectLayerById(id);
|
||||
if (msMapmoduleB != null && msMapmoduleB.getId() != null){
|
||||
this.baseMapper.deleteById(msMapmoduleB.getId());
|
||||
}
|
||||
this.baseMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -266,6 +266,10 @@ const columnsConfig = ref([
|
||||
type: 'EQ_7',
|
||||
columns: EQPointColumns7
|
||||
},
|
||||
{
|
||||
type: 'EQ',
|
||||
columns: EQPointColumns7
|
||||
},
|
||||
{
|
||||
type: 'WE',
|
||||
columns: wePointColumns
|
||||
@ -365,9 +369,10 @@ const getData = async () => {
|
||||
item =>
|
||||
item.type ==
|
||||
(modelStore.params.sttp == 'EQ'
|
||||
? modelStore.params.anchoPointState
|
||||
? modelStore.params.sttp
|
||||
: modelStore.params.sttp)
|
||||
).columns;
|
||||
// debugger
|
||||
|
||||
columns.forEach(item => {
|
||||
if (item.visible) {
|
||||
|
||||
@ -1707,6 +1707,7 @@ onBeforeUnmount(() => {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
background:#fff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -314,4 +314,7 @@ onMounted(() => {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
:deep(.media-empty){
|
||||
background:#fff !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -196,9 +196,7 @@ const getSelectConfig = async () => {
|
||||
return indexA - indexB;
|
||||
})
|
||||
select.value.options = filterSelectOptions(dataMapNameArr)
|
||||
if (baseid.value === 'all') {
|
||||
select.value.value = 'SJLY176'
|
||||
} else if (filterSelectOptions(dataMapNameArr)[0]?.children) {
|
||||
if (filterSelectOptions(dataMapNameArr)[0]?.children) {
|
||||
select.value.value = filterSelectOptions(dataMapNameArr)[0]?.children[0]?.value
|
||||
} else if (filterSelectOptions(dataMapNameArr)[0]?.value) {
|
||||
select.value.value = filterSelectOptions(dataMapNameArr)[0]?.value
|
||||
|
||||
@ -368,7 +368,7 @@ const chartSetting = computed<EChartsOption>(() => {
|
||||
title: [
|
||||
{
|
||||
text: String(total || 0),
|
||||
left: '28%',
|
||||
left: '30%',
|
||||
top: '43%',
|
||||
textStyle: { fontSize: 24, fontWeight: 'bold', color: '#333' }
|
||||
},
|
||||
|
||||
@ -230,47 +230,23 @@ async function fetchPieData(params: any): Promise<PieDataItem[]> {
|
||||
let list = resData.flatMap((item: any) => {
|
||||
let arr: PieDataItem[] = [];
|
||||
|
||||
const itmeData =
|
||||
qid.value === 'all' || qid.value === 'other'
|
||||
? item?.items
|
||||
: item?.items[0]?.items;
|
||||
const itmeData = item?.items;
|
||||
|
||||
itmeData?.map((outItem: any) => {
|
||||
const level5Data =
|
||||
qid.value === 'all' || qid.value === 'other'
|
||||
? outItem?.items?.[0]?.items?.[0]?.items?.[0]
|
||||
: outItem?.items?.[0]?.items?.[0];
|
||||
const level5Data = outItem?.items?.[0]?.items?.[0]?.items?.[0];
|
||||
|
||||
const name =
|
||||
qid.value === 'all'
|
||||
? outItem?.items?.[0]?.key
|
||||
: qid.value === 'other'
|
||||
? outItem?.items?.[0]?.key
|
||||
: outItem?.key || outItem?.HBRVCDNAME;
|
||||
const name = outItem?.items?.[0]?.key;
|
||||
|
||||
if (name) {
|
||||
arr.push({
|
||||
key:
|
||||
qid.value === 'all'
|
||||
? outItem?.key
|
||||
: qid.value === 'other'
|
||||
? outItem?.key
|
||||
: outItem?.HBRVCD || outItem?.key,
|
||||
key: outItem?.key,
|
||||
dataDimensionRecursive: 'true',
|
||||
name: name,
|
||||
unit: '',
|
||||
value:
|
||||
qid.value === 'all' && useTtpwrFilter
|
||||
useTtpwrFilter
|
||||
? level5Data?.SUM_TTPWR && +transUnit(level5Data?.SUM_TTPWR)
|
||||
: qid.value === 'all' && !useTtpwrFilter
|
||||
? level5Data?.COUNT_BLDSTTCCODE
|
||||
: qid.value === 'other' && useTtpwrFilter
|
||||
? level5Data?.SUM_TTPWR && +transUnit(level5Data?.SUM_TTPWR)
|
||||
: qid.value === 'other' && !useTtpwrFilter
|
||||
? level5Data?.COUNT_BLDSTTCCODE
|
||||
: (level5Data?.SUM_TTPWR &&
|
||||
+transUnit(level5Data?.SUM_TTPWR)) ||
|
||||
level5Data?.COUNT_BLDSTTCCODE
|
||||
: level5Data?.COUNT_BLDSTTCCODE
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -2041,6 +2041,7 @@ onBeforeUnmount(() => {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
background:#fff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -215,4 +215,7 @@ const handlePageChange = (page: number, pageSize: number) => {
|
||||
}
|
||||
}
|
||||
/* 样式继承自父组件 */
|
||||
:deep(.media-empty){
|
||||
background:#fff !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -118,3 +118,8 @@ svg {
|
||||
.ant-select-tree-node-selected {
|
||||
background-color: #bae7ff !important;
|
||||
}
|
||||
.ant-empty{
|
||||
p{
|
||||
text-indent: 0em !important;
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ service.interceptors.request.use(
|
||||
config.headers._sysid = '10EC2E0B-AEA9-4757-83A2-201BA1BC54E9';
|
||||
|
||||
config.headers.authorization =
|
||||
'bearer 863782c5-5e51-49c6-95fd-13e6f25b9bf2';
|
||||
'bearer f2438154-ca4c-4acb-8e56-739534932ebb';
|
||||
config.baseURL = '/';
|
||||
} else {
|
||||
const user = useUserStoreHook();
|
||||
|
||||
@ -5,136 +5,8 @@ import RightDrawer from '@/components/RightDrawer/index.vue';
|
||||
import jidiInfoMod from '@/modules/jidiInfoMod/index.vue';
|
||||
import shuidianhuangjingjieruMod from '@/modules/shuidianhuangjingjieruMod/index.vue';
|
||||
import { useModelStore } from '@/store/modules/model';
|
||||
|
||||
const modelStore = useModelStore();
|
||||
// import { getQgcStaticData } from "@/api/ecoFlow";
|
||||
onMounted(() => {
|
||||
// const params = {
|
||||
// filter: {
|
||||
// logic: "and",
|
||||
// filters: [
|
||||
// { field: "dtin", operator: "eq", dataType: "string", value: "1" },
|
||||
// { field: "type", operator: "eq", dataType: "string", value: "hour" },
|
||||
// { field: "tm", operator: "gte", dataType: "date", value: "2026-03-02 00:00:00" },
|
||||
// { field: "tm", operator: "lte", dataType: "date", value: "2026-04-02 23:59:59" },
|
||||
// ],
|
||||
// },
|
||||
// };
|
||||
// getQgcStaticData(params).then((res) => {
|
||||
// console.log(res);
|
||||
// });
|
||||
});
|
||||
|
||||
const showMapModal = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'ENG';
|
||||
modelStore.title = '三峡 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal1 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'WT';
|
||||
modelStore.title = '水温 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal2 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'WQFB';
|
||||
modelStore.title = '水质 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal3 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'FH';
|
||||
modelStore.title = '栖息地 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
}; //
|
||||
const showMapModal4 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'fh_zq_point';
|
||||
modelStore.title = '栖息地流量 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal5 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'fp_point';
|
||||
modelStore.title = '过鱼设施 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal6 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'FB';
|
||||
modelStore.title = '鱼类增殖站 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
//
|
||||
const showMapModal7 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'VA';
|
||||
modelStore.title = '动物救助站 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal8 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'VP';
|
||||
modelStore.title = '珍稀植物园 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal9 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'WE';
|
||||
modelStore.title = '水生生态调查断面 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal10 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'WVA';
|
||||
modelStore.title = '野生动物监测 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal11 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'VD_FBFM';
|
||||
modelStore.title = 'AI视频监控站 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal12 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'eng_alarm_point';
|
||||
modelStore.title = '水电站告警情况 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal13 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'FPRD';
|
||||
modelStore.title = '鱼类调查装置 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal14 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'DW_2';
|
||||
modelStore.title = '低温水减缓设施-叠梁门 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal15 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'DW_5';
|
||||
modelStore.title = '前置挡墙 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal16 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'DW_6';
|
||||
modelStore.title = '隔水幕墙 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal17 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'DW_1';
|
||||
modelStore.title = '夹岩双层取水 ';
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
//DW_5
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -144,25 +16,6 @@ const showMapModal17 = () => {
|
||||
</div>
|
||||
<div class="rightContent">
|
||||
<RightDrawer>
|
||||
<a-button @click="showMapModal">打开电站弹窗</a-button>
|
||||
<a-button @click="showMapModal1">打开水温弹窗</a-button>
|
||||
<!-- <a-button @click="showMapModal2">打开水质弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal3">打开栖息地弹窗</a-button> -->
|
||||
<a-button @click="showMapModal4">打开栖息地流量弹窗</a-button>
|
||||
<!-- <a-button @click="showMapModal5">打开过鱼设施弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal6">打开鱼类增殖站弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal7">打开动物救助站弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal8">打开珍稀植物园弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal9">打开水生生态调查断面弹窗</a-button> -->
|
||||
<a-button @click="showMapModal10">打开野生动物监测弹窗</a-button>
|
||||
<!-- <a-button @click="showMapModal11">打开AI视频监控站弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal12">打开水电站告警情况弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal13">打开鱼类调查装置弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal14">打开低温水减缓设施-叠梁门弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal15">打开前置挡墙弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal16">打开隔水幕墙弹窗</a-button> -->
|
||||
<!-- <a-button @click="showMapModal17">打开夹岩双层取水弹窗</a-button> -->
|
||||
|
||||
<jidiInfoMod />
|
||||
<shuidianhuangjingjieruMod />
|
||||
</RightDrawer>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user