From 5ac56c82c48200f5bfd82917d04279ff502a906f Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期四, 20 三月 2025 15:06:20 +0800
Subject: [PATCH] 高级安全防护

---
 src/main/resources/mapper_xml/ConfigSecurityMapperEx.xml                             |   23 +++++++++++
 src/main/java/com/jsh/erp/service/configSecurity/ConfigSecurityService.java          |    2 +
 src/main/java/com/jsh/erp/dto/ConfigSecurityQuery.java                               |    2 
 src/main/java/com/jsh/erp/datasource/mappers/ConfigSecurityMapperEx.java             |   10 +++++
 src/main/java/com/jsh/erp/controller/ConfigSecurityController.java                   |   24 ++++++++++-
 src/main/java/com/jsh/erp/datasource/entities/ConfigSecurityExample.java             |   20 +++++-----
 src/main/java/com/jsh/erp/service/configSecurity/impl/ConfigSecurityServiceImpl.java |   15 +++++++
 src/main/java/com/jsh/erp/filter/LogCostFilter.java                                  |    3 +
 8 files changed, 83 insertions(+), 16 deletions(-)

diff --git a/src/main/java/com/jsh/erp/controller/ConfigSecurityController.java b/src/main/java/com/jsh/erp/controller/ConfigSecurityController.java
index f50d4e5..bf4ff77 100644
--- a/src/main/java/com/jsh/erp/controller/ConfigSecurityController.java
+++ b/src/main/java/com/jsh/erp/controller/ConfigSecurityController.java
@@ -1,9 +1,7 @@
 package com.jsh.erp.controller;
 
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageInfo;
-import com.jsh.erp.datasource.entities.SysDict;
 import com.jsh.erp.dto.ConfigSecurityCreateOrUpdate;
 import com.jsh.erp.dto.ConfigSecurityQuery;
 import com.jsh.erp.datasource.entities.ConfigSecurity;
@@ -79,7 +77,7 @@
 
     @GetMapping(value = "/list")
     @ApiOperation(value = "高级安全防护列表")
-    public BaseResponseInfo findAccountInOutList(ConfigSecurityQuery configSecurityQuery,
+    public BaseResponseInfo getPageList(ConfigSecurityQuery configSecurityQuery,
                                                  HttpServletRequest request) throws Exception{
         BaseResponseInfo res = new BaseResponseInfo();
         Map<String, Object> map = new HashMap<String, Object>();
@@ -101,6 +99,26 @@
         return res;
     }
 
+    @GetMapping(value = "/enable-list-all")
+    @ApiOperation(value = "高级安全防护列表")
+    public BaseResponseInfo getEnabledListAll() throws Exception{
+        BaseResponseInfo res = new BaseResponseInfo();
+        Map<String, Object> map = new HashMap<String, Object>();
+        try {
+            List<ConfigSecurity> list =configSecurityService.getEnabledListAll();
+            map.put("data",list);
+            res.code = 200;
+            res.data = list;
+            res.msg="查询成功";
+        } catch(Exception e){
+            logger.error(e.getMessage(), e);
+            res.code = 500;
+            res.data = null;
+            res.msg="查询失败";
+        }
+        return res;
+    }
+
 
     @PostMapping
     public BaseResponseInfo add(@RequestBody @Valid ConfigSecurityCreateOrUpdate configSecurityCreateOrUpdate) {
diff --git a/src/main/java/com/jsh/erp/datasource/entities/ConfigSecurityExample.java b/src/main/java/com/jsh/erp/datasource/entities/ConfigSecurityExample.java
index 3f74d6b..a14492c 100644
--- a/src/main/java/com/jsh/erp/datasource/entities/ConfigSecurityExample.java
+++ b/src/main/java/com/jsh/erp/datasource/entities/ConfigSecurityExample.java
@@ -445,52 +445,52 @@
             return (Criteria) this;
         }
 
-        public Criteria andStatusEqualTo(Boolean value) {
+        public Criteria andStatusEqualTo(Integer value) {
             addCriterion("status =", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusNotEqualTo(Boolean value) {
+        public Criteria andStatusNotEqualTo(Integer value) {
             addCriterion("status <>", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusGreaterThan(Boolean value) {
+        public Criteria andStatusGreaterThan(Integer value) {
             addCriterion("status >", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusGreaterThanOrEqualTo(Boolean value) {
+        public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
             addCriterion("status >=", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusLessThan(Boolean value) {
+        public Criteria andStatusLessThan(Integer value) {
             addCriterion("status <", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusLessThanOrEqualTo(Boolean value) {
+        public Criteria andStatusLessThanOrEqualTo(Integer value) {
             addCriterion("status <=", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusIn(List<Boolean> values) {
+        public Criteria andStatusIn(List<Integer> values) {
             addCriterion("status in", values, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusNotIn(List<Boolean> values) {
+        public Criteria andStatusNotIn(List<Integer> values) {
             addCriterion("status not in", values, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusBetween(Boolean value1, Boolean value2) {
+        public Criteria andStatusBetween(Integer value1, Integer value2) {
             addCriterion("status between", value1, value2, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusNotBetween(Boolean value1, Boolean value2) {
+        public Criteria andStatusNotBetween(Integer value1, Integer value2) {
             addCriterion("status not between", value1, value2, "status");
             return (Criteria) this;
         }
diff --git a/src/main/java/com/jsh/erp/datasource/mappers/ConfigSecurityMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/ConfigSecurityMapperEx.java
new file mode 100644
index 0000000..8668e57
--- /dev/null
+++ b/src/main/java/com/jsh/erp/datasource/mappers/ConfigSecurityMapperEx.java
@@ -0,0 +1,10 @@
+package com.jsh.erp.datasource.mappers;
+
+import com.jsh.erp.datasource.entities.ConfigSecurity;
+
+import java.util.List;
+
+public interface ConfigSecurityMapperEx {
+
+    List<ConfigSecurity> getEnabledListAll();
+}
\ No newline at end of file
diff --git a/src/main/java/com/jsh/erp/dto/ConfigSecurityQuery.java b/src/main/java/com/jsh/erp/dto/ConfigSecurityQuery.java
index b41cc50..ab9b9c2 100644
--- a/src/main/java/com/jsh/erp/dto/ConfigSecurityQuery.java
+++ b/src/main/java/com/jsh/erp/dto/ConfigSecurityQuery.java
@@ -18,7 +18,7 @@
 
     private Integer sortOrder;
 
-    private Boolean status;
+    private Integer status;
 
     private Boolean deleteFlag;
 }
diff --git a/src/main/java/com/jsh/erp/filter/LogCostFilter.java b/src/main/java/com/jsh/erp/filter/LogCostFilter.java
index feaefe9..ae7a4a7 100644
--- a/src/main/java/com/jsh/erp/filter/LogCostFilter.java
+++ b/src/main/java/com/jsh/erp/filter/LogCostFilter.java
@@ -93,7 +93,8 @@
                         requestUrl.contains("/cloudContent/list")  ||         // 允许未登录访问的API
                         requestUrl.contains("/sysDict/getByDictCodeAndItemText")  || //允许查询字典值API
                         requestUrl.contains("/sms/send-code")  || //
-                        requestUrl.contains("/sms/login")  //
+                        requestUrl.contains("/sms/login")||  //
+                        requestUrl.contains("/config-security/enable-list-all")  //
         );
     }
 
diff --git a/src/main/java/com/jsh/erp/service/configSecurity/ConfigSecurityService.java b/src/main/java/com/jsh/erp/service/configSecurity/ConfigSecurityService.java
index cecc4d4..121bc7b 100644
--- a/src/main/java/com/jsh/erp/service/configSecurity/ConfigSecurityService.java
+++ b/src/main/java/com/jsh/erp/service/configSecurity/ConfigSecurityService.java
@@ -24,4 +24,6 @@
     int batchSetStatus(Integer status, String ids) throws Exception;
 
     PageInfo<ConfigSecurity> findPageInfo(ConfigSecurityQuery configSecurityQuery);
+
+    List<ConfigSecurity> getEnabledListAll();
 }
diff --git a/src/main/java/com/jsh/erp/service/configSecurity/impl/ConfigSecurityServiceImpl.java b/src/main/java/com/jsh/erp/service/configSecurity/impl/ConfigSecurityServiceImpl.java
index 7497e33..13b98bb 100644
--- a/src/main/java/com/jsh/erp/service/configSecurity/impl/ConfigSecurityServiceImpl.java
+++ b/src/main/java/com/jsh/erp/service/configSecurity/impl/ConfigSecurityServiceImpl.java
@@ -7,6 +7,7 @@
 import com.jsh.erp.datasource.entities.ConfigSecurity;
 import com.jsh.erp.datasource.entities.ConfigSecurityExample;
 import com.jsh.erp.datasource.mappers.ConfigSecurityMapper;
+import com.jsh.erp.datasource.mappers.ConfigSecurityMapperEx;
 import com.jsh.erp.dto.ConfigSecurityQuery;
 import com.jsh.erp.exception.JshException;
 import com.jsh.erp.service.account.AccountService;
@@ -17,11 +18,11 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
 
 import javax.annotation.Resource;
-import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
 
@@ -32,6 +33,9 @@
 
     @Resource
     private ConfigSecurityMapper configSecurityMapper;
+
+    @Resource
+    private ConfigSecurityMapperEx configSecurityMapperEx;
 
     @Resource
     private LogService logService;
@@ -168,6 +172,9 @@
         if (StringUtils.isNotEmpty(configSecurityQuery.getType())) {
             criteria.andTypeEqualTo(configSecurityQuery.getType());
         }
+        if (!ObjectUtils.isEmpty(configSecurityQuery.getStatus())) {
+            criteria.andStatusEqualTo(configSecurityQuery.getStatus());
+        }
 
         example.setOrderByClause(" create_time desc ");
 
@@ -177,5 +184,11 @@
 
     }
 
+    @Override
+    public List<ConfigSecurity> getEnabledListAll() {
+
+        return configSecurityMapperEx.getEnabledListAll();
+    }
+
 
 }
diff --git a/src/main/resources/mapper_xml/ConfigSecurityMapperEx.xml b/src/main/resources/mapper_xml/ConfigSecurityMapperEx.xml
new file mode 100644
index 0000000..338eeb3
--- /dev/null
+++ b/src/main/resources/mapper_xml/ConfigSecurityMapperEx.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jsh.erp.datasource.mappers.ConfigSecurityMapperEx">
+  <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.ConfigSecurity">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="keyword" jdbcType="VARCHAR" property="keyword" />
+    <result column="type" jdbcType="VARCHAR" property="type" />
+    <result column="description" jdbcType="VARCHAR" property="description" />
+    <result column="sort_order" jdbcType="INTEGER" property="sortOrder" />
+    <result column="status" jdbcType="BIT" property="status" />
+    <result column="delete_flag" jdbcType="BIT" property="deleteFlag" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="creator" jdbcType="BIGINT" property="creator" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="updater" jdbcType="BIGINT" property="updater" />
+    <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
+  </resultMap>
+  <select id="getEnabledListAll" resultType="com.jsh.erp.datasource.entities.ConfigSecurity">
+        select * from config_security where delete_flag = 0 and status=1
+  </select>
+
+
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.3