diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java index a073f68..bcc3aaa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java @@ -8,22 +8,44 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.tc.entity.*; +import com.ruoyi.tc.entity.AssetBasicNetwork; +import com.ruoyi.tc.entity.AssetCurrent; +import com.ruoyi.tc.entity.AssetExport; +import com.ruoyi.tc.entity.AssetSupplyChain; +import com.ruoyi.tc.entity.AssetTask; +import com.ruoyi.tc.entity.UnitOtherConcat; import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo; import com.ruoyi.tc.entity.po.AssetCurrentCpPo; import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo; import com.ruoyi.tc.entity.po.UnitOtherConcatCpPo; import com.ruoyi.tc.entity.request.AssetCurrentPageRequest; -import com.ruoyi.tc.service.*; +import com.ruoyi.tc.service.AssetBasicNetworkCpService; +import com.ruoyi.tc.service.AssetBasicNetworkService; +import com.ruoyi.tc.service.AssetBusinessFormCpService; +import com.ruoyi.tc.service.AssetBusinessFormService; +import com.ruoyi.tc.service.AssetCurrentCpService; +import com.ruoyi.tc.service.AssetCurrentService; +import com.ruoyi.tc.service.AssetSupplyChainCpService; +import com.ruoyi.tc.service.AssetSupplyChainService; +import com.ruoyi.tc.service.AssetTaskService; +import com.ruoyi.tc.service.UnitOtherConcatCpService; +import com.ruoyi.tc.service.UnitOtherConcatService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.Serializable; @@ -100,26 +122,6 @@ public class AssetCurrentController extends BaseController { return success(assetCurrentService.page(page, as)); } - - /** - * 查询所有数据(带子表) - * - * @param as 查询实体 - * @return 所有数据 - */ - @ApiOperation(value = "查询所有数据(带子表)", response = AssetCurrent.class) - @PostMapping("/selectAllAsset") - public AjaxResult selectAllAsset(@RequestBody AssetCurrentPageRequest as, HttpServletRequest request) { - if (!"U2FsdGVkX199X+bZRylJnFMCCCrHgQw7OJ0DIV7jDQHnrX//trM2UNQx00jKvg4Oi16bAi2VWcg=".equals(request.getHeader("token"))) { - throw new ServiceException("token验证失败"); - } - if (!"OB4J7ZcpC8aLDuH0InPRhYjxNx0TGaRK".equals(request.getHeader("signature"))) { - throw new ServiceException("签名验证失败"); - } - return success(assetCurrentService.selectAllAsset(as)); - } - - /** * 通过主键查询单条数据 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/WithoutController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/WithoutController.java new file mode 100644 index 0000000..d0c73b4 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/WithoutController.java @@ -0,0 +1,138 @@ +package com.ruoyi.tc.controller; + +import cn.hutool.core.collection.CollectionUtil; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.tc.entity.AssetCurrent; +import com.ruoyi.tc.entity.Unit; +import com.ruoyi.tc.entity.request.AssetCurrentPageRequest; +import com.ruoyi.tc.entity.request.GeneralQueryRequest; +import com.ruoyi.tc.service.AssetCurrentService; +import com.ruoyi.tc.service.UnitService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.time.LocalDate; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * 提供外部接口 + * + * @author wu + * @since 2024/11/28 16:41 + */ +@Api(tags = "提供外部接口") +@RestController +@RequestMapping("/tc/without") +public class WithoutController extends BaseController { + + @Resource + private AssetCurrentService assetCurrentService; + + @Resource + private UnitService unitService; + + @Resource + private RedisCache redisCache; + + /** + * 根据查询条件查询所有数据(带子表) + * + * @param as 查询实体 + * @return 所有数据 + */ + @ApiOperation(value = "查询所有数据(带子表)", response = AssetCurrent.class) + @PostMapping("/selectAllAsset") + public AjaxResult selectAllAsset(@RequestBody AssetCurrentPageRequest as, HttpServletRequest request) { + if (!"U2FsdGVkX199X+bZRylJnFMCCCrHgQw7OJ0DIV7jDQHnrX//trM2UNQx00jKvg4Oi16bAi2VWcg=".equals(request.getHeader("token"))) { + throw new ServiceException("签名验证失败"); + } + if (!"OB4J7ZcpC8aLDuH0InPRhYjxNx0TGaRK".equals(request.getHeader("signature"))) { + throw new ServiceException("签名验证失败"); + } + return success(assetCurrentService.selectAllAsset(as)); + } + + /** + * 根据查询条件查询所有单位列表 + * + * @param req 查询条件 + * @return 单位 + */ + @ApiOperation(value = "获取所有单位列表", response = Unit.class) + @PostMapping("/selectAllUnit") + public AjaxResult selectAllUnit(@RequestBody GeneralQueryRequest req, HttpServletRequest request) { + if (!"U2FsdGVkX199X+bZRylJnFMCCCrHgQw7OJ0DIV7jDQHnrX//trM2UNQx00jKvg4Oi16bAi2VWcg=".equals(request.getHeader("token"))) { + throw new ServiceException("签名验证失败"); + } + if (!"OB4J7ZcpC8aLDuH0InPRhYjxNx0TGaRK".equals(request.getHeader("signature"))) { + throw new ServiceException("签名验证失败"); + } + return AjaxResult.success(unitService.selectAllUnit(req)); + } + + /** + * 根据查询条件查询所有单位列表 + * + * @return 单位 + */ + @ApiOperation(value = "获取所有单位列表213", response = Unit.class) + @GetMapping("/test") + public void test() { + sendSms("123", "17638176947", "120ErrorMes"); + } + + /** + * 发送短信 + * + * @param content 短信内容 + * @param tel 手机号多个使用,拼接 + * @param errorMes 异常通知的类别 即redis的key + */ + public void sendSms(String content, String tel, String errorMes) { + if (errorMes != null) { + Integer minutes = redisCache.getCacheObject(errorMes); + if (minutes == null) { + redisCache.setCacheObject(errorMes, 1, 10, TimeUnit.MINUTES); + return; + } + if (minutes < 10) { + long expireTime = redisCache.getExpire(errorMes); + if (expireTime == -1 || expireTime == -2) { + redisCache.setCacheObject(errorMes, 1, 10, TimeUnit.MINUTES); + } else { + redisCache.setCacheObject(errorMes, minutes + 1, (int) expireTime, TimeUnit.SECONDS); + } + return; + } + } + // 限制每种tel每天只能发一次短信 + Map dataKey = redisCache.getCacheMap("dataKey"); + if (CollectionUtil.isNotEmpty(dataKey)) { + String sendDateStr = (String) dataKey.get(content); + LocalDate sendDate = LocalDate.parse(sendDateStr); + if (LocalDate.now().equals(sendDate)) { + return; + } else { + dataKey.put(content, LocalDate.now()); + redisCache.setCacheMap("dataKey", dataKey); + } + } else { + Map map = new HashMap<>(); + map.put(content, LocalDate.now()); + redisCache.setCacheMap("dataKey", map); + } + System.err.println("已经发送短信"); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/GeneralQueryRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/GeneralQueryRequest.java new file mode 100644 index 0000000..bf9d246 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/GeneralQueryRequest.java @@ -0,0 +1,37 @@ +package com.ruoyi.tc.entity.request; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * 通用时间查询请求类 + * + * @author wu + * @since 2024/11/28 17:11 + */ +@Data +public class GeneralQueryRequest implements Serializable { + + private static final long serialVersionUID = 7986278462703735074L; + + /** + * 开始时间 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("开始时间") + private Date startTime; + + /** + * 结束时间 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("结束时间") + private Date endTime; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitMapper.java index be381e3..06e2cd0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitMapper.java @@ -2,8 +2,8 @@ package com.ruoyi.tc.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - import com.ruoyi.tc.entity.Unit; +import com.ruoyi.tc.entity.request.GeneralQueryRequest; import com.ruoyi.tc.entity.request.UnitRequest; import org.apache.ibatis.annotations.Param; @@ -59,4 +59,12 @@ public interface UnitMapper extends BaseMapper { * @return 用户信息集合信息 */ Page dwList(Page page, @Param("req") UnitRequest unit); + + /** + * 根据查询条件查询所有单位列表 + * + * @param req 查询条件 + * @return 单位 + */ + List selectAllUnit(@Param("req") GeneralQueryRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitService.java index 11a3d27..6497463 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitService.java @@ -5,6 +5,7 @@ package com.ruoyi.tc.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.tc.entity.Unit; +import com.ruoyi.tc.entity.request.GeneralQueryRequest; import com.ruoyi.tc.entity.request.UnitRequest; import java.util.List; @@ -56,8 +57,6 @@ public interface UnitService extends IService { */ void deleteUnits(Long ids); - - /** * 分页条件查询单位列表过滤 * @@ -65,4 +64,12 @@ public interface UnitService extends IService { * @return 用户信息集合信息 */ Page dwList(Page page, UnitRequest unit); + + /** + * 根据查询条件查询所有单位列表 + * + * @param req 查询条件 + * @return 单位 + */ + List selectAllUnit(GeneralQueryRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitServiceImpl.java index 0a13944..0fb9f6d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitServiceImpl.java @@ -9,6 +9,7 @@ import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.service.ISysUserService; import com.ruoyi.tc.entity.Unit; +import com.ruoyi.tc.entity.request.GeneralQueryRequest; import com.ruoyi.tc.entity.request.UnitRequest; import com.ruoyi.tc.mapper.UnitMapper; import com.ruoyi.tc.service.UnitService; @@ -118,4 +119,15 @@ public class UnitServiceImpl extends ServiceImpl implements Un return baseMapper.dwList(page, unit); } + /** + * 根据查询条件查询所有单位列表 + * + * @param req 查询条件 + * @return 单位 + */ + @Override + public List selectAllUnit(GeneralQueryRequest req) { + return baseMapper.selectAllUnit(req); + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java index 48cb5f5..1eeffbf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java @@ -1,125 +1,89 @@ -//package com.ruoyi.web.core.config; -// -//import java.util.ArrayList; -//import java.util.List; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.beans.factory.annotation.Value; -//import org.springframework.context.annotation.Bean; -//import org.springframework.context.annotation.Configuration; -//import com.ruoyi.common.config.RuoYiConfig; -//import io.swagger.annotations.ApiOperation; -//import io.swagger.models.auth.In; -//import springfox.documentation.builders.ApiInfoBuilder; -//import springfox.documentation.builders.PathSelectors; -//import springfox.documentation.builders.RequestHandlerSelectors; -//import springfox.documentation.service.ApiInfo; -//import springfox.documentation.service.ApiKey; -//import springfox.documentation.service.AuthorizationScope; -//import springfox.documentation.service.Contact; -//import springfox.documentation.service.SecurityReference; -//import springfox.documentation.service.SecurityScheme; -//import springfox.documentation.spi.DocumentationType; -//import springfox.documentation.spi.service.contexts.SecurityContext; -//import springfox.documentation.spring.web.plugins.Docket; -// -///** -// * Swagger2的接口配置 -// * -// * @author ruoyi -// */ -//@Configuration -//public class SwaggerConfig -//{ -// /** 系统基础配置 */ -// @Autowired -// private RuoYiConfig ruoyiConfig; -// -// /** 是否开启swagger */ -// @Value("${swagger.enabled}") -// private boolean enabled; -// -// /** 设置请求的统一前缀 */ -// @Value("${swagger.pathMapping}") -// private String pathMapping; -// -// /** -// * 创建API -// */ -// @Bean -// public Docket createRestApi() -// { -// return new Docket(DocumentationType.OAS_30) -// // 是否启用Swagger -// .enable(enabled) -// // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) -// .apiInfo(apiInfo()) -// // 设置哪些接口暴露给Swagger展示 -// .select() -// // 扫描所有有注解的api,用这种方式更灵活 -// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) -// // 扫描指定包中的swagger注解 -// // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) -// // 扫描所有 .apis(RequestHandlerSelectors.any()) -// .paths(PathSelectors.any()) -// .build() -// /* 设置安全模式,swagger可以设置访问token */ -// .securitySchemes(securitySchemes()) -// .securityContexts(securityContexts()) -// .pathMapping(pathMapping); -// } -// -// /** -// * 安全模式,这里指定token通过Authorization头请求头传递 -// */ -// private List securitySchemes() -// { -// List apiKeyList = new ArrayList(); -// apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue())); -// return apiKeyList; -// } -// -// /** -// * 安全上下文 -// */ -// private List securityContexts() -// { -// List securityContexts = new ArrayList<>(); -// securityContexts.add( -// SecurityContext.builder() -// .securityReferences(defaultAuth()) -// .operationSelector(o -> o.requestMappingPattern().matches("/.*")) -// .build()); -// return securityContexts; -// } -// -// /** -// * 默认的安全上引用 -// */ -// private List defaultAuth() -// { -// AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); -// AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; -// authorizationScopes[0] = authorizationScope; -// List securityReferences = new ArrayList<>(); -// securityReferences.add(new SecurityReference("Authorization", authorizationScopes)); -// return securityReferences; -// } -// -// /** -// * 添加摘要信息 -// */ -// private ApiInfo apiInfo() -// { -// // 用ApiInfoBuilder进行定制 -// return new ApiInfoBuilder() -// // 设置标题 -// .title("标题:若依管理系统_接口文档") -// // 描述 -// .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...") -// // 作者信息 -// .contact(new Contact(ruoyiConfig.getName(), null, null)) -// // 版本 -// .version("版本号:" + ruoyiConfig.getVersion()) -// .build(); -// } -//} +package com.ruoyi.web.core.config; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.config.RuoYiConfig; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; + +/** + * Swagger2的接口配置 + * + * @author ruoyi + */ +@Configuration +@EnableSwagger2WebMvc +public class SwaggerConfig { + /** + * 系统基础配置 + */ + @Autowired + private RuoYiConfig ruoyiConfig; + + /** + * 是否开启swagger + */ + @Value("${swagger.enabled}") + private boolean enabled; + + /** + * 设置请求的统一前缀 + */ + @Value("${swagger.pathMapping}") + private String pathMapping; + + /** + * 创建API + */ + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + // 是否启用Swagger + .enable(enabled) + //分组名称 + .groupName("太仓资产核查") + // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) + .apiInfo(apiInfo()) + // 设置哪些接口暴露给Swagger展示 + .select() + // 扫描所有有注解的api,用这种方式更灵活 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + // 扫描指定包中的swagger注解 + // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) + // 扫描所有 .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build() + .pathMapping(pathMapping) + // 排除mybatis-plus的分页参数 + .ignoredParameterTypes(Page.class, IPage.class); + } + + + /** + * 添加摘要信息 + */ + private ApiInfo apiInfo() { + // 用ApiInfoBuilder进行定制 + return new ApiInfoBuilder() + // 设置标题 + .title("太仓资产核查系统_接口文档") + // 描述 + .description("描述:用于太仓资产核查") + // 作者信息 + .contact(new Contact(ruoyiConfig.getName(), null, null)) + // 版本 + .version("版本号:" + ruoyiConfig.getVersion()) + .build(); + } +} diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml index d40406a..9e2c418 100644 --- a/ruoyi-admin/src/main/resources/application-prod.yml +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -94,6 +94,13 @@ knife4j: production: true enable: false +# Swagger配置 +swagger: + # 是否开启swagger + enabled: false + # 请求前缀 + pathMapping: / + # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 8380e7f..656838e 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -119,6 +119,13 @@ knife4j: # production: true enable: true +# Swagger配置 +swagger: + # 是否开启swagger + enabled: true + # 请求前缀 + pathMapping: / + # 防止XSS攻击 xss: # 过滤开关 diff --git a/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml b/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml index be0bb1c..d9721de 100644 --- a/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml @@ -450,12 +450,12 @@ and a.xtzt = #{req.xtzt} - and a.create_time >= #{req.startTime} + and a.update_time >= #{req.startTime} - and a.create_time <= #{req.endTime} + and a.update_time <= #{req.endTime} - order by a.create_time desc + order by a.create_time \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml b/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml index 7184fdf..cdd3fca 100644 --- a/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml @@ -139,6 +139,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + update unit_info set del_flag = '2' where id = #{id} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 04f15aa..04cab7d 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -1,5 +1,9 @@ package com.ruoyi.framework.config; +import com.ruoyi.framework.config.properties.PermitAllUrlProperties; +import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; +import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl; +import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -16,10 +20,6 @@ import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.logout.LogoutFilter; import org.springframework.web.filter.CorsFilter; -import com.ruoyi.framework.config.properties.PermitAllUrlProperties; -import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; -import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl; -import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; /** * spring security配置 @@ -117,7 +117,7 @@ public class SecurityConfig .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() // .antMatchers("/unit/assetTask/**","/tc/**","/unit/assetLc/**","/tc/unit/**").permitAll() // 除上面外的所有请求全部需要鉴权认证 - .antMatchers("/tc/assetCurrent/selectAllAsset").permitAll() + .antMatchers("/tc/without/**").permitAll() .anyRequest().authenticated(); }) // 添加Logout filter