tj
2025-03-20 5ac56c82c48200f5bfd82917d04279ff502a906f
高级安全防护
已修改6个文件
已添加2个文件
99 ■■■■ 文件已修改
src/main/java/com/jsh/erp/controller/ConfigSecurityController.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/jsh/erp/datasource/entities/ConfigSecurityExample.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/jsh/erp/datasource/mappers/ConfigSecurityMapperEx.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/jsh/erp/dto/ConfigSecurityQuery.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/jsh/erp/filter/LogCostFilter.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/jsh/erp/service/configSecurity/ConfigSecurityService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/jsh/erp/service/configSecurity/impl/ConfigSecurityServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper_xml/ConfigSecurityMapperEx.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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) {
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;
        }
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();
}
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;
}
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")  //
        );
    }
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();
}
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();
    }
}
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>