Merge branch 'main' of http://121.37.111.42:3000/zhengsl/WholeProcessPlatform into main_hzz
This commit is contained in:
commit
2d46b99357
@ -65,26 +65,28 @@ public class SecurityConfig {
|
||||
.requestMatchers("/system/user/auditUser").permitAll()
|
||||
.requestMatchers("/register/accessToken").permitAll()
|
||||
.requestMatchers("/api/oauth2/oauth/token").permitAll()
|
||||
.requestMatchers("/dict/cache/**").permitAll()
|
||||
.requestMatchers("/sys/psbmodulelbb/**").permitAll()
|
||||
.requestMatchers("/base/operationLog/**").permitAll()
|
||||
// .requestMatchers("/dict/cache/**").permitAll()
|
||||
// .requestMatchers("/sys/psbmodulelbb/**").permitAll()
|
||||
// .requestMatchers("/base/operationLog/**").permitAll()
|
||||
// .requestMatchers("/system/**").permitAll()
|
||||
.requestMatchers("/qgcExport/**").permitAll()
|
||||
// .requestMatchers("/eng/**").permitAll()
|
||||
.requestMatchers("/eq/**").permitAll()
|
||||
// .requestMatchers("/qgcExport/**").permitAll()
|
||||
.requestMatchers("/eng/**").permitAll()
|
||||
.requestMatchers("/system/**").permitAll()
|
||||
// .requestMatchers("/eq/**").permitAll()
|
||||
// .requestMatchers("/env/**").permitAll()
|
||||
// .requestMatchers("/warn/**").permitAll()
|
||||
// .requestMatchers("/threedroamb/**").permitAll()
|
||||
// .requestMatchers("/overview/**").permitAll()
|
||||
// .requestMatchers("/wt/**").permitAll()
|
||||
// .requestMatchers("/fb/**").permitAll()
|
||||
.requestMatchers("/wt/**").permitAll()
|
||||
.requestMatchers("/system/acctPasswordPolicy/**").permitAll()
|
||||
.requestMatchers("/fb/**").permitAll()
|
||||
// .requestMatchers("/base/**").permitAll()
|
||||
// .requestMatchers("/zq/**").permitAll()
|
||||
// .requestMatchers("/wq/**").permitAll()
|
||||
.requestMatchers("/wq/**").permitAll()
|
||||
// .requestMatchers("/wte/**").permitAll()
|
||||
// .requestMatchers("/vd/**").permitAll()
|
||||
// .requestMatchers("/vap/**").permitAll()
|
||||
// .requestMatchers("/fp/**").permitAll()
|
||||
.requestMatchers("/vap/**").permitAll()
|
||||
.requestMatchers("/fp/**").permitAll()
|
||||
// .requestMatchers("/fpr/**").permitAll()
|
||||
// .requestMatchers("/fh/**").permitAll()
|
||||
// .requestMatchers("/data/**").permitAll()
|
||||
|
||||
@ -29,7 +29,7 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
|
||||
@Bean
|
||||
public Cache<String, String> loginuserCache() {
|
||||
return CacheUtil.newLRUCache(200);
|
||||
return CacheUtil.newLRUCache(500);
|
||||
}
|
||||
|
||||
public void putLoginCache(String key, String value, long timeoutSeconds) {
|
||||
|
||||
@ -13,7 +13,7 @@ public class Constant {
|
||||
public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
public static final String CODE_KEY = "code-key-";
|
||||
public static final long CODE_EXPIRATION_TIME = 1000 * 60 * 2;
|
||||
public static final long CODE_EXPIRATION_TIME = 1000 * 60 * 5;
|
||||
/**
|
||||
* 用于IP定位转换
|
||||
*/
|
||||
|
||||
@ -36,5 +36,11 @@ public class DynamicDataSource extends AbstractRoutingDataSource {
|
||||
contextHolder.remove();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据数据源 key 获取目标数据源实例(如 dm-master / oracle-master)
|
||||
*/
|
||||
public DataSource getDataSourceByKey(String key) {
|
||||
Map<Object, DataSource> resolved = getResolvedDataSources();
|
||||
return resolved == null ? null : resolved.get(key);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +1,29 @@
|
||||
package com.yfd.platform.qgc_base.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBHOperateRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssR;
|
||||
import com.yfd.platform.qgc_base.service.ISdFpssRService;
|
||||
import com.yfd.platform.qgc_data.service.AttachmentUploadService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 过鱼设施人工数据表 前端控制器
|
||||
* </p>
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/data/fpssR")
|
||||
@Tag(name = "过鱼数据管理")
|
||||
@ -22,6 +32,12 @@ public class FpssRController {
|
||||
@Resource
|
||||
private ISdFpssRService fpssRService;
|
||||
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Resource
|
||||
private AttachmentUploadService attachmentUploadService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询过鱼数据列表")
|
||||
public ResponseResult queryPageList(
|
||||
@ -44,37 +60,170 @@ public class FpssRController {
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增过鱼数据")
|
||||
public ResponseResult add(@RequestBody SdFpssR fpssR) {
|
||||
boolean result = fpssRService.save(fpssR);
|
||||
return result ? ResponseResult.success("新增成功") : ResponseResult.error("新增失败");
|
||||
public ResponseResult add(@RequestParam("data") String dataStr,
|
||||
@RequestParam(value = "picFiles", required = false) List<MultipartFile> picFiles,
|
||||
@RequestParam(value = "vdFiles", required = false) List<MultipartFile> vdFiles) {
|
||||
try {
|
||||
SdEngInfoBHOperateRequest request = objectMapper.readValue(dataStr, SdEngInfoBHOperateRequest.class);
|
||||
SdFpssR entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), SdFpssR.class);
|
||||
if (entity == null) {
|
||||
return ResponseResult.error("数据不能为空");
|
||||
}
|
||||
|
||||
// 上传附件并设置到实体
|
||||
applyUploadedFiles(entity, picFiles, vdFiles);
|
||||
|
||||
boolean result = fpssRService.add(entity, request.getSource());
|
||||
return result ? ResponseResult.success("新增成功") : ResponseResult.error("新增失败");
|
||||
} catch (Exception e) {
|
||||
log.error("新增过鱼数据失败", e);
|
||||
return ResponseResult.error("新增失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改过鱼数据")
|
||||
public ResponseResult update(@RequestBody SdFpssR fpssR) {
|
||||
boolean result = fpssRService.updateById(fpssR);
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
public ResponseResult update(@RequestParam("data") String dataStr,
|
||||
@RequestParam(value = "picFiles", required = false) List<MultipartFile> picFiles,
|
||||
@RequestParam(value = "vdFiles", required = false) List<MultipartFile> vdFiles) {
|
||||
try {
|
||||
SdEngInfoBHOperateRequest request = objectMapper.readValue(dataStr, SdEngInfoBHOperateRequest.class);
|
||||
Map<String, Object> engInfo = request == null ? null : request.getEngInfo();
|
||||
if (engInfo == null || engInfo.get("id") == null) {
|
||||
return ResponseResult.error("数据或ID不能为空");
|
||||
}
|
||||
|
||||
// 获取修改前的实体,用于后续清理被替换的旧附件
|
||||
SdFpssR before = fpssRService.getById((String) engInfo.get("id"));
|
||||
List<String> oldAttachmentIds = before != null ? collectAttachmentIds(before) : Collections.emptyList();
|
||||
|
||||
// 上传新附件并合并回 patch map(仅当本次有文件上传时才覆盖对应字段)
|
||||
SdFpssR tempEntity = objectMapper.convertValue(engInfo, SdFpssR.class);
|
||||
applyUploadedFiles(tempEntity, picFiles, vdFiles);
|
||||
if (picFiles != null && !picFiles.isEmpty()) {
|
||||
engInfo.put("picpth", tempEntity.getPicpth());
|
||||
}
|
||||
if (vdFiles != null && !vdFiles.isEmpty()) {
|
||||
engInfo.put("vdpth", tempEntity.getVdpth());
|
||||
}
|
||||
|
||||
boolean result = fpssRService.update(engInfo, request.getSource());
|
||||
if (result) {
|
||||
// 清理被替换的旧附件
|
||||
SdFpssR after = fpssRService.getById((String) engInfo.get("id"));
|
||||
deleteReplacedFiles(oldAttachmentIds, collectAttachmentIds(after));
|
||||
}
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
} catch (Exception e) {
|
||||
log.error("修改过鱼数据失败", e);
|
||||
return ResponseResult.error("修改失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "删除过鱼数据")
|
||||
public ResponseResult delete(@RequestParam String id) {
|
||||
boolean result = fpssRService.removeById(id);
|
||||
public ResponseResult delete(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
List<String> ids = request == null ? null : request.getIds();
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return ResponseResult.error("ID不能为空");
|
||||
}
|
||||
|
||||
// 删除前先收集所有需要清理的附件ID
|
||||
List<String> allAttachmentIds = new ArrayList<>();
|
||||
for (String id : ids) {
|
||||
SdFpssR entity = fpssRService.getById(id);
|
||||
if (entity != null) {
|
||||
allAttachmentIds.addAll(collectAttachmentIds(entity));
|
||||
}
|
||||
}
|
||||
|
||||
boolean result = fpssRService.delete(ids, request.getSource());
|
||||
if (result) {
|
||||
// 删除关联的附件
|
||||
deleteAttachments(allAttachmentIds);
|
||||
}
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||
}
|
||||
|
||||
@PostMapping("/batchDelete")
|
||||
@Operation(summary = "批量删除过鱼数据")
|
||||
public ResponseResult batchDelete(@RequestBody java.util.List<String> ids) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return ResponseResult.error("请选择要删除的数据");
|
||||
}
|
||||
boolean result = true;
|
||||
for (String id : ids) {
|
||||
if (!fpssRService.removeById(id)) {
|
||||
result = false;
|
||||
// ==================== 附件处理辅助方法 ====================
|
||||
|
||||
/**
|
||||
* 上传图片/视频附件并追加附件ID到 picpth/vdpth 字段(与已有ID以逗号拼接)
|
||||
*/
|
||||
private void applyUploadedFiles(SdFpssR entity, List<MultipartFile> picFiles, List<MultipartFile> vdFiles) {
|
||||
if (picFiles != null && !picFiles.isEmpty()) {
|
||||
List<String> ids = attachmentUploadService.uploadMultipartFiles(picFiles);
|
||||
if (!ids.isEmpty()) {
|
||||
entity.setPicpth(mergeIds(entity.getPicpth(), ids));
|
||||
}
|
||||
}
|
||||
if (vdFiles != null && !vdFiles.isEmpty()) {
|
||||
List<String> ids = attachmentUploadService.uploadMultipartFiles(vdFiles);
|
||||
if (!ids.isEmpty()) {
|
||||
entity.setVdpth(mergeIds(entity.getVdpth(), ids));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将新上传的附件ID列表追加到已有ID字符串后面(逗号分隔)
|
||||
*/
|
||||
private String mergeIds(String existing, List<String> ids) {
|
||||
String newIds = ids.stream()
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.collect(Collectors.joining(","));
|
||||
if (StrUtil.isBlank(newIds)) {
|
||||
return existing;
|
||||
}
|
||||
return StrUtil.isBlank(existing) ? newIds : existing + "," + newIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 收集实体中 picpth/vdpth 字段的附件ID
|
||||
*/
|
||||
private List<String> collectAttachmentIds(SdFpssR entity) {
|
||||
List<String> ids = new ArrayList<>();
|
||||
if (entity == null) {
|
||||
return ids;
|
||||
}
|
||||
if (StrUtil.isNotBlank(entity.getPicpth())) {
|
||||
Arrays.stream(entity.getPicpth().split(","))
|
||||
.map(String::trim)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.forEach(ids::add);
|
||||
}
|
||||
if (StrUtil.isNotBlank(entity.getVdpth())) {
|
||||
Arrays.stream(entity.getVdpth().split(","))
|
||||
.map(String::trim)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.forEach(ids::add);
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除被替换的旧附件(old中有但new中没有的)
|
||||
*/
|
||||
private void deleteReplacedFiles(List<String> oldIds, List<String> newIds) {
|
||||
for (String oldId : oldIds) {
|
||||
if (StrUtil.isBlank(oldId)) {
|
||||
continue;
|
||||
}
|
||||
if (!newIds.contains(oldId)) {
|
||||
attachmentUploadService.deleteFile(oldId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除附件
|
||||
*/
|
||||
private void deleteAttachments(List<String> attachmentIds) {
|
||||
for (String id : attachmentIds) {
|
||||
if (StrUtil.isNotBlank(id)) {
|
||||
attachmentUploadService.deleteFile(id);
|
||||
}
|
||||
}
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("部分删除失败");
|
||||
}
|
||||
}
|
||||
@ -40,9 +40,8 @@ public class SdAiboxBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdAiboxBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdAiboxBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -44,10 +44,8 @@ public class SdAimonitorBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdAimonitorBH entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), SdAimonitorBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdArtsgBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdArtsgBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdArtsgBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdDwBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdDwBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdDwBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.yfd.platform.qgc_base.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngRsvrcscdBVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.RstcdTreeInfoVo;
|
||||
import com.yfd.platform.qgc_base.service.ISdEngInfoBHService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -75,4 +77,18 @@ public class SdEngMonitorController {
|
||||
public ResponseResult getQgcRvcdList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(engInfoBHService.getQgcRvcdList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/engTree/GetKendoList")
|
||||
@Operation(summary = "树形结构数据信息 电站沿程排序")
|
||||
public ResponseResult getEngTreeKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<RstcdTreeInfoVo> result = engInfoBHService.getEngTreeByAlong(dataSourceRequest);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/vmsstbprpt/engTree/GetKendoList")
|
||||
@Operation(summary = "沿程对象视图 树形结构数据信息 电站沿程排序")
|
||||
public ResponseResult getVmsstbprptEngTreeKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<RstcdTreeInfoVo> result = engInfoBHService.getEngTreeByAlong(dataSourceRequest);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdEqBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdEqBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdEqBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdFbrdBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdFbrdBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdFbrdBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdFhbtBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdFhbtBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdFhbtBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -20,10 +20,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -88,9 +85,14 @@ public class SdFishDictoryBController {
|
||||
if (entity == null) {
|
||||
return ResponseResult.error("数据不能为空");
|
||||
}
|
||||
entity.setId(IdUtil.simpleUUID());
|
||||
entity.setId(IdUtil.fastUUID());
|
||||
entity.setCode(entity.getId());
|
||||
|
||||
// 名称重名校验
|
||||
if (sdFishDictoryBService.existsByName(entity.getName())) {
|
||||
return ResponseResult.error("该鱼类名称已存在");
|
||||
}
|
||||
|
||||
// 上传文件并设置附件ID到实体
|
||||
applyUploadedFiles(entity, files);
|
||||
|
||||
@ -109,23 +111,35 @@ public class SdFishDictoryBController {
|
||||
@RequestParam(value = "files", required = false) List<MultipartFile> files) {
|
||||
try {
|
||||
SdEngInfoBHOperateRequest request = objectMapper.readValue(dataStr, SdEngInfoBHOperateRequest.class);
|
||||
SdFishDictoryB entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), SdFishDictoryB.class);
|
||||
if (entity == null || entity.getId() == null) {
|
||||
Map<String, Object> engInfo = request == null ? null : request.getEngInfo();
|
||||
if (engInfo == null || engInfo.get("id") == null) {
|
||||
return ResponseResult.error("数据或ID不能为空");
|
||||
}
|
||||
|
||||
// 名称重名校验(仅当本次修改了名称时校验)
|
||||
Object newName = engInfo.get("name");
|
||||
if (newName != null && StrUtil.isNotBlank(newName.toString())) {
|
||||
String name = newName.toString();
|
||||
if (sdFishDictoryBService.existsByNameExcludeId(name, (String) engInfo.get("id"))) {
|
||||
return ResponseResult.error("该鱼类名称已存在");
|
||||
}
|
||||
}
|
||||
|
||||
// 获取修改前的实体,用于后续清理旧文件
|
||||
SdFishDictoryB before = sdFishDictoryBService.getById(entity.getId());
|
||||
SdFishDictoryB before = sdFishDictoryBService.getById((String) engInfo.get("id"));
|
||||
List<String> oldAttachmentIds = before != null ? collectAttachmentIds(before) : Collections.emptyList();
|
||||
|
||||
// 上传新文件并设置附件ID
|
||||
applyUploadedFiles(entity, files);
|
||||
SdFishDictoryB tempEntity = objectMapper.convertValue(engInfo, SdFishDictoryB.class);
|
||||
applyUploadedFiles(tempEntity, files);
|
||||
// 将文件处理后 inffile 合并回 patch map
|
||||
engInfo.put("inffile", tempEntity.getInffile());
|
||||
|
||||
boolean result = sdFishDictoryBService.update(entity, request.getSource());
|
||||
boolean result = sdFishDictoryBService.update(engInfo, request.getSource());
|
||||
if (result) {
|
||||
// 清理被替换的旧文件
|
||||
deleteReplacedFiles(oldAttachmentIds, collectAttachmentIds(entity));
|
||||
SdFishDictoryB after = sdFishDictoryBService.getById((String) engInfo.get("id"));
|
||||
deleteReplacedFiles(oldAttachmentIds, collectAttachmentIds(after));
|
||||
}
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -89,9 +89,8 @@ public class SdFpssBHController {
|
||||
@Log(module = "过鱼设施管理", value = "修改过鱼设施")
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改过鱼设施")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdFpssBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdFpssBH.class);
|
||||
boolean result = sdFpssBHService.updateById(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = sdFpssBHService.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,314 @@
|
||||
package com.yfd.platform.qgc_base.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.yfd.platform.annotation.Log;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBHOperateRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdFishDictoryB;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssrlAiR;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssrlRAiRequest;
|
||||
import com.yfd.platform.qgc_base.service.ISdFishDictoryBService;
|
||||
import com.yfd.platform.qgc_base.service.ISdFpssrlAiRService;
|
||||
import com.yfd.platform.qgc_data.service.AttachmentUploadService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 过鱼设施AI盒子自动数据表 前端控制器
|
||||
* </p>
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/base/fpssrlAiR")
|
||||
@Tag(name = "过鱼设施AI自动数据管理")
|
||||
public class SdFpssrlAiRController {
|
||||
|
||||
@Resource
|
||||
private ISdFpssrlAiRService sdFpssrlAiRService;
|
||||
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Resource
|
||||
private AttachmentUploadService attachmentUploadService;
|
||||
|
||||
@Resource
|
||||
private ISdFishDictoryBService sdFishDictoryBService;
|
||||
|
||||
// ==================== CRUD 方法 ====================
|
||||
|
||||
@PostMapping("/queryPageList")
|
||||
@Operation(summary = "分页查询过鱼AI自动数据列表(支持动态过滤和排序)")
|
||||
public ResponseResult queryPageList(@RequestBody DataSourceRequest request) {
|
||||
Page<SdFpssrlAiR> page = sdFpssrlAiRService.queryPageList(request);
|
||||
return ResponseResult.successData(page);
|
||||
}
|
||||
|
||||
@GetMapping("/getById")
|
||||
@Operation(summary = "根据ID查询过鱼AI自动数据")
|
||||
public ResponseResult getById(@RequestParam String id) {
|
||||
return ResponseResult.successData(sdFpssrlAiRService.getById(id));
|
||||
}
|
||||
|
||||
@Log(module = "过鱼设施AI自动数据管理", value = "新增过鱼AI自动数据")
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增过鱼AI自动数据")
|
||||
public ResponseResult add(@RequestParam("data") String dataStr,
|
||||
@RequestParam(value = "picFiles", required = false) List<MultipartFile> picFiles,
|
||||
@RequestParam(value = "vdFiles", required = false) List<MultipartFile> vdFiles) {
|
||||
try {
|
||||
SdEngInfoBHOperateRequest request = objectMapper.readValue(dataStr, SdEngInfoBHOperateRequest.class);
|
||||
SdFpssrlAiR entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), SdFpssrlAiR.class);
|
||||
if (entity == null) {
|
||||
return ResponseResult.error("数据不能为空");
|
||||
}
|
||||
|
||||
// 上传附件并设置到实体(图片→firstImgUrl,视频→videoUrl)
|
||||
applyUploadedFiles(entity, picFiles, vdFiles);
|
||||
|
||||
boolean result = sdFpssrlAiRService.add(entity, request.getSource());
|
||||
return result ? ResponseResult.success("新增成功") : ResponseResult.error("新增失败");
|
||||
} catch (Exception e) {
|
||||
log.error("新增过鱼AI自动数据失败", e);
|
||||
return ResponseResult.error("新增失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Log(module = "过鱼设施AI自动数据管理", value = "修改过鱼AI自动数据")
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改过鱼AI自动数据")
|
||||
public ResponseResult update(@RequestParam("data") String dataStr,
|
||||
@RequestParam(value = "picFiles", required = false) List<MultipartFile> picFiles,
|
||||
@RequestParam(value = "vdFiles", required = false) List<MultipartFile> vdFiles) {
|
||||
try {
|
||||
SdEngInfoBHOperateRequest request = objectMapper.readValue(dataStr, SdEngInfoBHOperateRequest.class);
|
||||
Map<String, Object> engInfo = request == null ? null : request.getEngInfo();
|
||||
if (engInfo == null || engInfo.get("id") == null) {
|
||||
return ResponseResult.error("数据或ID不能为空");
|
||||
}
|
||||
|
||||
// 获取修改前的实体,用于后续清理被替换的旧附件
|
||||
SdFpssrlAiR before = sdFpssrlAiRService.getById((String) engInfo.get("id"));
|
||||
List<String> oldAttachmentIds = before != null ? collectAttachmentIds(before) : Collections.emptyList();
|
||||
|
||||
// 上传新附件并合并回 patch map(仅当本次有文件上传时才覆盖对应字段)
|
||||
SdFpssrlAiR tempEntity = objectMapper.convertValue(engInfo, SdFpssrlAiR.class);
|
||||
applyUploadedFiles(tempEntity, picFiles, vdFiles);
|
||||
if (picFiles != null && !picFiles.isEmpty()) {
|
||||
engInfo.put("firstimgurl", tempEntity.getFirstimgurl());
|
||||
}
|
||||
if (vdFiles != null && !vdFiles.isEmpty()) {
|
||||
engInfo.put("videourl", tempEntity.getVideourl());
|
||||
}
|
||||
|
||||
boolean result = sdFpssrlAiRService.update(engInfo, request.getSource());
|
||||
if (result) {
|
||||
// 清理被替换的旧附件
|
||||
SdFpssrlAiR after = sdFpssrlAiRService.getById((String) engInfo.get("id"));
|
||||
deleteReplacedFiles(oldAttachmentIds, collectAttachmentIds(after));
|
||||
}
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
} catch (Exception e) {
|
||||
log.error("修改过鱼AI自动数据失败", e);
|
||||
return ResponseResult.error("修改失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Log(module = "过鱼设施AI自动数据管理", value = "删除过鱼AI自动数据")
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "删除过鱼AI自动数据")
|
||||
public ResponseResult delete(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
List<String> ids = request == null ? null : request.getIds();
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return ResponseResult.error("ID不能为空");
|
||||
}
|
||||
|
||||
// 删除前先收集所有需要清理的附件ID
|
||||
List<String> allAttachmentIds = new ArrayList<>();
|
||||
for (String id : ids) {
|
||||
SdFpssrlAiR entity = sdFpssrlAiRService.getById(id);
|
||||
if (entity != null) {
|
||||
allAttachmentIds.addAll(collectAttachmentIds(entity));
|
||||
}
|
||||
}
|
||||
|
||||
boolean result = sdFpssrlAiRService.delete(ids, request.getSource());
|
||||
if (result) {
|
||||
// 删除关联的附件
|
||||
deleteAttachments(allAttachmentIds);
|
||||
}
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||
}
|
||||
|
||||
// ==================== AI 设备识别数据上报接口 ====================
|
||||
|
||||
/**
|
||||
* AI设备图片/视频上传接口
|
||||
* 步骤1:先上传图片获取附件URL,再将URL填入数据上报接口
|
||||
*/
|
||||
@PostMapping("/ai/uploadImage")
|
||||
@Operation(summary = "AI设备图片上传")
|
||||
public ResponseResult aiUploadImage(@RequestParam("file") MultipartFile file) {
|
||||
if (file == null || file.isEmpty()) {
|
||||
return ResponseResult.error("文件不能为空");
|
||||
}
|
||||
try {
|
||||
List<MultipartFile> files = new ArrayList<>();
|
||||
files.add(file);
|
||||
List<String> attachmentIds = attachmentUploadService.uploadMultipartFiles(files);
|
||||
if (attachmentIds != null && !attachmentIds.isEmpty()) {
|
||||
return ResponseResult.successData(attachmentIds);
|
||||
} else {
|
||||
return ResponseResult.error("图片上传失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("AI图片上传失败", e);
|
||||
return ResponseResult.error("图片上传失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* AI设备识别数据上报接口(支持单条和批量)
|
||||
* 步骤2:上传完图片后,将附件ID填入JSON数组调用此接口
|
||||
*/
|
||||
@PostMapping("/ai/report")
|
||||
@Operation(summary = "AI设备识别数据上报(支持批量)")
|
||||
public ResponseResult aiReport(@RequestBody List<SdFpssrlRAiRequest> requests) {
|
||||
if (requests == null || requests.isEmpty()) {
|
||||
return ResponseResult.error("请求数据不能为空");
|
||||
}
|
||||
List<SdFishDictoryB> list = sdFishDictoryBService.list(new LambdaQueryWrapper<SdFishDictoryB>().eq(SdFishDictoryB::getIsDeleted, "0").select(SdFishDictoryB::getId, SdFishDictoryB::getName));
|
||||
Map<String, String> idNameMap = list.stream()
|
||||
.filter(item -> item.getId() != null && item.getName() != null)
|
||||
.collect(Collectors.toMap(
|
||||
SdFishDictoryB::getName,
|
||||
SdFishDictoryB::getId,
|
||||
(oldValue, newValue) -> oldValue // 如果有重复 key 保留旧值(实际不会重复)
|
||||
));
|
||||
// 逐条校验
|
||||
for (int i = 0; i < requests.size(); i++) {
|
||||
SdFpssrlRAiRequest req = requests.get(i);
|
||||
if (req == null) {
|
||||
return ResponseResult.error("第" + (i + 1) + "条数据为空");
|
||||
}
|
||||
if (req.getStcd() == null || req.getStcd().isEmpty()) {
|
||||
return ResponseResult.error("第" + (i + 1) + "条过鱼设施编码(stcd)不能为空");
|
||||
}
|
||||
if (req.getFwdx() == null || req.getFwdx().isEmpty()) {
|
||||
return ResponseResult.error("第" + (i + 1) + "条服务对象(fwdx)不能为空");
|
||||
}
|
||||
if (req.getTm() == null) {
|
||||
return ResponseResult.error("第" + (i + 1) + "条识别时间(tm)不能为空");
|
||||
}
|
||||
if (req.getFtp() == null || req.getFtp().isEmpty()) {
|
||||
return ResponseResult.error("第" + (i + 1) + "条鱼种类(ftp)不能为空");
|
||||
}
|
||||
if (StrUtil.isNotBlank(req.getFtp())) {
|
||||
req.setFtp(idNameMap.getOrDefault(req.getFtp(), req.getFtp()));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
List<SdFpssrlAiR> result = sdFpssrlAiRService.processAiReportBatch(requests);
|
||||
log.info("AI批量上报成功,共{}条", result.size());
|
||||
return ResponseResult.success();
|
||||
} catch (Exception e) {
|
||||
log.error("AI识别数据批量上报失败", e);
|
||||
return ResponseResult.error("上报失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 附件处理辅助方法 ====================
|
||||
|
||||
/**
|
||||
* 上传图片/视频附件并追加附件ID到 firstImgUrl/videoUrl 字段(与已有ID以逗号拼接)
|
||||
*/
|
||||
private void applyUploadedFiles(SdFpssrlAiR entity, List<MultipartFile> picFiles, List<MultipartFile> vdFiles) {
|
||||
if (picFiles != null && !picFiles.isEmpty()) {
|
||||
List<String> ids = attachmentUploadService.uploadMultipartFiles(picFiles);
|
||||
if (!ids.isEmpty()) {
|
||||
entity.setFirstimgurl(mergeIds(entity.getFirstimgurl(), ids));
|
||||
}
|
||||
}
|
||||
if (vdFiles != null && !vdFiles.isEmpty()) {
|
||||
List<String> ids = attachmentUploadService.uploadMultipartFiles(vdFiles);
|
||||
if (!ids.isEmpty()) {
|
||||
entity.setVideourl(mergeIds(entity.getVideourl(), ids));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将新上传的附件ID列表追加到已有ID字符串后面(逗号分隔)
|
||||
*/
|
||||
private String mergeIds(String existing, List<String> ids) {
|
||||
String newIds = ids.stream()
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.collect(Collectors.joining(","));
|
||||
if (StrUtil.isBlank(newIds)) {
|
||||
return existing;
|
||||
}
|
||||
return StrUtil.isBlank(existing) ? newIds : existing + "," + newIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 收集实体中 firstImgUrl/videoUrl 字段的附件ID
|
||||
*/
|
||||
private List<String> collectAttachmentIds(SdFpssrlAiR entity) {
|
||||
List<String> ids = new ArrayList<>();
|
||||
if (entity == null) {
|
||||
return ids;
|
||||
}
|
||||
if (StrUtil.isNotBlank(entity.getFirstimgurl())) {
|
||||
Arrays.stream(entity.getFirstimgurl().split(","))
|
||||
.map(String::trim)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.forEach(ids::add);
|
||||
}
|
||||
if (StrUtil.isNotBlank(entity.getVideourl())) {
|
||||
Arrays.stream(entity.getVideourl().split(","))
|
||||
.map(String::trim)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.forEach(ids::add);
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除被替换的旧附件(old中有但new中没有的)
|
||||
*/
|
||||
private void deleteReplacedFiles(List<String> oldIds, List<String> newIds) {
|
||||
for (String oldId : oldIds) {
|
||||
if (StrUtil.isBlank(oldId)) {
|
||||
continue;
|
||||
}
|
||||
if (!newIds.contains(oldId)) {
|
||||
attachmentUploadService.deleteFile(oldId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除附件
|
||||
*/
|
||||
private void deleteAttachments(List<String> attachmentIds) {
|
||||
for (String id : attachmentIds) {
|
||||
if (StrUtil.isNotBlank(id)) {
|
||||
attachmentUploadService.deleteFile(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -18,9 +18,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -64,27 +62,66 @@ public class SdFpssrlRController {
|
||||
@Log(module = "过鱼设施自动数据管理", value = "新增过鱼自动数据")
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增过鱼自动数据")
|
||||
public ResponseResult add(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdFpssrlR entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), SdFpssrlR.class);
|
||||
if (entity == null) {
|
||||
return ResponseResult.error("数据不能为空");
|
||||
public ResponseResult add(@RequestParam("data") String dataStr,
|
||||
@RequestParam(value = "picFiles", required = false) List<MultipartFile> picFiles,
|
||||
@RequestParam(value = "vdFiles", required = false) List<MultipartFile> vdFiles) {
|
||||
try {
|
||||
SdEngInfoBHOperateRequest request = objectMapper.readValue(dataStr, SdEngInfoBHOperateRequest.class);
|
||||
SdFpssrlR entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), SdFpssrlR.class);
|
||||
if (entity == null) {
|
||||
return ResponseResult.error("数据不能为空");
|
||||
}
|
||||
|
||||
// 上传附件并设置到实体(图片→firstImgUrl,视频→videoUrl)
|
||||
applyUploadedFiles(entity, picFiles, vdFiles);
|
||||
|
||||
boolean result = sdFpssrlRService.add(entity, request.getSource());
|
||||
return result ? ResponseResult.success("新增成功") : ResponseResult.error("新增失败");
|
||||
} catch (Exception e) {
|
||||
log.error("新增过鱼自动数据失败", e);
|
||||
return ResponseResult.error("新增失败: " + e.getMessage());
|
||||
}
|
||||
boolean result = sdFpssrlRService.add(entity, request.getSource());
|
||||
return result ? ResponseResult.success("新增成功") : ResponseResult.error("新增失败");
|
||||
}
|
||||
|
||||
@Log(module = "过鱼设施自动数据管理", value = "修改过鱼自动数据")
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改过鱼自动数据")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdFpssrlR entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), SdFpssrlR.class);
|
||||
if (entity == null || entity.getId() == null) {
|
||||
return ResponseResult.error("数据或ID不能为空");
|
||||
public ResponseResult update(@RequestParam("data") String dataStr,
|
||||
@RequestParam(value = "picFiles", required = false) List<MultipartFile> picFiles,
|
||||
@RequestParam(value = "vdFiles", required = false) List<MultipartFile> vdFiles) {
|
||||
try {
|
||||
SdEngInfoBHOperateRequest request = objectMapper.readValue(dataStr, SdEngInfoBHOperateRequest.class);
|
||||
Map<String, Object> engInfo = request == null ? null : request.getEngInfo();
|
||||
if (engInfo == null || engInfo.get("id") == null) {
|
||||
return ResponseResult.error("数据或ID不能为空");
|
||||
}
|
||||
|
||||
// 获取修改前的实体,用于后续清理被替换的旧附件
|
||||
SdFpssrlR before = sdFpssrlRService.getById((String) engInfo.get("id"));
|
||||
List<String> oldAttachmentIds = before != null ? collectAttachmentIds(before) : Collections.emptyList();
|
||||
|
||||
// 上传新附件并合并回 patch map(仅当本次有文件上传时才覆盖对应字段)
|
||||
SdFpssrlR tempEntity = objectMapper.convertValue(engInfo, SdFpssrlR.class);
|
||||
applyUploadedFiles(tempEntity, picFiles, vdFiles);
|
||||
if (picFiles != null && !picFiles.isEmpty()) {
|
||||
engInfo.put("firstimgurl", tempEntity.getFirstimgurl());
|
||||
}
|
||||
if (vdFiles != null && !vdFiles.isEmpty()) {
|
||||
engInfo.put("videourl", tempEntity.getVideourl());
|
||||
}
|
||||
|
||||
boolean result = sdFpssrlRService.update(engInfo, request.getSource());
|
||||
if (result) {
|
||||
// 清理被替换的旧附件
|
||||
SdFpssrlR after = sdFpssrlRService.getById((String) engInfo.get("id"));
|
||||
deleteReplacedFiles(oldAttachmentIds, collectAttachmentIds(after));
|
||||
}
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
} catch (Exception e) {
|
||||
log.error("修改过鱼自动数据失败", e);
|
||||
return ResponseResult.error("修改失败: " + e.getMessage());
|
||||
}
|
||||
boolean result = sdFpssrlRService.update(entity, request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
@Log(module = "过鱼设施自动数据管理", value = "删除过鱼自动数据")
|
||||
@ -95,7 +132,21 @@ public class SdFpssrlRController {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return ResponseResult.error("ID不能为空");
|
||||
}
|
||||
|
||||
// 删除前先收集所有需要清理的附件ID
|
||||
List<String> allAttachmentIds = new ArrayList<>();
|
||||
for (String id : ids) {
|
||||
SdFpssrlR entity = sdFpssrlRService.getById(id);
|
||||
if (entity != null) {
|
||||
allAttachmentIds.addAll(collectAttachmentIds(entity));
|
||||
}
|
||||
}
|
||||
|
||||
boolean result = sdFpssrlRService.delete(ids, request.getSource());
|
||||
if (result) {
|
||||
// 删除关联的附件
|
||||
deleteAttachments(allAttachmentIds);
|
||||
}
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||
}
|
||||
|
||||
@ -169,7 +220,6 @@ public class SdFpssrlRController {
|
||||
|
||||
try {
|
||||
List<SdFpssrlAiR> result = sdFpssrlRService.processAiReportBatch(requests);
|
||||
// List<String> ids = result.stream().map(SdFpssrlR::getId).collect(Collectors.toList());
|
||||
log.info("AI批量上报成功,共{}条", result.size());
|
||||
return ResponseResult.success();
|
||||
} catch (Exception e) {
|
||||
@ -177,4 +227,85 @@ public class SdFpssrlRController {
|
||||
return ResponseResult.error("上报失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 附件处理辅助方法 ====================
|
||||
|
||||
/**
|
||||
* 上传图片/视频附件并追加附件ID到 firstImgUrl/videoUrl 字段(与已有ID以逗号拼接)
|
||||
*/
|
||||
private void applyUploadedFiles(SdFpssrlR entity, List<MultipartFile> picFiles, List<MultipartFile> vdFiles) {
|
||||
if (picFiles != null && !picFiles.isEmpty()) {
|
||||
List<String> ids = attachmentUploadService.uploadMultipartFiles(picFiles);
|
||||
if (!ids.isEmpty()) {
|
||||
entity.setFirstimgurl(mergeIds(entity.getFirstimgurl(), ids));
|
||||
}
|
||||
}
|
||||
if (vdFiles != null && !vdFiles.isEmpty()) {
|
||||
List<String> ids = attachmentUploadService.uploadMultipartFiles(vdFiles);
|
||||
if (!ids.isEmpty()) {
|
||||
entity.setVideourl(mergeIds(entity.getVideourl(), ids));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将新上传的附件ID列表追加到已有ID字符串后面(逗号分隔)
|
||||
*/
|
||||
private String mergeIds(String existing, List<String> ids) {
|
||||
String newIds = ids.stream()
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.collect(Collectors.joining(","));
|
||||
if (StrUtil.isBlank(newIds)) {
|
||||
return existing;
|
||||
}
|
||||
return StrUtil.isBlank(existing) ? newIds : existing + "," + newIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 收集实体中 firstImgUrl/videoUrl 字段的附件ID
|
||||
*/
|
||||
private List<String> collectAttachmentIds(SdFpssrlR entity) {
|
||||
List<String> ids = new ArrayList<>();
|
||||
if (entity == null) {
|
||||
return ids;
|
||||
}
|
||||
if (StrUtil.isNotBlank(entity.getFirstimgurl())) {
|
||||
Arrays.stream(entity.getFirstimgurl().split(","))
|
||||
.map(String::trim)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.forEach(ids::add);
|
||||
}
|
||||
if (StrUtil.isNotBlank(entity.getVideourl())) {
|
||||
Arrays.stream(entity.getVideourl().split(","))
|
||||
.map(String::trim)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.forEach(ids::add);
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除被替换的旧附件(old中有但new中没有的)
|
||||
*/
|
||||
private void deleteReplacedFiles(List<String> oldIds, List<String> newIds) {
|
||||
for (String oldId : oldIds) {
|
||||
if (StrUtil.isBlank(oldId)) {
|
||||
continue;
|
||||
}
|
||||
if (!newIds.contains(oldId)) {
|
||||
attachmentUploadService.deleteFile(oldId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除附件
|
||||
*/
|
||||
private void deleteAttachments(List<String> attachmentIds) {
|
||||
for (String id : attachmentIds) {
|
||||
if (StrUtil.isNotBlank(id)) {
|
||||
attachmentUploadService.deleteFile(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdOpinfoBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdOpinfoBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdOpinfoBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdOtteBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdOtteBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdOtteBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdOtweBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdOtweBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdOtweBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdSonarBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdSonarBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdSonarBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdTeBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdTeBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdTeBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdVaBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdVaBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdVaBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdVdinfoBController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdVdinfoB entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdVdinfoB.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdVpBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdVpBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdVpBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdWeBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdWeBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdWeBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdWqBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdWqBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdWqBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -40,9 +40,8 @@ public class SdWtBHController {
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdWtBH entity = request == null || request.getEngInfo() == null ? null : objectMapper.convertValue(request.getEngInfo(), SdWtBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) throws Exception {
|
||||
boolean result = service.update(request == null ? null : request.getEngInfo(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ -36,4 +36,13 @@ public class MsOperationLog implements Serializable {
|
||||
@TableField("RECORD_ID")
|
||||
private String recordId;
|
||||
|
||||
@TableField("OPERATION_TYPE")
|
||||
private String operationType;
|
||||
|
||||
/**
|
||||
* 操作记录的名称(瞬态字段,不持久化,由后端查询后填充)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String recordName;
|
||||
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ public class SdEngInfoBHRequest {
|
||||
private String hbrvcd;
|
||||
private String rvcd;
|
||||
private String reachcd;
|
||||
private List<String> basIds;
|
||||
private List<String> baseIds;
|
||||
private List<String> hbrvcds;
|
||||
private List<String> rvcds;
|
||||
// private List<String> rvcds;
|
||||
|
||||
@ -52,6 +52,10 @@ public class SdFhbtBH implements Serializable {
|
||||
@FieldChinese("高程")
|
||||
private BigDecimal elev;
|
||||
|
||||
/** 图层编码 */
|
||||
@FieldChinese("图层编码")
|
||||
private String layerCode;
|
||||
|
||||
/** 站址/位置 */
|
||||
@FieldChinese("站址/位置")
|
||||
private String stlc;
|
||||
|
||||
@ -21,7 +21,7 @@ public class SdFishDictoryB implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
@TableId(type = IdType.INPUT)
|
||||
@FieldChinese("主键")
|
||||
private String id;
|
||||
|
||||
@ -105,6 +105,9 @@ public class SdFishDictoryB implements Serializable {
|
||||
@FieldChinese("所属流域")
|
||||
private String rvcd;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String rvcdName;
|
||||
|
||||
/** 洄游习性 */
|
||||
@FieldChinese("洄游习性")
|
||||
private String habitMigrat;
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yfd.platform.annotation.FieldChinese;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -24,121 +27,159 @@ public class SdFpssR implements Serializable {
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
@FieldChinese("主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 过鱼设施编码
|
||||
*/
|
||||
@FieldChinese("过鱼设施编码")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 填报时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("填报时间")
|
||||
private Date tm;
|
||||
|
||||
/**
|
||||
* 鱼种类
|
||||
*/
|
||||
@FieldChinese("鱼种类")
|
||||
private String ftp;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String ftpName;
|
||||
|
||||
/**
|
||||
* 鱼类规格,单位:cm
|
||||
*/
|
||||
@FieldChinese("鱼类规格")
|
||||
private String fsz;
|
||||
|
||||
/**
|
||||
* 过鱼数量,单位:尾
|
||||
*/
|
||||
@FieldChinese("过鱼数量")
|
||||
private Integer fcnt;
|
||||
|
||||
/**
|
||||
* 平均体重,单位:g
|
||||
*/
|
||||
@FieldChinese("平均体重")
|
||||
private String fwet;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("开始日期")
|
||||
private Date strdt;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("结束日期")
|
||||
private Date enddt;
|
||||
|
||||
/**
|
||||
* 游向:0=上行,1=下行,2=上行折返,3=下行折返
|
||||
*/
|
||||
@FieldChinese("游向")
|
||||
private Integer direction;
|
||||
|
||||
/**
|
||||
* 当日运行次数
|
||||
*/
|
||||
@FieldChinese("当日运行次数")
|
||||
private Integer rcnt;
|
||||
|
||||
/**
|
||||
* 过鱼设施引用流量
|
||||
*/
|
||||
@FieldChinese("过鱼设施引用流量")
|
||||
private BigDecimal fq;
|
||||
|
||||
/**
|
||||
* 过鱼图片文件路径
|
||||
*/
|
||||
@FieldChinese("过鱼图片文件路径")
|
||||
private String picpth;
|
||||
|
||||
/**
|
||||
* 过鱼视频文件路径
|
||||
*/
|
||||
@FieldChinese("过鱼视频文件路径")
|
||||
private String vdpth;
|
||||
|
||||
/**
|
||||
* 年份:数据时间,精确到年
|
||||
*/
|
||||
@FieldChinese("年份")
|
||||
private Integer yr;
|
||||
|
||||
/**
|
||||
* 主要月份
|
||||
*/
|
||||
@FieldChinese("主要月份")
|
||||
private String mouth;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@FieldChinese("创建人")
|
||||
private String recordUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("创建时间")
|
||||
private Date recordTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@FieldChinese("更新人")
|
||||
private String modifyUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("更新时间")
|
||||
private Date modifyTime;
|
||||
|
||||
/**
|
||||
* 是否已删除:0=未删除 1=已删除
|
||||
*/
|
||||
@FieldChinese("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
/**
|
||||
* 删除人
|
||||
*/
|
||||
@FieldChinese("删除人")
|
||||
private String deleteUser;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("删除时间")
|
||||
private Date deleteTime;
|
||||
|
||||
/**
|
||||
* 是否鱼苗(0否 1是)
|
||||
*/
|
||||
@FieldChinese("是否鱼苗")
|
||||
private Integer isfs;
|
||||
|
||||
/**
|
||||
* 水温:单位:℃
|
||||
*/
|
||||
@FieldChinese("水温")
|
||||
private BigDecimal wtmp;
|
||||
}
|
||||
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yfd.platform.annotation.FieldChinese;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -23,98 +25,137 @@ public class SdFpssrlAiR implements Serializable {
|
||||
|
||||
/** 主键ID */
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
@FieldChinese("主键ID")
|
||||
private String id;
|
||||
|
||||
/** 过鱼设施编码 */
|
||||
@FieldChinese("过鱼设施编码")
|
||||
private String stcd;
|
||||
|
||||
/** 时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("时间")
|
||||
private Date tm;
|
||||
|
||||
/** 鱼种类 */
|
||||
@FieldChinese("鱼种类")
|
||||
private String ftp;
|
||||
|
||||
/** 过鱼数量 */
|
||||
@FieldChinese("过鱼数量")
|
||||
private Integer fcnt;
|
||||
|
||||
/** 鱼尺寸:大/中/小 */
|
||||
@FieldChinese("鱼尺寸")
|
||||
private String fsz;
|
||||
|
||||
/** 鱼长度 */
|
||||
@FieldChinese("鱼长度")
|
||||
private BigDecimal length;
|
||||
|
||||
/** 鱼宽度 */
|
||||
@FieldChinese("鱼宽度")
|
||||
private BigDecimal width;
|
||||
|
||||
/** 鱼速度 */
|
||||
@FieldChinese("鱼速度")
|
||||
private String fishspeed;
|
||||
|
||||
/** 游向:0=上行 1=下行 */
|
||||
@FieldChinese("游向")
|
||||
private Integer direction;
|
||||
|
||||
/** 鱼位置 */
|
||||
@FieldChinese("鱼位置")
|
||||
private Long fishposition;
|
||||
|
||||
/** 鱼截图主图片url */
|
||||
private String firstImgUrl;
|
||||
@FieldChinese("鱼截图主图片url")
|
||||
private String firstimgurl;
|
||||
|
||||
/** 鱼截图副图片url */
|
||||
private String secondImgUrl;
|
||||
@FieldChinese("鱼截图副图片url")
|
||||
private String secondimgurl;
|
||||
|
||||
/** 视频url */
|
||||
private String videoUrl;
|
||||
@FieldChinese("视频url")
|
||||
private String videourl;
|
||||
|
||||
/** 水温:单位:℃ */
|
||||
@FieldChinese("水温")
|
||||
private BigDecimal temperature;
|
||||
|
||||
/** 水位:单位:m */
|
||||
@FieldChinese("水位")
|
||||
private BigDecimal waterlevel;
|
||||
|
||||
/** 流速:单位:m/s */
|
||||
@FieldChinese("流速")
|
||||
private BigDecimal speed;
|
||||
|
||||
/** 流量:单位:m3/s */
|
||||
@FieldChinese("流量")
|
||||
private BigDecimal q;
|
||||
|
||||
/** 溶氧:单位:mg/L */
|
||||
@FieldChinese("溶氧")
|
||||
private BigDecimal dox;
|
||||
|
||||
/** 浊度:单位:NTU */
|
||||
@FieldChinese("浊度")
|
||||
private Integer tu;
|
||||
|
||||
/** 过鱼通道 */
|
||||
@FieldChinese("过鱼通道")
|
||||
private String channelno;
|
||||
|
||||
/** AI盒子编码 */
|
||||
@FieldChinese("AI盒子编码")
|
||||
private String aiBoxCode;
|
||||
|
||||
/** 创建人 */
|
||||
@FieldChinese("创建人")
|
||||
private String recordUser;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("创建时间")
|
||||
private Date recordTime;
|
||||
|
||||
/** 更新人 */
|
||||
@FieldChinese("更新人")
|
||||
private String modifyUser;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("更新时间")
|
||||
private Date modifyTime;
|
||||
|
||||
/** 是否已删除:0=未删除 1=已删除 */
|
||||
@FieldChinese("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
/** 删除人 */
|
||||
@FieldChinese("删除人")
|
||||
private String deleteUser;
|
||||
|
||||
/** 删除时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("删除时间")
|
||||
private Date deleteTime;
|
||||
|
||||
/** 附件ID */
|
||||
@FieldChinese("附件ID")
|
||||
private String fid;
|
||||
|
||||
/** 备注 */
|
||||
@FieldChinese("备注")
|
||||
private String remark;
|
||||
|
||||
/** 鱼种类名称(非表字段,用于列表展示) */
|
||||
@TableField(exist = false)
|
||||
private String ftpName;
|
||||
|
||||
/** 过鱼设施名称(非表字段,用于列表展示) */
|
||||
@TableField(exist = false)
|
||||
private String stnm;
|
||||
|
||||
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yfd.platform.annotation.FieldChinese;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -25,151 +27,188 @@ public class SdFpssrlR implements Serializable {
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
@FieldChinese("主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 过鱼设施编码
|
||||
*/
|
||||
@FieldChinese("过鱼设施编码")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("时间")
|
||||
private Date tm;
|
||||
|
||||
/**
|
||||
* 鱼种类
|
||||
*/
|
||||
@FieldChinese("鱼种类")
|
||||
private String ftp;
|
||||
|
||||
/**
|
||||
* 过鱼数量
|
||||
*/
|
||||
@FieldChinese("过鱼数量")
|
||||
private Integer fcnt;
|
||||
|
||||
/**
|
||||
* 鱼尺寸:大/中/小
|
||||
*/
|
||||
@FieldChinese("鱼尺寸")
|
||||
private String fsz;
|
||||
|
||||
/**
|
||||
* 鱼长度
|
||||
*/
|
||||
@FieldChinese("鱼长度")
|
||||
private BigDecimal length;
|
||||
|
||||
/**
|
||||
* 鱼宽度
|
||||
*/
|
||||
@FieldChinese("鱼宽度")
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 鱼速度
|
||||
*/
|
||||
@FieldChinese("鱼速度")
|
||||
private String fishspeed;
|
||||
|
||||
/**
|
||||
* 游向:0=上行 1=下行
|
||||
*/
|
||||
@FieldChinese("游向")
|
||||
private Integer direction;
|
||||
|
||||
/**
|
||||
* 鱼位置
|
||||
*/
|
||||
@FieldChinese("鱼位置")
|
||||
private Long fishposition;
|
||||
|
||||
/**
|
||||
* 鱼截图主图片url
|
||||
*/
|
||||
private String firstImgUrl;
|
||||
@TableField("FIRSTIMGURL")
|
||||
@FieldChinese("鱼截图主图片url")
|
||||
private String firstimgurl;
|
||||
|
||||
/**
|
||||
* 鱼截图副图片url
|
||||
*/
|
||||
private String secondImgUrl;
|
||||
@TableField("SECONDIMGURL")
|
||||
@FieldChinese("鱼截图副图片url")
|
||||
private String secondimgurl;
|
||||
|
||||
/**
|
||||
* 视频url
|
||||
*/
|
||||
private String videoUrl;
|
||||
@TableField("VIDEOURL")
|
||||
@FieldChinese("视频url")
|
||||
private String videourl;
|
||||
|
||||
/**
|
||||
* 水温:单位:℃
|
||||
*/
|
||||
@FieldChinese("水温")
|
||||
private BigDecimal temperature;
|
||||
|
||||
/**
|
||||
* 水位:单位:m
|
||||
*/
|
||||
@FieldChinese("水位")
|
||||
private BigDecimal waterlevel;
|
||||
|
||||
/**
|
||||
* 流速:单位:m/s
|
||||
*/
|
||||
@FieldChinese("流速")
|
||||
private BigDecimal speed;
|
||||
|
||||
/**
|
||||
* 流量:单位:m3/s
|
||||
*/
|
||||
@FieldChinese("流量")
|
||||
private BigDecimal q;
|
||||
|
||||
/**
|
||||
* 溶氧:单位:mg/L
|
||||
*/
|
||||
@FieldChinese("溶氧")
|
||||
private BigDecimal dox;
|
||||
|
||||
/**
|
||||
* 浊度:单位:NTU
|
||||
*/
|
||||
@FieldChinese("浊度")
|
||||
private Integer tu;
|
||||
|
||||
/**
|
||||
* 过鱼通道
|
||||
*/
|
||||
@FieldChinese("过鱼通道")
|
||||
private String channelno;
|
||||
|
||||
/**
|
||||
* 创建人:关联SYS_USER.ID
|
||||
*/
|
||||
@FieldChinese("创建人")
|
||||
private String recordUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("创建时间")
|
||||
private Date recordTime;
|
||||
|
||||
/**
|
||||
* 更新人:关联SYS_USER.ID
|
||||
*/
|
||||
@FieldChinese("更新人")
|
||||
private String modifyUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("更新时间")
|
||||
private Date modifyTime;
|
||||
|
||||
/**
|
||||
* 是否已删除:0=未删除 1=已删除
|
||||
*/
|
||||
@FieldChinese("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
/**
|
||||
* 删除人:关联SYS_USER.ID
|
||||
*/
|
||||
@FieldChinese("删除人")
|
||||
private String deleteUser;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("删除时间")
|
||||
private Date deleteTime;
|
||||
|
||||
/**
|
||||
* 附件ID
|
||||
*/
|
||||
@FieldChinese("附件ID")
|
||||
private String fid;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@FieldChinese("备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.yfd.platform.qgc_base.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ -24,6 +25,7 @@ public class EngVmsstbprptVo implements Serializable {
|
||||
private String rvcdFullPath;
|
||||
private String stcd;
|
||||
private String stnm;
|
||||
private String rstcd;
|
||||
private String ennm;
|
||||
private String baseId;
|
||||
private String baseName;
|
||||
@ -124,4 +126,124 @@ public class EngVmsstbprptVo implements Serializable {
|
||||
private Integer rvcdStepSort;
|
||||
private Integer rstcdStepSort;
|
||||
private Integer siteStepSort;
|
||||
|
||||
|
||||
|
||||
/** 上游码头位置 */
|
||||
private String updcklc;
|
||||
/** 上游码头型式 */
|
||||
private String updcktp;
|
||||
/** 下游码头位置 */
|
||||
private String downdcklc;
|
||||
/** 下游码头型式 */
|
||||
private String downdcktp;
|
||||
/*** 过鱼时间*/
|
||||
private String psfishtm;
|
||||
/*** 过鱼对象*/
|
||||
private String psfishtyp;
|
||||
/*** 断面尺寸(长*宽*高)*/
|
||||
private String syjsz;
|
||||
/** 运鱼设施方式 */
|
||||
private String jyyyyfs;
|
||||
/** 过鱼规模 */
|
||||
private Long psfishcnt;
|
||||
/** 集鱼槽进口高程 */
|
||||
private String syjhg;
|
||||
/** 集鱼槽数量 */
|
||||
private Integer syjcnt;
|
||||
/** 集鱼槽流量 */
|
||||
private String syjq;
|
||||
/** 集鱼槽水深 */
|
||||
private String syjwdp;
|
||||
/** 运行时间 */
|
||||
private String runtm;
|
||||
/** 集诱鱼方式 */
|
||||
private String syjjyyfs;
|
||||
/** 投资:单位:亿元 */
|
||||
private BigDecimal inv;
|
||||
/** 数据监测频次 */
|
||||
private Integer dtfrqcy;
|
||||
/** 主要过鱼月份(多个月份用,隔开),主要过鱼月份(多个月份用,隔开),主要过鱼月份(多个月份用,隔开),主要过鱼月份(多个月份用,隔开) */
|
||||
private String fpssmnmon;
|
||||
|
||||
/** 放流对象 */
|
||||
private String zzfldx;
|
||||
/** 放流对象 */
|
||||
private String zzfldxName;
|
||||
/** 放流地点 */
|
||||
private String zzflfllc;
|
||||
private String zzflfllcName;
|
||||
/** 生产工艺 */
|
||||
private String zzflgy;
|
||||
/** 建设地点 */
|
||||
private String zzfljslc;
|
||||
/** 养殖模式 */
|
||||
private String zzflyzms;
|
||||
/** 养殖模式 */
|
||||
private String zzflyzmsName;
|
||||
/** 放流规模 */
|
||||
private Integer zzflcnt;
|
||||
/** 标记方式 */
|
||||
private String zzflbjfs;
|
||||
/** 承担放流任务 */
|
||||
private String zzflrw;
|
||||
/** 工程等级 */
|
||||
private Integer zzfllvl;
|
||||
/** 放流时间 */
|
||||
private Date zzfltm;
|
||||
/** 总占地面积 */
|
||||
private BigDecimal zzflar;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date ststdt;
|
||||
/** 保护方式 */
|
||||
private String protmthd;
|
||||
/** 保护对象 */
|
||||
private String protobj;
|
||||
/** 面积 */
|
||||
private BigDecimal area;
|
||||
/** 地点 */
|
||||
private String lsdwlc;
|
||||
/** 基荷发电工况 */
|
||||
private BigDecimal jhfdgk;
|
||||
/** 发电流量 */
|
||||
private BigDecimal fdll;
|
||||
|
||||
/** 天然河流平均水温 */
|
||||
private BigDecimal nravwt;
|
||||
/** 叠梁门式进水口的门叶数量 */
|
||||
private Integer dlmcnt;
|
||||
/** 叠梁门式进水口的单节门叶高度 */
|
||||
private String dlmhg;
|
||||
/** 天然河流最高温月份多年平均水温 */
|
||||
private BigDecimal nrmxavwt;
|
||||
/** 天然河流最低温月份多年平均水温 */
|
||||
private BigDecimal nrmnavwt;
|
||||
/** 建成后坝下平均水温 */
|
||||
private BigDecimal dnavwt;
|
||||
/** 建成后坝下最高温月份多年平均水温 */
|
||||
private BigDecimal dnmxavwt;
|
||||
/** 建成后坝下最低温月份多年平均水温 */
|
||||
private BigDecimal dnmnavwt;
|
||||
/** 顶部高程 */
|
||||
private BigDecimal frntwllhg;
|
||||
/** 翻板门顶部高程 */
|
||||
private BigDecimal fbmdbgc;
|
||||
/** 叠梁门式进水口的最大淹没水深 */
|
||||
private BigDecimal dlmmxwdp;
|
||||
|
||||
|
||||
/** 保护范围 */
|
||||
private String qxdbhfw;
|
||||
/** 保护对象 */
|
||||
private String protobjName;
|
||||
/** 保护外围长度 */
|
||||
private BigDecimal qxdbhwwcd;
|
||||
/** 保护长度 */
|
||||
private BigDecimal qxdbhcd;
|
||||
/** 保护河段 */
|
||||
private String bhhd;
|
||||
/** 保护河流 */
|
||||
private String bhhl;
|
||||
/** 保护核心长度 */
|
||||
private BigDecimal qxdbhhxcd;
|
||||
}
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
package com.yfd.platform.qgc_base.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 沿程树形节点:按电站(RSTCD)分组
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "沿程树形电站节点")
|
||||
public class RstcdTreeInfoVo {
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "沿程排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "下属测站列表")
|
||||
private List<StcdItemVo> items = new ArrayList<>();
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.yfd.platform.qgc_base.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 测站条目 — V_MS_STBPRP_T 视图中提取的测站字段
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "沿程树形测站条目")
|
||||
public class StcdItemVo {
|
||||
|
||||
@Schema(description = "测站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "测站名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "站类编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "站类名称")
|
||||
private String sttpName;
|
||||
|
||||
@Schema(description = "监测方式名称")
|
||||
private String mwayName;
|
||||
|
||||
@Schema(description = "监测方式:1=人工 2=自动")
|
||||
private Integer mway;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private String lgtd;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private String lttd;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer orderIndex;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "所属基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "所属基地名称")
|
||||
private String baseName;
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.yfd.platform.qgc_base.mapper;
|
||||
|
||||
import com.yfd.platform.qgc_base.domain.vo.StcdItemVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* V_MS_STBPRP_T 视图 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface VMsStbprpTMapper {
|
||||
|
||||
/**
|
||||
* 查询视图中的测站沿程数据,按站类编码过滤
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT STCD, STNM, STTP_CODE AS sttpCode, STTP_NAME AS sttpName, " +
|
||||
"MWAY, RSTCD, ENNM, BASE_ID AS baseId, BASE_NAME AS baseName, " +
|
||||
"NVL(RSTCDSTEPSORT, 999999) AS sort, ORDER_INDEX AS orderIndex, " +
|
||||
"LGTD AS lgtd, LTTD AS lttd " +
|
||||
"FROM V_MS_STBPRP_T " +
|
||||
"WHERE IS_DELETED = 0 " +
|
||||
"<if test='sttpCodes != null and sttpCodes.size() > 0'>" +
|
||||
" AND STTP_CODE IN " +
|
||||
" <foreach collection='sttpCodes' item='code' open='(' separator=',' close=')'>#{code}</foreach>" +
|
||||
"</if>" +
|
||||
"ORDER BY NVL(RSTCDSTEPSORT, 999999), NVL(ORDER_INDEX, 999999)" +
|
||||
"</script>")
|
||||
List<StcdItemVo> selectBySttpCodes(@Param("sttpCodes") List<String> sttpCodes);
|
||||
}
|
||||
@ -6,6 +6,7 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdAiboxBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -28,6 +29,7 @@ public interface ISdAiboxBHService extends IService<SdAiboxBH> {
|
||||
* 修改
|
||||
*/
|
||||
boolean update(SdAiboxBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
||||
@ -6,6 +6,7 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdAimonitorBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* AI智能监测装置 Service 接口
|
||||
@ -14,5 +15,6 @@ public interface ISdAimonitorBHService extends IService<SdAimonitorBH> {
|
||||
Page<SdAimonitorBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdAimonitorBH entity, String source);
|
||||
boolean update(SdAimonitorBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdArtsgBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -28,6 +29,7 @@ public interface ISdArtsgBHService extends IService<SdArtsgBH> {
|
||||
* 修改
|
||||
*/
|
||||
boolean update(SdArtsgBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
||||
@ -6,6 +6,7 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdDwBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -28,6 +29,7 @@ public interface ISdDwBHService extends IService<SdDwBH> {
|
||||
* 修改
|
||||
*/
|
||||
boolean update(SdDwBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
||||
@ -17,6 +17,8 @@ import com.yfd.platform.qgc_base.domain.vo.EngPointVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngStInfoResultVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngVmsstbprptVo;
|
||||
|
||||
import com.yfd.platform.qgc_base.domain.vo.RstcdTreeInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@ -101,4 +103,9 @@ public interface ISdEngInfoBHService extends IService<SdEngInfoBH> {
|
||||
DataSourceResult<EngRsvrcscdRvcdVo> getRsvrcscdBRvcdList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngQgcRvcdVo> getQgcRvcdList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
/**
|
||||
* 树形结构数据信息 电站沿程排序
|
||||
*/
|
||||
DataSourceResult<RstcdTreeInfoVo> getEngTreeByAlong(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdEqBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -28,6 +29,7 @@ public interface ISdEqBHService extends IService<SdEqBH> {
|
||||
* 修改
|
||||
*/
|
||||
boolean update(SdEqBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
||||
@ -6,6 +6,7 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdFbrdBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -28,6 +29,7 @@ public interface ISdFbrdBHService extends IService<SdFbrdBH> {
|
||||
* 修改
|
||||
*/
|
||||
boolean update(SdFbrdBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
||||
@ -6,6 +6,7 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdFhbtBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -28,6 +29,7 @@ public interface ISdFhbtBHService extends IService<SdFhbtBH> {
|
||||
* 修改
|
||||
*/
|
||||
boolean update(SdFhbtBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
||||
@ -6,6 +6,7 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdFishDictoryB;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdFishDictoryBService extends IService<SdFishDictoryB> {
|
||||
|
||||
@ -16,10 +17,21 @@ public interface ISdFishDictoryBService extends IService<SdFishDictoryB> {
|
||||
boolean add(SdFishDictoryB entity, String source);
|
||||
|
||||
boolean update(SdFishDictoryB entity, String source);
|
||||
boolean update(Map<String, Object> patchMap, String source) throws Exception;
|
||||
|
||||
boolean delete(List<String> ids, String source);
|
||||
|
||||
SdFishDictoryB getById(String id);
|
||||
|
||||
/**
|
||||
* 检查名称是否已存在(不过滤IS_DELETED,因为唯一约束不区分软删除)
|
||||
*/
|
||||
boolean existsByName(String name);
|
||||
|
||||
/**
|
||||
* 检查名称是否已被其他记录占用(排除指定ID)
|
||||
*/
|
||||
boolean existsByNameExcludeId(String name, String excludeId);
|
||||
|
||||
List<SdFishDictoryB> findSimilarFish(String name, Integer limit);
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import com.yfd.platform.qgc_base.domain.SdFhbtBH;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public interface ISdFpssBHService extends IService<SdFpssBH> {
|
||||
@ -25,6 +26,7 @@ public interface ISdFpssBHService extends IService<SdFpssBH> {
|
||||
boolean add(SdFpssBH sdFpssBH, String source);
|
||||
|
||||
boolean updateById(SdFpssBH sdFpssBH, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
boolean deleteById(String stcd, String sttp);
|
||||
|
||||
|
||||
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssR;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 过鱼设施人工数据表 服务类
|
||||
@ -15,4 +18,19 @@ public interface ISdFpssRService extends IService<SdFpssR> {
|
||||
* 分页查询过鱼数据
|
||||
*/
|
||||
Page<SdFpssR> queryPageList(Page<SdFpssR> page, String stcd, Integer yr, String ftp);
|
||||
|
||||
/**
|
||||
* 新增过鱼数据
|
||||
*/
|
||||
boolean add(SdFpssR entity, String source);
|
||||
|
||||
/**
|
||||
* 修改过鱼数据(按前端 patch 显式更新字段,含 null 置空)
|
||||
*/
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除过鱼数据(逻辑删除)
|
||||
*/
|
||||
boolean delete(List<String> ids, String source);
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.yfd.platform.qgc_base.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssrlAiR;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssrlRAiRequest;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 过鱼设施AI盒子自动数据表 服务接口
|
||||
* </p>
|
||||
*/
|
||||
public interface ISdFpssrlAiRService extends IService<SdFpssrlAiR> {
|
||||
|
||||
/**
|
||||
* 分页查询(Kendo Grid)
|
||||
*/
|
||||
Page<SdFpssrlAiR> queryPageList(DataSourceRequest request);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
boolean add(SdFpssrlAiR entity, String source);
|
||||
|
||||
/**
|
||||
* 修改(按前端 patch 显式更新字段,含 null 置空)
|
||||
*/
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除(逻辑删除)
|
||||
*/
|
||||
boolean delete(List<String> ids, String source);
|
||||
|
||||
/**
|
||||
* 根据ID查询(排除已删除的)
|
||||
*/
|
||||
SdFpssrlAiR getById(String id);
|
||||
|
||||
/**
|
||||
* 批量处理AI设备上报的识别数据
|
||||
*/
|
||||
List<SdFpssrlAiR> processAiReportBatch(List<SdFpssrlRAiRequest> requests);
|
||||
}
|
||||
@ -8,6 +8,7 @@ import com.yfd.platform.qgc_base.domain.SdFpssrlR;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssrlRAiRequest;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -27,9 +28,9 @@ public interface ISdFpssrlRService extends IService<SdFpssrlR> {
|
||||
boolean add(SdFpssrlR entity, String source);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* 修改(按前端 patch 显式更新字段,含 null 置空)
|
||||
*/
|
||||
boolean update(SdFpssrlR entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除(逻辑删除)
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdOpinfoBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdOpinfoBHService extends IService<SdOpinfoBH> {
|
||||
Page<SdOpinfoBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdOpinfoBH entity, String source);
|
||||
boolean update(SdOpinfoBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdOtteBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdOtteBHService extends IService<SdOtteBH> {
|
||||
Page<SdOtteBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdOtteBH entity, String source);
|
||||
boolean update(SdOtteBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdOtweBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdOtweBHService extends IService<SdOtweBH> {
|
||||
Page<SdOtweBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdOtweBH entity, String source);
|
||||
boolean update(SdOtweBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdSonarBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdSonarBHService extends IService<SdSonarBH> {
|
||||
Page<SdSonarBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdSonarBH entity, String source);
|
||||
boolean update(SdSonarBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdTeBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdTeBHService extends IService<SdTeBH> {
|
||||
Page<SdTeBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdTeBH entity, String source);
|
||||
boolean update(SdTeBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdVaBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdVaBHService extends IService<SdVaBH> {
|
||||
Page<SdVaBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdVaBH entity, String source);
|
||||
boolean update(SdVaBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdVdinfoB;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdVdinfoBService extends IService<SdVdinfoB> {
|
||||
Page<SdVdinfoB> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdVdinfoB entity, String source);
|
||||
boolean update(SdVdinfoB entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdVpBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdVpBHService extends IService<SdVpBH> {
|
||||
Page<SdVpBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdVpBH entity, String source);
|
||||
boolean update(SdVpBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdWeBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdWeBHService extends IService<SdWeBH> {
|
||||
Page<SdWeBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdWeBH entity, String source);
|
||||
boolean update(SdWeBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdWqBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdWqBHService extends IService<SdWqBH> {
|
||||
Page<SdWqBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdWqBH entity, String source);
|
||||
boolean update(SdWqBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdWtBH;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISdWtBHService extends IService<SdWtBH> {
|
||||
Page<SdWtBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdWtBH entity, String source);
|
||||
boolean update(SdWtBH entity, String source);
|
||||
boolean update(Map<String, Object> engInfoPatch, String source) throws Exception;
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.annotation.FieldChinese;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.qgc_base.domain.MsOperationLog;
|
||||
import com.yfd.platform.qgc_base.domain.MsOperationLogDetail;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBH;
|
||||
@ -20,6 +21,7 @@ import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -32,11 +34,62 @@ import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper, MsOperationLog> implements IMsOperationLogService {
|
||||
|
||||
private static final String ENG_TABLE_NAME = "SD_ENGINFO_B_H";
|
||||
|
||||
/**
|
||||
* 表名 → (主键列, 名称列) 配置映射
|
||||
* 默认:主键列 = STCD,名称列 = STNM,无需显式配置
|
||||
* 仅在主键列或名称列与默认不同的情况下才需配置
|
||||
* <p>
|
||||
* 若名称列不在本表,而在关联表中(如 SD_QEC_R 本身无站名,需通过 STCD
|
||||
* 关联 SD_ENGINFO_B_H 查出 ENNM),使用 {@link #join} 配置关联表信息。
|
||||
*/
|
||||
private record TableNameConfig(String pkColumn, String nameColumn,
|
||||
String joinColumn, String joinTableName, String joinTableNameColumn) {
|
||||
/**
|
||||
* 名称列在本表中:直接配置主键列和名称列
|
||||
*/
|
||||
static TableNameConfig self(String pkColumn, String nameColumn) {
|
||||
return new TableNameConfig(pkColumn, nameColumn, null, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 名称列在关联表中:本表 joinColumn 关联到关联表同名主键列,取关联表名称列
|
||||
*
|
||||
* @param pkColumn 本表主键列(IN 查询条件)
|
||||
* @param joinColumn 本表关联列(也是关联表主键列,如 STCD)
|
||||
* @param joinTableName 关联表名(如 SD_ENGINFO_B_H)
|
||||
* @param joinTableNameColumn 关联表名称列(如 ENNM)
|
||||
*/
|
||||
static TableNameConfig join(String pkColumn, String joinColumn, String joinTableName, String joinTableNameColumn) {
|
||||
return new TableNameConfig(pkColumn, null, joinColumn, joinTableName, joinTableNameColumn);
|
||||
}
|
||||
}
|
||||
private static final Map<String, TableNameConfig> TABLE_NAME_CONFIG_MAP = new HashMap<>();
|
||||
static {
|
||||
// Engine Info: 名称列是 ENNM 而非 STNM
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_ENGINFO_B_H", TableNameConfig.self("STCD", "ENNM"));
|
||||
// Hydro Base: 主键列是 BASEID,名称列是 BASENAME
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_HYDROBASE", TableNameConfig.self("BASEID", "BASENAME"));
|
||||
// Fish Dictionary: 需确认结构后配置
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_FISHDICTORY_B", TableNameConfig.self("ID", "NAME"));
|
||||
// 生态流量小时表本身无站名,通过 STCD 关联 SD_ENGINFO_B_H 查询 ENNM
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_QEC_R", TableNameConfig.join("ID", "STCD", "V_MS_STBPRP_T", "ENNM"));
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_FPSS_R", TableNameConfig.join("ID", "STCD", "V_MS_STBPRP_T", "STNM"));
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_RIVER_R", TableNameConfig.join("ID", "STCD", "V_MS_STBPRP_T", "STNM"));
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_FPSSRL_AI_R", TableNameConfig.join("ID", "STCD", "V_MS_STBPRP_T", "STNM"));
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_WTRV_R", TableNameConfig.join("ID", "STCD", "V_MS_STBPRP_T", "STNM"));
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_WTVT_R", TableNameConfig.join("STCD", "STCD", "V_MS_STBPRP_T", "STNM"));
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_WQ_R", TableNameConfig.join("ID", "STCD", "V_MS_STBPRP_T", "STNM"));
|
||||
TABLE_NAME_CONFIG_MAP.put("SD_RPIMNFISH_R", TableNameConfig.join("ID", "STCD", "V_MS_STBPRP_T", "STNM"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static final Map<String, String> ENG_FIELD_MEANING_MAP = new LinkedHashMap<>();
|
||||
// 标准日期时间格式器
|
||||
private static final DateTimeFormatter DATETIME_FORMATTER =
|
||||
@ -282,12 +335,15 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
@Resource
|
||||
private MsOperationLogDetailMapper msOperationLogDetailMapper;
|
||||
|
||||
@Resource
|
||||
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||
|
||||
@Override
|
||||
public void recordEngAddLog(SdEngInfoBH engInfo, String source) {
|
||||
if (engInfo == null) {
|
||||
return;
|
||||
}
|
||||
MsOperationLog mainLog = buildMainLog(engInfo.getStcd(),"新增电站", source);
|
||||
MsOperationLog mainLog = buildMainLog(engInfo.getStcd(),"新增", source,"01");
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
@ -323,7 +379,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
return;
|
||||
}
|
||||
|
||||
MsOperationLog mainLog = buildMainLog(before.getStcd(),"修改电站", source);
|
||||
MsOperationLog mainLog = buildMainLog(before.getStcd(),"修改电站", source,"02");
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
@ -360,7 +416,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
if (engInfo == null) {
|
||||
return;
|
||||
}
|
||||
MsOperationLog mainLog = buildMainLog(engInfo.getStcd(),"删除电站", source);
|
||||
MsOperationLog mainLog = buildMainLog(engInfo.getStcd(),"删除电站", source,"03");
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
@ -390,11 +446,11 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
batchInsertDetails(details);
|
||||
}
|
||||
|
||||
private MsOperationLog buildMainLog(String recordId,String remark, String source) {
|
||||
return buildMainLog(ENG_TABLE_NAME, recordId, remark, source);
|
||||
private MsOperationLog buildMainLog(String recordId,String remark, String source,String operationType) {
|
||||
return buildMainLog(ENG_TABLE_NAME, recordId, remark, source,operationType);
|
||||
}
|
||||
|
||||
private MsOperationLog buildMainLog(String tableName, String recordId, String remark, String source) {
|
||||
private MsOperationLog buildMainLog(String tableName, String recordId, String remark, String source,String operationType) {
|
||||
MsOperationLog log = new MsOperationLog();
|
||||
log.setOperator(resolveOperator());
|
||||
log.setOperateTime(new Date());
|
||||
@ -402,12 +458,13 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
log.setRecordId(recordId);
|
||||
log.setSource(StrUtil.trimToNull(source));
|
||||
log.setRemark(remark);
|
||||
log.setOperationType(operationType);
|
||||
return log;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recordOperationLog(String tableName, String recordId, String operation, String source) {
|
||||
MsOperationLog log = buildMainLog(tableName, recordId, operation, source);
|
||||
MsOperationLog log = buildMainLog(tableName, recordId, operation, source,null);
|
||||
msOperationLogMapper.insert(log);
|
||||
}
|
||||
|
||||
@ -417,7 +474,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
return;
|
||||
}
|
||||
// String recordId = getStcd(before);
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "修改", source);
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "修改", source,"02");
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
@ -457,7 +514,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
return;
|
||||
}
|
||||
// String recordId = getStcd(entity);
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "新增", source);
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "新增", source,"01");
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
@ -489,7 +546,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
}
|
||||
Map<String, String> codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList);
|
||||
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "新增", source);
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "新增", source,"01");
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
@ -507,7 +564,9 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
}
|
||||
String fieldMeaning = resolveFieldChinese(field);
|
||||
Object newValue = getFieldValue(field, entity);
|
||||
|
||||
if(newValue == null){
|
||||
continue;
|
||||
}
|
||||
MsOperationLogDetail detail = buildGenericDetail(mainLog.getId(), tableName, recordId, columnName,
|
||||
fieldMeaning, null, newValue, "新增字段值");
|
||||
|
||||
@ -525,7 +584,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
return;
|
||||
}
|
||||
// String recordId = getStcd(entity);
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "删除", source);
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "删除", source,"03");
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
@ -560,7 +619,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
}
|
||||
Map<String, String> codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList);
|
||||
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "修改", source);
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "修改", source,"02");
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
@ -580,9 +639,9 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
Object oldValue = getFieldValue(field, before);
|
||||
Object newValue = getFieldValue(field, after);
|
||||
|
||||
if (newValue == null) {
|
||||
continue;
|
||||
}
|
||||
// if (newValue == null) {
|
||||
// continue;
|
||||
// }
|
||||
if (equalsValue(oldValue, newValue)) {
|
||||
continue;
|
||||
}
|
||||
@ -604,7 +663,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
}
|
||||
Map<String, String> codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList);
|
||||
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "删除", source);
|
||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "删除", source,"03");
|
||||
msOperationLogMapper.insert(mainLog);
|
||||
|
||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||
@ -622,7 +681,9 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
}
|
||||
String fieldMeaning = resolveFieldChinese(field);
|
||||
Object oldValue = getFieldValue(field, entity);
|
||||
|
||||
if(oldValue == null){
|
||||
continue;
|
||||
}
|
||||
MsOperationLogDetail detail = buildGenericDetail(mainLog.getId(), tableName, recordId, columnName,
|
||||
fieldMeaning, oldValue, null, "删除字段值");
|
||||
|
||||
@ -931,16 +992,129 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
@Override
|
||||
public Page<MsOperationLog> queryPageList(DataSourceRequest request) {
|
||||
Page<MsOperationLog> msOperationLogPage = DataSourceRequestUtil.executeQuery(request, MsOperationLog.class, this);
|
||||
// 批量解析操作记录名称
|
||||
batchResolveRecordNames(msOperationLogPage.getRecords());
|
||||
return msOperationLogPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量解析操作记录的名称
|
||||
* 按 tableName 分组后,每张表一次批量查询名称
|
||||
*/
|
||||
private void batchResolveRecordNames(List<MsOperationLog> records) {
|
||||
if (records == null || records.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 按 tableName 分组,收集 recordId
|
||||
Map<String, List<String>> tableRecordIdsMap = new LinkedHashMap<>();
|
||||
for (MsOperationLog log : records) {
|
||||
if (StrUtil.isNotBlank(log.getTableName()) && StrUtil.isNotBlank(log.getRecordId())) {
|
||||
tableRecordIdsMap.computeIfAbsent(log.getTableName(), k -> new ArrayList<>())
|
||||
.add(log.getRecordId());
|
||||
}
|
||||
}
|
||||
|
||||
// 每个表批量查询名称
|
||||
for (Map.Entry<String, List<String>> entry : tableRecordIdsMap.entrySet()) {
|
||||
String tableName = entry.getKey();
|
||||
List<String> recordIds = entry.getValue();
|
||||
if (recordIds.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取表配置
|
||||
TableNameConfig config = TABLE_NAME_CONFIG_MAP.get(tableName);
|
||||
String pkColumn;
|
||||
String nameColumn;
|
||||
if (config != null) {
|
||||
pkColumn = config.pkColumn();
|
||||
nameColumn = config.nameColumn();
|
||||
} else {
|
||||
// 默认:主键列 = STCD,名称列 = STNM
|
||||
pkColumn = "STCD";
|
||||
nameColumn = "STNM";
|
||||
}
|
||||
|
||||
// 去重后构建 IN 参数
|
||||
Set<String> distinctIds = new LinkedHashSet<>(recordIds);
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String inPlaceholders = buildInPlaceholders(distinctIds, paramMap);
|
||||
|
||||
// 注意:如果配置的表在数据库中不存在,跳过
|
||||
try {
|
||||
String sql;
|
||||
if (config != null && StrUtil.isNotBlank(config.joinTableName())) {
|
||||
// 名称列在关联表中:本表 joinColumn 关联到关联表同名主键列,取关联表名称列
|
||||
sql = "SELECT t." + pkColumn + " AS pkVal, nt." + config.joinTableNameColumn() + " AS nameVal " +
|
||||
"FROM " + tableName + " t " +
|
||||
"LEFT JOIN " + config.joinTableName() + " nt " +
|
||||
" ON t." + config.joinColumn() + " = nt." + config.joinColumn() + " " +
|
||||
" AND NVL(nt.IS_DELETED, 0) = 0 " +
|
||||
"WHERE t." + pkColumn + " IN (" + inPlaceholders + ")" +
|
||||
" AND NVL(t.IS_DELETED, 0) = 0";
|
||||
} else {
|
||||
sql = "SELECT " + pkColumn + " AS pkVal, " + nameColumn + " AS nameVal " +
|
||||
"FROM " + tableName +
|
||||
" WHERE " + pkColumn + " IN (" + inPlaceholders + ")" +
|
||||
" AND NVL(IS_DELETED, 0) = 0";
|
||||
}
|
||||
List<Map<String, Object>> results = microservicDynamicSQLMapper.getAllList(sql, paramMap);
|
||||
|
||||
// 构建 pkVal → nameVal 映射
|
||||
Map<String, String> nameMap = new HashMap<>();
|
||||
for (Map<String, Object> row : results) {
|
||||
Object pkObj = row.get("PKVAL");
|
||||
Object nameObj = row.get("NAMEVAL");
|
||||
if (pkObj != null && nameObj != null) {
|
||||
nameMap.put(String.valueOf(pkObj), String.valueOf(nameObj));
|
||||
}
|
||||
}
|
||||
|
||||
// 回填 recordName
|
||||
for (MsOperationLog log : records) {
|
||||
if (tableName.equals(log.getTableName())) {
|
||||
String name = nameMap.get(log.getRecordId());
|
||||
if (name != null) {
|
||||
log.setRecordName(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 表不存在或查询失败时静默跳过
|
||||
log.warn("批量解析记录名称失败, tableName={}", tableName, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建 IN 子句占位符,如 #{map.p0}, #{map.p1}, ...
|
||||
*/
|
||||
private String buildInPlaceholders(Set<String> ids, Map<String, Object> paramMap) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int i = 0;
|
||||
for (String id : ids) {
|
||||
if (i > 0) {
|
||||
sb.append(", ");
|
||||
}
|
||||
String key = "p" + i;
|
||||
sb.append("#{map.").append(key).append("}");
|
||||
paramMap.put(key, id);
|
||||
i++;
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MsOperationLogDetail> getDetailByMainId(String mainId) {
|
||||
if (StringUtils.isBlank(mainId)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
LambdaQueryWrapper<MsOperationLogDetail> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MsOperationLogDetail::getMainId, mainId);
|
||||
wrapper.eq(MsOperationLogDetail::getMainId, mainId)
|
||||
.notIn(MsOperationLogDetail::getFieldCode,
|
||||
"RECORD_USER", "RECORD_TIME", "MODIFY_USER", "MODIFY_TIME",
|
||||
"IS_DELETED", "DELETE_USER", "DELETE_TIME");
|
||||
return msOperationLogDetailMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,146 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 公共 Patch 更新辅助工具,按前端 Map patch 显式更新实体字段(含 null 值置空)。
|
||||
* <p>
|
||||
* MyBatis-Plus 的 updateById 默认忽略 null 字段,前端传 "baseId": null 表示要将该字段置空,
|
||||
* 通过本工具 engInfoPatch.containsKey(fieldName) 判断前端显式传入的字段,
|
||||
* 对 null 值使用 SET column = NULL 实现置空。
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
* 使用示例:
|
||||
* @Resource
|
||||
* private PatchUpdateHelper patchUpdateHelper;
|
||||
*
|
||||
* public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
* return patchUpdateHelper.execute(
|
||||
* this, engInfoPatch, source, TABLE_NAME, SdWtBH.class,
|
||||
* TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
@Component
|
||||
public class PatchUpdateHelper {
|
||||
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Resource
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
|
||||
/**
|
||||
* 执行 patch 更新(默认主键字段为 "stcd")。
|
||||
*
|
||||
* @see #execute(IService, Map, String, String, Class, Set, List, String)
|
||||
*/
|
||||
public <T> boolean execute(
|
||||
IService<T> service,
|
||||
Map<String, Object> engInfoPatch,
|
||||
String source,
|
||||
String tableName,
|
||||
Class<T> entityClass,
|
||||
Set<String> transientFields,
|
||||
List<CodeToNameMetadataBo> codeToNameMetaList) throws Exception {
|
||||
return execute(service, engInfoPatch, source, tableName, entityClass, transientFields, codeToNameMetaList, "stcd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行 patch 更新:仅更新前端显式传入的字段(包括 null 值),未传入的字段保持原值。
|
||||
*
|
||||
* @param service 对应实体的 IService(用于 getById 和 update)
|
||||
* @param engInfoPatch 前端传入的字段 Map(key=字段名, value=字段值, 显式包含 null)
|
||||
* @param source 操作来源(用于日志)
|
||||
* @param tableName 数据库表名(用于日志)
|
||||
* @param entityClass 实体类
|
||||
* @param transientFields 需跳过的瞬态字段集合(如 @TableField(exist=false)、serialVersionUID)
|
||||
* @param codeToNameMetaList 字典代码转名称配置(用于操作日志)
|
||||
* @param pkFieldName 主键 Java 字段名(如 "stcd"、"id")
|
||||
* @param <T> 实体类型
|
||||
* @return true=更新成功
|
||||
* @throws Exception Jackson 类型转换异常等
|
||||
*/
|
||||
public <T> boolean execute(
|
||||
IService<T> service,
|
||||
Map<String, Object> engInfoPatch,
|
||||
String source,
|
||||
String tableName,
|
||||
Class<T> entityClass,
|
||||
Set<String> transientFields,
|
||||
List<CodeToNameMetadataBo> codeToNameMetaList,
|
||||
String pkFieldName) throws Exception {
|
||||
|
||||
Object pkValue = engInfoPatch == null ? null : engInfoPatch.get(pkFieldName);
|
||||
if (isEmptyPk(pkValue)) {
|
||||
throw new BizException("主键不能为空");
|
||||
}
|
||||
T before = service.getById((String) pkValue);
|
||||
if (before == null) {
|
||||
throw new BizException("记录不存在: " + pkValue);
|
||||
}
|
||||
|
||||
T after = entityClass.getDeclaredConstructor().newInstance();
|
||||
BeanUtil.copyProperties(before, after);
|
||||
objectMapper.updateValue(after, engInfoPatch);
|
||||
|
||||
String pkColumn = StrUtil.toUnderlineCase(pkFieldName).toUpperCase();
|
||||
UpdateWrapper<T> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq(pkColumn, pkValue);
|
||||
boolean hasUpdate = false;
|
||||
for (Field field : entityClass.getDeclaredFields()) {
|
||||
String fieldName = field.getName();
|
||||
if (transientFields.contains(fieldName) || pkFieldName.equals(fieldName)) {
|
||||
continue;
|
||||
}
|
||||
if (!engInfoPatch.containsKey(fieldName)) {
|
||||
continue;
|
||||
}
|
||||
String column = StrUtil.toUnderlineCase(fieldName).toUpperCase();
|
||||
field.setAccessible(true);
|
||||
Object value = field.get(after);
|
||||
if (value == null) {
|
||||
updateWrapper.setSql(column + " = NULL");
|
||||
} else {
|
||||
updateWrapper.set(column, value);
|
||||
}
|
||||
hasUpdate = true;
|
||||
}
|
||||
if (!hasUpdate) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean result = service.update(updateWrapper);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(before, codeToNameMetaList);
|
||||
dictCodeToNameConverter.convertCodeToName(after, codeToNameMetaList);
|
||||
msOperationLogService.recordModifyDetailLog(String.valueOf(pkValue), tableName, before, after, source, codeToNameMetaList);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean isEmptyPk(Object value) {
|
||||
if (value == null) return true;
|
||||
if (value instanceof String) return StrUtil.isBlank((String) value);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1,24 +1,26 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdAiboxBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdAiboxBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdAiboxBHService;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.yfd.platform.utils.StcdUniqueValidator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdAiboxBHServiceImpl extends ServiceImpl<SdAiboxBHMapper, SdAiboxBH> implements ISdAiboxBHService {
|
||||
@ -31,6 +33,14 @@ public class SdAiboxBHServiceImpl extends ServiceImpl<SdAiboxBHMapper, SdAiboxBH
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "bldsttCodeName", "usflName", "dtinName", "mwayName", "ennm", "baseName", "rvnm", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
* <p>
|
||||
@ -71,6 +81,11 @@ public class SdAiboxBHServiceImpl extends ServiceImpl<SdAiboxBHMapper, SdAiboxBH
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdAiboxBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -92,6 +107,14 @@ public class SdAiboxBHServiceImpl extends ServiceImpl<SdAiboxBHMapper, SdAiboxBH
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdAiboxBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,24 +1,22 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdAimonitorBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdAimonitorBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdAimonitorBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* AI智能监测装置 Service 实现类
|
||||
@ -33,6 +31,13 @@ public class SdAimonitorBHServiceImpl extends ServiceImpl<SdAimonitorBHMapper, S
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "bldsttCodeName", "dtinName", "mwayName", "ennm", "baseName", "rvnm", "serialVersionUID");
|
||||
|
||||
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
||||
|
||||
@ -57,6 +62,11 @@ public class SdAimonitorBHServiceImpl extends ServiceImpl<SdAimonitorBHMapper, S
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdAimonitorBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -78,6 +88,14 @@ public class SdAimonitorBHServiceImpl extends ServiceImpl<SdAimonitorBHMapper, S
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdAimonitorBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,21 +1,24 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdArtsgBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdArtsgBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdArtsgBHService;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.StcdUniqueValidator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdArtsgBHServiceImpl extends ServiceImpl<SdArtsgBHMapper, SdArtsgBH> implements ISdArtsgBHService {
|
||||
@ -24,6 +27,13 @@ public class SdArtsgBHServiceImpl extends ServiceImpl<SdArtsgBHMapper, SdArtsgBH
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "dtinName", "ennm", "baseName", "rvnm", "bldsttCodeName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -64,6 +74,11 @@ public class SdArtsgBHServiceImpl extends ServiceImpl<SdArtsgBHMapper, SdArtsgBH
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdArtsgBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -85,6 +100,14 @@ public class SdArtsgBHServiceImpl extends ServiceImpl<SdArtsgBHMapper, SdArtsgBH
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdArtsgBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,24 +1,22 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdDwBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdDwBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdDwBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdDwBHServiceImpl extends ServiceImpl<SdDwBHMapper, SdDwBH> implements ISdDwBHService {
|
||||
@ -30,6 +28,13 @@ public class SdDwBHServiceImpl extends ServiceImpl<SdDwBHMapper, SdDwBH> impleme
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "dtinName", "baseName", "ennm", "bldsttCodeName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -66,6 +71,11 @@ public class SdDwBHServiceImpl extends ServiceImpl<SdDwBHMapper, SdDwBH> impleme
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdDwBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -87,6 +97,14 @@ public class SdDwBHServiceImpl extends ServiceImpl<SdDwBHMapper, SdDwBH> impleme
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdDwBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -23,23 +23,12 @@ import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.GroupHelper;
|
||||
import com.yfd.platform.common.GroupingInfo;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.vo.*;
|
||||
import com.yfd.platform.qgc_data.domain.SysUserDataScope;
|
||||
import com.yfd.platform.qgc_data.mapper.SysUserDataScopeMapper;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBH;
|
||||
import com.yfd.platform.qgc_base.domain.vo.DataScopeApplyResult;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBHRequest;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngAlarmPointVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngBaseInfoVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngEiaapprovalVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngOperatVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngQgcRvcdVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngRsvrcscdBVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngRsvrcscdRvcdVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngPointVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngStbprpDataVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngStBaseInfoVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngStInfoResultVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngVmsstbprptVo;
|
||||
import com.yfd.platform.qgc_base.mapper.SdEngInfoBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IDataScopeFilterService;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
@ -65,7 +54,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEngInfoBH> implements ISdEngInfoBHService {
|
||||
private static final String TABLE_NAME = "SD_FISHDICTORY_B";
|
||||
private static final String TABLE_NAME = "SD_ENGINFO_B_H";
|
||||
private static final Map<String, String> ENG_CODE_NAME_FIELD_MAP = new LinkedHashMap<>();
|
||||
@Resource
|
||||
private RedisCacheUtil redisCacheUtil;
|
||||
@ -146,6 +135,14 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("usflName", "sttpName", "bldsttCodeName", "engtpName", "scrscName", "prgrName", "fnName", "adjustEngName", "ishvrgrgName", "rgcpName", "dmatName", "dmtpName", "dvtpName", "cntpName", "blsysName", "impdstrzName", "chngrdName", "chiefbasinengName", "dtinEnvName", "runStateName", "warnStateName", "coenvwStateName", "serialVersionUID");
|
||||
|
||||
@Resource
|
||||
private IAdminAuthService adminAuthService;
|
||||
|
||||
@ -207,6 +204,7 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
@Cacheable(cacheNames = "engInfoCache#3600", keyGenerator = "cacheKeyGenerator")
|
||||
public List<SdEngInfoBH> selectForDropdownCached(SdEngInfoBHRequest sdEngInfoBHRequest) {
|
||||
String baseId = sdEngInfoBHRequest.getBaseId();
|
||||
List<String> baseIds = sdEngInfoBHRequest.getBaseIds();
|
||||
String hbrvcd = sdEngInfoBHRequest.getHbrvcd();
|
||||
String ennm = sdEngInfoBHRequest.getEnnm();
|
||||
String rvcd = sdEngInfoBHRequest.getRvcd();
|
||||
@ -219,6 +217,7 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
.eq(StrUtil.isNotBlank(reachcd), SdEngInfoBH::getReachcd, reachcd)
|
||||
.eq(StrUtil.isNotBlank(rvcd), SdEngInfoBH::getRvcd, rvcd)
|
||||
.in(rvcds != null && !rvcds.isEmpty(), SdEngInfoBH::getReachcd, rvcds)
|
||||
.in(baseIds != null && !baseIds.isEmpty(), SdEngInfoBH::getBaseId, baseIds)
|
||||
.in(hbrvcds != null && !hbrvcds.isEmpty(), SdEngInfoBH::getHbrvcd, hbrvcds)
|
||||
.like(StringUtils.hasText(ennm), SdEngInfoBH::getEnnm, ennm)
|
||||
.select(SdEngInfoBH::getStcd, SdEngInfoBH::getEnnm, SdEngInfoBH::getReachcdName, SdEngInfoBH::getYrgeb, SdEngInfoBH::getBaseId)
|
||||
@ -299,6 +298,11 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
@CacheEvict(cacheNames = "engInfoCache", allEntries = true)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean addEngInfo(SdEngInfoBH engInfo, String source) {
|
||||
if (engInfo == null || StrUtil.isBlank(engInfo.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(engInfo.getStcd());
|
||||
// fillRelatedNameFields(engInfo);
|
||||
boolean result = this.save(engInfo);
|
||||
if (result) {
|
||||
@ -334,29 +338,10 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateEngInfo(Map<String, Object> engInfoPatch, String source) throws JsonMappingException {
|
||||
Map<String, Object> filteredPatch = filterEngInfoPatchFields(engInfoPatch);
|
||||
if (filteredPatch.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
String stcd = toTextValue(filteredPatch.get("stcd"));
|
||||
if (!StringUtils.hasText(stcd)) {
|
||||
return false;
|
||||
}
|
||||
SdEngInfoBH before = this.getById(stcd);
|
||||
if (before == null) {
|
||||
return false;
|
||||
}
|
||||
SdEngInfoBH after = BeanUtil.copyProperties(before, SdEngInfoBH.class);
|
||||
objectMapper.updateValue(after, filteredPatch);
|
||||
fillRelatedNameFields(after);
|
||||
boolean result = updateEngInfoByPatch(stcd, after, filteredPatch);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(after, CODE_TO_NAME_META_LIST);
|
||||
dictCodeToNameConverter.convertCodeToName(before, CODE_TO_NAME_META_LIST);
|
||||
msOperationLogService.recordModifyDetailLog(before.getStcd(),TABLE_NAME,before, after, source, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
return result;
|
||||
public boolean updateEngInfo(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdEngInfoBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
private boolean updateEngInfoByPatch(String stcd, SdEngInfoBH after, Map<String, Object> engInfoPatch) {
|
||||
@ -823,7 +808,7 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
List<Map<String, Object>> rows = microservicDynamicSQLMapper.pageAllList(page, sql, paramMap);
|
||||
List<EngStbprpDataVo> list = new ArrayList<>();
|
||||
for (Map<String, Object> row : rows) {
|
||||
list.add(new EngStbprpDataVo(row));
|
||||
list.add(new EngStbprpDataVo(convertKeysToCamelCase(row)));
|
||||
}
|
||||
result.setData(list);
|
||||
result.setTotal(page == null ? list.size() : page.getTotal());
|
||||
@ -833,15 +818,44 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
GroupingInfo[] groupInfos = loadOptions == null ? new GroupingInfo[0] : loadOptions.getGroup();
|
||||
String groupSql = buildStbprpDataGroupSql(detailSql, request.getGroup(), tableMetaList);
|
||||
List<Map<String, Object>> rows = microservicDynamicSQLMapper.pageAllList(null, groupSql, paramMap);
|
||||
List<Map<String, Object>> camelRows = new ArrayList<>();
|
||||
for (Map<String, Object> row : rows) {
|
||||
camelRows.add(convertKeysToCamelCase(row));
|
||||
}
|
||||
if (Boolean.TRUE.equals(request.getGroupResultFlat())) {
|
||||
result.setData((List<EngStbprpDataVo>) (List<?>) new GroupHelper().faltGroup(rows, Arrays.asList(groupInfos)));
|
||||
result.setData((List<EngStbprpDataVo>) (List<?>) new GroupHelper().faltGroup(camelRows, Arrays.asList(groupInfos)));
|
||||
} else {
|
||||
result.setData((List<EngStbprpDataVo>) (List<?>) new GroupHelper().group(rows, Arrays.asList(groupInfos)));
|
||||
result.setData((List<EngStbprpDataVo>) (List<?>) new GroupHelper().group(camelRows, Arrays.asList(groupInfos)));
|
||||
}
|
||||
result.setTotal((long) rows.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 Map 的 key 从 ORACLE 大写/下划线格式转为 camelCase
|
||||
*/
|
||||
private Map<String, Object> convertKeysToCamelCase(Map<String, Object> row) {
|
||||
if (CollUtil.isEmpty(row)) {
|
||||
return row;
|
||||
}
|
||||
Map<String, Object> result = new LinkedHashMap<>(row.size());
|
||||
for (Map.Entry<String, Object> entry : row.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key == null) {
|
||||
result.put(null, entry.getValue());
|
||||
continue;
|
||||
}
|
||||
// 如果已经是小写开头,说明已经是 camelCase,跳过转换
|
||||
if (Character.isLowerCase(key.charAt(0))) {
|
||||
result.put(key, entry.getValue());
|
||||
continue;
|
||||
}
|
||||
String camelKey = StrUtil.toCamelCase(key.toLowerCase());
|
||||
result.put(camelKey, entry.getValue());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private DataSourceResult<EngOperatVo> queryOperatSummaryList(DataSourceRequest dataSourceRequest,
|
||||
DataSourceLoadOptionsBase loadOptions) {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
@ -1002,75 +1016,25 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
|
||||
@Override
|
||||
public EngVmsstbprptVo getStInfoByStcd(String stcd) {
|
||||
// 先查 V_MS_STBPRP_T 视图获取 STTP_CODE
|
||||
String checkSql = "SELECT STCD, STTP_CODE FROM V_MS_STBPRP_T WHERE STCD = #{map.stcd} AND IS_DELETED = 0 AND ROWNUM = 1";
|
||||
Map<String, Object> checkResult = microservicDynamicSQLMapper.getOneBySql(checkSql, Collections.singletonMap("stcd", stcd));
|
||||
|
||||
String sttpCode = checkResult != null ? (String) checkResult.get("STTP_CODE") : null;
|
||||
|
||||
if (!"ENG".equals(sttpCode)) {
|
||||
// 非 ENG:直接从 V_MS_STBPRP_T 视图返回
|
||||
String viewSql = "SELECT *,SWDT STSTDT FROM V_MS_STBPRP_T WHERE STCD = #{map.stcd} AND IS_DELETED = 0";
|
||||
return microservicDynamicSQLMapper.getOneBySqlWithResultType(viewSql, Collections.singletonMap("stcd", stcd), EngVmsstbprptVo.class);
|
||||
}
|
||||
|
||||
// ENG 走原有逻辑
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT *")
|
||||
|
||||
.append(" FROM (")
|
||||
.append(buildVmsstbprptViewSqlNew())
|
||||
.append(") t WHERE 1 = 1 AND t.STCD = #{map.stcd}");
|
||||
EngVmsstbprptVo vo = microservicDynamicSQLMapper.getOneBySqlWithResultType(sql.toString(), Collections.singletonMap("stcd", stcd), EngVmsstbprptVo.class);
|
||||
// SdEngInfoBH entity = this.getById(stcd);
|
||||
// if (entity == null) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// EngBaseInfoVo vo = new EngBaseInfoVo();
|
||||
// BeanUtil.copyProperties(entity, vo);
|
||||
// vo.setId(entity.getStcd());
|
||||
// vo.setStnm(entity.getEnnm());
|
||||
//
|
||||
// String sql = "SELECT " +
|
||||
// "sttp.ID AS sttp, " +
|
||||
// "sttp.STTP_CODE AS sttpCode, " +
|
||||
// "sttp.STTP_NAME AS sttpName, " +
|
||||
// "sttp.FULL_PATH AS sttpFullPath, " +
|
||||
// "sttp.TREE_LEVEL AS sttpTreeLevel, " +
|
||||
// "hb.BASENAME AS baseName, " +
|
||||
// "hbrv.HBRVNM AS hbrvcdName, " +
|
||||
// "rv.RVNM AS rvcdName, " +
|
||||
// "rv.PATH AS rvcdFullPath, " +
|
||||
// "addv.ADDVNM AS addvcdName, " +
|
||||
// "addv.PATH AS addvcdFullPath, " +
|
||||
// "country.COUNTRY_NAME AS countryName, " +
|
||||
// "hy.HYNM AS hynm, " +
|
||||
// "topHy.HYNM AS topHynm " +
|
||||
// "FROM SD_ENGINFO_B_H eng " +
|
||||
// "LEFT JOIN SD_STTP_B sttp ON sttp.STTP_CODE = 'ENG' " +
|
||||
// " AND NVL(sttp.IS_DELETED, 0) = 0 " +
|
||||
// " AND NVL(sttp.ENABLE, 1) = 1 " +
|
||||
// "LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = eng.BASE_ID " +
|
||||
// "LEFT JOIN SD_HBRV_DIC hbrv ON hbrv.HBRVCD = eng.HBRVCD AND hbrv.BASEID = eng.BASE_ID " +
|
||||
// " 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 " +
|
||||
// "LEFT JOIN SD_COUNTRY_B country ON country.COUNTRY_ID = eng.COUNTRY AND NVL(country.ENABLED, 1) = 1 " +
|
||||
// "LEFT JOIN SD_HYCD_DIC hy ON hy.HYCD = eng.HYCD " +
|
||||
// "LEFT JOIN SD_HYCD_DIC topHy ON topHy.HYCD = eng.TOP_HYCD " +
|
||||
// "WHERE eng.STCD = #{map.stcd}";
|
||||
//
|
||||
// EngBaseInfoVo extra = microservicDynamicSQLMapper.getOneBySqlWithResultType(
|
||||
// sql, java.util.Collections.singletonMap("stcd", stcd), EngBaseInfoVo.class);
|
||||
// if (extra != null) {
|
||||
// BeanUtil.copyProperties(extra, vo, CopyOptions.create().setIgnoreNullValue(true));
|
||||
// }
|
||||
//
|
||||
// vo.setSttpCode("ENG");
|
||||
// vo.setBlprdCode(entity.getBlprd() == null ? null : String.valueOf(entity.getBlprd()));
|
||||
// vo.setBlprdCcode(entity.getBlprd() == null ? null : String.valueOf(entity.getBlprd()));
|
||||
// vo.setBlprdName(resolveBlprdName(entity.getBlprd()));
|
||||
// vo.setBlprdCname(vo.getBlprdName());
|
||||
// vo.setDtinName(resolveDtinName(entity.getDtin()));
|
||||
// vo.setBldsttName(resolveBldsttName(entity.getBldstt()));
|
||||
// vo.setBldsttCcode(entity.getBldsttCode() == null ? null : String.valueOf(entity.getBldsttCode()));
|
||||
// vo.setBldsttCcodeName(resolveBldsttCodeName(entity.getBldsttCode()));
|
||||
// vo.setDvtpName(resolveDvtpName(entity.getDvtp()));
|
||||
// vo.setRgcpName(resolveRgcpName(entity.getRgcp()));
|
||||
// vo.setEngtpName(resolveEngtpName(entity.getEngtp()));
|
||||
// vo.setPrscName(resolvePrscName(entity.getPrsc()));
|
||||
// vo.setScrscName(resolveScrscName(entity.getScrsc()));
|
||||
// vo.setPrgrName(resolvePrgrName(entity.getPrgr()));
|
||||
return vo;
|
||||
return microservicDynamicSQLMapper.getOneBySqlWithResultType(sql.toString(), Collections.singletonMap("stcd", stcd), EngVmsstbprptVo.class);
|
||||
}
|
||||
|
||||
|
||||
@ -1320,7 +1284,7 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
"t.BASE_ID AS baseId, " +
|
||||
"t.BASE_NAME AS baseName, " +
|
||||
"t.HBRVCD AS hbrvcd, " +
|
||||
"t.HBRVCD_NAME AS hbrvcdName, " +
|
||||
"t.RVCD_NAME AS hbrvcdName, " +
|
||||
"t.RVCD AS rvcd, " +
|
||||
"t.RVCD_NAME AS rvcdName, " +
|
||||
"t.ADDVCD AS addvcd, " +
|
||||
@ -4128,4 +4092,134 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ======================== 沿程树形查询 ========================
|
||||
|
||||
@Override
|
||||
public DataSourceResult<RstcdTreeInfoVo> getEngTreeByAlong(
|
||||
DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<RstcdTreeInfoVo> result = new DataSourceResult<>();
|
||||
result.setAggregates(new HashMap<>());
|
||||
|
||||
if (dataSourceRequest == null) {
|
||||
result.setData(new ArrayList<>());
|
||||
result.setTotal(0L);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 使用 buildFilterCondition 动态构建查询条件
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
||||
dataSourceRequest.getFilter(),
|
||||
paramMap,
|
||||
new int[]{0},
|
||||
this::mapVmsFilterColumn
|
||||
);
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT STCD AS stcd, STNM AS stnm, ")
|
||||
.append("STTP_CODE AS sttpCode, STTP_NAME AS sttpName, ")
|
||||
.append("MWAY AS mway, RSTCD AS rstcd, ENNM AS ennm, ")
|
||||
.append("BASE_ID AS baseId, BASE_NAME AS baseName, ")
|
||||
.append("NVL(RSTCDSTEPSORT, 999999) AS rstcdStepSort, ")
|
||||
.append("NVL(ORDER_INDEX, 999999) AS orderIndex, ")
|
||||
.append("LGTD AS lgtd, LTTD AS lttd ")
|
||||
.append("FROM V_MS_STBPRP_T ")
|
||||
.append("WHERE NVL(IS_DELETED, 0) = 0");
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql);
|
||||
}
|
||||
sql.append(" ORDER BY NVL(RSTCDSTEPSORT, 999999), NVL(ORDER_INDEX, 999999)");
|
||||
|
||||
List<StcdItemVo> allItems = microservicDynamicSQLMapper
|
||||
.getAllListWithResultType(sql.toString(), paramMap, StcdItemVo.class);
|
||||
|
||||
if (CollUtil.isEmpty(allItems)) {
|
||||
result.setData(new ArrayList<>());
|
||||
result.setTotal(0L);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 构建树形结构:按 RSTCD 分组
|
||||
Map<String, List<StcdItemVo>> groupedMap = new LinkedHashMap<>();
|
||||
|
||||
for (StcdItemVo item : allItems) {
|
||||
String rstcd = StrUtil.blankToDefault(item.getRstcd(), "");
|
||||
// 处理逗号分隔的多个 RSTCD(一个测站关联多个电站)
|
||||
if (rstcd.contains(",")) {
|
||||
for (String singleRstcd : rstcd.split(",")) {
|
||||
String r = singleRstcd.trim();
|
||||
if (StrUtil.isNotBlank(r)) {
|
||||
groupedMap.computeIfAbsent(r, k -> new ArrayList<>()).add(item);
|
||||
}
|
||||
}
|
||||
} else if (StrUtil.isNotBlank(rstcd)) {
|
||||
groupedMap.computeIfAbsent(rstcd, k -> new ArrayList<>()).add(item);
|
||||
} else {
|
||||
// 无电站归属 → other
|
||||
groupedMap.computeIfAbsent("other", k -> new ArrayList<>()).add(item);
|
||||
}
|
||||
}
|
||||
|
||||
// 转换为树节点列表
|
||||
List<RstcdTreeInfoVo> treeList = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<String, List<StcdItemVo>> entry : groupedMap.entrySet()) {
|
||||
String rstcd = entry.getKey();
|
||||
List<StcdItemVo> items = entry.getValue();
|
||||
|
||||
RstcdTreeInfoVo node =
|
||||
new RstcdTreeInfoVo();
|
||||
|
||||
if ("other".equals(rstcd)) {
|
||||
node.setRstcd("other");
|
||||
node.setEnnm("其它");
|
||||
} else {
|
||||
node.setRstcd(rstcd);
|
||||
// 从测站数据中取电站名称
|
||||
String ennm = items.stream()
|
||||
.map(StcdItemVo::getEnnm)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.findFirst().orElse(rstcd);
|
||||
node.setEnnm(ennm);
|
||||
}
|
||||
|
||||
// 取第一个测站的排序和基地信息
|
||||
StcdItemVo first = items.getFirst();
|
||||
node.setSort(first.getOrderIndex());
|
||||
node.setBaseId(first.getBaseId());
|
||||
node.setBaseName(first.getBaseName());
|
||||
node.setItems(items);
|
||||
|
||||
treeList.add(node);
|
||||
}
|
||||
|
||||
result.setData(treeList);
|
||||
result.setTotal(treeList.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* V_MS_STBPRP_T 视图字段映射:前端字段名 → 数据库列名
|
||||
*/
|
||||
private String mapVmsFilterColumn(String field) {
|
||||
if (field == null) return null;
|
||||
return switch (field) {
|
||||
case "stcd" -> "STCD";
|
||||
case "stnm" -> "STNM";
|
||||
case "sttpCode", "sttp_code" -> "STTP_CODE";
|
||||
case "sttpName", "sttp_name" -> "STTP_NAME";
|
||||
case "mway" -> "MWAY";
|
||||
case "rstcd" -> "RSTCD";
|
||||
case "ennm" -> "ENNM";
|
||||
case "baseId", "base_id" -> "BASE_ID";
|
||||
case "baseName", "base_name" -> "BASE_NAME";
|
||||
case "fhstcd" -> "FHSTCD";
|
||||
case "lgtd" -> "LGTD";
|
||||
case "lttd" -> "LTTD";
|
||||
case "orderIndex", "order_index" -> "ORDER_INDEX";
|
||||
case "rstcdStepSort", "rstcdstepsort" -> "RSTCDSTEPSORT";
|
||||
case "isDeleted", "is_deleted" -> "IS_DELETED";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,24 +1,22 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdEqBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdEqBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdEqBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdEqBHServiceImpl extends ServiceImpl<SdEqBHMapper, SdEqBH> implements ISdEqBHService {
|
||||
@ -30,6 +28,13 @@ public class SdEqBHServiceImpl extends ServiceImpl<SdEqBHMapper, SdEqBH> impleme
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "dtinName", "ennm", "baseName", "bldsttCodeName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -66,6 +71,11 @@ public class SdEqBHServiceImpl extends ServiceImpl<SdEqBHMapper, SdEqBH> impleme
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdEqBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -87,6 +97,14 @@ public class SdEqBHServiceImpl extends ServiceImpl<SdEqBHMapper, SdEqBH> impleme
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdEqBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,21 +1,24 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdFbrdBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdFbrdBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdFbrdBHService;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.StcdUniqueValidator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdFbrdBHServiceImpl extends ServiceImpl<SdFbrdBHMapper, SdFbrdBH> implements ISdFbrdBHService {
|
||||
@ -27,6 +30,13 @@ public class SdFbrdBHServiceImpl extends ServiceImpl<SdFbrdBHMapper, SdFbrdBH> i
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "dtinName", "ennm", "baseName", "bldsttCodeName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -63,6 +73,11 @@ public class SdFbrdBHServiceImpl extends ServiceImpl<SdFbrdBHMapper, SdFbrdBH> i
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdFbrdBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -84,6 +99,14 @@ public class SdFbrdBHServiceImpl extends ServiceImpl<SdFbrdBHMapper, SdFbrdBH> i
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdFbrdBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,24 +1,22 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdFhbtBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdFhbtBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdFhbtBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdFhbtBHServiceImpl extends ServiceImpl<SdFhbtBHMapper, SdFhbtBH> implements ISdFhbtBHService {
|
||||
@ -30,6 +28,13 @@ public class SdFhbtBHServiceImpl extends ServiceImpl<SdFhbtBHMapper, SdFhbtBH> i
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "dtinName", "ennm", "baseName", "bldsttCodeName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -67,6 +72,11 @@ public class SdFhbtBHServiceImpl extends ServiceImpl<SdFhbtBHMapper, SdFhbtBH> i
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdFhbtBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -88,6 +98,14 @@ public class SdFhbtBHServiceImpl extends ServiceImpl<SdFhbtBHMapper, SdFhbtBH> i
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdFhbtBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -36,6 +37,14 @@ public class SdFishDictoryBServiceImpl extends ServiceImpl<SdFishDictoryBMapper,
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
/** SdFishDictoryB 中 @TableField(exist = false) 的字段名 + serialVersionUID */
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of(
|
||||
"typeName", "rareName", "specOriginName", "ptypeName",
|
||||
"habitatName", "situationName", "resourceTypeName", "serialVersionUID"
|
||||
);
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -95,6 +104,14 @@ public class SdFishDictoryBServiceImpl extends ServiceImpl<SdFishDictoryBMapper,
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> patchMap, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, patchMap, source, TABLE_NAME, SdFishDictoryB.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST, "id");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> ids, String source) {
|
||||
@ -116,6 +133,29 @@ public class SdFishDictoryBServiceImpl extends ServiceImpl<SdFishDictoryBMapper,
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsByName(String name) {
|
||||
if (!StringUtils.hasText(name)) {
|
||||
return false;
|
||||
}
|
||||
LambdaQueryWrapper<SdFishDictoryB> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SdFishDictoryB::getName, name);
|
||||
return count(wrapper) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsByNameExcludeId(String name, String excludeId) {
|
||||
if (!StringUtils.hasText(name)) {
|
||||
return false;
|
||||
}
|
||||
LambdaQueryWrapper<SdFishDictoryB> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SdFishDictoryB::getName, name);
|
||||
if (StringUtils.hasText(excludeId)) {
|
||||
wrapper.ne(SdFishDictoryB::getId, excludeId);
|
||||
}
|
||||
return count(wrapper) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdFishDictoryB getById(String id) {
|
||||
LambdaQueryWrapper<SdFishDictoryB> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBH;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdEngInfoBHMapper;
|
||||
@ -14,12 +16,11 @@ import com.yfd.platform.qgc_base.service.ISdFpssBHService;
|
||||
import com.yfd.platform.qgc_data.domain.SysUserDataScope;
|
||||
import com.yfd.platform.qgc_data.mapper.SysUserDataScopeMapper;
|
||||
import com.yfd.platform.system.service.IAdminAuthService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.*;
|
||||
@ -42,6 +43,13 @@ public class SdFpssBHServiceImpl extends ServiceImpl<SdFpssBHMapper, SdFpssBH> i
|
||||
|
||||
@Resource
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "baseName", "dtinName", "ennm", "bldsttCodeName", "isUpName", "isDownName", "mwayName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -213,6 +221,11 @@ public class SdFpssBHServiceImpl extends ServiceImpl<SdFpssBHMapper, SdFpssBH> i
|
||||
|
||||
@Override
|
||||
public boolean add(SdFpssBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -234,6 +247,14 @@ public class SdFpssBHServiceImpl extends ServiceImpl<SdFpssBHMapper, SdFpssBH> i
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdFpssBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String stcd, String sttp) {
|
||||
LambdaQueryWrapper<SdFpssBH> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
@ -1,15 +1,27 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.qgc_base.domain.SdFpssR;
|
||||
import com.yfd.platform.qgc_base.mapper.SdFpssRMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdFpssRService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -19,6 +31,30 @@ import java.util.Date;
|
||||
@Service
|
||||
public class SdFpssRServiceImpl extends ServiceImpl<SdFpssRMapper, SdFpssR> implements ISdFpssRService {
|
||||
|
||||
private static final String TABLE_NAME = "SD_FPSS_R";
|
||||
|
||||
@Resource
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("ftpName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表
|
||||
*/
|
||||
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
||||
|
||||
static {
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("ftp").modifyProperty("ftpName")
|
||||
.dictType("DYNAMIC").dictSource("SD_FISHDICTORY_B").codeColumn("ID").nameColumn("NAME")
|
||||
.filter("NVL(IS_DELETED, 0) = 0 AND NVL(ENABLE, 1) = 1").build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SdFpssR> queryPageList(Page<SdFpssR> page, String stcd, Integer yr, String ftp) {
|
||||
LambdaQueryWrapper<SdFpssR> wrapper = new LambdaQueryWrapper<>();
|
||||
@ -35,7 +71,9 @@ public class SdFpssRServiceImpl extends ServiceImpl<SdFpssRMapper, SdFpssR> impl
|
||||
|
||||
wrapper.eq(SdFpssR::getIsDeleted, 0);
|
||||
wrapper.orderByDesc(SdFpssR::getRecordTime);
|
||||
return page(page, wrapper);
|
||||
Page<SdFpssR> result = page(page, wrapper);
|
||||
dictCodeToNameConverter.convertCodeToName(result, CODE_TO_NAME_META_LIST);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -51,14 +89,50 @@ public class SdFpssRServiceImpl extends ServiceImpl<SdFpssRMapper, SdFpssR> impl
|
||||
return super.updateById(entity);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean removeById(Object id) {
|
||||
// SdFpssR entity = getById(id);
|
||||
// if (entity != null) {
|
||||
// entity.setIsDeleted(1);
|
||||
// entity.setDeleteTime(new Date());
|
||||
// return updateById(entity);
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdFpssR entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new com.yfd.platform.common.exception.BizException("过鱼设施编码不能为空");
|
||||
}
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
msOperationLogService.recordAddDetailLog(entity.getId(), TABLE_NAME, entity, source, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(this, engInfoPatch, source, TABLE_NAME, SdFpssR.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST, "id");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> ids, String source) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
int count = 0;
|
||||
for (String id : ids) {
|
||||
SdFpssR entity = this.getById(id);
|
||||
if (entity == null) {
|
||||
continue;
|
||||
}
|
||||
LambdaUpdateWrapper<SdFpssR> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(SdFpssR::getId, id);
|
||||
wrapper.set(SdFpssR::getIsDeleted, 1);
|
||||
wrapper.set(SdFpssR::getDeleteUser, SecurityUtils.getCurrentUsername());
|
||||
wrapper.set(SdFpssR::getDeleteTime, new Date());
|
||||
if (this.update(wrapper)) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
msOperationLogService.recordDeleteDetailLog(id, TABLE_NAME, entity, source, CODE_TO_NAME_META_LIST);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,153 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssrlAiR;
|
||||
import com.yfd.platform.qgc_base.domain.SdFpssrlRAiRequest;
|
||||
import com.yfd.platform.qgc_base.mapper.SdFpssrlAiRMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdFpssrlAiRService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 过鱼设施AI盒子自动数据表 服务实现类
|
||||
* </p>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SdFpssrlAiRServiceImpl extends ServiceImpl<SdFpssrlAiRMapper, SdFpssrlAiR> implements ISdFpssrlAiRService {
|
||||
|
||||
private static final String TABLE_NAME = "SD_FPSSRL_AI_R";
|
||||
|
||||
@Resource
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("stnm", "ftpName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表
|
||||
*/
|
||||
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
||||
|
||||
static {
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("ftp").modifyProperty("ftpName")
|
||||
.dictType("DYNAMIC").dictSource("SD_FISHDICTORY_B").codeColumn("ID").nameColumn("NAME")
|
||||
.filter("NVL(IS_DELETED, 0) = 0 AND NVL(ENABLE, 1) = 1").build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SdFpssrlAiR> queryPageList(DataSourceRequest request) {
|
||||
return DataSourceRequestUtil.executeQuery(request, SdFpssrlAiR.class, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdFpssrlAiR entity, String source) {
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
msOperationLogService.recordAddDetailLog(entity.getId(), TABLE_NAME, entity, source, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(this, engInfoPatch, source, TABLE_NAME, SdFpssrlAiR.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST, "id");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> ids, String source) {
|
||||
if (ids == null || ids.isEmpty()) return false;
|
||||
int count = 0;
|
||||
for (String id : ids) {
|
||||
SdFpssrlAiR entity = getById(id);
|
||||
LambdaUpdateWrapper<SdFpssrlAiR> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(SdFpssrlAiR::getId, id);
|
||||
wrapper.set(SdFpssrlAiR::getIsDeleted, 1);
|
||||
wrapper.set(SdFpssrlAiR::getDeleteUser, SecurityUtils.getCurrentUsername());
|
||||
wrapper.set(SdFpssrlAiR::getDeleteTime, new Date());
|
||||
if (this.update(wrapper)) {
|
||||
msOperationLogService.recordDeleteDetailLog(id, TABLE_NAME, entity, source);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdFpssrlAiR getById(String id) {
|
||||
LambdaQueryWrapper<SdFpssrlAiR> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SdFpssrlAiR::getId, id)
|
||||
.eq(SdFpssrlAiR::getIsDeleted, 0);
|
||||
return getOne(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<SdFpssrlAiR> processAiReportBatch(List<SdFpssrlRAiRequest> requests) {
|
||||
List<SdFpssrlAiR> entities = new ArrayList<>();
|
||||
Date now = new Date();
|
||||
for (SdFpssrlRAiRequest req : requests) {
|
||||
SdFpssrlAiR entity = new SdFpssrlAiR();
|
||||
entity.setStcd(req.getFwdx());
|
||||
entity.setAiBoxCode(req.getStcd());
|
||||
entity.setTm(req.getTm());
|
||||
entity.setFtp(req.getFtp());
|
||||
entity.setFcnt(req.getFcnt() != null ? req.getFcnt() : 1);
|
||||
entity.setFsz(req.getFsz());
|
||||
entity.setLength(req.getLength());
|
||||
entity.setWidth(req.getWidth());
|
||||
entity.setFishspeed(req.getFishspeed());
|
||||
entity.setDirection(req.getDirection());
|
||||
entity.setFishposition(req.getFishposition());
|
||||
entity.setFirstimgurl(req.getFirstImgUrl());
|
||||
entity.setSecondimgurl(req.getSecondImgUrl());
|
||||
entity.setVideourl(req.getVideoUrl());
|
||||
entity.setTemperature(req.getTemperature());
|
||||
entity.setWaterlevel(req.getWaterlevel());
|
||||
entity.setSpeed(req.getSpeed());
|
||||
entity.setQ(req.getQ());
|
||||
entity.setDox(req.getDox());
|
||||
entity.setTu(req.getTu());
|
||||
entity.setChannelno(StrUtil.isNotBlank(req.getChannelno()) ? req.getChannelno() : "主通道");
|
||||
entity.setFid(req.getFid());
|
||||
entity.setRemark(req.getRemark());
|
||||
entity.setRecordUser("AI_SYSTEM");
|
||||
entity.setRecordTime(now);
|
||||
entity.setModifyUser("AI_SYSTEM");
|
||||
entity.setModifyTime(now);
|
||||
entity.setIsDeleted(0);
|
||||
entities.add(entity);
|
||||
}
|
||||
this.baseMapper.mergeFishRecords(entities);
|
||||
return entities;
|
||||
}
|
||||
}
|
||||
@ -13,7 +13,9 @@ import com.yfd.platform.qgc_base.mapper.SdFpssrlAiRMapper;
|
||||
import com.yfd.platform.qgc_base.mapper.SdFpssrlRMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdFpssrlRService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -23,6 +25,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -40,6 +44,26 @@ public class SdFpssrlRServiceImpl extends ServiceImpl<SdFpssrlRMapper, SdFpssrlR
|
||||
@Resource
|
||||
private SdFpssrlAiRMapper fpssrlAiRMapper;
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("stnm", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表
|
||||
*/
|
||||
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
||||
|
||||
static {
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("ftp").modifyProperty("ftpName")
|
||||
.dictType("DYNAMIC").dictSource("SD_FISHDICTORY_B").codeColumn("ID").nameColumn("NAME")
|
||||
.filter("NVL(IS_DELETED, 0) = 0 AND NVL(ENABLE, 1) = 1").build());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Page<SdFpssrlR> queryPageList(DataSourceRequest request) {
|
||||
return DataSourceRequestUtil.executeQuery(request, SdFpssrlR.class, this);
|
||||
@ -49,21 +73,18 @@ public class SdFpssrlRServiceImpl extends ServiceImpl<SdFpssrlRMapper, SdFpssrlR
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdFpssrlR entity, String source) {
|
||||
boolean result = this.save(entity);
|
||||
// if (result) {
|
||||
// msOperationLogService.recordAddDetailLog(entity.getId(),TABLE_NAME, entity, source);
|
||||
// }
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
msOperationLogService.recordAddDetailLog(entity.getId(), TABLE_NAME, entity, source, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(SdFpssrlR entity, String source) {
|
||||
// SdFpssrlR before = this.getById(entity.getId());
|
||||
boolean result = this.updateById(entity);
|
||||
// if (result && before != null) {
|
||||
// msOperationLogService.recordModifyDetailLog(entity.getId(),TABLE_NAME, before, entity, source);
|
||||
// }
|
||||
return result;
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(this, engInfoPatch, source, TABLE_NAME, SdFpssrlR.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST, "id");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -72,14 +93,14 @@ public class SdFpssrlRServiceImpl extends ServiceImpl<SdFpssrlRMapper, SdFpssrlR
|
||||
if (ids == null || ids.isEmpty()) return false;
|
||||
int count = 0;
|
||||
for (String id : ids) {
|
||||
// SdFpssrlR entity = getById(id);
|
||||
SdFpssrlR entity = getById(id);
|
||||
LambdaUpdateWrapper<SdFpssrlR> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(SdFpssrlR::getId, id);
|
||||
wrapper.set(SdFpssrlR::getIsDeleted, 1);
|
||||
wrapper.set(SdFpssrlR::getDeleteUser, SecurityUtils.getCurrentUsername());
|
||||
wrapper.set(SdFpssrlR::getDeleteTime, new Date());
|
||||
if (this.update(wrapper)) {
|
||||
// msOperationLogService.recordDeleteDetailLog(id,TABLE_NAME, entity, source);
|
||||
msOperationLogService.recordDeleteDetailLog(id,TABLE_NAME, entity, source);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@ -108,9 +129,9 @@ public class SdFpssrlRServiceImpl extends ServiceImpl<SdFpssrlRMapper, SdFpssrlR
|
||||
entity.setFishspeed(request.getFishspeed());
|
||||
entity.setDirection(request.getDirection());
|
||||
entity.setFishposition(request.getFishposition());
|
||||
entity.setFirstImgUrl(request.getFirstImgUrl());
|
||||
entity.setSecondImgUrl(request.getSecondImgUrl());
|
||||
entity.setVideoUrl(request.getVideoUrl());
|
||||
entity.setFirstimgurl(request.getFirstImgUrl());
|
||||
entity.setSecondimgurl(request.getSecondImgUrl());
|
||||
entity.setVideourl(request.getVideoUrl());
|
||||
entity.setTemperature(request.getTemperature());
|
||||
entity.setWaterlevel(request.getWaterlevel());
|
||||
entity.setSpeed(request.getSpeed());
|
||||
@ -150,9 +171,9 @@ public class SdFpssrlRServiceImpl extends ServiceImpl<SdFpssrlRMapper, SdFpssrlR
|
||||
entity.setFishspeed(req.getFishspeed());
|
||||
entity.setDirection(req.getDirection());
|
||||
entity.setFishposition(req.getFishposition());
|
||||
entity.setFirstImgUrl(req.getFirstImgUrl());
|
||||
entity.setSecondImgUrl(req.getSecondImgUrl());
|
||||
entity.setVideoUrl(req.getVideoUrl());
|
||||
entity.setFirstimgurl(req.getFirstImgUrl());
|
||||
entity.setSecondimgurl(req.getSecondImgUrl());
|
||||
entity.setVideourl(req.getVideoUrl());
|
||||
entity.setTemperature(req.getTemperature());
|
||||
entity.setWaterlevel(req.getWaterlevel());
|
||||
entity.setSpeed(req.getSpeed());
|
||||
|
||||
@ -1,24 +1,22 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdOpinfoBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdOpinfoBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdOpinfoBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdOpinfoBHServiceImpl extends ServiceImpl<SdOpinfoBHMapper, SdOpinfoBH> implements ISdOpinfoBHService {
|
||||
@ -30,6 +28,13 @@ public class SdOpinfoBHServiceImpl extends ServiceImpl<SdOpinfoBHMapper, SdOpinf
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("dtinName", "ennm", "baseName", "rvnm", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -67,6 +72,11 @@ public class SdOpinfoBHServiceImpl extends ServiceImpl<SdOpinfoBHMapper, SdOpinf
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdOpinfoBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -88,6 +98,14 @@ public class SdOpinfoBHServiceImpl extends ServiceImpl<SdOpinfoBHMapper, SdOpinf
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdOpinfoBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,21 +1,24 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdOtteBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdOtteBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdOtteBHService;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.StcdUniqueValidator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdOtteBHServiceImpl extends ServiceImpl<SdOtteBHMapper, SdOtteBH> implements ISdOtteBHService {
|
||||
@ -27,6 +30,13 @@ public class SdOtteBHServiceImpl extends ServiceImpl<SdOtteBHMapper, SdOtteBH> i
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "bldsttCodeName", "usflName", "dtinName", "mwayName", "ennm", "baseName", "rvnm", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -66,6 +76,11 @@ public class SdOtteBHServiceImpl extends ServiceImpl<SdOtteBHMapper, SdOtteBH> i
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdOtteBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -87,6 +102,14 @@ public class SdOtteBHServiceImpl extends ServiceImpl<SdOtteBHMapper, SdOtteBH> i
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdOtteBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,21 +1,24 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdOtweBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdOtweBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdOtweBHService;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.StcdUniqueValidator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdOtweBHServiceImpl extends ServiceImpl<SdOtweBHMapper, SdOtweBH> implements ISdOtweBHService {
|
||||
@ -26,6 +29,13 @@ public class SdOtweBHServiceImpl extends ServiceImpl<SdOtweBHMapper, SdOtweBH> i
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "usflName", "dtinName", "ennm", "baseName", "rvnm", "bldsttCodeName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -64,6 +74,11 @@ public class SdOtweBHServiceImpl extends ServiceImpl<SdOtweBHMapper, SdOtweBH> i
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdOtweBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -85,6 +100,14 @@ public class SdOtweBHServiceImpl extends ServiceImpl<SdOtweBHMapper, SdOtweBH> i
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdOtweBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,24 +1,22 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdSonarBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdSonarBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdSonarBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdSonarBHServiceImpl extends ServiceImpl<SdSonarBHMapper, SdSonarBH> implements ISdSonarBHService {
|
||||
@ -29,6 +27,13 @@ public class SdSonarBHServiceImpl extends ServiceImpl<SdSonarBHMapper, SdSonarBH
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "bldsttCodeName", "usflName", "dtinName", "mwayName", "ennm", "baseName", "rvnm", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -69,6 +74,11 @@ public class SdSonarBHServiceImpl extends ServiceImpl<SdSonarBHMapper, SdSonarBH
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdSonarBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -90,6 +100,14 @@ public class SdSonarBHServiceImpl extends ServiceImpl<SdSonarBHMapper, SdSonarBH
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdSonarBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,21 +1,24 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdTeBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdTeBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdTeBHService;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.StcdUniqueValidator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdTeBHServiceImpl extends ServiceImpl<SdTeBHMapper, SdTeBH> implements ISdTeBHService {
|
||||
@ -26,6 +29,13 @@ public class SdTeBHServiceImpl extends ServiceImpl<SdTeBHMapper, SdTeBH> impleme
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "dtinName", "ennm", "baseName", "rvnm", "bldsttCodeName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -64,6 +74,11 @@ public class SdTeBHServiceImpl extends ServiceImpl<SdTeBHMapper, SdTeBH> impleme
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdTeBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -85,6 +100,14 @@ public class SdTeBHServiceImpl extends ServiceImpl<SdTeBHMapper, SdTeBH> impleme
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdTeBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,24 +1,22 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdVaBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdVaBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdVaBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdVaBHServiceImpl extends ServiceImpl<SdVaBHMapper, SdVaBH> implements ISdVaBHService {
|
||||
@ -29,6 +27,13 @@ public class SdVaBHServiceImpl extends ServiceImpl<SdVaBHMapper, SdVaBH> impleme
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "usflName", "dtinName", "ennm", "baseName", "bldsttCodeName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -65,6 +70,11 @@ public class SdVaBHServiceImpl extends ServiceImpl<SdVaBHMapper, SdVaBH> impleme
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdVaBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -86,6 +96,14 @@ public class SdVaBHServiceImpl extends ServiceImpl<SdVaBHMapper, SdVaBH> impleme
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdVaBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -4,20 +4,21 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdVdinfoB;
|
||||
import com.yfd.platform.qgc_base.mapper.SdVdinfoBMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdVdinfoBService;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.StcdUniqueValidator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.checkerframework.checker.units.qual.C;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdVdinfoBServiceImpl extends ServiceImpl<SdVdinfoBMapper, SdVdinfoB> implements ISdVdinfoBService {
|
||||
@ -28,6 +29,13 @@ public class SdVdinfoBServiceImpl extends ServiceImpl<SdVdinfoBMapper, SdVdinfoB
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of("sttpName", "ennm", "rvnm", "addvcdName", "baseName", "bldsttCodeName", "dtinName", "serialVersionUID");
|
||||
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
@ -67,6 +75,11 @@ public class SdVdinfoBServiceImpl extends ServiceImpl<SdVdinfoBMapper, SdVdinfoB
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdVdinfoB entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
String mntp = entity.getMntp();
|
||||
if (StrUtil.isBlank(mntp)) {
|
||||
entity.setMntp("实时视频");
|
||||
@ -91,6 +104,14 @@ public class SdVdinfoBServiceImpl extends ServiceImpl<SdVdinfoBMapper, SdVdinfoB
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdVdinfoB.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,24 +1,22 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdVpBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdVpBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdVpBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdVpBHServiceImpl extends ServiceImpl<SdVpBHMapper, SdVpBH> implements ISdVpBHService {
|
||||
@ -29,7 +27,15 @@ public class SdVpBHServiceImpl extends ServiceImpl<SdVpBHMapper, SdVpBH> impleme
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
/** SdVpBH 中 @TableField(exist = false) 的字段名 + serialVersionUID */
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of(
|
||||
"sttpName", "dtinName", "ennm", "baseName", "bldsttCodeName", "serialVersionUID"
|
||||
);
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
* <p>
|
||||
@ -65,6 +71,11 @@ public class SdVpBHServiceImpl extends ServiceImpl<SdVpBHMapper, SdVpBH> impleme
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdVpBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -85,6 +96,14 @@ public class SdVpBHServiceImpl extends ServiceImpl<SdVpBHMapper, SdVpBH> impleme
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdVpBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdWeBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdWeBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
@ -10,12 +12,12 @@ import com.yfd.platform.qgc_base.service.ISdWeBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.StcdUniqueValidator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdWeBHServiceImpl extends ServiceImpl<SdWeBHMapper, SdWeBH> implements ISdWeBHService {
|
||||
@ -27,7 +29,15 @@ public class SdWeBHServiceImpl extends ServiceImpl<SdWeBHMapper, SdWeBH> impleme
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
/** SdWeBH 中 @TableField(exist = false) 的字段名 + serialVersionUID */
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of(
|
||||
"sttpName", "dtinName", "ennm", "baseName", "rvnm", "bldsttCodeName", "serialVersionUID"
|
||||
);
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
* <p>
|
||||
@ -66,6 +76,11 @@ public class SdWeBHServiceImpl extends ServiceImpl<SdWeBHMapper, SdWeBH> impleme
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdWeBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -87,6 +102,14 @@ public class SdWeBHServiceImpl extends ServiceImpl<SdWeBHMapper, SdWeBH> impleme
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdWeBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,24 +1,22 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdWqBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdWqBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdWqBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdWqBHServiceImpl extends ServiceImpl<SdWqBHMapper, SdWqBH> implements ISdWqBHService {
|
||||
@ -30,7 +28,16 @@ public class SdWqBHServiceImpl extends ServiceImpl<SdWqBHMapper, SdWqBH> impleme
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
/** SdWqBH 中 @TableField(exist = false) 的字段名 + serialVersionUID */
|
||||
private static final Set<String> TRANSIENT_FIELDS = Set.of(
|
||||
"sttpName", "wwqtgName", "bldsttCodeName", "dtinName",
|
||||
"dtinTypeName", "mwayName", "ennm", "baseName", "serialVersionUID"
|
||||
);
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
* <p>
|
||||
@ -68,6 +75,11 @@ public class SdWqBHServiceImpl extends ServiceImpl<SdWqBHMapper, SdWqBH> impleme
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdWqBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -88,6 +100,14 @@ public class SdWqBHServiceImpl extends ServiceImpl<SdWqBHMapper, SdWqBH> impleme
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdWqBH.class,
|
||||
TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -1,25 +1,22 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.DataSourceRequest;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_base.domain.SdWtBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdWtBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdWtBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import com.yfd.platform.utils.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class SdWtBHServiceImpl extends ServiceImpl<SdWtBHMapper, SdWtBH> implements ISdWtBHService {
|
||||
@ -32,7 +29,16 @@ public class SdWtBHServiceImpl extends ServiceImpl<SdWtBHMapper, SdWtBH> impleme
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
@Resource
|
||||
private StcdUniqueValidator stcdUniqueValidator;
|
||||
@Resource
|
||||
private PatchUpdateHelper patchUpdateHelper;
|
||||
|
||||
/** SdWtBH 中 @TableField(exist = false) 的字段名 + serialVersionUID */
|
||||
private static final Set<String> WT_TRANSIENT_FIELDS = Set.of(
|
||||
"sttpName", "bldsttCodeName", "dtinName", "dtinTypeName",
|
||||
"mwayName", "ennm", "baseName", "serialVersionUID"
|
||||
);
|
||||
/**
|
||||
* 代码转名称元数据配置列表(静态初始化)
|
||||
* <p>
|
||||
@ -70,6 +76,11 @@ public class SdWtBHServiceImpl extends ServiceImpl<SdWtBHMapper, SdWtBH> impleme
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdWtBH entity, String source) {
|
||||
if (entity == null || StrUtil.isBlank(entity.getStcd())) {
|
||||
throw new BizException("站点编码不能为空");
|
||||
}
|
||||
// 检查 STCD 在 V_MS_STBPRP_T 视图中是否已存在
|
||||
stcdUniqueValidator.throwIfExists(entity.getStcd());
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
dictCodeToNameConverter.convertCodeToName(entity, CODE_TO_NAME_META_LIST);
|
||||
@ -91,6 +102,14 @@ public class SdWtBHServiceImpl extends ServiceImpl<SdWtBHMapper, SdWtBH> impleme
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(Map<String, Object> engInfoPatch, String source) throws Exception {
|
||||
return patchUpdateHelper.execute(
|
||||
this, engInfoPatch, source, TABLE_NAME, SdWtBH.class,
|
||||
WT_TRANSIENT_FIELDS, CODE_TO_NAME_META_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
|
||||
@ -112,8 +112,9 @@ public class FishDraftDataController {
|
||||
|
||||
@PostMapping("/statistics")
|
||||
@Operation(summary = "过鱼到数统计(按用户月度汇总,支持流域/电站多选过滤)")
|
||||
public ResponseResult statistics(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
Page<FishStatisticsVO> result = fishStatisticsService.queryPage(dataSourceRequest);
|
||||
public ResponseResult statistics(@RequestBody DataSourceRequest dataSourceRequest,
|
||||
@RequestHeader(value = "Tenant_id", required = false) String tenantId) {
|
||||
Page<FishStatisticsVO> result = fishStatisticsService.queryPage(dataSourceRequest, tenantId);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@ -1227,8 +1228,9 @@ public class FishDraftDataController {
|
||||
if (data.getDirection() == null || data.getDirection().isEmpty()) {
|
||||
addWarning(warnings, "direction");
|
||||
} else {
|
||||
String direction = fishImportService.resolveDirection(data.getDirection().trim(), importRow);
|
||||
if (direction == null) {
|
||||
String direction = fishImportService.resolveDirection(data.getStnm(),data.getDirection().trim(), importRow);
|
||||
if (direction == null||importRow.getWarnings().contains("direction")) {
|
||||
data.setDirection(direction);
|
||||
addWarning(warnings, "direction");
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,10 +10,12 @@ public interface FishStatisticsMapper {
|
||||
List<FishStatisticsVO> queryStatistics(@Param("basinCode") String basinCode,
|
||||
@Param("stationCode") String stationCode,
|
||||
@Param("reportMonth") String reportMonth,
|
||||
@Param("tenantId") String tenantId,
|
||||
@Param("startRow") int startRow,
|
||||
@Param("endRow") int endRow);
|
||||
|
||||
int countStatistics(@Param("basinCode") String basinCode,
|
||||
@Param("stationCode") String stationCode,
|
||||
@Param("reportMonth") String reportMonth);
|
||||
@Param("reportMonth") String reportMonth,
|
||||
@Param("tenantId") String tenantId);
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ public interface IFishImportService {
|
||||
String resolveBaseCode(String code,String baseName);
|
||||
String resolveRiverCode(String code,String riverName);
|
||||
String resolveHbrvcdCode(String code,String riverName);
|
||||
String resolveDirection(String direction, FishImportResult.FishImportRow importRow);
|
||||
String resolveDirection(String stnm,String direction, FishImportResult.FishImportRow importRow);
|
||||
|
||||
String resolveIsfs(String value, FishImportResult.FishImportRow importRow);
|
||||
|
||||
|
||||
@ -6,5 +6,5 @@ import com.yfd.platform.qgc_data.domain.vo.FishStatisticsVO;
|
||||
|
||||
public interface IFishStatisticsService {
|
||||
|
||||
Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest);
|
||||
Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest, String tenantId);
|
||||
}
|
||||
@ -342,12 +342,16 @@ public class FishImportServiceImpl implements IFishImportService {
|
||||
FishImportResult.FishImportRow importRow = new FishImportResult.FishImportRow(rowIndex);
|
||||
FishDraftData data = new FishDraftData();
|
||||
data.setId(UUID.randomUUID().toString());
|
||||
|
||||
String stnm=null;
|
||||
for (Map.Entry<Integer, String> entry : columnIndexMap.entrySet()) {
|
||||
Integer columnIndex = entry.getKey();
|
||||
String fieldName = entry.getValue();
|
||||
Cell cell = row.getCell(columnIndex);
|
||||
String cellValue = getCellStringValue(cell);
|
||||
|
||||
if("stnm".equals(fieldName)){
|
||||
stnm=cellValue;
|
||||
}
|
||||
try {
|
||||
switch (fieldName) {
|
||||
case "stationName":
|
||||
@ -509,7 +513,7 @@ public class FishImportServiceImpl implements IFishImportService {
|
||||
importRow.getWarnings().add(fieldName);
|
||||
data.setDirection(cellValue.trim());
|
||||
} else {
|
||||
String direction = resolveDirection(cellValue.trim(), importRow);
|
||||
String direction = resolveDirection(stnm,cellValue.trim(), importRow);
|
||||
data.setDirection(direction);
|
||||
}
|
||||
break;
|
||||
@ -1372,25 +1376,109 @@ public class FishImportServiceImpl implements IFishImportService {
|
||||
return facilityName;
|
||||
}
|
||||
|
||||
public String resolveDirection(String direction, FishImportResult.FishImportRow importRow) {
|
||||
|
||||
public String resolveDirection(String stnm, String direction, FishImportResult.FishImportRow importRow) {
|
||||
if (direction == null) {
|
||||
return null;
|
||||
}
|
||||
String lowerName = direction.toLowerCase().trim();
|
||||
|
||||
if (lowerName.contains("上行") && lowerName.contains("折返")) {
|
||||
// 独立判断四种方向类型(按优先级从高到低)
|
||||
boolean isUpReturn = lowerName.contains("上行") && lowerName.contains("折返");
|
||||
boolean isDownReturn = lowerName.contains("下行") && lowerName.contains("折返");
|
||||
boolean isUp = lowerName.contains("上行") && !isUpReturn; // 排除上行折返
|
||||
boolean isDown = lowerName.contains("下行") && !isDownReturn; // 排除下行折返
|
||||
|
||||
|
||||
// 判断 direction 是否为字典编码
|
||||
boolean isDictCode = "0".equals(direction) || "1".equals(direction) ||
|
||||
"2".equals(direction) || "3".equals(direction);
|
||||
if (importRow.getWarnings().contains("stcd")) {
|
||||
importRow.getWarnings().add("direction");
|
||||
// 如果是字典编码,返回对应的中文;否则返回原始数据
|
||||
return isDictCode ? getDirectionChinese(direction) : direction;
|
||||
}
|
||||
// 如果 direction 本身是字典编码(0/1/2/3),直接识别
|
||||
if ("0".equals(direction)) {
|
||||
isUp = true;
|
||||
isUpReturn = false;
|
||||
} else if ("1".equals(direction)) {
|
||||
isDown = true;
|
||||
isDownReturn = false;
|
||||
} else if ("2".equals(direction)) {
|
||||
isUpReturn = true;
|
||||
isUp = false;
|
||||
} else if ("3".equals(direction)) {
|
||||
isDownReturn = true;
|
||||
isDown = false;
|
||||
}
|
||||
|
||||
// 根据设施名称校验方向(仅当 stnm 不为 null 时)
|
||||
if (StrUtil.isNotBlank(stnm)) {
|
||||
String facilityName = stnm.toLowerCase().trim();
|
||||
// 设施名称包含"上行"时,只允许上行或上行折返
|
||||
if (facilityName.contains("上行") && !isUp && !isUpReturn) {
|
||||
importRow.getWarnings().add("direction");
|
||||
// 如果是字典编码,返回对应的中文;否则返回原始数据
|
||||
return isDictCode ? getDirectionChinese(direction) : direction;
|
||||
}
|
||||
// 设施名称包含"下行"时,只允许下行或下行折返
|
||||
if (facilityName.contains("下行") && !isDown && !isDownReturn) {
|
||||
importRow.getWarnings().add("direction");
|
||||
// 如果是字典编码,返回对应的中文;否则返回原始数据
|
||||
return isDictCode ? getDirectionChinese(direction) : direction;
|
||||
}
|
||||
}
|
||||
|
||||
// 返回对应的字典编码
|
||||
if (isUpReturn) {
|
||||
return "2";
|
||||
} else if (lowerName.contains("下行") && lowerName.contains("折返")) {
|
||||
} else if (isDownReturn) {
|
||||
return "3";
|
||||
} else if (lowerName.contains("上行")) {
|
||||
} else if (isUp) {
|
||||
return "0";
|
||||
} else if (lowerName.contains("下行")) {
|
||||
} else if (isDown) {
|
||||
return "1";
|
||||
}
|
||||
|
||||
// 未匹配任何方向
|
||||
importRow.getWarnings().add("direction");
|
||||
return direction;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典编码返回对应的中文描述
|
||||
*/
|
||||
private String getDirectionChinese(String dictCode) {
|
||||
if ("0".equals(dictCode)) {
|
||||
return "上行";
|
||||
} else if ("1".equals(dictCode)) {
|
||||
return "下行";
|
||||
} else if ("2".equals(dictCode)) {
|
||||
return "上行折返";
|
||||
} else if ("3".equals(dictCode)) {
|
||||
return "下行折返";
|
||||
}
|
||||
return dictCode;
|
||||
}
|
||||
// public String resolveDirection(String stnm,String direction, FishImportResult.FishImportRow importRow) {
|
||||
// if (direction == null) {
|
||||
// return null;
|
||||
// }
|
||||
// String lowerName = direction.toLowerCase().trim();
|
||||
// if (lowerName.contains("上行") && lowerName.contains("折返")) {
|
||||
// return "2";
|
||||
// } else if (lowerName.contains("下行") && lowerName.contains("折返")) {
|
||||
// return "3";
|
||||
// } else if (lowerName.contains("上行")) {
|
||||
// return "0";
|
||||
// } else if (lowerName.contains("下行")) {
|
||||
// return "1";
|
||||
// }
|
||||
// importRow.getWarnings().add("direction");
|
||||
// return direction;
|
||||
// }
|
||||
|
||||
public String resolveIsfs(String value, FishImportResult.FishImportRow importRow) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
|
||||
@ -26,7 +26,7 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
|
||||
private FishStatisticsMapper fishStatisticsMapper;
|
||||
|
||||
@Override
|
||||
public Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest) {
|
||||
public Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest, String tenantId) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
|
||||
String basinNamesStr = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "basinCode");
|
||||
@ -53,9 +53,9 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
|
||||
int endRow = startRow + pageSize;
|
||||
|
||||
List<FishStatisticsVO> records = fishStatisticsMapper.queryStatistics(
|
||||
basinNamesStr, stationNamesStr, reportMonth, startRow, endRow);
|
||||
basinNamesStr, stationNamesStr, reportMonth, tenantId, startRow, endRow);
|
||||
|
||||
int total = fishStatisticsMapper.countStatistics(basinNamesStr, stationNamesStr, reportMonth);
|
||||
int total = fishStatisticsMapper.countStatistics(basinNamesStr, stationNamesStr, reportMonth, tenantId);
|
||||
|
||||
Page<FishStatisticsVO> page = new Page<>();
|
||||
page.setRecords(records);
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.yfd.platform.qgc_eng.eq.controller;
|
||||
|
||||
import com.yfd.platform.annotation.Log;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqBaseMsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqBaseVmsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDrtpDataVo;
|
||||
@ -14,6 +16,7 @@ import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqMsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqRuleVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqVmsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqRateCountVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EqOperateRequest;
|
||||
import com.yfd.platform.qgc_eng.eq.service.EngEqDataService;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.QgcQecStaticVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.StcdInfoVo;
|
||||
@ -187,4 +190,29 @@ public class EngEqDataController {
|
||||
public ResponseResult getEqdsKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(engEqDataService.getEqdsKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/GetKendoListCust")
|
||||
@Operation(summary = "电站业务结果数据查询(MS_ENG_T + V_MS_STBPRP_T)")
|
||||
public ResponseResult getMsEngKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(engEqDataService.getMsEngKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@Log(module = "生态流量监测数据管理", value = "删除生态流量小时/日/月数据")
|
||||
@PostMapping("/data/removeKendoByIds")
|
||||
@Operation(summary = "删除生态流量小时/日/月数据")
|
||||
public ResponseResult removeKendoByIds(@RequestBody BatchDeleteAo batchDeleteAo) {
|
||||
engEqDataService.removeKendoByIds(batchDeleteAo);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@Log(module = "生态流量监测数据管理", value = "修改生态流量小时数据")
|
||||
@PostMapping("/data/updateEqRsData")
|
||||
@Operation(summary = "修改生态流量小时数据")
|
||||
public ResponseResult updateEqRsData(@RequestBody EqOperateRequest eqOperateRequest) {
|
||||
engEqDataService.updateQecRsData(
|
||||
eqOperateRequest == null ? null : eqOperateRequest.getUpdateData(),
|
||||
eqOperateRequest == null ? null : eqOperateRequest.getSource()
|
||||
);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
package com.yfd.platform.qgc_eng.eq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 生态流量数据操作请求
|
||||
* <p>updateData: 修改数据,其中 stcd/tm 为定位条件,其余 key 对应小时表可修改字段</p>
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "生态流量数据操作请求")
|
||||
public class EqOperateRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "修改数据")
|
||||
private Map<String, Object> updateData;
|
||||
}
|
||||
@ -2,26 +2,8 @@ package com.yfd.platform.qgc_eng.eq.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqBaseMsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqBaseVmsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayDataVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDrtpDataVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayIntervalVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqdsVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqHourIntervalVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqIntervalVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitQueryVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqMsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqRuleVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngQecAlongVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqRateCountVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqVmsstbprptVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.QgcQecStaticVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.SdEqMonitorCountVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.StBaseInfo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.StcdInfoVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.WbsbVo;
|
||||
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -89,4 +71,27 @@ public interface EngEqDataService {
|
||||
StcdInfoVo getStInfoByStcd(String stcd);
|
||||
|
||||
DataSourceResult<EngEqdsVo> getEqdsKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
/**
|
||||
* 查询 MS_ENG_T 电站业务结果数据(支持动态过滤、排序、分组)
|
||||
* <p>对应旧系统 EngEqController.getKendoListCust</p>
|
||||
*/
|
||||
DataSourceResult<EngEqDataVo> getMsEngKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
/**
|
||||
* 批量删除生态流量小时/日/月数据
|
||||
* <p>删除小时数据后会按受影响站点重新聚合日表(SD_QECDAY_S)和月表(SD_QECDRTP_S)</p>
|
||||
*
|
||||
* @param batchDeleteAo dataType: TIME=小时 DATE=日 MON=月;dataList: 删除数据列表
|
||||
*/
|
||||
boolean removeKendoByIds(BatchDeleteAo batchDeleteAo);
|
||||
|
||||
/**
|
||||
* 修改生态流量小时数据
|
||||
* <p>修改后会按受影响站点重新聚合日表(SD_QECDAY_S)和月表(SD_QECDRTP_S)</p>
|
||||
*
|
||||
* @param updateData 修改数据,stcd/tm 为定位条件,其余 key 对应小时表可修改字段
|
||||
* @param source 数据来源
|
||||
*/
|
||||
boolean updateQecRsData(Map<String, Object> updateData, String source);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,11 @@
|
||||
package com.yfd.platform.qgc_env.fb.controller;
|
||||
|
||||
import com.yfd.platform.annotation.Log;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.BreedStageVO;
|
||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbFishRunQgcDeleteParam;
|
||||
import com.yfd.platform.qgc_env.fb.service.FbStationService;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -212,6 +214,14 @@ public class FbStationController {
|
||||
return ResponseResult.successData(fbStationService.getFishRunQgcKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@Log(module = "鱼类增殖站模块", value = "删除全过程鱼类放鱼数据")
|
||||
@PostMapping("/fishrun/qgc/removeFishRunQgcData")
|
||||
@Operation(summary = "删除全过程鱼类放鱼数据(按站点+年份+鱼种)")
|
||||
public ResponseResult removeFishRunQgcData(@RequestBody List<FbFishRunQgcDeleteParam> params) {
|
||||
fbStationService.removeFishRunQgcData(params);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/fishType/GetKendoListCust")
|
||||
@Operation(summary = "增殖站鱼种完成情况统计")
|
||||
public ResponseResult getFishTypeKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user