Ver código fonte

删除多余字段方法类

mazq 1 ano atrás
pai
commit
4a31448c28

+ 0 - 8
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/AppFunAuthResult.java

@@ -56,18 +56,10 @@ public class AppFunAuthResult implements LogicDeleteable, IdEntity<String> {
     @Column(name = "FUN_CODE")
     private String funCode;
 
-    /** 权限开始时间 */
-    @Column(name = "START_TIME")
-    private Date startTime;
-
     /** 权限结束时间 */
     @Column(name = "END_TIME")
     private Date endTime;
 
-    /** 权限起停用状态 */
-    @Column(name = "AUTH_STATUS")
-    private String authStatus;
-
     /** 权限结果来源 */
     @Column(name = "AUTH_SOURCE")
     private String authSource;

+ 0 - 12
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/ServiceAuthResult.java

@@ -71,24 +71,12 @@ public class ServiceAuthResult implements IdEntity<String> {
     @Column(name = "UPDATE_TIME")
     private Date updateTime;
 
-    /**
-     * 授权有效期起始时间
-     */
-    @Column(name = "START_TIME")
-    private Date startTime;
-
     /**
      * 授权有效期结束时间
      */
     @Column(name = "END_TIME")
     private Date endTime;
 
-    /**
-     * 授权结果状态 0:未到启用时间,1.正常 2.回收
-     */
-    @Column(name = "AUTH_STATUS")
-    private String authStatus;
-
     /**
      * 是否删除
      */

+ 0 - 51
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/enumresources/AuthStatusEnum.java

@@ -1,51 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.enumresources;
-
-/**
- * 服务授权结果状态枚举类
- * @author mazq
- * @date 2021/5/12
- */
-public enum AuthStatusEnum {
-
-    /**
-     * 服务授权申请审批通过后权限有效期时间未到启用时间
-     */
-    NOT_START("未到启动时间","0"),
-    /**
-     * 正常启用状态
-     */
-    START("正常","1"),
-    /**
-     * 授权被回收
-     */
-    CANCEL("回收","2"),
-    /**
-     * 权限超过有效期
-     */
-    OVER_DUE("过期","3");
-
-    private String label;
-
-    private String value;
-
-    AuthStatusEnum(String label, String value) {
-        this.label = label;
-        this.value = value;
-    }
-
-    public String getLable() {
-        return label;
-    }
-
-    public void setLable(String lable) {
-        this.label = lable;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-}

+ 2 - 33
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/ServiceAuthResultBPO.java

@@ -50,7 +50,7 @@ public class ServiceAuthResultBPO extends BaseBPO<ServiceAuthResult, String> {
     public List<ServiceAuthResult> serviceAuthResultList(String appCode) {
         String sql = " SELECT t.* FROM T_SERVICE_AUTH_RESULT t, T_SERVICE_RESOURCE r \n" +
                 " where t.service_id=r.id and t.deleted='0' and r.deleted='0'\n" +
-                " and r.service_status='1' and t.auth_status ='1' and t.service_resource_id = 'tj_service' and t.app_code=? \n";
+                " and r.service_status='1' and t.service_resource_id = 'tj_service' and t.app_code=? \n";
         return PersistentFactory.getJdbcDao().queryForList(sql, ServiceAuthResult.class, appCode);
     }
 
@@ -62,7 +62,7 @@ public class ServiceAuthResultBPO extends BaseBPO<ServiceAuthResult, String> {
 
     public Page<ServiceAuthResultPO> serviceResultPageJoinFlow(Searchable searchable) {
         String sql = "SELECT \n" +
-                "t.app_code, t.service_code, t.auth_status, t.create_time as auth_time, t.service_resource_id,t.deleted as deleted, " +
+                "t.app_code, t.service_code, t.create_time as auth_time, t.service_resource_id,t.deleted as deleted, " +
                 "a.apply_name as app_name, a.apply_status as app_status, a.org_name as app_org_name, a.manager_org_name as app_manager_org_name, " +
                 "f.applicant_name as applicant_name, f.applicant_org_code as applicant_org_code, f.create_time as apply_time," +
                 "f.applicant_org_name as applicant_org_name, f.applicant_idcard as applicant_idcard, f.applicant_phone_no as applicant_phone_no, " +
@@ -83,35 +83,4 @@ public class ServiceAuthResultBPO extends BaseBPO<ServiceAuthResult, String> {
                 " from t_auth_apply_flow w LEFT JOIN t_service_auth_content c on w.id = c.AUTH_APPLY_ID) as f on f.message_id = t.message_id";
         return PersistentFactory.getJdbcDao().paging(sql, searchable, ServiceAuthResultPO.class);
     }
-
-
-//    public Page<ServiceAuthResultPO> serviceResultPageJoinFlow(Searchable searchable) {
-//        String sql = "SELECT " +
-//                "t.app_code, t.service_code, t.auth_status, t.create_time as auth_time, t.service_resource_id,t.deleted as deleted, " +
-//                "a.apply_name as app_name, a.apply_status as app_status, a.org_name as app_org_name, a.manager_org_name as app_manager_org_name, " +
-//                "f.applicant_name, f.applicant_org_code, f.create_time as apply_time, f.applicant_org_name, f.applicant_idcard, f.applicant_phone_no, " +
-//                "f.app_org_code as app_org_code, f.app_manager_org_code as app_manager_org_code, f.service_shared_way, " +
-//                "s.service_name, s.service_status, s.build_unit as service_org_name, s.manager_unit as service_manager_org_name, " +
-//                "s.manager_unit_code as service_manager_org_code, s.build_unit_code as service_org_code, s.service_type, " +
-//                "t.app_code as appCode, t.service_code as serviceCode, t.service_resource_id as serviceResourceId, " +
-//                "a.org_name as appOrgName, a.apply_status as appStatus, a.manager_org_name as appManagerOrgName, a.apply_name as appName, a.deleted as app_deleted, " +
-//                "f.app_org_code as appOrgCode, f.applicant_name as applicantName, " +
-//                "s.service_status as serviceStatus, s.service_name as serviceName, s.manager_unit as serviceManagerOrgName, s.manager_unit_code as serviceManagerOrgCode, s.deleted as service_deleted " +
-//                "FROM T_SERVICE_AUTH_RESULT t " +
-//                "INNER JOIN T_SERVICE_RESOURCE s ON t.service_id = s.id " +
-//                "INNER JOIN T_APPLY_INFO a ON t.app_id = a.id " +
-//                "LEFT JOIN T_SERVICE_AUTH_FLOW f ON f.message_id = t.message_id";
-//        return PersistentFactory.getJdbcDao().paging(sql, searchable, ServiceAuthResultPO.class);
-//    }
-
-    /**
-     * 删除结果 根据条件
-     *
-     * @param appCode     应用code
-     * @param serviceCode 服务code
-     */
-    public void delByAppCodeAndServiceId(String appCode, String serviceCode) {
-        String sql = "update t_service_auth_result set deleted='1' where service_code= ? and app_code= ?";
-        PersistentFactory.getJdbcDao().update(sql, new Object[]{serviceCode, appCode});
-    }
 }

+ 0 - 17
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IServiceAuthResultService.java

@@ -28,15 +28,6 @@ public interface IServiceAuthResultService {
      */
     ServiceAuthResult saveAuthResult(ServiceAuthResult serviceAuthResult);
 
-    /**
-     * 根据appCode和serviceCode查询授权结果
-     *
-     * @param appCode     应用编码
-     * @param serviceCode 服务编码
-     * @return
-     */
-    ServiceAuthResult getByAppServiceCode(String appCode, String serviceCode);
-
     /**
      * 根据appCode查询授权结果
      *
@@ -98,14 +89,6 @@ public interface IServiceAuthResultService {
 
     ServiceAuthResultDTO getDetail(String id);
 
-    /**
-     * 根据appCode查询 服务结果和服务表关联表
-     *
-     * @param appCode
-     * @return
-     */
-    List<ServiceAuthResult> serviceAuthResultList(String appCode);
-
     /**
      * 发送服务的消息
      *

+ 1 - 20
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/AppFunAuthResultServiceImpl.java

@@ -3,8 +3,6 @@ package com.dragoninfo.dcuc.auth.auth.service.impl;
 import com.dragoninfo.dcuc.auth.auth.entity.AppFunApplyContent;
 import com.dragoninfo.dcuc.auth.auth.entity.AppFunAuthResult;
 import com.dragoninfo.dcuc.auth.auth.entity.WorkFlow;
-import com.dragoninfo.dcuc.auth.auth.enumresources.AuthStatusEnum;
-import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowPermissionTypeEnum;
 import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowStatusEnum;
 import com.dragoninfo.dcuc.auth.auth.repo.AppFunAuthResultRepository;
 import com.dragoninfo.dcuc.auth.auth.service.IAppFunAuthResultService;
@@ -81,22 +79,7 @@ public class AppFunAuthResultServiceImpl implements IAppFunAuthResultService {
             }
             String userId = applyInfo.getUserId();
             String appId = applyInfo.getAppId();
-            Date startTime = null;
-            Date endTime = null;
-            Date date = new Date();
-            String authStatus = AuthStatusEnum.START.getValue();
-            String permissionValidType = flow.getPermissionValidType();
-            if (StringUtils.isNotBlank(permissionValidType)
-                    && WorkFlowPermissionTypeEnum.TEMP.getValue().equals(permissionValidType)) {
-                startTime = flow.getStartTime();
-                endTime = flow.getEndTime();
-                if (date.before(startTime)) {
-                    authStatus = AuthStatusEnum.NOT_START.getValue();
-                }
-                if (date.after(endTime)) {
-                    authStatus = AuthStatusEnum.OVER_DUE.getValue();
-                }
-            }
+            Date endTime = flow.getEndTime();
             String funId = applyInfo.getFunId();
             String funCode = applyInfo.getFunCode();
             AppFunAuthResult authResult = new AppFunAuthResult();
@@ -107,8 +90,6 @@ public class AppFunAuthResultServiceImpl implements IAppFunAuthResultService {
             authResult.setUserId(userId);
             authResult.setFunId(funId);
             authResult.setFunCode(funCode);
-            authResult.setAuthStatus(authStatus);
-            authResult.setStartTime(startTime);
             authResult.setEndTime(endTime);
             authResult.setDeleted(BooleanEnum.FALSE.value);
             addResult.add(authResult);

+ 4 - 3
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/RoleService.java

@@ -7,9 +7,11 @@ import com.dragoninfo.dcuc.auth.audit.service.log.LogInfoFillService;
 import com.dragoninfo.dcuc.auth.auth.bpo.RoleInfoBPO;
 import com.dragoninfo.dcuc.auth.auth.dto.AppFunInfoDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.RoleApiDto;
-import com.dragoninfo.dcuc.auth.auth.entity.*;
+import com.dragoninfo.dcuc.auth.auth.entity.AppFunAuthResult;
+import com.dragoninfo.dcuc.auth.auth.entity.AppFunInfo;
+import com.dragoninfo.dcuc.auth.auth.entity.RoleInfo;
+import com.dragoninfo.dcuc.auth.auth.entity.StaffAssignAuthInfo;
 import com.dragoninfo.dcuc.auth.auth.entity.zerotrust.AuthRoleOrgRel;
-import com.dragoninfo.dcuc.auth.auth.enumresources.AuthStatusEnum;
 import com.dragoninfo.dcuc.auth.auth.service.*;
 import com.dragoninfo.dcuc.auth.auth.service.zerotrust.IAuthRoleOrgRelService;
 import com.dragoninfo.dcuc.auth.auth.vo.RoleAppFunVO;
@@ -139,7 +141,6 @@ public class RoleService implements IRoleService {
         searchable.addSearchFilter("appCode", SearchOperator.eq, appCode);
         searchable.addSearchFilter("userId", SearchOperator.eq, userId);
         searchable.addSearchFilter("deleted", SearchOperator.eq, BooleanEnum.FALSE.value);
-        searchable.addSearchFilter("authStatus", SearchOperator.eq, AuthStatusEnum.START.getValue());
         return appFunAuthResultService.getResultList(searchable);
     }
 

+ 1 - 48
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/ServiceAuthResultServiceImpl.java

@@ -14,8 +14,6 @@ import com.dragoninfo.dcuc.auth.auth.bpo.ServiceAuthResultBPO;
 import com.dragoninfo.dcuc.auth.auth.dto.*;
 import com.dragoninfo.dcuc.auth.auth.entity.ServiceAuthResult;
 import com.dragoninfo.dcuc.auth.auth.entity.WorkFlow;
-import com.dragoninfo.dcuc.auth.auth.enumresources.AuthStatusEnum;
-import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowPermissionTypeEnum;
 import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowStatusEnum;
 import com.dragoninfo.dcuc.auth.auth.po.ServiceAuthResultPO;
 import com.dragoninfo.dcuc.auth.auth.service.IServiceApplyContentService;
@@ -86,20 +84,6 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
         return serviceAuthResult;
     }
 
-    @Override
-    public ServiceAuthResult getByAppServiceCode(String appCode, String serviceCode) {
-        Searchable searchable = Searchable.newSearchable();
-        searchable.addSearchFilter("service_code", SearchOperator.eq, serviceCode);
-        searchable.addSearchFilter("app_code", SearchOperator.eq, appCode);
-        searchable.addSearchFilter("deleted", SearchOperator.eq, BooleanEnum.FALSE.getValue());
-        List<ServiceAuthResult> authResults = serviceAuthResultBPO.find(ServiceAuthResult.class, searchable);
-        if (CollectionUtils.isEmpty(authResults)) {
-            return null;
-        }
-        return authResults.get(0);
-    }
-
-
     @Override
     public void dealAuthFlowResult(WorkFlow workFlow, WorkFlowResutlAcceptDTO flowResutlAcceptDTO) {
         if (WorkFlowStatusEnum.SUCCESS.getValue().equals(workFlow.getFlowStatus())) {
@@ -236,21 +220,7 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
         Date date = new Date();
         String appCode = serviceAuthFlow.getAppCode();
         //判断工作单是长期还是自定义
-        Date startTime = null;
-        Date endTime = null;
-        String authStatus = AuthStatusEnum.START.getValue();
-        String permissionValidType = serviceAuthFlow.getPermissionValidType();
-        if (StringUtils.isNotBlank(permissionValidType)
-                && WorkFlowPermissionTypeEnum.TEMP.getValue().equals(permissionValidType)) {
-            startTime = serviceAuthFlow.getStartTime();
-            endTime = serviceAuthFlow.getEndTime();
-            if (date.before(startTime)) {
-                authStatus = AuthStatusEnum.NOT_START.getValue();
-            }
-            if (date.after(endTime)) {
-                authStatus = AuthStatusEnum.OVER_DUE.getValue();
-            }
-        }
+        Date endTime = serviceAuthFlow.getEndTime();
         //授权工作单
         //新增授权
         List<String> serviceCodes = serviceResourceMap.keySet().stream().filter(e -> !allAuthResultMap.containsKey(e)).collect(Collectors.toList());
@@ -259,9 +229,7 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
                 //已经存在的更新
                 if (allAuthResultMap.containsKey(serviceCode)) {
                     ServiceAuthResult serviceAuthResult = allAuthResultMap.get(serviceCode);
-                    serviceAuthResult.setStartTime(startTime);
                     serviceAuthResult.setEndTime(endTime);
-                    serviceAuthResult.setAuthStatus(authStatus);
                     serviceAuthResult.setUpdateTime(date);
                     serviceAuthResult.setFlowId(serviceAuthFlow.getFlowId());
                     serviceAuthResult.setMessageId(serviceAuthFlow.getMessageId());
@@ -272,9 +240,7 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
                     serviceAuthResult.setAppCode(appCode);
                     serviceAuthResult.setServiceCode(serviceCode);
                     ServiceResourceDTO serviceResource = serviceResourceMap.get(serviceCode);
-                    serviceAuthResult.setStartTime(startTime);
                     serviceAuthResult.setEndTime(endTime);
-                    serviceAuthResult.setAuthStatus(authStatus);
                     serviceAuthResult.setServiceId(serviceResource.getId());
                     serviceAuthResult.setAppId(appId);
                     serviceAuthResult.setFlowId(serviceAuthFlow.getFlowId());
@@ -372,7 +338,6 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
             result.setDeleted(BooleanEnum.FALSE.value);
             ServiceResource serviceResource = serviceResourceFacade.detailByCode(dto.getServiceCode());
             result.setServiceId(serviceResource.getId());
-            result.setAuthStatus(AuthStatusEnum.START.getValue());
             result.setServiceResourceId(ResourceTypeEnum.TJ_SERVICE.getResourceId());
             this.saveAuthResult(result);
             List<String> addServiceCodes = new ArrayList<>();
@@ -528,17 +493,6 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
 
     }
 
-    /**
-     * 查询结果
-     *
-     * @param appCode
-     * @return
-     */
-    @Override
-    public List<ServiceAuthResult> serviceAuthResultList(String appCode) {
-        return this.serviceAuthResultBPO.serviceAuthResultList(appCode);
-    }
-
     /**
      * 发送删除服务的消息
      *
@@ -609,7 +563,6 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
         Searchable searchable = Searchable.newSearchable();
         searchable.addSearchFilter("app_code", SearchOperator.eq, appCode);
         searchable.addSearchFilter("deleted", SearchOperator.eq, BooleanEnum.FALSE.getValue());
-        searchable.addSearchFilter("auth_status", SearchOperator.eq, AuthStatusEnum.START.getValue());
         List<ServiceAuthResult> authResults = serviceAuthResultBPO.find(ServiceAuthResult.class, searchable);
         List<String> exist = authResults.stream()
                 .map(item -> item.getServiceCode())

+ 0 - 29
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/business/impl/zerotrust/ServiceAuthCallbackHandler.java

@@ -7,7 +7,6 @@ import com.dragoninfo.dcuc.app.vo.ServiceResourceVo;
 import com.dragoninfo.dcuc.auth.auth.dto.zerotrust.approval.ApprovalBaseRespDto;
 import com.dragoninfo.dcuc.auth.auth.entity.ServiceAuthResult;
 import com.dragoninfo.dcuc.auth.auth.entity.zerotrust.ServiceAuthApply;
-import com.dragoninfo.dcuc.auth.auth.enumresources.AuthStatusEnum;
 import com.dragoninfo.dcuc.auth.auth.enumresources.zerotrust.approval.AuthApplyStatusEnum;
 import com.dragoninfo.dcuc.auth.auth.service.IServiceAuthResultService;
 import com.dragoninfo.dcuc.auth.auth.service.zerotrust.IServiceAuthApplyService;
@@ -101,9 +100,6 @@ public class ServiceAuthCallbackHandler implements IServiceAuthCallbackHandler {
             return Collections.emptyList();
         }
 
-        ServiceAuthApply authApply = authApplies.get(0);
-        String authStatus = getStatus(createTime, authApply.getStartTime(), authApply.getEndTime());
-
         return authApplies.stream().map(e -> {
             Date endTime = e.getEndTime();
             ServiceAuthResult authResult = new ServiceAuthResult();
@@ -114,10 +110,6 @@ public class ServiceAuthCallbackHandler implements IServiceAuthCallbackHandler {
             authResult.setServiceCode(serviceResourceVo.getServiceCode());
             authResult.setAppId(appId);
             authResult.setAppCode(appMap.get(appId).getApplyCode());
-
-            Date startTime = e.getStartTime();
-            authResult.setAuthStatus(authStatus);
-            authResult.setStartTime(startTime);
             authResult.setEndTime(endTime);
             authResult.setCreateTime(createTime);
             authResult.setServiceResourceId(serviceResourceVo.getResourceId());
@@ -126,25 +118,4 @@ public class ServiceAuthCallbackHandler implements IServiceAuthCallbackHandler {
         }).collect(Collectors.toList());
     }
 
-    private String getStatus(Date createTime, Date startTime, Date endTime) {
-        startTime = Optional.ofNullable(startTime).orElse(createTime);
-        endTime = Optional.ofNullable(endTime).orElse(createTime);
-        if (startTime.before(createTime) && endTime.after(createTime)) {
-            return AuthStatusEnum.START.getValue();
-        }
-        if (startTime.after(createTime)) {
-            return AuthStatusEnum.NOT_START.getValue();
-        }
-        if (startTime.before(createTime)) {
-            return AuthStatusEnum.START.getValue();
-        }
-        if (endTime.before(createTime)) {
-            return AuthStatusEnum.CANCEL.getValue();
-        }
-        if (endTime.after(createTime)) {
-            return AuthStatusEnum.START.getValue();
-        }
-
-        return AuthStatusEnum.START.getValue();
-    }
 }

+ 6 - 0
dcuc-auth-service/src/main/resources/config/mysql/V4_3_0035__ServiceAuthApply.sql

@@ -16,3 +16,9 @@ create table T_AUTH_SERVICE_AUTH_APPLY
     comment '服务授权申请表';
 
 create index T_AUTH_SERVICE_AUTH_APPLY_INX_INST_ID on T_AUTH_SERVICE_AUTH_APPLY (PROCESS_INST_ID);
+
+ALTER TABLE T_AUTH_APP_FUN_AUTH_RESULT DROP COLUMN START_TIME;
+ALTER TABLE T_AUTH_APP_FUN_AUTH_RESULT DROP COLUMN AUTH_STATUS;
+
+ALTER TABLE T_SERVICE_AUTH_RESULT DROP COLUMN START_TIME;
+ALTER TABLE T_SERVICE_AUTH_RESULT DROP COLUMN AUTH_STATUS;