From e64f7a0de56012a5bf91a1a483d926d3ba922367 Mon Sep 17 00:00:00 2001 From: xjm Date: Thu, 14 Sep 2023 10:47:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=87=E5=BC=82=E5=80=BC=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 7 ++++-- .../com/whdc/config/Knife4jConfiguration.java | 4 ++-- .../com/whdc/controller/ERuleController.java | 16 ++++++++++++++ .../controller/EStationRulesController.java | 18 +++++++-------- src/main/resources/application.yml | 22 +++++++++++-------- 5 files changed, 45 insertions(+), 22 deletions(-) diff --git a/README.MD b/README.MD index d3482bd..b418249 100644 --- a/README.MD +++ b/README.MD @@ -1,4 +1,4 @@ -# 清洗规则api +# 奇异值管理api ## 目录 ``` @@ -40,4 +40,7 @@ resources |_application-dev.yml 开发环境配置文件 |_application-test.yml 测试环境配置文件 |_application-prod.yml 生产环境配置文件 -``` \ No newline at end of file +``` + +服务 +10.10.2.75 yKRs4w7q9M \ No newline at end of file diff --git a/src/main/java/com/whdc/config/Knife4jConfiguration.java b/src/main/java/com/whdc/config/Knife4jConfiguration.java index 4c49ed6..28f71d4 100644 --- a/src/main/java/com/whdc/config/Knife4jConfiguration.java +++ b/src/main/java/com/whdc/config/Knife4jConfiguration.java @@ -30,8 +30,8 @@ public class Knife4jConfiguration { private ApiInfo getApiInfoBuilder() { return new ApiInfoBuilder() - .title("山洪接收中心数据清洗api") - .description("# 山洪接收中心数据清洗api RESTful APIs") + .title("奇异值管理api") + .description("# 奇异值管理api RESTful APIs") .termsOfServiceUrl("http://219.138.108.99:19000/jszx") .contact(new Contact("湖北纬皓端成", null, null)) .version("1.0") diff --git a/src/main/java/com/whdc/controller/ERuleController.java b/src/main/java/com/whdc/controller/ERuleController.java index b66889b..b82749a 100644 --- a/src/main/java/com/whdc/controller/ERuleController.java +++ b/src/main/java/com/whdc/controller/ERuleController.java @@ -4,12 +4,15 @@ package com.whdc.controller; import com.whdc.model.bean.ItemType; import com.whdc.model.dto.FindRuleDto; import com.whdc.model.entity.ERule; +import com.whdc.model.entity.EStationRules; import com.whdc.model.group.Insert; import com.whdc.model.group.Update; import com.whdc.service.IERuleService; +import com.whdc.service.IEStationRulesService; import com.whdc.utils.ResultJson; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -22,6 +25,7 @@ import java.util.Objects; * @author xusan * @since 2023-03-19 */ +@Slf4j @Api(tags = "规则管理 - Controller") @RestController @RequestMapping("/v2/eRule") @@ -30,6 +34,9 @@ public class ERuleController { @Autowired private IERuleService ieRuleService; + @Autowired + private IEStationRulesService ieStationRulesService; + @ApiOperation(value = "查询所有") @PostMapping(value = "list") @@ -104,6 +111,15 @@ public class ERuleController { } + if (!ieStationRulesService.lambdaUpdate() + .set(EStationRules::getDel,"0") + .eq(EStationRules::getRuleId,id) + .update()) { + + log.info("规则关联删除失败"); + + } + return ResultJson.ok(ieRuleService.removeById(id)); } diff --git a/src/main/java/com/whdc/controller/EStationRulesController.java b/src/main/java/com/whdc/controller/EStationRulesController.java index 2036800..c365616 100644 --- a/src/main/java/com/whdc/controller/EStationRulesController.java +++ b/src/main/java/com/whdc/controller/EStationRulesController.java @@ -80,15 +80,15 @@ public class EStationRulesController { return ResultJson.error("当前规则不存在"); } - if (CollectionUtils.isNotEmpty( - ieStationRulesService.lambdaQuery() - .eq(EStationRules::getStcd,eStationRules.getStcd()) - .eq(EStationRules::getRuleId,eStationRules.getRuleId()) - .ne(EStationRules::getId,eStationRules.getId()) - .list() - )){ - return ResultJson.error("当前规则和测站已绑定"); - } +// if (CollectionUtils.isNotEmpty( +// ieStationRulesService.lambdaQuery() +// .eq(EStationRules::getStcd,eStationRules.getStcd()) +// .eq(EStationRules::getRuleId,eStationRules.getRuleId()) +// .ne(EStationRules::getId,eStationRules.getId()) +// .list() +// )){ +// return ResultJson.error("当前规则和测站已绑定"); +// } return ResultJson.ok(ieStationRulesService.updateById(eStationRules)); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 66f1aa3..b0e47e6 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -6,12 +6,12 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: dm.jdbc.driver.DmDriver -# url: jdbc:dm://127.0.0.1:5236?schema=SYSDBA -# username: SYSDBA -# password: 199999999 - url: jdbc:dm://10.42.6.142:5236?schema=SHZH - username: SHZH - password: Shzh_890 + url: jdbc:dm://127.0.0.1:5236?schema=SYSDBA + username: SYSDBA + password: 199999999 +# url: jdbc:dm://10.42.6.142:5236?schema=SHZH +# username: SHZH +# password: Shzh_890 druid: initialSize: 5 minIdle: 5 @@ -35,16 +35,20 @@ spring: # Redis redis: database: 5 - host: 10.42.6.75 +# host: 10.42.6.75 + host: 127.0.0.1 port: 6379 - password: Whdc_890 + password: +# password: Whdc_890 # 数据清洗专用redis redisRules: database: 6 - host: 10.42.6.75 +# host: 10.42.6.75 + host: 127.0.0.1 port: 6379 password: Whdc_890 +# password: timeout: 60000 lettuce: pool: