@@ -12,6 +13,7 @@ import org.apache.ibatis.annotations.Param;
* @author
* @since 2024-04-02
*/
+@Repository
public interface ExPerformMapper extends BaseMapper
@@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author
* @since 2024-04-02
*/
+@Repository
public interface ExScoreFileMapper extends BaseMapper
@@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author
* @since 2024-04-02
*/
+@Repository
public interface ExScoreRecordMapper extends BaseMapper> entEquipmentTypeList(@RequestParam(required = true) String enterpriseId)throws Exception{
@@ -78,7 +76,6 @@ public class EnterpriseEquipmentController extends BaseController {
@ApiImplicitParam(name = "keyWord", value = "关键字", required = false, dataType = "string")
})
@GetMapping(value = "/entEquipmentList")
- @PreAuthorize("hasAnyAuthority('entEquipmentList','entEquipmentList:update')")
@MethodAnnotation(authorizations = {"entEquipmentList","entEquipmentList:update"},name = "企业设备列表")
@ResponseBody
public SingleResult
> entEquipmentList(@RequestParam(required = true) String enterpriseId, String typeId, Integer page, Integer pageSize, String keyWord)throws Exception{
@@ -97,7 +94,6 @@ public class EnterpriseEquipmentController extends BaseController {
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataType = "string"),
})
@GetMapping(value = "/deviceDetail")
- @PreAuthorize("hasAnyAuthority('entEquipmentList')")
@MethodAnnotation(authorizations = {"entEquipmentList"},name = "企业设备详细")
@ResponseBody
public SingleResult
> insRecord(String deviceId,String inspectionRecordName,Integer page,Integer pageSize)throws Exception{
@@ -240,7 +228,6 @@ public class EnterpriseEquipmentController extends BaseController {
**/
@ApiOperation(value = "备件列表", notes = "备件列表")
@GetMapping(value = "/sparePartList")
- @PreAuthorize("hasAnyAuthority('sparePartList','sparePartList:update')")
@MethodAnnotation(authorizations = {"sparePartList","sparePartList:update"},name = "备件列表")
@ResponseBody
public SingleResult
> sparePartList(String name, Integer page, Integer pageSize)throws Exception{
@@ -255,7 +242,6 @@ public class EnterpriseEquipmentController extends BaseController {
**/
@ApiOperation(value = "备件列表-新增和修改", notes = "备件列表-新增和修改")
@PostMapping(value = "/sparePartAddOrUpdate")
- @PreAuthorize("hasAnyAuthority('sparePartList:update')")
@MethodAnnotation(authorizations = {"sparePartList:update"},name = "备件列表-新增和修改")
@ResponseBody
public SingleResult sparePartUpdate(SparePartDto sparePartDto)throws Exception{
@@ -270,7 +256,6 @@ public class EnterpriseEquipmentController extends BaseController {
**/
@ApiOperation(value = "保养计划-新增和修改", notes = "保养计划-新增和修改")
@PostMapping(value = "/entDeviceMaintenancePlanAddOrUpdate")
- @PreAuthorize("hasAnyAuthority('entDeviceMaintenancePlan:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenancePlan:update"},name = "保养计划-新增和修改")
@ResponseBody
public SingleResult entDeviceMaintenancePlanUpdate(@RequestBody EntDeviceMaintenancePlanDto deviceMaintenancePlanDto)throws Exception{
@@ -285,7 +270,6 @@ public class EnterpriseEquipmentController extends BaseController {
**/
@ApiOperation(value = "保养计划列表", notes = "保养计划列表")
@GetMapping(value = "/entDeviceMaintenancePlan")
- @PreAuthorize("hasAnyAuthority('entDeviceMaintenancePlan','entDeviceMaintenancePlan:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenancePlan","entDeviceMaintenancePlan:update"},name = "保养计划列表")
@ResponseBody
public SingleResult
> entDeviceMaintenancePlan(String deviceId, Integer page, Integer pageSize)throws Exception{
@@ -301,7 +285,6 @@ public class EnterpriseEquipmentController extends BaseController {
**/
@ApiOperation(value = "保养记录-新增和修改", notes = "保养记录-新增和修改")
@PostMapping(value = "/entDeviceMaintenanceRecordAddOrUpdate")
- @PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord:update"},name = "保养记录-新增和修改")
@ResponseBody
public SingleResult entDeviceMaintenanceRecordUpdate(@RequestBody EntDeviceMaintenanceRecordDto entDeviceMaintenanceRecordDto)throws Exception{
@@ -318,7 +301,6 @@ public class EnterpriseEquipmentController extends BaseController {
**/
@ApiOperation(value = "保养记录", notes = "保养记录")
@GetMapping(value = "/entDeviceMaintenanceRecord")
- @PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord','entDeviceMaintenanceRecord:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord","entDeviceMaintenanceRecord:update"},name = "保养记录")
@ResponseBody
public SingleResult
> entDeviceMaintenanceRecord(String deviceId, Integer page, Integer pageSize)throws Exception{
@@ -334,7 +316,6 @@ public class EnterpriseEquipmentController extends BaseController {
**/
@ApiOperation(value = "送检记录", notes = "送检记录")
@GetMapping(value = "/inspectionRecord")
- @PreAuthorize("hasAnyAuthority('inspectionRecord','inspectionRecord:update')")
@MethodAnnotation(authorizations = {"inspectionRecord","inspectionRecord:update"},name = "送检记录")
@ResponseBody
public SingleResult
> inspectionRecord(String startTime, String endTime,Integer page,Integer pageSize,String deviceId)throws Exception {
@@ -349,7 +330,6 @@ public class EnterpriseEquipmentController extends BaseController {
**/
@ApiOperation(value = "送检操作", notes = "送检操作")
@PostMapping(value = "/submitInspection")
- @PreAuthorize("hasAnyAuthority('inspectionRecord:update')")
@MethodAnnotation(authorizations = {"inspectionRecord:update"},name = "送检操作")
@ResponseBody
public SingleResult submitInspection(@RequestBody @Valid InspectionRecordDto inspectionRecordDto)throws Exception{
@@ -365,7 +345,6 @@ public class EnterpriseEquipmentController extends BaseController {
**/
@ApiOperation(value = "维修计划", notes = "维修计划")
@GetMapping(value = "/repairPlan")
- @PreAuthorize("hasAnyAuthority('repairPlan','repairPlan:update')")
@MethodAnnotation(authorizations = {"repairPlan","repairPlan:update"},name = "维修计划")
@ResponseBody
public SingleResult
> insRecord(String deviceId,String inspectionRecordName,Integer page,Integer pageSize)throws Exception{
@@ -384,7 +380,6 @@ public class MinWorkController extends BaseController{
**/
@ApiOperation(value = "维修记录", notes = "维修记录")
@GetMapping(value = "/repairRecord")
- @PreAuthorize("hasAnyAuthority('repairRecord','repairRecord:update')")
@MethodAnnotation(authorizations = {"repairRecord","repairRecord:update"},name = "维修记录")
@ResponseBody
public SingleResult
> entEquipmentListAndIns(@RequestParam(required = true) String enterpriseId, String typeId,Integer page,Integer pageSize,String keyWord)throws Exception{
diff --git a/inventory-ent/src/main/java/com/rzyc/controller/PcCompanyController.java b/inventory-ent/src/main/java/com/rzyc/controller/PcCompanyController.java
index afd8b91..34a25d5 100644
--- a/inventory-ent/src/main/java/com/rzyc/controller/PcCompanyController.java
+++ b/inventory-ent/src/main/java/com/rzyc/controller/PcCompanyController.java
@@ -41,7 +41,6 @@ import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.converters.DateConverter;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -882,7 +881,6 @@ public class PcCompanyController extends BaseController{
@PostMapping("/testSpringSecurity")
@ResponseBody
- @PreAuthorize("hasRole('USER')")
public String testSpringSecurity(String SysEnterpriseId)throws Exception {
return "SysEnterpriseId";
}
@@ -901,7 +899,6 @@ public class PcCompanyController extends BaseController{
@ApiImplicitParam(name = "pageSize", value = "pageSize",required = true, dataType = "int"),
})
@GetMapping(value = "/inListStatistic")
- @PreAuthorize("hasAnyAuthority('inListStatistic')")
@MethodAnnotation(authorizations = {"inListStatistic"},name = "企业清单统计")
@ResponseBody
public SingleResult entUserList(String listId,
@@ -919,7 +916,6 @@ public class PcCompanyController extends BaseController{
*/
@ApiOperation(value = "企业清单类型", notes = "企业清单类型")
@GetMapping(value = "/inListTypes")
- @PreAuthorize("hasAnyAuthority('inListTypes')")
@MethodAnnotation(authorizations = {"inListTypes"},name = "企业清单类型")
@ResponseBody
public SingleResult
> entUserList(@RequestParam(required = true) String enterpriseId)throws Exception{
@@ -938,7 +934,6 @@ public class PcCompanyController extends BaseController{
@ApiImplicitParam(name = "year", value = "年份",required = false, dataType = "string"),
@ApiImplicitParam(name = "listId", value = "清单id",required = false, dataType = "string"),
})
- @PreAuthorize("hasAnyAuthority('entPostListFinishedPercent')")
@MethodAnnotation(authorizations = {"entPostListFinishedPercent"},name = "企业工作要务总进度")
@ResponseBody
public SingleResult entPostListFinishedPercent(@RequestParam(required = true) String enterpriseId,Integer year,String listId)throws Exception{
@@ -958,7 +953,6 @@ public class PcCompanyController extends BaseController{
@ApiImplicitParam(name = "year", value = "年份",required = false, dataType = "string"),
@ApiImplicitParam(name = "listId", value = "清单id",required = false, dataType = "string"),
})
- @PreAuthorize("hasAnyAuthority('entPostListPercentStatistic')")
@MethodAnnotation(authorizations = {"entPostListPercentStatistic"},name = "企业清单履职总统计")
@ResponseBody
public SingleResult entPostListPercentStatistic(@RequestParam(required = true)String enterpriseId,Integer year,String listId)throws Exception{
diff --git a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java
index e951dc4..239352f 100644
--- a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java
+++ b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java
@@ -23,7 +23,6 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -195,7 +194,6 @@ public class PersonalController extends BaseController{
@ApiImplicitParam(name = "postId", value = "企业用户岗位id",required = false, dataType = "string"),
})
@GetMapping(value = "/entUserTree")
- @PreAuthorize("hasAnyAuthority('entUserTree','entUserTree:update')")
@MethodAnnotation(authorizations = {"entUserTree","entUserTree:update"},name = "企业用户组织树")
@ResponseBody
public SingleResult
> entUserTree(@RequestParam(required = true) String enterpriseId, String postId)throws Exception{
@@ -211,7 +209,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "企业用户工作要务", notes = "企业用户工作要务")
@PostMapping(value = "/entUserPostList")
- @PreAuthorize("hasAnyAuthority('entUserPostList','entUserPostList:update')")
@MethodAnnotation(authorizations = {"entUserPostList","entUserPostList:update"},name = "企业用户工作要务")
@ResponseBody
public SingleResult
> entUserPostList(@RequestBody EntUserPostListDto entUserPostListDto)throws Exception{
@@ -228,7 +225,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "企业用户日常工作清单", notes = "企业用户日常工作清单")
@PostMapping(value = "/entUserPostTask")
- @PreAuthorize("hasAnyAuthority('entUserPostTask','entUserPostTask:update')")
@MethodAnnotation(authorizations = {"entUserPostTask","entUserPostTask:update"},name = "企业用户日常工作清单")
@ResponseBody
public SingleResult
> entUserPostTask(@RequestBody EntUserPostTaskDto entUserPostTaskDto)throws Exception{
@@ -246,7 +242,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "企业用户岗位职责", notes = "企业用户岗位职责")
@PostMapping(value = "/entUserPostDuty")
- @PreAuthorize("hasAnyAuthority('entUserPostDuty','entUserPostDuty:update')")
@MethodAnnotation(authorizations = {"entUserPostDuty","entUserPostDuty:update"},name = "企业用户岗位职责")
@ResponseBody
public SingleResult
> entUserPostDuty(@RequestBody EntUserPostDutyDto entUserPostDutyDto)throws Exception{
@@ -270,7 +265,6 @@ public class PersonalController extends BaseController{
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = false, dataType = "string"),
})
@GetMapping(value = "/entUserCredential")
- @PreAuthorize("hasAnyAuthority('entUserCredential','entUserCredential:update')")
@MethodAnnotation(authorizations = {"entUserCredential","entUserCredential:update"},name = "企业用户证照表")
@ResponseBody
public SingleResult
> entUserCredential(String entUserId, @RequestParam(required = true) Integer page, @RequestParam(required = true)Integer pageSize,Integer credentialState,String enterpriseId)throws Exception{
@@ -285,7 +279,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "企业用户证照表-新增,修改", notes = "企业用户证照表-新增,修改")
@PostMapping(value = "/entUserCredentialUpdate")
- @PreAuthorize("hasAnyAuthority('entUserCredentialUpdate:update')")
@MethodAnnotation(authorizations = {"entUserCredentialUpdate:update"},name = "企业用户证照表-新增,修改")
@ResponseBody
public SingleResult entUserCredentialUpdate(@RequestBody EntUserCredentialUpdateDto entUserCredentialUpdateDto)throws Exception{
@@ -306,7 +299,6 @@ public class PersonalController extends BaseController{
@ApiImplicitParam(name = "credentialId", value = "证件照id",required = true, dataType = "string"),
})
@PostMapping(value = "/entUserCredentialDelete")
- @PreAuthorize("hasAnyAuthority('entUserCredentialDelete')")
@MethodAnnotation(authorizations = {"entUserCredentialDelete"},name = "企业用户证照表-删除")
@ResponseBody
public SingleResult entUserCredentialDelete(@RequestParam(required = true) String credentialId)throws Exception{
@@ -330,7 +322,6 @@ public class PersonalController extends BaseController{
@ApiImplicitParam(name = "userType", value = "人员类型",required = false, dataType = "string"),
})
@GetMapping(value = "/entUserList")
- @PreAuthorize("hasAnyAuthority('entUserList','entUserList:update')")
@MethodAnnotation(authorizations = {"entUserList","entUserList:update"},name = "企业岗位人员总体信息列表")
@ResponseBody
public SingleResult
> entUserList(@RequestParam(required = false) String keyContent,
@@ -356,7 +347,6 @@ public class PersonalController extends BaseController{
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = false, dataType = "string"),
})
@GetMapping(value = "/entUserListNoPage")
- @PreAuthorize("hasAnyAuthority('entUserList','entUserList:update')")
@MethodAnnotation(authorizations = {"entUserList","entUserList:update"},name = "企业岗位人员不分页")
@ResponseBody
public SingleResult
> entUserList(@RequestParam(required = false) String name,
@@ -374,7 +364,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "新增和修改公司岗位人员", notes = "新增和修改公司岗位人员")
@PostMapping(value = "/addOrUpdateEntUser")
- @PreAuthorize("hasAnyAuthority('addOrUpdateEntUser:update')")
@MethodAnnotation(authorizations = {"addOrUpdateEntUser:update"},name = "新增和修改公司岗位人员")
@ResponseBody
@Transactional(rollbackFor = Exception.class)
@@ -392,7 +381,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "停用岗位人员", notes = "停用岗位人员")
@PostMapping(value = "/stopUseEntUser")
- @PreAuthorize("hasAnyAuthority('addOrUpdateEntUser:delete')")
@MethodAnnotation(authorizations = {"addOrUpdateEntUser:delete"},name = "停用岗位人员")
@ResponseBody
public SingleResult stopUseEntUser(String entUserId)throws Exception{
@@ -409,7 +397,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "手动企业分配任务", notes = "手动企业分配任务")
@PostMapping(value = "/manualAssignmentTask")
- @PreAuthorize("hasAnyAuthority('entUserPostTask:update')")
@MethodAnnotation(authorizations = {"entUserPostTask:update"},name = "手动企业分配任务")
@ResponseBody
@Transactional
@@ -425,7 +412,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "手动企业添加履职记录", notes = "手动企业添加履职记录")
@PostMapping(value = "/manualAddListDetail")
- @PreAuthorize("hasAnyAuthority('entPostListDetail:update')")
@MethodAnnotation(authorizations = {"entPostListDetail:update"},name = "手动企业添加履职记录")
@ResponseBody
public SingleResult manualAddListDetail(@RequestBody EntPostListDetailDto entPostListDetailDto)throws Exception{
@@ -438,7 +424,6 @@ public class PersonalController extends BaseController{
* */
@ApiOperation(value = "查询履职记录列表", notes = "查询履职记录列表")
@GetMapping(value = "/selectPostListDetail")
- @PreAuthorize("hasAnyAuthority('entPostListDetail:update')")
@MethodAnnotation(authorizations = {"entPostListDetail:update"},name = "查询履职记录列表")
@ResponseBody
public SingleResult selectPostListDetail(String postListId,String userId,Integer page,Integer pageSize)throws Exception{
@@ -454,7 +439,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "新增和修改公司岗位", notes = "新增和修改公司岗位")
@PostMapping(value = "/addOrUpdateEntPost")
- @PreAuthorize("hasAnyAuthority('addOrUpdateEntPost:update')")
@MethodAnnotation(authorizations = {"addOrUpdateEntPost:update"},name = "新增和修改公司岗位")
@ResponseBody
public SingleResult addOrUpdateEntPost(@RequestBody AddOrUpdateEntPostDto addOrUpdateEntPostDto)throws Exception{
@@ -469,7 +453,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "软删除公司岗位", notes = "软删除公司岗位")
@PostMapping(value = "/deletePost")
- @PreAuthorize("hasAnyAuthority('addOrUpdateEntPost:delete')")
@MethodAnnotation(authorizations = {"addOrUpdateEntPost:delete"},name = "软删除公司岗位")
@ResponseBody
public SingleResult deleteEntPost(String postId)throws Exception{
@@ -491,7 +474,6 @@ public class PersonalController extends BaseController{
@ApiImplicitParam(name = "userId", value = "用户id",required = true, dataType = "string"),
})
@GetMapping(value = "/entListGroupByListId")
- @PreAuthorize("hasAnyAuthority('entListGroupByListId','entListGroupByListId:update')")
@MethodAnnotation(authorizations = {"entListGroupByListId","entListGroupByListId:update"},name = "企业清单(类型)分组查询")
@ResponseBody
public SingleResult
> entListGroupByListId(@RequestParam(required = true) String enterpriseId,
@@ -509,7 +491,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "人员类型列表", notes = "人员类型列表")
@GetMapping(value = "/entUserTypeList")
- @PreAuthorize("hasAnyAuthority('entUserTypeList')")
@MethodAnnotation(authorizations = {"entUserTypeList"},name = "人员类型列表")
@ResponseBody
public SingleResult
> entListGroupByListId()throws Exception{
@@ -527,7 +508,6 @@ public class PersonalController extends BaseController{
@ApiImplicitParam(name = "type", value = "1.修改隐患 2.履职 3:系统通知 4:检查签名 5:履职提醒 7:文件下达",required = false, dataType = "string")
})
@GetMapping(value = "/entNotice")
- @PreAuthorize("hasAnyAuthority('entNotice')")
@MethodAnnotation(authorizations = {"entNotice"},name = "消息通知接口")
@ResponseBody
public SingleResult
> notice(String type,Integer page,Integer pageSize)throws Exception{
@@ -541,7 +521,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "消息一键已读", notes = "消息一键已读")
@GetMapping(value = "/oneButtonRead")
- @PreAuthorize("hasAnyAuthority('entNotice')")
@MethodAnnotation(authorizations = {"entNotice"},name = "消息一键已读")
@ResponseBody
public SingleResult oneButtonRead()throws Exception{
@@ -557,7 +536,6 @@ public class PersonalController extends BaseController{
*/
@ApiOperation(value = "消息通知数量", notes = "消息通知数量")
@GetMapping(value = "/entNoticeNumber")
- @PreAuthorize("hasAnyAuthority('entNotice')")
@MethodAnnotation(authorizations = {"entNotice"},name = "消息通知数量")
@ResponseBody
public SingleResult entNoticeNumber()throws Exception{
diff --git a/inventory-ent/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java b/inventory-ent/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java
deleted file mode 100644
index abf5034..0000000
--- a/inventory-ent/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package com.rzyc.filter;
-
-import com.common.utils.jwt.JwtUtil;
-import com.rzyc.advice.CustomException;
-import com.rzyc.config.RedisUtil;
-import com.rzyc.mapper.AuthorityKeyMapper;
-import com.rzyc.model.AuthorityKey;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.AccessDeniedException;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-import org.springframework.web.filter.OncePerRequestFilter;
-
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * spring security JWT Filter
- * @author Xuwanxin
- * @date 2022/9/26
- * */
-
-@Component
-public class JwtAuthenticationTokenFiler extends OncePerRequestFilter {
-
- AuthorityKeyMapper authorityKeyMapper;
-
- RedisUtil redisUtil;
-
- @Autowired
- public JwtAuthenticationTokenFiler(AuthorityKeyMapper authorityKeyMapper, RedisUtil redisUtil) {
- this.authorityKeyMapper = authorityKeyMapper;
- this.redisUtil = redisUtil;
- }
-
- @Override
- protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
- //获取token
- String token = request.getHeader("userToken");
- if(null != token){
- token = "rzyc";
- }
- /*if (!StringUtils.hasText(token)) {
- //放行
- filterChain.doFilter(request, response);
- return;
- }*/
-
- try {
- String userId = JwtUtil.getTokenMsg(token);
- } catch (Exception e) {
- System.out.println("token非法");
- throw new RuntimeException("token非法");
- }
- try {
- //这里是要去拿角色权限的
- List
> entUserCredential(String entUserId, @RequestParam(required = true) Integer page, @RequestParam(required = true)Integer pageSize, Integer credentialState, String enterpriseId)throws Exception{
@@ -74,7 +72,6 @@ public class WxProductionController extends BaseController {
*/
@ApiOperation(value = "企业设备过期列表", notes = "企业设备过期列表")
@GetMapping(value = "/entDeviceOverdue")
- @PreAuthorize("hasAnyAuthority('entDeviceOverdue')")
@MethodAnnotation(authorizations = {"entDeviceOverdue"},name = "应急资源删除")
@ApiImplicitParams({
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = true, dataType = "string"),
diff --git a/inventory-gov/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java b/inventory-gov/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java
deleted file mode 100644
index 9c0a3fc..0000000
--- a/inventory-gov/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.rzyc.filter;
-
-import com.common.utils.jwt.JwtUtil;
-import com.rzyc.advice.CustomException;
-import com.rzyc.mapper.AuthorityKeyMapper;
-import com.rzyc.model.AuthorityKey;
-import com.rzyc.utils.IpUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.AccessDeniedException;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-import org.springframework.web.filter.OncePerRequestFilter;
-
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * spring security JWT Filter
- * @author Xuwanxin
- * @date 2022/9/26
- * */
-
-@Component
-@Slf4j
-public class JwtAuthenticationTokenFiler extends OncePerRequestFilter {
-
- @Autowired
- AuthorityKeyMapper authorityKeyMapper;
-
- @Override
- protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
- //获取token
- String token = request.getHeader("userToken");
-
- System.out.println("addr ------> "+ IpUtil.getIpAddr(request));
-/* if (!StringUtils.hasText(token)) {
- //放行
- filterChain.doFilter(request, response);
- return;
- }*/
- if(null != token){
- token = "rzyc";
- }
-
- try {
- String userId = JwtUtil.getTokenMsg(token);
- } catch (Exception e) {
- System.out.println("token非法");
- throw new RuntimeException("token非法");
- }
- try {
-
- List