Selaa lähdekoodia

多余方法删除

mazq 1 vuosi sitten
vanhempi
sitoutus
143ef7aebb
43 muutettua tiedostoa jossa 174 lisäystä ja 3565 poistoa
  1. 0 51
      dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/IApprovalFacade.java
  2. 0 9
      dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/IStaffAssignAuthInfoFacade.java
  3. 0 42
      dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/IStaffAssignAuthInfoLogFacade.java
  4. 0 32
      dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/power/facade/IAppFunEventFacade.java
  5. 0 47
      dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/power/facade/IFunEventFacade.java
  6. 0 82
      dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/power/facade/IFuncSyncRuleConfigFacade.java
  7. 0 178
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/FunEvent.java
  8. 0 290
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/FuncApproval.java
  9. 0 213
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/FuncSyncRuleConfig.java
  10. 0 106
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/MdAppDataSource.java
  11. 0 364
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/MdDataSource.java
  12. 0 141
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/StaffAssignAuthLog.java
  13. 0 48
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/ApprovalEventCenterBus.java
  14. 2 3
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/PermissionUpdateEventBus.java
  15. 2 2
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/PermssionServiceUpdateEventBus.java
  16. 0 48
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/StaffAssignAuthEventCenterBus.java
  17. 0 113
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/subscribe/ApprovalSendMessage.java
  18. 0 150
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/subscribe/StaffAssignAuthSendMessage.java
  19. 0 13
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/ApprovalBPO.java
  20. 0 59
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/FunEventBPO.java
  21. 0 45
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/FuncSyncRuleConfigBPO.java
  22. 0 31
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/ServiceAuthFlowBPO.java
  23. 0 65
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/StaffAssignAuthLogBPO.java
  24. 0 30
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/AppFunEventFacade.java
  25. 0 60
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/ApprovalFacade.java
  26. 0 41
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/FunEventFacade.java
  27. 0 57
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/FuncSyncRuleConfigFacade.java
  28. 0 5
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/StaffAssignAuthInfoFacade.java
  29. 0 49
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/StaffAssignAuthInfoLogFacade.java
  30. 0 56
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IApprovalService.java
  31. 0 20
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IFunEventService.java
  32. 0 54
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IFuncSyncRuleConfigService.java
  33. 0 36
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IStaffAssignAuthLogService.java
  34. 0 257
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/ApprovalService.java
  35. 0 77
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/FunEventService.java
  36. 0 351
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/FuncSyncRuleConfigService.java
  37. 68 6
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/ServiceAuthResultServiceImpl.java
  38. 80 217
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/StaffAssignAuthInfoService.java
  39. 0 104
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/StaffAssignAuthLogService.java
  40. 14 0
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/zerotrust/IRoleAuthApplyService.java
  41. 8 1
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/zerotrust/IServiceAuthApplyService.java
  42. 0 10
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/config/DcucAuthKafkaConfig.java
  43. 0 2
      dcuc-auth-service/src/main/resources/application-auth.yml

+ 0 - 51
dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/IApprovalFacade.java

@@ -1,51 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.facade;
-
-import com.dragoninfo.dcuc.auth.auth.dto.ApprovalDto;
-import com.dragoninfo.dcuc.auth.auth.entity.FuncApproval;
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.data.domain.Page;
-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.RequestParam;
-
-/**
- * Created by liws on 2019/3/4.
- */
-@FeignClient(name = "dcuc-auth",path = "/dcuc/auth/approvalFacade")
-public interface IApprovalFacade {
-    /**
-     * 动态授权申请
-     *
-     * @param appCode       应用代码
-     * @param roleCode       角色代码
-     * @param userIdCard     申请人身份证
-     * @param approvalIdCard 审批人身份证
-     * @param reason         申请事由
-     * @return
-     */
-    @RequestMapping(value = "authApply")
-    ResponseDTO authApply(@RequestParam("appCode")String appCode,
-                          @RequestParam("roleCode")String roleCode,
-                          @RequestParam("userIdCard")String userIdCard,
-                          @RequestParam("approvalIdCard")String approvalIdCard,
-                          @RequestParam("reason")String reason);
-
-    @PostMapping(value = "approvalPage")
-    Page<FuncApproval> approvalPage(@RequestBody SearchDTO searchDTO);
-
-    @PostMapping(value = "agree")
-    ResponseStatus agree(@RequestBody ApprovalDto approvalDto);
-
-    @PostMapping(value = "disagree")
-    ResponseStatus disagree(@RequestBody ApprovalDto approvalDto);
-
-    @RequestMapping(value = "detail")
-    FuncApproval detail(@RequestParam("id")String id);
-
-    @PostMapping(value = "applyResult")
-    ResponseDTO applyResult(@RequestBody ApprovalDto approvalDto);
-}

+ 0 - 9
dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/IStaffAssignAuthInfoFacade.java

@@ -33,15 +33,6 @@ public interface IStaffAssignAuthInfoFacade {
     @PostMapping(value = "saveStaffRoleAuth")
     ResponseStatus saveStaffRoleAuth(@RequestBody StaffRoleOperateDTO dto);
 
-    /**
-     * 取消用户的所有角色授权
-     *
-     * @param staffId 用户id
-     * @return ResponseStatus
-     */
-    @RequestMapping(value = "deleteAllStaffRole")
-    ResponseStatus deleteAllStaffRole(@RequestParam("staffId") String staffId);
-
     /**
      * 查询列表
      *

+ 0 - 42
dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/IStaffAssignAuthInfoLogFacade.java

@@ -1,42 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.facade;
-
-import com.dragoninfo.dcuc.auth.auth.entity.RoleInfo;
-import com.dragoninfo.dcuc.auth.auth.entity.StaffAssignAuthLog;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.data.domain.Page;
-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.RequestParam;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * Created by Administrator on 2018/11/13.
- */
-@FeignClient(name = "dcuc-auth",path = "/dcuc/auth/staffAssignAuthInfoLogFacade")
-public interface IStaffAssignAuthInfoLogFacade {
-
-    /**
-     * 获取用户拥有过的权限
-     * @param searchDTO
-     * @return
-     */
-    @PostMapping(value = "roleListByUserIdAndAppId")
-    Page<RoleInfo> roleListByUserIdAndAppId(@RequestBody SearchDTO searchDTO);
-
-    /**
-     * 获取用户的权限变更记录
-     * @param userId
-     * @param roleId
-     * @return
-     */
-    @RequestMapping(value = "staffAssignAuthLogList")
-    List<StaffAssignAuthLog> staffAssignAuthLogList(@RequestParam("userId")String userId,
-                                                    @RequestParam("roleId")String roleId);
-
-    @RequestMapping(value = "operateList")
-    Page<Map<String,String>> operateList(@RequestBody SearchDTO searchDTO);
-}

+ 0 - 32
dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/power/facade/IAppFunEventFacade.java

@@ -1,32 +0,0 @@
-package com.dragoninfo.dcuc.auth.power.facade;
-
-import com.dragoninfo.dcuc.auth.auth.vo.EventInfoVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import java.util.List;
-
-/**
- * Created by huanghy on 2018/7/9.
- */
-@Api(description = "菜单事件服务类")
-@FeignClient(name = "dcuc-auth",path = "/dcuc/auth/appFunEventFacade")
-public interface IAppFunEventFacade {
-
-    /**
-     * 根据菜单id获取菜单的功能事件
-     * @param funId 应用菜单id
-     * @return
-     */
-    @ApiOperation(value = "根据菜单id获取菜单的功能事件",httpMethod = "GET",nickname = "/dcuc/auth/events/{funId}"
-            ,response = List.class)
-    @ApiImplicitParams({@ApiImplicitParam(paramType = "path",name = "funId" ,value="菜单ID",required = true
-            ,example = "yhglpt10004")})
-    @RequestMapping(value = "getEventByFunId")
-    List<EventInfoVO> getEventByFunId(@RequestParam("funId") String funId);
-}

+ 0 - 47
dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/power/facade/IFunEventFacade.java

@@ -1,47 +0,0 @@
-package com.dragoninfo.dcuc.auth.power.facade;
-
-
-import com.dragoninfo.dcuc.auth.auth.vo.EventInfoVO;
-import com.dragoninfo.dcuc.auth.auth.entity.FunEvent;
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import java.util.List;
-
-@FeignClient(name = "dcuc-auth",path = "/dcuc/auth/funEventFacade")
-public interface IFunEventFacade {
-
-    /**
-     * 根据功能菜单id获取菜单的功能事件列表(包括公共的事件)
-     * @param pkMenuId
-     * @param searchDTO
-     * @return
-     */
-    @RequestMapping(value = "getMenuData")
-    List<FunEvent> getMenuData(@RequestParam("pkMenuId")String pkMenuId,
-                               @RequestParam("searchDTO")SearchDTO searchDTO);
-
-    /**
-     * 更新应用菜单的功能事件
-     * @param funEventList
-     * @param id
-     */
-    @RequestMapping(value = "updateFilter")
-    ResponseDTO updateFilter(@RequestParam("funEventList")List<FunEvent> funEventList,
-                             @RequestParam("id")String id);
-
-    /**
-     * 根据菜单id获取菜单的功能事件
-     * @param id
-     * @return
-     */
-    @GetMapping(value = "getEventByTreeId")
-    List<EventInfoVO> getEventByTreeId(@RequestParam("id") String id);
-
-    @RequestMapping(value = "getEventByFunIds")
-    List<EventInfoVO> getEventByFunIds(@RequestParam("funIds") String funIds);
-}

+ 0 - 82
dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/power/facade/IFuncSyncRuleConfigFacade.java

@@ -1,82 +0,0 @@
-package com.dragoninfo.dcuc.auth.power.facade;
-
-import com.dragoninfo.dcuc.auth.auth.entity.FuncSyncRuleConfig;
-import com.dragoninfo.dcuc.auth.auth.vo.MenuInfoVO;
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import java.util.List;
-
-/**
- * Created by liws on 2018/6/21.
- */
-@FeignClient(name = "dcuc-auth",path = "/dcuc/auth/funcSyncRuleConfigFacade")
-public interface IFuncSyncRuleConfigFacade {
-    /**
-     * 根据应用id获取应用菜单规则同步配置列表
-     *
-     * @param applicationId
-     * @return
-     */
-    @RequestMapping(value = "getMenuRulesList")
-    Page<FuncSyncRuleConfig> getMenuRulesList(@RequestParam("applicationId")String applicationId,
-                                              @RequestParam("searchDTO")SearchDTO searchDTO);
-
-    /**
-     * 菜单规则信息删除(物理删)
-     *
-     * @param rulesId 菜单规则id
-     */
-    @RequestMapping(value = "del")
-    ResponseStatus del(@RequestParam("rulesId") String rulesId);
-
-    /**
-     * 资源同步
-     *
-     * @param menuSynId 菜单规则id
-     * @param appId     应用id
-     * @return
-     */
-    @RequestMapping(value = "menuSyn")
-    ResponseStatus menuSyn(@RequestParam("menuSynId")String menuSynId,
-                           @RequestParam("appId")String appId);
-
-    @RequestMapping(value = "menuSynHn")
-    ResponseStatus menuSynHn(@RequestParam("menuSynId")String menuSynId,
-                             @RequestParam("appId")String appId);
-
-    /**
-     * 判断同步规则是否存在
-     *
-     * @param name  规则名称
-     * @param appId 应用id
-     * @return
-     */
-    @RequestMapping(value = "isExist")
-    boolean isExist(@RequestParam("name")String name,
-                    @RequestParam("appId")String appId);
-
-    /**
-     * 保存更新菜单同步规则
-     *
-     * @param ruleConfig
-     */
-    @PostMapping(value = "saveOrUpdate")
-    ResponseDTO saveOrUpdate(@RequestParam("ruleConfig") FuncSyncRuleConfig ruleConfig);
-
-    /**
-     * 根据应用id获取菜单同步规则列表
-     *
-     * @param appId
-     * @return
-     */
-    @RequestMapping(value = "getMenuRuleList")
-    List<MenuInfoVO> getMenuRuleList(@RequestParam("appId")String appId);
-
-}

+ 0 - 178
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/FunEvent.java

@@ -1,178 +0,0 @@
-
-package com.dragoninfo.dcuc.auth.auth.entity;
-
-import com.dragonsoft.duceap.base.entity.persistent.IdEntity;
-import org.hibernate.annotations.GenericGenerator;
-
-import javax.persistence.*;
-
-//功能事件资源表:菜单对应的按钮信息
-@Entity
-@Table(name = "T_FUN_EVENT")
-public class FunEvent implements IdEntity<String> {
-
-	@Id
-	@GeneratedValue(generator="idGenerator")
-	@GenericGenerator(name="idGenerator", strategy="uuid")
-	//编号
-	@Column(name = "ID")
-	private String id;
-
-	//事件名称
-	@Column(name = "NAME")
-	private String name;
-
-	//事件代码
-	@Column(name = "CODE")
-	private String code;
-
-	//功能ID
-	@Column(name = "FUN_ID")
-	private String funId;
-
-	//事件类型(1:公共 2:自定义)
-	@Column(name = "EVENT_TYPE")
-	private String eventType;
-
-	//是否显示(1:在菜单中显示 2:不在菜单中显示)
-	@Column(name = "SHOW_MODE")
-	private String showMode;
-
-	//排序
-	@Column(name = "SEQ")
-	private Integer seq;
-
-	//有效标志(0:无效 1:有效)
-	@Column(name = "IS_ACTIVE")
-	private String isActive = "1";
-
-	//创建时间
-	@Column(name = "CREATE_TIME")
-	private java.util.Date createTime;
-
-	//创建人
-	@Column(name = "CREATOR")
-	private String creator;
-
-	//修改时间
-	@Column(name = "MODIFIED_TIME")
-	private java.util.Date modifiedTime;
-
-	//修改人
-	@Column(name = "MODIFIER")
-	private String modifier;
-
-	//备注
-	@Column(name = "REMARK")
-	private String remark;
-
-	//columns END
-
-		
-	public void setId(String value) {
-		this.id = value;
-	}
-	
-	public String getId() {
-		return this.id;
-	}
-		
-	public void setName(String value) {
-		this.name = value;
-	}
-	
-	public String getName() {
-		return this.name;
-	}
-		
-	public void setCode(String value) {
-		this.code = value;
-	}
-	
-	public String getCode() {
-		return this.code;
-	}
-		
-	public void setFunId(String value) {
-		this.funId = value;
-	}
-	
-	public String getFunId() {
-		return this.funId;
-	}
-		
-	public void setEventType(String value) {
-		this.eventType = value;
-	}
-	
-	public String getEventType() {
-		return this.eventType;
-	}
-		
-	public void setShowMode(String value) {
-		this.showMode = value;
-	}
-	
-	public String getShowMode() {
-		return this.showMode;
-	}
-		
-	public void setSeq(Integer value) {
-		this.seq = value;
-	}
-	
-	public Integer getSeq() {
-		return this.seq;
-	}
-		
-	public void setIsActive(String value) {
-		this.isActive = value;
-	}
-	
-	public String getIsActive() {
-		return this.isActive;
-	}
-		
-	public void setCreateTime(java.util.Date value) {
-		this.createTime = value;
-	}
-	
-	public java.util.Date getCreateTime() {
-		return this.createTime;
-	}
-		
-	public void setCreator(String value) {
-		this.creator = value;
-	}
-	
-	public String getCreator() {
-		return this.creator;
-	}
-		
-	public void setModifiedTime(java.util.Date value) {
-		this.modifiedTime = value;
-	}
-	
-	public java.util.Date getModifiedTime() {
-		return this.modifiedTime;
-	}
-		
-	public void setModifier(String value) {
-		this.modifier = value;
-	}
-	
-	public String getModifier() {
-		return this.modifier;
-	}
-		
-	public void setRemark(String value) {
-		this.remark = value;
-	}
-	
-	public String getRemark() {
-		return this.remark;
-	}
-
-
-}
-

+ 0 - 290
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/FuncApproval.java

@@ -1,290 +0,0 @@
-
-package com.dragoninfo.dcuc.auth.auth.entity;
-
-import com.dragonsoft.duceap.base.entity.persistent.IdEntity;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.hibernate.annotations.GenericGenerator;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import javax.persistence.*;
-import java.util.Date;
-
-//动态审批表
-@Entity
-@Table(name = "T_FUNC_APPROVAL")
-public class FuncApproval implements IdEntity<String> {
-
-	@Id
-	@GeneratedValue(generator="idGenerator")
-	@GenericGenerator(name="idGenerator", strategy="uuid")
-	//编号
-	@Column(name = "ID")
-	private String id;
-
-	//应用ID
-	@Column(name = "APP_ID")
-	private String appId;
-
-	//应用名称
-	@Column(name = "APP_NAME")
-	private String appName;
-
-	//功能id
-	@Column(name = "FUNC_ID")
-	private String funcId;
-
-	//功能名称
-	@Column(name = "FUNC_NAME")
-	private String funcName;
-
-	//角色id
-	@Column(name = "ROLE_ID")
-	private String roleId;
-
-	//申请单位
-	@Column(name = "PROPOSER_ORG")
-	private String proposerOrg;
-
-	//申请人
-	@Column(name = "PROPOSER_Id")
-	private String proposerId;
-
-	//申请人身份证
-	@Column(name = "PROPOSER_IDCARD")
-	private String proposerIdcard;
-
-	//申请时间
-	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
-	@Column(name = "PROPOSER_TIME")
-	private Date proposerTime;
-
-	//申请事由
-	@Column(name = "PROPOSER_REASON")
-	private String proposerReason;
-
-	//审核状态:-1:审批中 0:未通过 1:通过
-	@Column(name = "APPROVAL_STATUS")
-	private String approvalStatus;
-
-	//审批意见
-	@Column(name = "APPROVAL_OPINION")
-	private String approvalOpinion;
-
-	//审批时间
-	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
-	@Column(name = "APPROVAL_TIME")
-	private Date approvalTime;
-
-	//审批人
-	@Column(name = "APPROVAL_ID")
-	private String approvalId;
-
-	//权限有效期限
-	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
-	@Column(name = "VALID_TIME")
-	private Date validTime;
-
-	//有效标志(0:无效 1:有效)
-	@Column(name = "IS_ACTIVE")
-	private String isActive;
-
-	//角色名称
-	@Column(name = "ROLE_NAME")
-	private String roleName;
-
-	//申请人名称
-	@Column(name = "PEOPOSER_NAME")
-	private String proposerName;
-
-	//调用次数
-	@Column(name = "CALL_TIME")
-	private int callTime;
-
-	//申请人机构名称
-	@Transient
-	private String orgName;
-
-	//审批人名称
-	@Transient
-	private String approvalName;
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public String getAppId() {
-		return appId;
-	}
-
-	public void setAppId(String appId) {
-		this.appId = appId;
-	}
-
-	public String getAppName() {
-		return appName;
-	}
-
-	public void setAppName(String appName) {
-		this.appName = appName;
-	}
-
-	public String getFuncId() {
-		return funcId;
-	}
-
-	public void setFuncId(String funcId) {
-		this.funcId = funcId;
-	}
-
-	public String getFuncName() {
-		return funcName;
-	}
-
-	public void setFuncName(String funcName) {
-		this.funcName = funcName;
-	}
-
-	public String getRoleId() {
-		return roleId;
-	}
-
-	public void setRoleId(String roleId) {
-		this.roleId = roleId;
-	}
-
-	public String getProposerOrg() {
-		return proposerOrg;
-	}
-
-	public void setProposerOrg(String proposerOrg) {
-		this.proposerOrg = proposerOrg;
-	}
-
-	public String getProposerId() {
-		return proposerId;
-	}
-
-	public void setProposerId(String proposerId) {
-		this.proposerId = proposerId;
-	}
-
-	public String getProposerIdcard() {
-		return proposerIdcard;
-	}
-
-	public void setProposerIdcard(String proposerIdcard) {
-		this.proposerIdcard = proposerIdcard;
-	}
-
-	public Date getProposerTime() {
-		return proposerTime;
-	}
-
-	public void setProposerTime(Date proposerTime) {
-		this.proposerTime = proposerTime;
-	}
-
-	public String getProposerReason() {
-		return proposerReason;
-	}
-
-	public void setProposerReason(String proposerReason) {
-		this.proposerReason = proposerReason;
-	}
-
-	public String getApprovalStatus() {
-		return approvalStatus;
-	}
-
-	public void setApprovalStatus(String approvalStatus) {
-		this.approvalStatus = approvalStatus;
-	}
-
-	public String getApprovalOpinion() {
-		return approvalOpinion;
-	}
-
-	public void setApprovalOpinion(String approvalOpinion) {
-		this.approvalOpinion = approvalOpinion;
-	}
-
-	public Date getApprovalTime() {
-		return approvalTime;
-	}
-
-	public void setApprovalTime(Date approvalTime) {
-		this.approvalTime = approvalTime;
-	}
-
-	public String getApprovalId() {
-		return approvalId;
-	}
-
-	public void setApprovalId(String approvalId) {
-		this.approvalId = approvalId;
-	}
-
-	public Date getValidTime() {
-		return validTime;
-	}
-
-	public void setValidTime(Date validTime) {
-		this.validTime = validTime;
-	}
-
-	public String getIsActive() {
-		return isActive;
-	}
-
-	public void setIsActive(String isActive) {
-		this.isActive = isActive;
-	}
-
-	public String getRoleName() {
-		return roleName;
-	}
-
-	public void setRoleName(String roleName) {
-		this.roleName = roleName;
-	}
-
-	public String getOrgName() {
-		return orgName;
-	}
-
-	public void setOrgName(String orgName) {
-		this.orgName = orgName;
-	}
-
-	public String getProposerName() {
-		return proposerName;
-	}
-
-	public void setProposerName(String proposerName) {
-		this.proposerName = proposerName;
-	}
-
-	public String getApprovalName() {
-		return approvalName;
-	}
-
-	public void setApprovalName(String approvalName) {
-		this.approvalName = approvalName;
-	}
-
-	public int getCallTime() {
-		return callTime;
-	}
-
-	public void setCallTime(int callTime) {
-		this.callTime = callTime;
-	}
-}
-

+ 0 - 213
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/FuncSyncRuleConfig.java

@@ -1,213 +0,0 @@
-
-package com.dragoninfo.dcuc.auth.auth.entity;
-
-import com.dragonsoft.duceap.base.entity.persistent.IdEntity;
-import org.hibernate.annotations.GenericGenerator;
-import org.springframework.util.StringUtils;
-
-import javax.persistence.*;
-
-//功能数据源同步配置表
-@Entity
-@Table(name = "T_FUNC_SYNC_RULE_CONFIG")
-public class FuncSyncRuleConfig implements IdEntity<String> {
-
-	@Id
-	@GeneratedValue(generator="idGenerator")
-	@GenericGenerator(name="idGenerator", strategy="uuid")
-	//编号
-	@Column(name = "ID")
-	private String id;
-
-	//名称
-	@Column(name = "NAME")
-	private String name;
-
-	//应用ID
-	@Column(name = "APP_ID")
-	private String appId;
-
-	//数据源
-	@Column(name = "DS")
-	private String ds;
-
-	//表用户
-	@Column(name = "OWNER")
-	private String owner;
-
-	//表名或视图名
-	@Column(name = "TABLE_NAME")
-	private String tableName;
-
-	//功能代码字段
-	@Column(name = "FUN_CODE")
-	private String funCode;
-
-	//功能名称字段
-	@Column(name = "FUN_NAME")
-	private String funName;
-
-	//url
-	@Column(name = "URL")
-	private String url;
-
-	//父功能ID
-	@Column(name = "PARENT_MENU_ID")
-	private String parentMenuId;
-
-	//字段显示方式
-	@Column(name = "SHOW_MODE")
-	private Boolean showMode;
-
-	//排序字段
-	@Column(name = "SEQ")
-	private String seq;
-
-	//查询条件
-	@Column(name = "CONDITIONS")
-	private String conditions;
-
-	//同步时间
-	@Column(name = "SYNC_TIME")
-	private java.util.Date syncTime;
-
-	@Transient
-	private String datasourceName;
-
-	//columns END
-
-	public void setId(String value) {
-		this.id = value;
-	}
-	
-	public String getId() {
-		return this.id;
-	}
-		
-	public void setName(String value) {
-		this.name = value;
-	}
-	
-	public String getName() {
-		return this.name;
-	}
-		
-	public void setAppId(String value) {
-		this.appId = value;
-	}
-	
-	public String getAppId() {
-		return this.appId;
-	}
-		
-	public void setDs(String value) {
-		this.ds = value;
-	}
-	
-	public String getDs() {
-		return this.ds;
-	}
-		
-	public void setOwner(String value) {
-		this.owner = value;
-	}
-	
-	public String getOwner() {
-		return this.owner;
-	}
-		
-	public void setTableName(String value) {
-		this.tableName = value;
-	}
-	
-	public String getTableName() {
-		return this.tableName;
-	}
-		
-	public void setFunCode(String value) {
-		this.funCode = value;
-	}
-	
-	public String getFunCode() {
-		return this.funCode;
-	}
-		
-	public void setFunName(String value) {
-		this.funName = value;
-	}
-	
-	public String getFunName() {
-		return this.funName;
-	}
-		
-	public void setUrl(String value) {
-		this.url = value;
-	}
-	
-	public String getUrl() {
-		return this.url;
-	}
-		
-	public void setParentMenuId(String value) {
-		this.parentMenuId = value;
-	}
-	
-	public String getParentMenuId() {
-		return this.parentMenuId;
-	}
-		
-	public void setShowMode(Boolean value) {
-		this.showMode = value;
-	}
-	
-	public Boolean getShowMode() {
-		return this.showMode;
-	}
-		
-	public void setSeq(String value) {
-		this.seq = value;
-	}
-	
-	public String getSeq() {
-		return this.seq;
-	}
-
-	public String getConditions() {
-		return translation(conditions);
-	}
-
-	public void setConditions(String conditions) {
-		this.conditions = conditions;
-	}
-
-	public void setSyncTime(java.util.Date value) {
-		this.syncTime = value;
-	}
-	
-	public java.util.Date getSyncTime() {
-		return this.syncTime;
-	}
-
-	public String getDatasourceName() {
-		return datasourceName;
-	}
-
-	public void setDatasourceName(String datasourceName) {
-		this.datasourceName = datasourceName;
-	}
-	/**
-	 * 转译
-	 * @param value 需要转译的值
-	 * @return 转译后的值
-	 */
-	private String translation(String value) {
-		if (StringUtils.isEmpty(value))return value;
-			//You'll need to remove the spaces from the html entities below
-		value = value.replaceAll("&lt;","<" ).replaceAll("&gt;",">");
-		value = value.replaceAll("&#40;","\\(").replaceAll("&#41;","\\)");
-		value = value.replaceAll("&#39;","'");
-
-		return value;
-	}
-}
-

+ 0 - 106
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/MdAppDataSource.java

@@ -1,106 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.entity;
-
-import com.dragonsoft.duceap.base.entity.persistent.IdEntity;
-import org.hibernate.annotations.GenericGenerator;
-
-import javax.persistence.*;
-import java.util.Date;
-
-@Entity
-@Table(name = "T_MD_APP_DATASOURCE")
-public class MdAppDataSource implements IdEntity<String> {
-
-    //    数据源编号
-    @Id
-    @GeneratedValue(generator = "idGenerator")
-    @GenericGenerator(name = "idGenerator", strategy = "uuid")
-    @Column(name = "ID")
-    private String id;
-
-    //应用编号
-    @Column(name = "APPLY_ID")
-    private String applyId;
-
-    //
-    @Column(name = "APPLY_NAME")
-    private String applyName;
-
-    @Column(name = "DATASOURCE_ID")
-    private String datasourceId;
-
-    @Column(name = "CREATE_USER")
-    private String createUser;
-
-    @Column(name = "CREATE_TIME")
-    private Date createTime;
-
-    @Column(name = "UPDATE_USER")
-    private String updateUser;
-
-    @Column(name = "UPDATE_TIME")
-    private Date updateTime;
-
-    public String getApplyId() {
-        return applyId;
-    }
-
-    public void setApplyId(String applyId) {
-        this.applyId = applyId;
-    }
-
-    public String getApplyName() {
-        return applyName;
-    }
-
-    public void setApplyName(String applyName) {
-        this.applyName = applyName;
-    }
-
-    public String getCreateUser() {
-        return createUser;
-    }
-
-    public void setCreateUser(String createUser) {
-        this.createUser = createUser;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getUpdateUser() {
-        return updateUser;
-    }
-
-    public void setUpdateUser(String updateUser) {
-        this.updateUser = updateUser;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getDatasourceId() {
-        return datasourceId;
-    }
-
-    public void setDatasourceId(String datasourceId) {
-        this.datasourceId = datasourceId;
-    }
-}

+ 0 - 364
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/MdDataSource.java

@@ -1,364 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.entity;
-
-import com.dragonsoft.duceap.base.entity.persistent.IdEntity;
-import org.hibernate.annotations.GenericGenerator;
-
-import javax.persistence.*;
-import java.util.Date;
-
-/**
- * Created by huanghy on 2018/10/17.
- */
-@Entity
-@Table(name = "T_MD_DATASOURCE")
-public class MdDataSource implements IdEntity<String> {
-
-    @Id
-    @GeneratedValue(generator="idGenerator")
-    @GenericGenerator(name="idGenerator", strategy="uuid")
-
-    //数据源编号
-    @Column(name = "DATASOURCE_ID")
-    private String datasourceId;
-
-    //数据库中文名
-    @Column(name = "NAME")
-    private String name;
-
-    //数据库类型
-    @Column(name = "DB_TYPE")
-    private String dbType;
-
-    //JNDI名称
-    @Column(name = "JNDI_NAME")
-    private String jndiName;
-
-    //用户名
-    @Column(name = "USERNAME")
-    private String username;
-
-    //密码
-    @Column(name = "PASSWORD")
-    private String password;
-
-    //连接串
-    @Column(name = "DB_URL")
-    private String dbUrl;
-
-    //字符集(0:中文;1:英文)
-    @Column(name = "CHARSET")
-    private String charset;
-
-    //主机IP地址
-    @Column(name = "IP_ADDRESS")
-    private String ipAddress;
-
-    //服务器端口
-    @Column(name = "SERVER_PORT")
-    private String serverPort;
-
-    //最大连接数
-    @Column(name = "MAX_CONN_COUNT")
-    private int maxConnCount;
-
-    //最小连接数
-    @Column(name = "MIN_CONN_COUNT")
-    private int minConnCount;
-
-    //数据库名
-    @Column(name = "DBNAME")
-    private String dbname;
-
-    //数据库别名
-    @Column(name = "DATASOURCE_ALIAS")
-    private String datasourceAlias;
-
-    //是否启用数据源(1启用,0不启用)
-    @Column(name = "IS_ENABLED")
-    private String isEnabled;
-
-    //内置数据源标识符(1内置,0用户定义)
-    @Column(name = "IS_SYSTEM")
-    private String isSystem;
-
-    //是否延迟加载成连接池 1-是 0-否
-    @Column(name = "IS_LAZYDATAOURCE")
-    private String isLazydataource;
-
-    //创建用户ID
-    @Column(name = "CREATE_USER")
-    private String createUser;
-
-    //创建时间
-    @Column(name = "CREATE_TIME")
-    private Date createTime;
-
-    //创建单位编码
-    @Column(name = "CREATE_DEPT")
-    private String createDept;
-
-    //更新用户ID
-    @Column(name = "UPDATE_USER")
-    private String updateUser;
-
-    //更新时间
-    @Column(name = "UPDATE_TIME")
-    private Date updateTime;
-
-    //更新单位编码
-    @Column(name = "UPDATE_DEPT")
-    private String updateDept;
-
-    //删除标识; 1-删除;0-使用中
-    @Column(name = "IS_DELETED")
-    private String isDeleted;
-
-    //删除时间
-    @Column(name = "DELETE_TIME")
-    private Date deleteTime;
-
-    //删除用户
-    @Column(name = "DELETE_USER")
-    private String deleteUser;
-
-    //删除部门
-    @Column(name = "DELETE_DEPT")
-    private String deleteDept;
-
-    //提供与spring的连接数据源映射,避免连接池重复创建,浪费
-    @Column(name = "validationquery")
-    private String validationquery;
-
-
-    public String getId() {
-        return datasourceId;
-    }
-
-    public void setId(String s) {
-        this.datasourceId = s;
-    }
-
-    public String getDatasourceId() {
-        return datasourceId;
-    }
-
-    public void setDatasourceId(String datasourceId) {
-        this.datasourceId = datasourceId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getDbType() {
-        return dbType;
-    }
-
-    public void setDbType(String dbType) {
-        this.dbType = dbType;
-    }
-
-    public String getJndiName() {
-        return jndiName;
-    }
-
-    public void setJndiName(String jndiName) {
-        this.jndiName = jndiName;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getDbUrl() {
-        return dbUrl;
-    }
-
-    public void setDbUrl(String dbUrl) {
-        this.dbUrl = dbUrl;
-    }
-
-    public String getCharset() {
-        return charset;
-    }
-
-    public void setCharset(String charset) {
-        this.charset = charset;
-    }
-
-    public String getIpAddress() {
-        return ipAddress;
-    }
-
-    public void setIpAddress(String ipAddress) {
-        this.ipAddress = ipAddress;
-    }
-
-    public String getServerPort() {
-        return serverPort;
-    }
-
-    public void setServerPort(String serverPort) {
-        this.serverPort = serverPort;
-    }
-
-    public int getMaxConnCount() {
-        return maxConnCount;
-    }
-
-    public void setMaxConnCount(int maxConnCount) {
-        this.maxConnCount = maxConnCount;
-    }
-
-    public int getMinConnCount() {
-        return minConnCount;
-    }
-
-    public void setMinConnCount(int minConnCount) {
-        this.minConnCount = minConnCount;
-    }
-
-    public String getDbname() {
-        return dbname;
-    }
-
-    public void setDbname(String dbname) {
-        this.dbname = dbname;
-    }
-
-    public String getDatasourceAlias() {
-        return datasourceAlias;
-    }
-
-    public void setDatasourceAlias(String datasourceAlias) {
-        this.datasourceAlias = datasourceAlias;
-    }
-
-    public String getIsEnabled() {
-        return isEnabled;
-    }
-
-    public void setIsEnabled(String isEnabled) {
-        this.isEnabled = isEnabled;
-    }
-
-    public String getIsSystem() {
-        return isSystem;
-    }
-
-    public void setIsSystem(String isSystem) {
-        this.isSystem = isSystem;
-    }
-
-    public String getIsLazydataource() {
-        return isLazydataource;
-    }
-
-    public void setIsLazydataource(String isLazydataource) {
-        this.isLazydataource = isLazydataource;
-    }
-
-    public String getCreateUser() {
-        return createUser;
-    }
-
-    public void setCreateUser(String createUser) {
-        this.createUser = createUser;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getCreateDept() {
-        return createDept;
-    }
-
-    public void setCreateDept(String createDept) {
-        this.createDept = createDept;
-    }
-
-    public String getUpdateUser() {
-        return updateUser;
-    }
-
-    public void setUpdateUser(String updateUser) {
-        this.updateUser = updateUser;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getUpdateDept() {
-        return updateDept;
-    }
-
-    public void setUpdateDept(String updateDept) {
-        this.updateDept = updateDept;
-    }
-
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-
-    public Date getDeleteTime() {
-        return deleteTime;
-    }
-
-    public void setDeleteTime(Date deleteTime) {
-        this.deleteTime = deleteTime;
-    }
-
-    public String getDeleteUser() {
-        return deleteUser;
-    }
-
-    public void setDeleteUser(String deleteUser) {
-        this.deleteUser = deleteUser;
-    }
-
-    public String getDeleteDept() {
-        return deleteDept;
-    }
-
-    public void setDeleteDept(String deleteDept) {
-        this.deleteDept = deleteDept;
-    }
-
-    public String getValidationquery() {
-        return validationquery;
-    }
-
-    public void setValidationquery(String validationquery) {
-        this.validationquery = validationquery;
-    }
-}

+ 0 - 141
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/entity/StaffAssignAuthLog.java

@@ -1,141 +0,0 @@
-
-package com.dragoninfo.dcuc.auth.auth.entity;
-
-import com.dragonsoft.duceap.base.entity.persistent.IdEntity;
-import org.hibernate.annotations.GenericGenerator;
-
-import javax.persistence.*;
-import java.util.Date;
-
-
-@Entity
-@Table(name = "T_STAFF_ASSIGN_AUTH_LOG")
-public class StaffAssignAuthLog implements IdEntity<String> {
-
-	@Id
-	@GeneratedValue(generator="idGenerator")
-	@GenericGenerator(name="idGenerator", strategy="uuid")
-	//ID
-	@Column(name = "ID")
-	private String id;
-
-	//管理员ID
-	@Column(name = "MANAGER_ID")
-	private String managerId;
-
-	//应用所属机构ID
-	@Column(name = "APP_ORG_ID")
-	private String appOrgId;
-
-	//应用ID
-	@Column(name = "APP_ID")
-	private String appId;
-
-	//角色ID
-	@Column(name = "ROLE_ID")
-	private String roleId;
-
-	//人员所属机构ID
-	@Column(name = "STAFF_ORG_ID")
-	private String staffOrgId;
-
-	//人员ID
-	@Column(name = "STAFF_ID")
-	private String staffId;
-
-	//状态 10:新建 90:取消
-	@Column(name = "STATUS")
-	private String status;
-
-	//创建时间
-	@Column(name = "CREATE_TIME")
-	private java.util.Date createTime = new Date();
-
-	//创建时间
-	@Column(name = "CHANGE_CONTENT")
-	private String changeContent;
-
-	//columns END
-
-		
-	public void setId(String value) {
-		this.id = value;
-	}
-	
-	public String getId() {
-		return this.id;
-	}
-		
-	public void setManagerId(String value) {
-		this.managerId = value;
-	}
-	
-	public String getManagerId() {
-		return this.managerId;
-	}
-		
-	public void setAppOrgId(String value) {
-		this.appOrgId = value;
-	}
-	
-	public String getAppOrgId() {
-		return this.appOrgId;
-	}
-		
-	public void setAppId(String value) {
-		this.appId = value;
-	}
-	
-	public String getAppId() {
-		return this.appId;
-	}
-		
-	public void setRoleId(String value) {
-		this.roleId = value;
-	}
-	
-	public String getRoleId() {
-		return this.roleId;
-	}
-		
-	public void setStaffOrgId(String value) {
-		this.staffOrgId = value;
-	}
-	
-	public String getStaffOrgId() {
-		return this.staffOrgId;
-	}
-		
-	public void setStaffId(String value) {
-		this.staffId = value;
-	}
-	
-	public String getStaffId() {
-		return this.staffId;
-	}
-		
-	public void setStatus(String value) {
-		this.status = value;
-	}
-	
-	public String getStatus() {
-		return this.status;
-	}
-		
-	public void setCreateTime(java.util.Date value) {
-		this.createTime = value;
-	}
-	
-	public java.util.Date getCreateTime() {
-		return this.createTime;
-	}
-
-    public String getChangeContent() {
-        return changeContent;
-    }
-
-    public void setChangeContent(String changeContent) {
-        this.changeContent = changeContent;
-    }
-}
-

+ 0 - 48
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/ApprovalEventCenterBus.java

@@ -1,48 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.async;
-
-import com.dragoninfo.dcuc.auth.auth.async.subscribe.ApprovalSendMessage;
-import com.google.common.eventbus.AsyncEventBus;
-import com.google.common.eventbus.EventBus;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.concurrent.Executors;
-
-/**
- * 异步处理注册类,在要异步处理的地方,引入此类,调用post方法
- */
-@Component
-public class ApprovalEventCenterBus implements InitializingBean {
-
-    private EventBus eventBus = null;
-
-    @Autowired
-    private ApprovalSendMessage approvalSendMessage;
-
-    /**
-     * 添加异步处理参数
-     * @param object
-     */
-    public void post(Object object){
-        eventBus.post(object);
-    }
-
-    /**
-     * 注册异步处理类
-     * @param object
-     */
-    public void register(Object object){
-        eventBus.register(object);
-    }
-
-    /**
-     * 初始化异步处理参数(单线程、处理类:RecodeLoginLog,可修改)
-     * @throws Exception
-     */
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        eventBus = new AsyncEventBus(EvenBusThreadPoolHolder.executor);
-        eventBus.register(approvalSendMessage);
-    }
-}

+ 2 - 3
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/PermissionUpdateEventBus.java

@@ -4,14 +4,13 @@ package com.dragoninfo.dcuc.auth.auth.async;
 import com.dragoninfo.dcuc.auth.auth.async.subscribe.PermissionUpdateMessage;
 
 import com.dragoninfo.dcuc.auth.auth.vo.PermissionParameter;
+import com.dragoninfo.dcuc.auth.util.ThreadPoolHolder;
 import com.google.common.eventbus.AsyncEventBus;
 import com.google.common.eventbus.EventBus;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.concurrent.Executors;
-
 /**
  * @author huangzqa
  * @date 2020/7/10
@@ -34,7 +33,7 @@ public class PermissionUpdateEventBus implements InitializingBean {
 
     @Override
     public void afterPropertiesSet() {
-        eventBus = new AsyncEventBus(EvenBusThreadPoolHolder.executor);
+        eventBus = new AsyncEventBus(ThreadPoolHolder.executor);
         eventBus.register(permissionUpdateMessage);
     }
 }

+ 2 - 2
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/PermssionServiceUpdateEventBus.java

@@ -2,6 +2,7 @@ package com.dragoninfo.dcuc.auth.auth.async;
 
 import com.dragoninfo.dcuc.auth.auth.async.subscribe.PermissionServiceUpdateMessage;
 import com.dragoninfo.dcuc.auth.auth.dto.AppServiceCodeDto;
+import com.dragoninfo.dcuc.auth.util.ThreadPoolHolder;
 import com.google.common.eventbus.AsyncEventBus;
 import com.google.common.eventbus.EventBus;
 import org.slf4j.Logger;
@@ -11,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
-import java.util.concurrent.*;
 
 /**
  * @Author yica
@@ -38,7 +38,7 @@ public class PermssionServiceUpdateEventBus implements InitializingBean {
 
     @Override
     public void afterPropertiesSet()  {
-            eventBus = new AsyncEventBus(EvenBusThreadPoolHolder.executor);
+            eventBus = new AsyncEventBus(ThreadPoolHolder.executor);
             eventBus.register(permissionServiceUpdateMessage);
     }
 }

+ 0 - 48
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/StaffAssignAuthEventCenterBus.java

@@ -1,48 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.async;
-
-import com.dragoninfo.dcuc.auth.auth.async.subscribe.StaffAssignAuthSendMessage;
-import com.google.common.eventbus.AsyncEventBus;
-import com.google.common.eventbus.EventBus;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.concurrent.Executors;
-
-/**
- * 异步处理注册类,在要异步处理的地方,引入此类,调用post方法
- */
-@Component
-public class StaffAssignAuthEventCenterBus implements InitializingBean {
-
-    private EventBus eventBus = null;
-
-    @Autowired
-    private StaffAssignAuthSendMessage staffAssignAuthSendMessage;
-
-    /**
-     * 添加异步处理参数
-     * @param object
-     */
-    public void post(Object object){
-        eventBus.post(object);
-    }
-
-    /**
-     * 注册异步处理类
-     * @param object
-     */
-    public void register(Object object){
-        eventBus.register(object);
-    }
-
-    /**
-     * 初始化异步处理参数(单线程、处理类:RecodeLoginLog,可修改)
-     * @throws Exception
-     */
-    @Override
-    public void afterPropertiesSet() {
-        eventBus = new AsyncEventBus(EvenBusThreadPoolHolder.executor);
-        eventBus.register(staffAssignAuthSendMessage);
-    }
-}

+ 0 - 113
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/subscribe/ApprovalSendMessage.java

@@ -1,113 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.async.subscribe;
-
-import com.dragoninfo.dcuc.auth.auth.entity.FuncApproval;
-import com.dragoninfo.dcuc.auth.auth.enumresources.MessageTypeEnum;
-import com.dragoninfo.dcuc.auth.config.DcucAuthKafkaConfig;
-import com.dragoninfo.duceap.commons.util.kafka.KafkaServer;
-import com.dragonsoft.duceap.base.entity.security.SecurityUser;
-import com.dragonsoft.duceap.commons.util.date.DateConst;
-import com.dragonsoft.duceap.commons.util.date.DateUtils;
-import com.dragonsoft.duceap.commons.util.enums.EnumUtils;
-import com.dragonsoft.duceap.core.entity.response.ResponseResult;
-import com.dragonsoft.mq.client.model.vo.MessageInfoReqVo;
-import com.dragonsoft.mq.client.model.vo.MessageInfoVo;
-import com.google.common.eventbus.Subscribe;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 异步消息处理
- */
-@Component
-public class ApprovalSendMessage {
-
-    private Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    @Autowired
-    private KafkaServer kafkaServer;
-    @Autowired
-    private DcucAuthKafkaConfig dcucAuthKafkaConfig;
-
-    @Subscribe
-    public void handle(Map<String, Object> paramsMap) {
-        try {
-            FuncApproval approval = (FuncApproval) paramsMap.get("approval");
-            String messageType = (String) paramsMap.get("messageType");
-            SecurityUser securityUser = (SecurityUser) paramsMap.get("securityUser");
-            String topic = dcucAuthKafkaConfig.getMessageTopic();
-            MessageTypeEnum messageTypeEnum = EnumUtils.enumOf(MessageTypeEnum.class, messageType);
-            //消息自定义内容key-value
-            List<Map<String, String>> infoSetList = infoSetVal(approval);
-            //构造消息
-            MessageInfoVo messages = getMessageVo(securityUser, "动态授权审批结果", messageTypeEnum.getLabel(), topic);
-
-            messages.setInfoSet(infoSetList);
-            List<MessageInfoVo> msg = new ArrayList<>();
-            msg.add(messages);
-            //构造发送请求参数体
-            MessageInfoReqVo requestVo = new MessageInfoReqVo();
-            requestVo.setTopic(topic);
-            requestVo.setAppKey(dcucAuthKafkaConfig.getAppkey());
-            requestVo.setAppSecret(dcucAuthKafkaConfig.getAppSecret());
-            requestVo.setMessages(msg);
-            //
-            ResponseResult result = kafkaServer.send(requestVo, dcucAuthKafkaConfig.getKafkaServers());
-        } catch (
-                Exception e) {
-            logger.error("发送消息失败", e);
-        }
-
-    }
-
-    private MessageInfoVo getMessageVo(SecurityUser securityUser, String title, String content, String topic) {
-        MessageInfoVo messageInfoVo = new MessageInfoVo();
-        if (securityUser == null) {
-            messageInfoVo.setUserCode("dcuc");
-            messageInfoVo.setUserName("用户中心");
-            } else {
-                //账号名称
-            messageInfoVo.setUserCode(securityUser.getUserName());
-                //用户名
-            messageInfoVo.setUserName(securityUser.getName());
-            messageInfoVo.setUserPoliceNo(securityUser.getPoliceNo());
-            messageInfoVo.setUserDeptId(securityUser.getDeptId());
-            }
-        messageInfoVo.setUserSystemCode("dcuc");
-        messageInfoVo.setUserSystem("usercenter");
-            //消息类型,与消息主题一致
-        messageInfoVo.setInfoType(topic);
-        messageInfoVo.setTitle(title);
-        messageInfoVo.setContent(content);
-        messageInfoVo.setCreateTime(DateUtils.getCurrTime(DateConst.DB_STORE_TIME));
-        return messageInfoVo;
-    }
-
-    private List<Map<String, String>> infoSetVal(FuncApproval approval) {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
-        List<Map<String, String>> mapList = new ArrayList<>();
-        Map<String, String> map = new HashMap<>();
-        map.put("ID", approval.getId());//编号
-        map.put("APP_ID", approval.getAppId());//应用Id
-        map.put("ROLE_ID", approval.getRoleId());//角色Id
-        map.put("PROPOSER_ORG", approval.getProposerOrg());//申请机构Id
-        map.put("PROPOSER_Id", approval.getProposerId());//申请人userId
-        map.put("PROPOSER_IDCARD", approval.getProposerIdcard());//申请人身份证号
-        map.put("PROPOSER_TIME", approval.getProposerTime() == null ? null : sdf.format(approval.getProposerTime()));//申请时间
-        map.put("PROPOSER_REASON", approval.getProposerReason());//申请事由
-        map.put("APPROVAL_STATUS", approval.getApprovalStatus());//审核状态:-1:审批中 0:未通过 1:通过
-        map.put("APPROVAL_TIME", approval.getApprovalTime() == null ? null : sdf.format(approval.getApprovalTime()));//审批时间
-        map.put("APPROVAL_ID", approval.getApprovalId());//审批人userId
-        map.put("VALID_TIME", approval.getValidTime() == null ? null : sdf.format(approval.getValidTime()));//有效期限
-        map.put("APPROVAL_OPINION", approval.getApprovalOpinion());//审批意见
-        mapList.add(map);
-        return mapList;
-    }
-}

+ 0 - 150
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/subscribe/StaffAssignAuthSendMessage.java

@@ -1,150 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.async.subscribe;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.dragoninfo.dcuc.app.entity.ApplyInfo;
-import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
-import com.dragoninfo.dcuc.auth.auth.bpo.RoleInfoBPO;
-import com.dragoninfo.dcuc.auth.auth.entity.RoleInfo;
-import com.dragoninfo.dcuc.auth.auth.enumresources.MessageTypeEnum;
-import com.dragoninfo.dcuc.auth.auth.service.impl.StaffAssignAuthInfoService;
-import com.dragoninfo.dcuc.auth.config.DcucAuthKafkaConfig;
-import com.dragoninfo.dcuc.auth.sub.entity.AuthUserInfo;
-import com.dragoninfo.dcuc.auth.sub.service.IAuthUserInfoService;
-import com.dragoninfo.duceap.commons.util.kafka.KafkaServer;
-import com.dragonsoft.duceap.base.entity.security.SecurityUser;
-import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
-import com.dragonsoft.duceap.commons.util.date.DateConst;
-import com.dragonsoft.duceap.commons.util.date.DateUtils;
-import com.dragonsoft.duceap.commons.util.string.StringUtils;
-import com.dragonsoft.duceap.core.entity.response.ResponseResult;
-import com.dragonsoft.mq.client.model.vo.MessageInfoReqVo;
-import com.dragonsoft.mq.client.model.vo.MessageInfoVo;
-import com.google.common.eventbus.Subscribe;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 异步消息处理
- */
-@Component
-public class StaffAssignAuthSendMessage {
-
-    private Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    @Autowired
-    private RoleInfoBPO roleInfoBPO;
-    @Autowired
-    private KafkaServer kafkaServer;
-    @Autowired
-    private StaffAssignAuthInfoService staffAssignAuthInfoService;
-
-    @Autowired
-    private IApplyInfoFacade applyInfoFacade;
-    @Autowired
-    private IAuthUserInfoService authUserInfoService;
-    @Autowired
-    private DcucAuthKafkaConfig dcucAuthKafkaConfig;
-
-
-    @Subscribe
-    public void handle(Map<String, Object> paramsMap) {
-        try {
-            JSONArray staffObjList = (JSONArray) paramsMap.get("staffObjList");
-            String appId = (String) paramsMap.get("appId");
-            SecurityUser securityUser = (SecurityUser) paramsMap.get("securityUser");
-            String topic = dcucAuthKafkaConfig.getMessageJssqTopic();
-            //消息自定义内容key-value
-            List<Map<String, String>> infoSetList = infoSetVal(staffObjList, appId);
-            //构造消息
-            MessageInfoVo messages = getMessageVo(securityUser, "角色授权变更", MessageTypeEnum.JSSQBG.getLabel(), topic);
-            messages.setInfoSet(infoSetList);
-            List<MessageInfoVo> msg = new ArrayList<>();
-            msg.add(messages);
-            //构造发送请求参数体
-            MessageInfoReqVo requestVo = new MessageInfoReqVo();
-            requestVo.setTopic(topic);
-            requestVo.setAppKey(dcucAuthKafkaConfig.getAppkey());
-            requestVo.setAppSecret(dcucAuthKafkaConfig.getAppSecret());
-            requestVo.setMessages(msg);
-            //
-            ResponseResult result = kafkaServer.send(requestVo, dcucAuthKafkaConfig.getKafkaServers());
-        } catch (
-                Exception e) {
-            logger.error("发送消息失败", e);
-        }
-
-    }
-
-    private List<Map<String, String>> infoSetVal(JSONArray staffObjList, String appId) {
-        String appCode = "";
-        List<Map<String, String>> infoSetList = new ArrayList<>();
-        if (CollectionUtils.isEmpty(staffObjList)) {
-            return infoSetList;
-        }
-        for (Object o : staffObjList) {
-            JSONObject jsonObject = (JSONObject) o;
-            String userId = (String) jsonObject.get("id");
-            logger.info("消息发送参数[userId:{},appId:{}]", userId, appId);
-            //获取变更用户的身份证号
-            AuthUserInfo userInfo = authUserInfoService.findById(userId);
-            //获取变更的应用code
-            if (StringUtils.isNotEmpty(appId) && StringUtils.isEmpty(appCode)) {
-                ApplyInfo applyInfo = applyInfoFacade.applyDetail(appId);
-                appCode = applyInfo.getApplyCode();
-            }
-            //变更后现有对应应用的角色代码
-            StringBuilder roleCodes = new StringBuilder();
-            if (StringUtils.isNotEmpty(appId)) {
-                List<String> roleIds = staffAssignAuthInfoService.getRoleIds(userId, appId);
-                for (String roleId : roleIds) {
-                    RoleInfo roleInfo = roleInfoBPO.get(roleId);
-                    roleCodes.append(roleInfo.getCode()).append(",");
-                }
-                if (StringUtils.isNotEmpty(roleCodes.toString())) {
-                    roleCodes = new StringBuilder(roleCodes.substring(0, roleCodes.length() - 1));
-                }
-            }
-            Map<String, String> map = new HashMap<>();
-            map.put("OPERATE_TYPE", MessageTypeEnum.JSSQBG.getValue());
-            map.put("IDCARD", userInfo.getIdcard());
-            map.put("APP_CODE", appCode);
-            map.put("ROLE_CODES", roleCodes.toString());
-            infoSetList.add(map);
-        }
-        return infoSetList;
-    }
-
-    private MessageInfoVo getMessageVo(SecurityUser securityUser, String title, String content, String topic) {
-        MessageInfoVo messageInfoVo = new MessageInfoVo();
-        if (securityUser == null) {
-            messageInfoVo.setUserCode("dcuc");
-            messageInfoVo.setUserName("用户中心");
-        } else {
-            //账号名称
-            messageInfoVo.setUserCode(securityUser.getUserName());
-            //用户名
-            messageInfoVo.setUserName(securityUser.getName());
-            messageInfoVo.setUserPoliceNo(securityUser.getPoliceNo());
-            messageInfoVo.setUserDeptId(securityUser.getDeptId());
-        }
-        messageInfoVo.setUserSystemCode("dcuc");
-        messageInfoVo.setUserSystem("usercenter");
-        //消息类型,与消息主题一致
-        messageInfoVo.setInfoType(topic);
-        messageInfoVo.setTitle(title);
-        messageInfoVo.setContent(content);
-        messageInfoVo.setCreateTime(DateUtils.getCurrTime(DateConst.DB_STORE_TIME));
-        return messageInfoVo;
-    }
-
-
-
-}

+ 0 - 13
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/ApprovalBPO.java

@@ -1,13 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.bpo;
-
-import com.dragoninfo.dcuc.auth.auth.entity.FuncApproval;
-import com.dragoninfo.duceap.core.persistent.BaseBPO;
-import org.springframework.stereotype.Repository;
-
-/**
- * Created by liws on 2019/3/4.
- */
-@Repository
-public class ApprovalBPO extends BaseBPO<FuncApproval, String> {
-
-}

+ 0 - 59
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/FunEventBPO.java

@@ -1,59 +0,0 @@
-
-package com.dragoninfo.dcuc.auth.auth.bpo;
-
-
-import com.dragoninfo.dcuc.auth.auth.entity.FunEvent;
-import com.dragoninfo.dcuc.auth.auth.vo.EventInfoVO;
-import com.dragoninfo.duceap.core.persistent.BaseBPO;
-import com.dragonsoft.duceap.commons.util.string.StringUtils;
-import com.dragonsoft.duceap.core.persistent.factory.PersistentFactory;
-import com.dragonsoft.duceap.core.search.Searchable;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public class FunEventBPO extends BaseBPO<FunEvent, String> {
-
-    public List<FunEvent> getMenuData(String pkMenuId, Searchable searchable) {
-        pkMenuId = (pkMenuId == null) ? "" :pkMenuId;
-        String hql = "from FunEvent t where (t.funId is null or t.funId = '') and t.eventType = '1' or  t.funId = '" + pkMenuId + "'";
-        return getBaseDAOHibernate().find(hql);
-    }
-
-    public void deleteFunEvent(List<String> idList, String idPlace) {
-        StringBuffer stringBuffer1 = new StringBuffer();
-        StringBuffer stringBuffer2 = new StringBuffer();
-
-        stringBuffer1.append("delete from FunEvent a where a.funId = ? ");
-        stringBuffer2.append("delete from RoleFunRsRl r where r.funId = ?");
-
-        if (!StringUtils.isEmpty(idPlace)) {
-            stringBuffer1.append("and a.id not in (" + idPlace + ")");
-            stringBuffer2.append("and r.eventId not in (" + idPlace + ")");
-            PersistentFactory.getHibernateDao().bulkUpdate(stringBuffer1.toString(), idList.toArray());
-            PersistentFactory.getHibernateDao().bulkUpdate(stringBuffer2.toString(), idList.toArray());
-        }else{
-            PersistentFactory.getHibernateDao().bulkUpdate(stringBuffer1.toString(), idList.toArray());
-            PersistentFactory.getHibernateDao().bulkUpdate(stringBuffer2.toString(), idList.toArray());
-        }
-    }
-
-
-    public List<EventInfoVO> getEventByTreeId(String treeId) {
-        String hql = "select new com.dragoninfo.dcuc.auth.auth.vo.EventInfoVO(t.id,t.code,t.name,t.eventType,t.showMode) from FunEvent t where (t.funId is null or t.funId = '') and t.eventType = '1' or t.funId = ?";
-        return PersistentFactory.getHibernateDao().find(hql, treeId);
-    }
-
-    public List<EventInfoVO> getEventByFunIds(String funIds){
-        String hql = "select new com.dragoninfo.dcuc.auth.auth.vo.EventInfoVO(t.id,t.code,t.name,t.eventType," +
-                "t.showMode,t.funId) from FunEvent t where t.funId in (?)";
-        return PersistentFactory.getHibernateDao().find(hql,funIds);
-    }
-
-    public List<EventInfoVO> getEventNoFunId(){
-        String hql = "select new com.dragoninfo.dcuc.auth.auth.vo.EventInfoVO(t.id,t.code,t.name,t.eventType," +
-                "t.showMode,t.funId) from FunEvent t where (t.funId is null or t.funId = '') and t.eventType = '1'";
-        return PersistentFactory.getHibernateDao().find(hql);
-    }
-}

+ 0 - 45
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/FuncSyncRuleConfigBPO.java

@@ -1,45 +0,0 @@
-
-package com.dragoninfo.dcuc.auth.auth.bpo;
-
-import com.dragoninfo.dcuc.auth.auth.entity.FuncSyncRuleConfig;
-import com.dragoninfo.dcuc.auth.auth.vo.MenuInfoVO;
-import com.dragoninfo.duceap.core.persistent.BaseBPO;
-import com.dragonsoft.duceap.core.persistent.factory.PersistentFactory;
-import com.dragonsoft.duceap.core.search.Searchable;
-import org.springframework.data.domain.Page;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public class FuncSyncRuleConfigBPO extends BaseBPO<FuncSyncRuleConfig, String> {
-    /**
-     * 菜单规则信息删除
-     */
-    public void del(String rulesId) {
-        PersistentFactory.getHibernateDao().delete(FuncSyncRuleConfig.class, rulesId);
-    }
-
-    public Page<FuncSyncRuleConfig> getMenuRulesList(String applicationId, Searchable searchable) {
-        String sql = "select * from T_FUNC_SYNC_RULE_CONFIG a where a.app_id= ?";
-        Page<FuncSyncRuleConfig> page = PersistentFactory.getJdbcDao().paging(sql, searchable, FuncSyncRuleConfig.class, applicationId);
-        return page;
-    }
-
-    public List<FuncSyncRuleConfig> menuSyn(String menuSyn) {
-        String hql = "from FuncSyncRuleConfig t where t.id = '" + menuSyn + "'";
-        return PersistentFactory.getHibernateDao().find(hql);
-    }
-
-    public int isExist(String name, String appId) {
-        String hql = "from FuncSyncRuleConfig where name in (select name from FuncSyncRuleConfig where name = ? ) and appId = ?";
-        List<FuncSyncRuleConfig> funcSyncRuleConfigs = PersistentFactory.getHibernateDao().find(hql, new Object[]{name, appId});
-        return (funcSyncRuleConfigs != null && funcSyncRuleConfigs.size() > 0) ? funcSyncRuleConfigs.size() : 0;
-    }
-
-    public List<MenuInfoVO> getMenuRuleList(String appId) {
-        String hql = "select new com.dragoninfo.dcuc.auth.auth.vo.MenuInfoVO(t.id,t.name,t.url) from FuncSyncRuleConfig t where t.appId = ?";
-        List<MenuInfoVO> menuInfoVOs = PersistentFactory.getHibernateDao().find(hql, appId);
-        return menuInfoVOs;
-    }
-}

+ 0 - 31
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/ServiceAuthFlowBPO.java

@@ -1,31 +0,0 @@
-//package com.dragoninfo.dcuc.auth.auth.bpo;
-//
-//
-//import com.dragoninfo.dcuc.auth.auth.entity.ServiceAuthFlow;
-//import com.dragoninfo.duceap.core.persistent.BaseBPO;
-//import com.dragonsoft.duceap.base.enums.BooleanEnum;
-//import com.dragonsoft.duceap.core.persistent.factory.PersistentFactory;
-//import org.springframework.stereotype.Repository;
-//
-///**
-// * @author Administrator
-// * @Description
-// * @create 2020-11-25 14:31
-// */
-//@Repository
-//public class ServiceAuthFlowBPO extends BaseBPO<ServiceAuthFlow,String> {
-//
-//    /**
-//     * 校验申请单id
-//     * @param applicantId
-//     * @return
-//     */
-//    public boolean checkApplicantId(String applicantId){
-//        String sql="select  count(*) from  t_service_auth_flow where applicant_id = ? and deleted= ?";
-//        int i = PersistentFactory.getJdbcDao().queryForInt(sql, new Object[]{applicantId, BooleanEnum.FALSE.value});
-//        if (i==0){
-//            return false;
-//        }
-//        return true;
-//    }
-//}

+ 0 - 65
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/StaffAssignAuthLogBPO.java

@@ -1,65 +0,0 @@
-
-package com.dragoninfo.dcuc.auth.auth.bpo;
-
-import com.dragoninfo.dcuc.common.SystemConstant;
-import com.dragoninfo.dcuc.auth.auth.entity.RoleInfo;
-import com.dragoninfo.dcuc.auth.auth.entity.StaffAssignAuthLog;
-import com.dragoninfo.duceap.core.persistent.BaseBPO;
-import com.dragonsoft.duceap.commons.util.string.StringUtils;
-import com.dragonsoft.duceap.core.persistent.dialect.DatabaseType;
-import com.dragonsoft.duceap.core.persistent.factory.PersistentFactory;
-import com.dragonsoft.duceap.core.search.Searchable;
-import org.springframework.data.domain.Page;
-import org.springframework.stereotype.Repository;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-@Repository
-public class StaffAssignAuthLogBPO extends BaseBPO<StaffAssignAuthLog, String> {
-
-    public Page<RoleInfo> roleListByUserIdAndAppId(String userId, String appId, Searchable searchable) {
-        String append="";
-        //当应用appid等于空的时候
-        if (StringUtils.isNotEmpty(appId)){
-             append="and t.app_id = '"+appId+"' ";
-        }
-        String sql = "select * from t_role_info where id in (select distinct role_id from t_Staff_Assign_Auth_Log t " +
-                "where t.staff_id=? "+append+")";
-        return PersistentFactory.getJdbcDao().paging(sql, searchable, RoleInfo.class,  userId);
-    }
-
-    public Page<Map<String, String>> operateList(Searchable searchable, String createUser) {
-        List<String> params = new ArrayList<String>();
-        StringBuilder sql = new StringBuilder("select t.id,t.app_id as appId,t.role_id as roleId," +
-                "t.staff_id as userId,t.status,t.change_content as content, t.create_time as createTime " +
-                "from t_staff_assign_auth_log t where t.manager_id = ?");
-        params.add(createUser);
-
-        DatabaseType defaultDatabaseType = SystemConstant.getDefaultDatabaseType();
-        StringBuilder conditionSql = new StringBuilder();
-        if (searchable.getSearchFilterByKey("operateTimeKS_eq") != null) {
-            String timeStart = searchable.getSearchFilterByKey("operateTimeKS_eq").getValue().toString() + "000000";
-            searchable.removeSearchFilter("operateTimeKS_eq");
-            if (DatabaseType.ORACLE.equals(defaultDatabaseType)) {
-                conditionSql.append(" and CREATE_TIME >= to_date(?,'yyyy/mm/dd hh24:mi:ss') ");
-            } else if (DatabaseType.MYSQL.equals(defaultDatabaseType)) {
-                conditionSql.append(" and CREATE_TIME >= str_to_date(?,'%Y%m%d%H%i%s') ");
-            }
-            params.add(timeStart);
-        }
-        if (searchable.getSearchFilterByKey("operateTimeJS_eq") != null) {
-            String timeEnd = searchable.getSearchFilterByKey("operateTimeJS_eq").getValue().toString() + "235959";
-            searchable.removeSearchFilter("operateTimeJS_eq");
-            if (DatabaseType.ORACLE.equals(defaultDatabaseType)) {
-                conditionSql.append(" and CREATE_TIME <= to_date(?,'yyyy/mm/dd hh24:mi:ss') ");
-            } else if (DatabaseType.MYSQL.equals(defaultDatabaseType)) {
-                conditionSql.append(" and CREATE_TIME <= str_to_date(?,'%Y%m%d%H%i%s') ");
-            }
-            params.add(timeEnd);
-        }
-        sql.append(conditionSql).append(" order by t.create_time desc");
-        return PersistentFactory.getJdbcDao().paging(sql.toString(), searchable, params.toArray());
-    }
-}

+ 0 - 30
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/AppFunEventFacade.java

@@ -1,30 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.facade;
-
-import com.dragoninfo.dcuc.auth.auth.vo.EventInfoVO;
-import com.dragoninfo.dcuc.auth.power.facade.IAppFunEventFacade;
-import com.dragoninfo.dcuc.auth.power.facade.IFunEventFacade;
-import com.dragoninfo.dcuc.auth.util.DcucConstantsUtil;
-import com.dragonsoft.duceap.base.exception.ApplicationException;
-import com.dragonsoft.duceap.commons.util.string.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.*;
-
-/**·
- * Created by huanghy on 2018/7/9.
- */
-@RestController
-@RequestMapping(value = "/dcuc/auth/appFunEventFacade")
-public class AppFunEventFacade implements IAppFunEventFacade {
-
-    @Autowired
-    private IFunEventFacade funEventFacade;
-
-    public List<EventInfoVO> getEventByFunId(String funId) {
-        if (StringUtils.isEmpty(funId))
-            throw new ApplicationException(DcucConstantsUtil.loadRequired(DcucConstantsUtil.FUN_ID));
-        return funEventFacade.getEventByTreeId(funId);
-    }
-}

+ 0 - 60
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/ApprovalFacade.java

@@ -1,60 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.facade;
-
-import com.dragoninfo.dcuc.auth.api.vo.zerotrust.ZeroTrustMessageRespVO;
-import com.dragoninfo.dcuc.auth.auth.dto.ApprovalDto;
-import com.dragoninfo.dcuc.auth.auth.service.IApprovalService;
-import com.dragoninfo.dcuc.auth.auth.entity.FuncApproval;
-import com.dragoninfo.dcuc.auth.auth.vo.zerotrust.approval.ApprovalCallBackReqVO;
-import com.dragoninfo.dcuc.auth.business.zerotrust.IZeroTrustApprovalBusiness;
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * Created by liws on 2019/3/4.
- */
-@RestController
-@RequestMapping(value = "/dcuc/auth/approvalFacade")
-public class ApprovalFacade implements IApprovalFacade {
-
-    @Autowired
-    private IApprovalService iApprovalService;
-
-    @Autowired
-    private IZeroTrustApprovalBusiness zeroTrustApprovalBusiness;
-
-    @Override
-    public ResponseDTO authApply(String appCode, String roleCode, String userIdCard, String approvalIdCard, String reason) {
-        return iApprovalService.authApply(appCode, roleCode, userIdCard, approvalIdCard, reason);
-    }
-
-    @Override
-    public Page<FuncApproval> approvalPage(SearchDTO searchDTO) {
-        return iApprovalService.approvalPage(searchDTO);
-    }
-
-    @Override
-    public ResponseStatus agree(ApprovalDto approvalDto) {
-        return iApprovalService.agree( approvalDto);
-    }
-
-    @Override
-    public ResponseStatus disagree(ApprovalDto approvalDto) {
-        return iApprovalService.disagree( approvalDto);
-    }
-
-    @Override
-    public FuncApproval detail(String id) {
-        return iApprovalService.detail(id);
-    }
-
-    @Override
-    public ResponseDTO applyResult(ApprovalDto approvalDto) {
-        return iApprovalService.applyResult(approvalDto);
-    }
-
-}

+ 0 - 41
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/FunEventFacade.java

@@ -1,41 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.facade;
-
-
-import com.dragoninfo.dcuc.auth.auth.vo.EventInfoVO;
-import com.dragoninfo.dcuc.auth.power.facade.IFunEventFacade;
-import com.dragoninfo.dcuc.auth.auth.entity.FunEvent;
-import com.dragoninfo.dcuc.auth.auth.service.IFunEventService;
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import com.dragonsoft.duceap.core.search.Searchable;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * Created by liws on 2018/6/20.
- */
-@RestController
-@RequestMapping(value = "/dcuc/auth/funEventFacade")
-public class FunEventFacade implements IFunEventFacade {
-    @Autowired
-    private IFunEventService iFunEventService;
-
-    public List<FunEvent> getMenuData(String pkMenuId, SearchDTO searchDTO) {
-        return iFunEventService.getMenuData(pkMenuId, Searchable.toSearchable(searchDTO));
-    }
-
-    public ResponseDTO updateFilter(List<FunEvent> funEventList, String id) {
-        return iFunEventService.updateFilter(funEventList, id);
-    }
-
-    public List<EventInfoVO> getEventByTreeId(String id) {
-        return iFunEventService.getEventByTreeId(id);
-    }
-
-    public List<EventInfoVO> getEventByFunIds(String funIds){
-        return iFunEventService.getEventByFunIds(funIds);
-    }
-}

+ 0 - 57
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/FuncSyncRuleConfigFacade.java

@@ -1,57 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.facade;
-
-import com.dragoninfo.dcuc.auth.auth.entity.FuncSyncRuleConfig;
-import com.dragoninfo.dcuc.auth.auth.vo.MenuInfoVO;
-import com.dragoninfo.dcuc.auth.power.facade.IFuncSyncRuleConfigFacade;
-import com.dragoninfo.dcuc.auth.auth.service.IFuncSyncRuleConfigService;
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import com.dragonsoft.duceap.core.search.Searchable;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * Created by liws on 2018/6/21.
- */
-@RestController
-@RequestMapping(value = "/dcuc/auth/funcSyncRuleConfigFacade")
-public class FuncSyncRuleConfigFacade implements IFuncSyncRuleConfigFacade {
-
-    @Autowired
-    private IFuncSyncRuleConfigService iFuncSyncRuleConfigService;
-
-    public Page<FuncSyncRuleConfig> getMenuRulesList(String applicationId, SearchDTO searchDTO) {
-        return iFuncSyncRuleConfigService.getMenuRulesList(applicationId, Searchable.toSearchable(searchDTO));
-    }
-
-    public ResponseStatus del(String rulesId) {
-        return iFuncSyncRuleConfigService.del(rulesId);
-    }
-
-    public ResponseStatus menuSyn(String menuSynId, String appId) {
-        return iFuncSyncRuleConfigService.menuSyn(menuSynId, appId);
-    }
-
-    public ResponseStatus menuSynHn(String menuSynId,String appId) {
-        return iFuncSyncRuleConfigService.menuSynHn(menuSynId,appId);
-    }
-
-    public boolean isExist(String name, String appId) {
-        return iFuncSyncRuleConfigService.isExist(name, appId);
-    }
-
-    public ResponseDTO saveOrUpdate(FuncSyncRuleConfig ruleConfig) {
-        iFuncSyncRuleConfigService.saveOrUpdate(ruleConfig);
-        return ResponseDTO.success("保存成功", ruleConfig);
-    }
-
-    public List<MenuInfoVO> getMenuRuleList(String appId) {
-        return iFuncSyncRuleConfigService.getMenuRuleList(appId);
-    }
-
-}

+ 0 - 5
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/StaffAssignAuthInfoFacade.java

@@ -35,11 +35,6 @@ public class StaffAssignAuthInfoFacade implements IStaffAssignAuthInfoFacade {
         return staffAssignAuthInfoService.saveStaffRoleAuth(dto);
     }
 
-    @Override
-    public ResponseStatus deleteAllStaffRole(String staffId) {
-        return staffAssignAuthInfoService.deleteAllStaffRole(staffId);
-    }
-
     @Override
     public Page<StaffAssignAuthInfo> findForPage(SearchDTO searchDTO) {
         return staffAssignAuthInfoService.findForPage(searchDTO);

+ 0 - 49
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/StaffAssignAuthInfoLogFacade.java

@@ -1,49 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.facade;
-
-import com.dragoninfo.dcuc.auth.auth.entity.RoleInfo;
-import com.dragoninfo.dcuc.auth.auth.entity.StaffAssignAuthLog;
-import com.dragoninfo.dcuc.auth.auth.service.IStaffAssignAuthLogService;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import com.dragonsoft.duceap.core.search.Searchable;
-import com.dragonsoft.duceap.core.search.filter.Condition;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * Created by Administrator on 2018/11/13.
- */
-@RestController
-@RequestMapping(value = "/dcuc/auth/staffAssignAuthInfoLogFacade")
-public class StaffAssignAuthInfoLogFacade implements IStaffAssignAuthInfoLogFacade {
-
-    @Autowired
-    private IStaffAssignAuthLogService staffAssignAuthLogService;
-
-    @Override
-    public Page<RoleInfo> roleListByUserIdAndAppId(SearchDTO searchDTO) {
-        Searchable searchable = Searchable.toSearchable(searchDTO);
-        String userId = searchable.getSearchFilterByKey("userId_eq").getValue().toString();
-        Condition appId_eq = searchable.getSearchFilterByKey("appId_eq");
-        String appId = appId_eq == null?null:appId_eq.getValue().toString();
-        return staffAssignAuthLogService.roleListByUserIdAndAppId(userId, appId, searchable);
-    }
-
-    @Override
-    public List<StaffAssignAuthLog> staffAssignAuthLogList(String userId, String roleId) {
-        return staffAssignAuthLogService.staffAssignAuthLogList(userId, roleId);
-    }
-
-    @Override
-    public Page<Map<String, String>> operateList(SearchDTO searchDTO) {
-        Searchable searchable = Searchable.toSearchable(searchDTO);
-        String createUser = searchable.getSearchFilterByKey("createUser_eq").getValue().toString();
-        searchable.removeSearchFilter("createUser_eq");
-        return staffAssignAuthLogService.operateList(searchDTO,createUser);
-    }
-
-}

+ 0 - 56
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IApprovalService.java

@@ -1,56 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.service;
-
-import com.dragoninfo.dcuc.auth.auth.dto.ApprovalDto;
-import com.dragoninfo.dcuc.auth.auth.entity.FuncApproval;
-
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import org.springframework.data.domain.Page;
-
-/**
- * Created by liws on 2019/3/4.
- */
-public interface IApprovalService {
-    /**
-     * 新建申请
-     * @param roleCode
-     * @param userIdCard
-     * @param approvalIdCard
-     * @param reason
-     * @return
-     */
-    ResponseDTO authApply( String appCode,  String roleCode,
-                          String userIdCard,
-                          String approvalIdCard,  String reason);
-
-    /**
-     * 申请列表
-     * @param searchDTO
-     * @return
-     */
-    Page<FuncApproval> approvalPage(SearchDTO searchDTO);
-
-    /**
-     * 同意申请
-     * @param approvalDto
-     * @return
-     */
-    ResponseStatus agree(ApprovalDto approvalDto);
-
-    /**
-     * 申请不通过
-     * @param approvalDto
-     * @return
-     */
-    ResponseStatus disagree(ApprovalDto approvalDto);
-
-    /**
-     * 申请详情
-     * @param id
-     * @return
-     */
-    FuncApproval detail(String id);
-
-    ResponseDTO applyResult(ApprovalDto approvalDto);
-}

+ 0 - 20
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IFunEventService.java

@@ -1,20 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.service;
-
-import com.dragoninfo.dcuc.auth.auth.entity.FunEvent;
-import com.dragoninfo.dcuc.auth.auth.vo.EventInfoVO;
-import com.dragoninfo.duceap.core.service.IOldBaseService;
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.core.search.Searchable;
-
-import java.util.List;
-
-public interface IFunEventService extends IOldBaseService<FunEvent, String> {
-
-    List<FunEvent> getMenuData( String pkMenuId, Searchable searchable);
-
-    ResponseDTO updateFilter(List<FunEvent> funEventList, String id);
-
-    List<EventInfoVO> getEventByTreeId(String treeId);
-
-    List<EventInfoVO> getEventByFunIds(String funIds);
-}

+ 0 - 54
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IFuncSyncRuleConfigService.java

@@ -1,54 +0,0 @@
-
-package com.dragoninfo.dcuc.auth.auth.service;
-
-import com.dragoninfo.dcuc.auth.auth.entity.FuncSyncRuleConfig;
-import com.dragoninfo.dcuc.auth.auth.vo.MenuInfoVO;
-import com.dragoninfo.duceap.core.service.IOldBaseService;
-import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
-import com.dragonsoft.duceap.core.search.Searchable;
-import org.springframework.data.domain.Page;
-
-import java.util.List;
-
-public interface IFuncSyncRuleConfigService extends IOldBaseService<FuncSyncRuleConfig, String> {
-
-    /**
-     * 根据应用id获取应用菜单规则同步配置列表
-     *
-     * @param applicationId
-     * @return
-     */
-    Page<FuncSyncRuleConfig> getMenuRulesList( String applicationId, Searchable searchable);
-
-    /**
-     * 菜单规则信息删除
-     *
-     * @param rulesId
-     */
-    ResponseStatus del( String rulesId);
-
-    /**
-     * 资源同步功能
-     *
-     * @param menuSynId
-     */
-    ResponseStatus menuSyn( String menuSynId,  String appId);
-
-    ResponseStatus menuSynHn(String menuSynId, String appId);
-
-    /**
-     * 判断同步规则名称是否存在
-     *
-     * @param name
-     */
-    boolean isExist( String name,  String appId);
-
-    /**
-     * 根据应用id获取菜单同步规则列表
-     *
-     * @param appId
-     * @return
-     */
-    
-    List<MenuInfoVO> getMenuRuleList(String appId);
-}

+ 0 - 36
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IStaffAssignAuthLogService.java

@@ -1,36 +0,0 @@
-
-package com.dragoninfo.dcuc.auth.auth.service;
-
-import com.dragoninfo.dcuc.auth.auth.entity.RoleInfo;
-import com.dragoninfo.dcuc.auth.auth.entity.StaffAssignAuthLog;
-import com.dragoninfo.duceap.core.service.IOldBaseService;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import com.dragonsoft.duceap.core.search.Searchable;
-import org.springframework.data.domain.Page;
-
-import java.util.List;
-import java.util.Map;
-
-public interface IStaffAssignAuthLogService extends IOldBaseService<StaffAssignAuthLog,String> {
-
-    /**
-     * 获取用户曾经和现在拥有的权限
-     * @param userId
-     * @param appId
-     * @param searchable
-     * @return
-     */
-    Page<RoleInfo> roleListByUserIdAndAppId(String userId, String appId,
-                                            Searchable searchable);
-
-    /**
-     * 获取用户的权限变更日志
-     * @param userId
-     * @param roleId
-     * @return
-     */
-    List<StaffAssignAuthLog> staffAssignAuthLogList( String userId,
-                                                     String roleId);
-
-    Page<Map<String,String>> operateList(SearchDTO searchDTO, String createUser);
-}

+ 0 - 257
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/ApprovalService.java

@@ -1,257 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.service.impl;
-
-import com.dragoninfo.dcuc.app.entity.ApplyInfo;
-import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
-import com.dragoninfo.dcuc.auth.auth.async.ApprovalEventCenterBus;
-import com.dragoninfo.dcuc.auth.auth.bpo.AppFunInfoBPO;
-import com.dragoninfo.dcuc.auth.auth.bpo.ApprovalBPO;
-import com.dragoninfo.dcuc.auth.auth.bpo.RoleInfoBPO;
-import com.dragoninfo.dcuc.auth.auth.dto.ApprovalDto;
-import com.dragoninfo.dcuc.auth.auth.entity.AppFunInfo;
-import com.dragoninfo.dcuc.auth.auth.entity.FuncApproval;
-import com.dragoninfo.dcuc.auth.auth.entity.RoleInfo;
-import com.dragoninfo.dcuc.auth.auth.enumresources.ApprovalStatusEnum;
-import com.dragoninfo.dcuc.auth.auth.enumresources.MessageTypeEnum;
-import com.dragoninfo.dcuc.auth.auth.enumresources.YesNotEnum;
-import com.dragoninfo.dcuc.auth.auth.service.IApprovalService;
-import com.dragoninfo.dcuc.auth.auth.service.IStaffAssignAuthInfoService;
-import com.dragoninfo.dcuc.auth.sub.entity.AuthUserInfo;
-import com.dragoninfo.dcuc.auth.sub.service.IAuthUserInfoService;
-import com.dragoninfo.duceap.core.service.impl.BaseService;
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import com.dragonsoft.duceap.base.entity.security.SecurityUser;
-import com.dragonsoft.duceap.base.utils.UserContextUtils;
-import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
-import com.dragonsoft.duceap.commons.util.string.StringUtils;
-import com.dragonsoft.duceap.core.context.ContextUtils;
-import com.dragonsoft.duceap.core.search.Searchable;
-import com.dragonsoft.duceap.core.search.enums.SearchOperator;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Sort;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * Created by liws on 2019/3/4.
- */
-@Service
-@Transactional
-public class ApprovalService extends BaseService<FuncApproval, String> implements IApprovalService {
-    @Autowired
-    private ApprovalBPO approvalBPO;
-    @Autowired
-    private RoleInfoBPO roleBPO;
-    @Autowired
-    private AppFunInfoBPO appFunInfoBPO;
-    @Autowired
-    private ApprovalEventCenterBus approvalEventCenterBus;
-    @Autowired
-    private IStaffAssignAuthInfoService iStaffAssignAuthInfoService;
-
-    @Autowired
-    private IApplyInfoFacade applyInfoFacade;
-
-    @Autowired
-    private IAuthUserInfoService authUserInfoService;
-
-    @Override
-    public ResponseDTO authApply(String appCode, String roleCode, String userIdCard, String approvalIdCard, String reason) {
-
-        ApplyInfo applyInfo = applyInfoFacade.getAppByCode(appCode);
-        if (applyInfo == null) {
-            return ResponseDTO.fail("应用代码不存在,请先创建应用及角色!", (Object) null);
-        }
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.put("code", roleCode);
-        params.put("appId", applyInfo.getId());
-        List<RoleInfo> roleInfos = roleBPO.andsearch(RoleInfo.class, params);
-        if (CollectionUtils.isEmpty(roleInfos)) {
-            return ResponseDTO.fail("角色代码不存在,请先创建角色!", (Object) null);
-        }
-        RoleInfo roleInfo = roleInfos.get(0);
-
-        AuthUserInfo userInfo = authUserInfoService.findByIdcard(userIdCard);
-        if (userInfo == null) {
-            return ResponseDTO.fail("申请人不存在,核对后重新申请!", (Object) null);
-        }
-        AuthUserInfo approvalUser = authUserInfoService.findByIdcard(approvalIdCard);
-
-        if (approvalUser == null) {
-            return ResponseDTO.fail("审批人不存在,核对后重新申请!", (Object) null);
-        }
-        Searchable searchable = Searchable.newSearchable();
-        searchable.addSearchFilter("appId", SearchOperator.eq, applyInfo.getId());
-        searchable.addSearchFilter("roleId", SearchOperator.eq, roleInfo.getId());
-        searchable.addSearchFilter("proposerIdcard", SearchOperator.eq, userIdCard);
-        searchable.addSearchFilter("isActive", SearchOperator.eq, YesNotEnum.YES.getValue());
-        searchable.addSearchFilter("approvalStatus", SearchOperator.ne, ApprovalStatusEnum.NOTPASS.getValue());
-        List<FuncApproval> list = approvalBPO.find(FuncApproval.class, searchable);
-        if (CollectionUtils.isNotEmpty(list)) {
-            FuncApproval approval = list.get(0);
-            if (ApprovalStatusEnum.DOING.getValue().equals(approval.getApprovalStatus())) {
-                return ResponseDTO.fail("申请正在审批中,请勿重复申请!", (Object) null);
-            } else {
-                if (approval.getValidTime() == null || approval.getValidTime().getTime() > System.currentTimeMillis()) {
-                    return ResponseDTO.fail("您已经拥有该权限,无须重新申请!", (Object) null);
-                }
-            }
-        }
-        //把历史申请置为无效
-        searchable.removeSearchFilter("approvalStatus");
-        list = approvalBPO.find(FuncApproval.class, searchable);
-        if (CollectionUtils.isNotEmpty(list)) {
-            for (FuncApproval funcApproval : list) {
-                funcApproval.setIsActive(YesNotEnum.NO.getValue());
-                approvalBPO.update(funcApproval);
-            }
-        }
-        FuncApproval approval = saveFuncApproval(reason, applyInfo, roleInfo, userInfo, approvalUser);
-        return ResponseDTO.success("申请成功,等待审批人审批!", approval);
-    }
-
-    private FuncApproval saveFuncApproval(String reason, ApplyInfo applyInfo, RoleInfo roleInfo, AuthUserInfo userInfo, AuthUserInfo approvalUser) {
-        FuncApproval approval = new FuncApproval();
-        approval.setAppId(roleInfo.getAppId());
-        approval.setAppName(applyInfo.getApplyName());
-        approval.setRoleId(roleInfo.getId());
-        approval.setRoleName(roleInfo.getName());
-        approval.setProposerOrg(userInfo.getOrgId());
-        approval.setProposerId(userInfo.getId());
-        approval.setProposerName(userInfo.getName());
-        approval.setProposerIdcard(userInfo.getIdcard());
-        approval.setProposerTime(new Date());
-        approval.setProposerReason(reason);
-        approval.setApprovalStatus(ApprovalStatusEnum.DOING.getValue());
-        approval.setApprovalId(approvalUser.getId());
-        approval.setIsActive(YesNotEnum.YES.getValue());
-        approval.setCallTime(0);
-        approvalBPO.save(approval);
-        return approval;
-    }
-
-    @Override
-    public Page<FuncApproval> approvalPage(SearchDTO searchDTO) {
-        SecurityUser securityUser = (SecurityUser) ContextUtils.getUserInfo();
-        Searchable searchable = Searchable.toSearchable(searchDTO);
-        searchable.addSearchFilter("isActive", SearchOperator.eq, YesNotEnum.YES.getValue());
-        searchable.addSearchFilter("approvalId", SearchOperator.eq, securityUser.getId());
-        searchable.addSort(Sort.Direction.ASC, "approvalStatus");
-        return approvalBPO.paging(searchable);
-    }
-
-    @Override
-    public ResponseStatus agree(ApprovalDto approvalDto) {
-        FuncApproval approval = approvalBPO.get(approvalDto.getId());
-        approval.setApprovalStatus(ApprovalStatusEnum.PASS.getValue());
-        approval.setApprovalTime(new Date());
-        if (YesNotEnum.YES.getValue().equals(approvalDto.getHasTime())) {
-            DateFormat format1 = new SimpleDateFormat("yyyyMMddHHmmss");
-            Date date = null;
-            try {
-                date = format1.parse(approvalDto.getValidTime());
-            } catch (ParseException e) {
-                return ResponseStatus.fail("保存失败!");
-            }
-            approval.setValidTime(date);
-        }
-        approvalBPO.update(approval);
-        //发送消息到消息中心
-        String activeTime = "长期";
-        if (StringUtils.isNotEmpty(approvalDto.getValidTime())) {
-            activeTime = approvalDto.getValidTime().substring(0, 4) + "-" + approvalDto.getValidTime().substring(4, 6) + "-" + approvalDto.getValidTime().substring(6, 8);
-        }
-        SecurityUser userInfo = UserContextUtils.getCurrentUser();
-        iStaffAssignAuthInfoService.saveStaffAssign(approval.getRoleId(), approval.getProposerOrg(), approval.getAppId(),
-                userInfo.getId(), userInfo.getDeptId(), activeTime, approval.getProposerId());
-        return ResponseStatus.success("保存成功!");
-    }
-
-    @Override
-    public ResponseStatus disagree(ApprovalDto approvalDto) {
-        FuncApproval approval = approvalBPO.get(approvalDto.getId());
-        approval.setApprovalStatus(ApprovalStatusEnum.NOTPASS.getValue());
-        approval.setApprovalOpinion(approvalDto.getApprovalOpinion());
-        approval.setApprovalTime(new Date());
-        approvalBPO.update(approval);
-        //发送消息到消息中心
-        Map<String, Object> map = new HashMap<>();
-        map.put("approval", approval);
-        map.put("securityUser", ContextUtils.getUserInfo());
-        map.put("messageType", MessageTypeEnum.NOTPASS.getValue());
-        approvalEventCenterBus.post(map);
-        return ResponseStatus.success("保存成功!");
-    }
-
-    @Override
-    public FuncApproval detail(String id) {
-        return approvalBPO.get(id);
-    }
-
-    @Override
-    public ResponseDTO applyResult(ApprovalDto approvalDto) {
-        String appCode = approvalDto.getAppCode();
-        ApplyInfo applyInfo = applyInfoFacade.getAppByCode(appCode);
-        if (applyInfo == null) {
-            return ResponseDTO.fail("应用代码不存在!", (Object) null);
-        }
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.put("code", approvalDto.getRoleCode());
-        params.put("appId", applyInfo.getId());
-        List<RoleInfo> roleInfos = roleBPO.andsearch(RoleInfo.class, params);
-        if (CollectionUtils.isEmpty(roleInfos)) {
-            return ResponseDTO.fail("角色代码不存在!", (Object) null);
-        }
-        RoleInfo roleInfo = roleInfos.get(0);
-        Searchable searchable = Searchable.newSearchable();
-        searchable.addSearchFilter("appId", SearchOperator.eq, applyInfo.getId());
-        searchable.addSearchFilter("roleId", SearchOperator.eq, roleInfo.getId());
-        searchable.addSearchFilter("proposerIdcard", SearchOperator.eq, approvalDto.getUserIdCard());
-        searchable.addSearchFilter("isActive", SearchOperator.eq, YesNotEnum.YES.getValue());
-        List<FuncApproval> list = approvalBPO.find(FuncApproval.class, searchable);
-        if (CollectionUtils.isEmpty(list)) {
-            return ResponseDTO.fail("没有您的申请记录!", (Object) null);
-        }
-        FuncApproval approval = list.get(0);
-        if (approval.getApprovalStatus().equals(ApprovalStatusEnum.DOING.getValue())) {
-            return ResponseDTO.success("您的申请还未审批,请耐心等待!", null);
-        } else if (approval.getApprovalStatus().equals(ApprovalStatusEnum.NOTPASS.getValue())) {
-            return ResponseDTO.success("对不起, 您的申请没有通过!", null);
-        }
-        if (approval.getValidTime() == null || approval.getValidTime().getTime() > System.currentTimeMillis()) {
-            //在有效期内
-            List<AppFunInfo> funList = appFunInfoBPO.getByRoleId(roleInfo.getId());
-            List<Map<String, String>> result = new ArrayList<Map<String, String>>();
-            for (AppFunInfo funInfo : funList) {
-                Map<String, String> map = getStringStringMap(funInfo);
-                result.add(map);
-            }
-            approval.setCallTime(approval.getCallTime() + 1);
-            approvalBPO.update(approval);
-            return ResponseDTO.success("审批已通过!", result);
-        } else {
-            return ResponseDTO.success("对不起,该申请已超出有效期!", new ArrayList<Map<String, String>>());
-        }
-    }
-
-    private Map<String, String> getStringStringMap(AppFunInfo funInfo) {
-        Map<String, String> map = new HashMap<String, String>();
-        map.put("id", funInfo.getId());
-        map.put("name", funInfo.getName());
-        map.put("code", funInfo.getCode());
-        map.put("appId", funInfo.getAppId());
-        map.put("parentCode", funInfo.getParentId());
-        map.put("url", funInfo.getUrl());
-        map.put("paramName", funInfo.getParamName());
-        map.put("paramValue", funInfo.getParamValue());
-        map.put("isActive", funInfo.getIsActive());
-        return map;
-    }
-}

+ 0 - 77
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/FunEventService.java

@@ -1,77 +0,0 @@
-package com.dragoninfo.dcuc.auth.auth.service.impl;
-
-
-import com.dragoninfo.dcuc.auth.auth.bpo.FunEventBPO;
-import com.dragoninfo.dcuc.auth.auth.entity.FunEvent;
-import com.dragoninfo.dcuc.auth.auth.service.IFunEventService;
-import com.dragoninfo.dcuc.auth.auth.vo.EventInfoVO;
-import com.dragoninfo.duceap.core.service.impl.BaseService;
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.commons.util.string.StringUtils;
-import com.dragonsoft.duceap.core.search.Searchable;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@Service
-@Transactional
-public class FunEventService extends BaseService<FunEvent, String> implements IFunEventService {
-
-    @Autowired
-    private FunEventBPO funEventBPO;
-
-    public List<FunEvent> getMenuData(String pkMenuId, Searchable searchable) {
-        return funEventBPO.getMenuData(pkMenuId, searchable);
-    }
-
-    public ResponseDTO updateFilter(List<FunEvent> funEventList, String pkMenuId) {
-//		funEventBPO.deleteAndUpdate(pkMenuId);
-        List<String> idList = new ArrayList<String>();
-        String idPlace = "";
-        idList.add(pkMenuId);
-        for (FunEvent funEvent : funEventList) {
-            if (funEvent.getCode().contains("DELETE") || funEvent.getCode().equals("ADD")
-                    || funEvent.getCode().equals("EDIT") || funEvent.getCode().equals("QUERY")) {
-                continue;
-            } else if (funEvent.getId() != null) {
-                this.update(funEvent);
-            } else {
-                funEvent.setFunId(pkMenuId);
-                this.save(funEvent);
-            }
-            idList.add(funEvent.getId());
-            idPlace += ",?";
-        }
-        if (!StringUtils.isEmpty(idPlace))
-            idPlace = idPlace.substring(1);
-        funEventBPO.deleteFunEvent(idList, idPlace);
-        return ResponseDTO.success("保存成功", funEventList);
-    }
-
-
-    public List<EventInfoVO> getEventByTreeId(String treeId) {
-        return funEventBPO.getEventByTreeId(treeId);
-    }
-
-    public List<EventInfoVO> getEventByFunIds(String funIds) {
-        List<EventInfoVO> eventInfoVOList = new ArrayList<EventInfoVO>();
-        String[] funIdsArray = funIds.split(",");
-        StringBuffer ids = new StringBuffer();
-        int count = 1;
-        for (String funId : funIdsArray) {
-            ids.append("'").append(funId).append("',");
-            if (count % 100 == 0) {                                                                                        //一次查询100条记录
-                eventInfoVOList.addAll(funEventBPO.getEventByFunIds(ids.substring(0, ids.length() - 1)));
-                ids = new StringBuffer();
-            }
-            count++;
-        }
-        if (ids.length() > 0)
-            eventInfoVOList.addAll(funEventBPO.getEventByFunIds(ids.substring(0, ids.length() - 1)));                    //查询剩余funId的记录
-        eventInfoVOList.addAll(funEventBPO.getEventNoFunId());                                                        //查询没有funId的记录,将所有查询的记录整合为一条list
-        return eventInfoVOList;
-    }
-}

+ 0 - 351
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/FuncSyncRuleConfigService.java

@@ -1,351 +0,0 @@
-
-
-package com.dragoninfo.dcuc.auth.auth.service.impl;
-
-
-import com.dragoninfo.dcuc.auth.auth.bpo.AppFunInfoBPO;
-import com.dragoninfo.dcuc.auth.auth.bpo.FuncSyncRuleConfigBPO;
-import com.dragoninfo.dcuc.auth.auth.entity.AppFunInfo;
-import com.dragoninfo.dcuc.auth.auth.entity.FuncSyncRuleConfig;
-import com.dragoninfo.dcuc.auth.auth.service.IFuncSyncRuleConfigService;
-import com.dragoninfo.dcuc.auth.auth.vo.MenuInfoVO;
-import com.dragoninfo.dcuc.auth.config.DcucAuthConfig;
-import com.dragoninfo.duceap.core.service.impl.BaseService;
-import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
-import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
-import com.dragonsoft.duceap.commons.util.UUIDUtils;
-import com.dragonsoft.duceap.commons.util.string.StringUtils;
-import com.dragonsoft.duceap.core.persistent.factory.PersistentFactory;
-import com.dragonsoft.duceap.core.search.Searchable;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-//import com.dragonsoft.duceap.resource.facade.IDataSourceService;
-//import com.dragonsoft.duceap.resource.facade.ITableResourceService;
-
-@Service
-@Transactional
-public class FuncSyncRuleConfigService extends BaseService<FuncSyncRuleConfig, String> implements IFuncSyncRuleConfigService {
-
-    @Autowired
-    private FuncSyncRuleConfigBPO funcSyncRuleConfigBPO;
-    //    @Autowired
-//    private ITableResourceService tableResourceService;
-//    @Autowired
-//    private IDataSourceService dataSourceService;
-    @Autowired
-    private DcucAuthConfig dcucAuthConfig;
-    @Autowired
-    private AppFunInfoBPO appFunInfoBPO;
-
-    /**
-     * 根据应用id获取应用菜单规则同步配置列表
-     *
-     * @param applicationId
-     * @return
-     */
-    @Override
-    public Page<FuncSyncRuleConfig> getMenuRulesList(String applicationId, Searchable searchable) {
-        Page<FuncSyncRuleConfig> page = funcSyncRuleConfigBPO.getMenuRulesList(applicationId, searchable);
-        List<Map<String, Object>> list = new ArrayList<>();
-//        List<Map<String, Object>> list = dataSourceService.getDataSources();
-        Map<String, String> dataMap = new HashMap<String, String>();
-        for (Map<String, Object> map : list) {
-            dataMap.put(map.get("code").toString(), map.get("value").toString());
-        }
-        for (FuncSyncRuleConfig fun : page.getContent()) {
-            fun.setDatasourceName(dataMap.get(fun.getDs()));
-        }
-        return page;
-    }
-
-    /**
-     * 应用信息删除
-     */
-    @Override
-    public ResponseStatus del(String rulesId) {
-        funcSyncRuleConfigBPO.del(rulesId);
-        return ResponseStatus.success("删除成功");
-    }
-
-    /**
-     * 资源同步功能
-     *
-     * @param
-     */
-    @Override
-    public ResponseStatus menuSyn(String menuSynId, String appId) {
-        //新数据
-        List<Object[]> appFunInfoList = new ArrayList<Object[]>();
-        //获取旧数据
-        HashMap<String, AppFunInfo> existFunList = getOldAppFunInfos(appId);
-        //更新数据
-        List<AppFunInfo> updateAppFunInfoList = new ArrayList<AppFunInfo>();
-        List<Object[]> delAppFunInfoList = new ArrayList<Object[]>();
-        //新增数据
-        List<Object[]> addAppFunInfoList = new ArrayList<Object[]>();
-        //获取规则表数据
-        addFunInfoList(menuSynId, appId, appFunInfoList);
-
-        if (dcucAuthConfig.getMenuNoclear()) {
-            //不删除旧数据,判断新加入的数据是否在旧数据中存在,存在不重复添加,不存在则加进来
-            calcResult(appId, existFunList, appFunInfoList, updateAppFunInfoList, delAppFunInfoList, addAppFunInfoList);
-            //插入T_APP_FUN_INFO表
-            appFunInfoBPO.batchInsetBaseObject(addAppFunInfoList);
-            appFunInfoBPO.updateOrSave(updateAppFunInfoList);
-            appFunInfoBPO.batchDeleteById(delAppFunInfoList);
-        } else {
-            //删除原来已同步的数据
-            appFunInfoBPO.delByAppId(appId);
-
-            //插入T_APP_FUN_INFO表
-            appFunInfoBPO.batchInsetBaseObject(appFunInfoList);
-        }
-
-
-//        //更新parentId code替换成id
-//        String updateSql = "";
-//        if (DcucConstantsUtil.DATABASE_MYSQL.equals(DcucConstantsUtil.DATABASE_TYPE)) {
-//            updateSql = "update  T_APP_FUN_INFO  t set t.parent_id=(ifnull((select t1.id from (select * from T_APP_FUN_INFO) t1 where  t.parent_id = t1.code and t1.app_id = ? ),t.parent_id)) ";
-//        } else if (DcucConstantsUtil.DATABASE_ORACLE.equals(DcucConstantsUtil.DATABASE_TYPE)) {
-//            updateSql = "update  T_APP_FUN_INFO  t set t.parent_id=(nvl((select t1.id from  T_APP_FUN_INFO t1 where  t.parent_id = t1.code and t1.app_id = ? ),t.parent_id)) ";
-//        }
-//        PersistentFactory.getJdbcDao().update(updateSql,new Object[]{appId});
-        return ResponseDTO.success("同步成功");
-    }
-
-    /**
-     * 组装需要新增,修改,删除的数据
-     *
-     * @param appId                应用Id
-     * @param existFunList         旧数据
-     * @param newFunInfoList       新数据
-     * @param updateAppFunInfoList 更新的数据
-     * @param delAppFunInfoList    删除的数据
-     * @param addAppFunInfoList    新增的数据
-     */
-    private void calcResult(String appId,
-                            HashMap<String, AppFunInfo> existFunList,
-                            List<Object[]> newFunInfoList,
-                            List<AppFunInfo> updateAppFunInfoList,
-                            List<Object[]> delAppFunInfoList,
-                            List<Object[]> addAppFunInfoList) {
-        //循环新数据  objects[0]新增主键 ,objects[1]:name,objects[2]:code
-        for (Object[] objects : newFunInfoList) {
-
-            //对比获取更新数据
-            AppFunInfo appFunInfo = existFunList.get(objects[2]);
-            if (appFunInfo != null && appFunInfo.getCode().equals(objects[2])) {//已存在菜单更新
-                appFunInfo.setName((String) objects[1]);
-                appFunInfo.setUrl((String) objects[4]);
-                appFunInfo.setParentId((String) objects[5]);
-                updateAppFunInfoList.add(appFunInfo);
-                existFunList.remove(objects[2]);
-                continue;
-            }
-            //新增,
-            if (appFunInfo == null) {
-                addAppFunInfoList.add(objects);
-                existFunList.remove(objects[2]);
-            }
-
-        }
-
-        //删除
-        for (String code : existFunList.keySet()) {
-            delAppFunInfoList.add(new Object[]{code});
-        }
-
-         /*  Iterator<Object[]> iterator = appFunInfoList.iterator();
-        while (iterator.hasNext()) {
-            Object[] object = iterator.next();
-            for (AppFunInfo appFunInfo : existFunList) {
-                if (appFunInfo.getCode().equals(object[2])) {
-                    if (!appFunInfo.getName().equals(object[3])){//ID相同Name不同,需要修改名称
-                        //放入需要修改的数据
-                        Object[] updateObjects = new Object[]{
-                                object[1]  ,object[2] ,appId
-                        };
-                        updateAppFunInfoList.add(updateObjects);
-                    }
-                    //appFunInfoList移除需要修改的(appFunInfoList后续作为新增数据)
-                    iterator.remove();
-                }
-            }
-        }*/
-    }
-
-
-    /**
-     * 组装需要新增,修改,删除的数据
-     *
-     * @param appId                应用Id
-     * @param existFunList         旧数据
-     * @param newFunInfoList       新数据
-     * @param updateAppFunInfoList 更新的数据
-     * @param delAppFunInfoList    删除的数据
-     * @param addAppFunInfoList    新增的数据
-     */
-    private void calcResultHn(String appId,
-                              HashMap<String, AppFunInfo> existFunList,
-                              List<Object[]> newFunInfoList,
-                              List<AppFunInfo> updateAppFunInfoList,
-                              List<Object[]> delRoleFunRsRlList,
-                              List<Object[]> delAppFunInfoList,
-                              List<Object[]> addAppFunInfoList) {
-        //循环新数据  objects[0]新增主键 ,objects[1]:name,objects[2]:code
-        for (Object[] objects : newFunInfoList) {
-
-            //对比获取更新数据
-            AppFunInfo appFunInfo = existFunList.get(objects[2]);
-            if (appFunInfo != null && appFunInfo.getCode().equals(objects[2])) {//已存在菜单更新
-                appFunInfo.setName((String) objects[1]);
-                appFunInfo.setUrl((String) objects[4]);
-                appFunInfo.setParentId((String) objects[5]);
-                updateAppFunInfoList.add(appFunInfo);
-                existFunList.remove(objects[2]);
-                continue;
-            }
-            //新增,
-            if (appFunInfo == null) {
-                addAppFunInfoList.add(objects);
-                existFunList.remove(objects[2]);
-            }
-
-        }
-
-        //删除
-        for (String code : existFunList.keySet()) {
-            delAppFunInfoList.add(new Object[]{code, appId});
-            delRoleFunRsRlList.add(new Object[]{appId, code, appId});
-        }
-
-    }
-
-    /**
-     * 资源同步功能
-     *
-     * @param
-     */
-    @Override
-    public ResponseStatus menuSynHn(String menuSynId, String appId) {
-        //新数据
-        List<Object[]> appFunInfoList = new ArrayList<Object[]>();
-        HashMap<String, AppFunInfo> existFunList = getOldAppFunInfos(appId);                         //获取旧数据
-        List<AppFunInfo> updateAppFunInfoList = new ArrayList<AppFunInfo>();                        //更新数据
-        List<Object[]> delRoleFunRsRlList = new ArrayList<Object[]>();                               //同步后需要删除的角色功能关系记录
-        List<Object[]> delAppFunInfoList = new ArrayList<Object[]>();                               //同步后需要删除的功能
-        List<Object[]> addAppFunInfoList = new ArrayList<Object[]>();                               //新增功能数据
-        addFunInfoList(menuSynId, appId, appFunInfoList);                                           //获取规则表数据
-        //不删除旧数据,判断新加入的数据是否在旧数据中存在,存在不重复添加,不存在则加进来
-        calcResultHn(appId, existFunList, appFunInfoList, updateAppFunInfoList, delRoleFunRsRlList, delAppFunInfoList, addAppFunInfoList);
-        appFunInfoBPO.batchInsetBaseObject(addAppFunInfoList);
-        appFunInfoBPO.updateOrSave(updateAppFunInfoList);
-        String delSql = "delete from t_role_fun_rs_rl t where role_id in(select id from t_role_info " +                 //删除同步后不存在的菜单
-                "where app_id = ?) and fun_id = (select id from T_APP_FUN_INFO where code=? and app_id=?)";
-        PersistentFactory.getJdbcDao().batchUpdate(delSql, delRoleFunRsRlList);
-        for (Object[] objects : delAppFunInfoList) {
-            String code = (String) objects[0];
-            String deleteAppId = (String) objects[1];
-            appFunInfoBPO.delByAppIdAndFunCode(deleteAppId, code);
-        }
-        return ResponseDTO.success("同步成功");
-    }
-
-    /**
-     * 获取AppFunInfo旧数据
-     *
-     * @param appId 应用ID
-     * @return
-     */
-    public HashMap<String, AppFunInfo> getOldAppFunInfos(String appId) {
-        Map<String, Object> params = new HashMap<String, Object>();
-        HashMap<String, AppFunInfo> oldAppFun = new HashMap<String, AppFunInfo>();
-        params.put("appId", appId);
-        List<AppFunInfo> list = PersistentFactory.getHibernateDao().andsearch(AppFunInfo.class, params);
-        for (AppFunInfo appFunInfo : list) {
-            oldAppFun.put(appFunInfo.getCode(), appFunInfo);
-        }
-        return oldAppFun;
-    }
-
-    /**
-     * 获取规则表数据
-     *
-     * @param menuSynId
-     * @param appId          应用系统ID
-     * @param appFunInfoList 组装列集合
-     */
-    public void addFunInfoList(String menuSynId, String appId, List<Object[]> appFunInfoList) {
-        FuncSyncRuleConfig funcSyncRuleConfig = funcSyncRuleConfigBPO.menuSyn(menuSynId).get(0);
-        StringBuilder stringBuffer = new StringBuilder();
-        //查询列
-        String tableName = funcSyncRuleConfig.getTableName();
-        String code = funcSyncRuleConfig.getFunCode();
-        String name = funcSyncRuleConfig.getFunName();
-        String url = funcSyncRuleConfig.getUrl();
-        String parentId = funcSyncRuleConfig.getParentMenuId();
-        String columnName = code + "," + name;
-        if (StringUtils.isNotBlank(url)) {
-            columnName += "," + url;
-        }
-        if (StringUtils.isNotBlank(parentId)) {
-            columnName += "," + parentId;
-        }
-        //拼接sql语句
-        stringBuffer.append("select ").append(columnName).append(" from ").append(tableName).append(" ");
-        if (StringUtils.isNotEmpty(funcSyncRuleConfig.getConditions())) {
-            String translation = translation(funcSyncRuleConfig.getConditions());
-            stringBuffer.append("where ").append(translation);
-        }
-        //查出的结果
-        List<Map<String, Object>> checkResultList = new ArrayList<>();
-//        List<Map<String, Object>> checkResultList = tableResourceService.getSourcesData(funcSyncRuleConfig.getDs(), stringBuffer.toString());/**/
-        //查出的结果进行数据处理装在List里
-        for (Map<String, Object> checkResult : checkResultList) {
-            Object[] objects = new Object[]{
-                    UUIDUtils.getUUID(),
-                    checkResult.get(name) == null ? "" : checkResult.get(name).toString(),
-                    checkResult.get(code) == null ? "" : checkResult.get(code).toString(),
-                    appId,
-                    checkResult.get(url) == null ? "" : checkResult.get(url).toString(),
-                    checkResult.get(parentId) == null ? "" : checkResult.get(parentId).toString(),
-                    "1"};
-            appFunInfoList.add(objects);
-        }
-    }
-
-    /**
-     * 转译
-     *
-     * @param value 需要转译的值
-     * @return 转译后的值
-     */
-    private String translation(String value) {
-        if (StringUtils.isNotEmpty(value)) {
-            //You'll need to remove the spaces from the html entities below
-            value = value.replaceAll("&lt;", "<").replaceAll("&gt;", ">");
-            value = value.replaceAll("&#40;", "\\(").replaceAll("&#41;", "\\)");
-            value = value.replaceAll("&#39;", "'");
-        }
-        return value;
-    }
-
-    @Override
-    public boolean isExist(String name, String appId) {
-        return funcSyncRuleConfigBPO.isExist(name, appId) > 0;
-    }
-
-    @Override
-    public List<MenuInfoVO> getMenuRuleList(String appId) {
-        return funcSyncRuleConfigBPO.getMenuRuleList(appId);
-    }
-
-}

+ 68 - 6
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/ServiceAuthResultServiceImpl.java

@@ -7,6 +7,7 @@ import com.dragoninfo.dcuc.app.entity.ServiceResource;
 import com.dragoninfo.dcuc.app.enumresources.ResourceTypeEnum;
 import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
 import com.dragoninfo.dcuc.app.facade.IServiceResourceFacade;
+import com.dragoninfo.dcuc.app.vo.ServiceResourceVo;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.audit.service.log.LogInfoFillService;
 import com.dragoninfo.dcuc.auth.auth.async.PermssionServiceUpdateEventBus;
@@ -14,6 +15,7 @@ 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.entity.zerotrust.ServiceAuthApply;
 import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowStatusEnum;
 import com.dragoninfo.dcuc.auth.auth.po.ServiceAuthResultPO;
 import com.dragoninfo.dcuc.auth.auth.service.IServiceApplyContentService;
@@ -22,7 +24,9 @@ import com.dragoninfo.dcuc.auth.auth.service.IWorkFlowService;
 import com.dragoninfo.dcuc.auth.auth.vo.ServiceAuthenticationResVO;
 import com.dragoninfo.dcuc.duceap.enums.AuthApplyTypeEnum;
 import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
+import com.dragonsoft.duceap.base.entity.security.SecurityUser;
 import com.dragonsoft.duceap.base.enums.BooleanEnum;
+import com.dragonsoft.duceap.base.utils.UserContextUtils;
 import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
 import com.dragonsoft.duceap.commons.util.ip.IpUtils;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
@@ -103,12 +107,12 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
             dto.setPermissionValidType(flowResutlAcceptDTO.getPermissionValidType());
             String startTime = flowResutlAcceptDTO.getStartTime();
             Date start = parseTime(startTime);
-            if (start != null){
+            if (start != null) {
                 dto.setStartTime(start);
             }
             String endTime = flowResutlAcceptDTO.getEndTime();
             Date end = parseTime(endTime);
-            if (end != null){
+            if (end != null) {
                 dto.setEndTime(end);
             }
 
@@ -121,7 +125,7 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
             SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             try {
                 return dateFormat.parse(startTime);
-            }catch (Exception e) {
+            } catch (Exception e) {
                 return null;
             }
         }
@@ -577,13 +581,71 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
         return serviceAuthResultBPO.findAll();
     }
 
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void deleteExpireAuth() {
+        log.info("取消过期的服务授权开始");
+        setAuthSysSecurityUser();
+        List<ServiceAuthResult> expires = serviceAuthResultBPO.getExpiredAuth();
+        if (CollectionUtils.isNotEmpty(expires)) {
+            expires.forEach(e -> {
+                ServiceAuthResultDTO dto = new ServiceAuthResultDTO();
+                dto.setId(e.getId());
+                delServiceAuthResult(dto);
+            });
+        }
+        log.info("取消过期的服务授权结束");
+    }
+
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public void batchSave(List<ServiceAuthResult> serviceAuthResult) {
-        if (CollectionUtils.isEmpty(serviceAuthResult)) {
+    public void startServiceAuthApply(List<ServiceAuthApply> authApplies) {
+        if (CollectionUtils.isEmpty(authApplies)) {
             return;
         }
-        serviceAuthResult.forEach(e-> serviceAuthResultBPO.save(e));
+
+        setAuthSysSecurityUser();
+
+        List<ServiceAuthResult> serviceAuthResult = getServiceAuthResult(authApplies);
+        serviceAuthResult.forEach(e-> {
+            serviceAuthResultBPO.save(e);
+            logInfoFillService.sendServiceAuthLog(AuthResultEnum.SUC, e.getAppId(), e.getServiceCode(), "");
+        });
+    }
+
+    private void setAuthSysSecurityUser() {
+        // 设置当前登录人为系统自动
+        SecurityUser securityUser = new SecurityUser();
+        securityUser.setName("权限服务审批回调处理");
+        UserContextUtils.setCurrentUser(securityUser);
+    }
+
+    private List<ServiceAuthResult> getServiceAuthResult(List<ServiceAuthApply> authApplies) {
+        List<String> appIds = authApplies.stream().map(ServiceAuthApply::getAppId).distinct().collect(Collectors.toList());
+        List<String> serviceIds = authApplies.stream().map(ServiceAuthApply::getServiceId).distinct().collect(Collectors.toList());
+        List<ApplyInfo> appInfos = applyInfoFacade.getAppById(appIds);
+        List<ServiceResourceVo> serviceResourceVos = serviceResourceFacade.getServiceByIds(serviceIds);
+        Map<String, ApplyInfo> appMap = appInfos.stream().collect(Collectors.toMap(ApplyInfo::getId, e -> e));
+        Map<String, ServiceResourceVo> serviceMap = serviceResourceVos.stream().collect(Collectors.toMap(ServiceResourceVo::getId, e -> e));
+        Date createTime = new Date();
+
+        return authApplies.stream().map(e -> {
+            Date endTime = e.getEndTime();
+            ServiceAuthResult authResult = new ServiceAuthResult();
+            String serviceId = e.getServiceId();
+            String appId = e.getAppId();
+            ServiceResourceVo serviceResourceVo = serviceMap.get(serviceId);
+            authResult.setServiceId(serviceId);
+            authResult.setServiceCode(serviceResourceVo.getServiceCode());
+            authResult.setAppId(appId);
+            authResult.setAppCode(appMap.get(appId).getApplyCode());
+            authResult.setEndTime(endTime);
+            authResult.setCreateTime(createTime);
+            authResult.setServiceResourceId(serviceResourceVo.getResourceId());
+
+            return authResult;
+        }).collect(Collectors.toList());
     }
 
 }

+ 80 - 217
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/StaffAssignAuthInfoService.java

@@ -8,7 +8,6 @@ import com.dragoninfo.dcuc.app.entity.ApplyInfo;
 import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.audit.service.log.LogInfoFillService;
-import com.dragoninfo.dcuc.auth.auth.async.StaffAssignAuthEventCenterBus;
 import com.dragoninfo.dcuc.auth.auth.bpo.StaffAssignAuthInfoBPO;
 import com.dragoninfo.dcuc.auth.auth.bpo.po.StaffRoleAuthApiPO;
 import com.dragoninfo.dcuc.auth.auth.dto.AppDataSensitiveLevelDTO;
@@ -17,6 +16,7 @@ import com.dragoninfo.dcuc.auth.auth.dto.StaffRoleOperateDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.UserRoleAuthInfoDTO;
 import com.dragoninfo.dcuc.auth.auth.entity.*;
 import com.dragoninfo.dcuc.auth.auth.entity.zerotrust.AuthRoleOrgRel;
+import com.dragoninfo.dcuc.auth.auth.entity.zerotrust.RoleAuthApply;
 import com.dragoninfo.dcuc.auth.auth.service.*;
 import com.dragoninfo.dcuc.auth.auth.service.zerotrust.IAuthRoleOrgRelService;
 import com.dragoninfo.dcuc.auth.auth.vo.*;
@@ -39,6 +39,7 @@ import com.dragonsoft.duceap.core.search.Searchable;
 import com.dragonsoft.duceap.core.search.enums.SearchOperator;
 import com.dragonsoft.duceap.core.search.filter.Condition;
 import com.dragonsoft.duceap.web.utils.RequestUtils;
+import lombok.extern.slf4j.Slf4j;
 import org.hibernate.criterion.DetachedCriteria;
 import org.hibernate.criterion.Projections;
 import org.hibernate.criterion.Restrictions;
@@ -56,6 +57,7 @@ import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
+@Slf4j
 @Service
 @Transactional
 public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
@@ -69,10 +71,6 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
     @Autowired
     private IRoleInfoService roleInfoService;
     @Autowired
-    private IStaffAssignAuthLogService staffAssignAuthLogService;
-    @Autowired
-    private StaffAssignAuthEventCenterBus staffAssignAuthEventCenterBus;
-    @Autowired
     private IApplyInfoFacade applyInfoFacade;
     @Autowired
     private IAuthUserInfoService authUserInfoService;
@@ -207,31 +205,12 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
             updateNum = dfpNum - needNum;
             bjNum = quotoInfo.getBjNum() + needNum;
         }
-        SecurityUser securityUser = UserContextUtils.getCurrentUser();
         //保存授权、日志
-        addList.forEach(e -> {
-            staffAssignAuthInfoBPO.save(e);
-            String activeTime = e.getActiveTime();
-            String prefix = "有效期至:";
-            if ("长期".equals(activeTime)) {
-                prefix = "有效期为:";
-            }
-            saveLog(e, applyInfo.getOrgCode(), "10", securityUser, prefix + activeTime);
-        });
-        Map<String, StaffAssignAuthInfo> finalExistMap1 = existMap;
+        addList.forEach(e -> staffAssignAuthInfoBPO.save(e));
         //更新有效期、保存日志
-        updateList.forEach(e -> {
-            staffAssignAuthInfoBPO.update(e);
-            String staffId = e.getStaffId();
-            String oldActiveTime = finalExistMap1.get(staffId).getActiveTime();
-            String content = "有效期时间由" + oldActiveTime + "变更为" + e.getActiveTime();
-            saveLog(e, applyInfo.getOrgCode(), "20", securityUser, content);
-        });
+        updateList.forEach(e -> staffAssignAuthInfoBPO.update(e));
         //删除权限、保存日志
-        delList.forEach(e -> {
-            staffAssignAuthInfoBPO.delete(e.getId());
-            saveLog(e, applyInfo.getOrgCode(), "30", securityUser, "");
-        });
+        delList.forEach(e -> staffAssignAuthInfoBPO.delete(e.getId()));
         //更新配额
         if (updateNum != null) {
             quotoInfo.setDfpNum(updateNum);
@@ -243,20 +222,6 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
         return ResponseStatus.success("保存成功!");
     }
 
-    private void saveLog(StaffAssignAuthInfo assignAuthInfo, String appOrgCode, String status, SecurityUser securityUser, String content) {
-        StaffAssignAuthLog staffAssignAuthLog = new StaffAssignAuthLog();
-        staffAssignAuthLog.setAppId(assignAuthInfo.getAppId());
-        staffAssignAuthLog.setRoleId(assignAuthInfo.getRoleId());
-        staffAssignAuthLog.setStaffId(assignAuthInfo.getStaffId());
-        staffAssignAuthLog.setCreateTime(new Date());
-        staffAssignAuthLog.setStaffOrgId(assignAuthInfo.getStaffOrgId());
-        staffAssignAuthLog.setManagerId(securityUser.getId());
-        staffAssignAuthLog.setStatus(status);
-        staffAssignAuthLog.setAppOrgId(appOrgCode); // 之后取appOrgId
-        staffAssignAuthLog.setChangeContent(content);
-        staffAssignAuthLogService.save(staffAssignAuthLog);
-    }
-
     private List<StaffAssignAuthInfo> getRoleAuthByOrgId(String orgId, String roleId) {
         Searchable searchable = Searchable.newSearchable();
         searchable.addSearchFilter("role_id", SearchOperator.eq, roleId);
@@ -278,20 +243,6 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
         return authInfo;
     }
 
-    /**
-     * 人员角色变更消息发送
-     *
-     * @param staffObjList
-     * @param appId
-     */
-    private void sendMessage(JSONArray staffObjList, String appId) {
-        Map<String, Object> paramsObject = new HashMap<String, Object>();
-        paramsObject.put("staffObjList", staffObjList);
-        paramsObject.put("appId", appId);
-        paramsObject.put("securityUser", ContextUtils.getUserInfo());
-        staffAssignAuthEventCenterBus.post(paramsObject);
-    }
-
     private boolean isEnoughQuota(String appId, String roleId, String orgId, int needNum, boolean isAdd) {
         RoleInfo roleInfo = roleInfoService.get(roleId);
         if (BooleanEnum.FALSE.getValue().equals(roleInfo.getIsNotLimitCount())) {
@@ -321,10 +272,6 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
                 }
                 staffAssignAuthInfo.setActiveTime(activeTime);
                 this.update(staffAssignAuthInfo);
-                //记录修改日志
-
-                //保存T_STAFF_ASSIGN_AUTH_INFO表
-                saveLog(roleId, orgId, appId, user, staffId, "20", "有效时间由" + oldActiveTime + "变更为" + activeTime);
             }
             return "update";
         } else {
@@ -340,127 +287,30 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
             }
             staffAssignAuthInfo.setActiveTime(activeTime);
             this.save(staffAssignAuthInfo);
-            //记录授权日志
-
-            //保存T_STAFF_ASSIGN_AUTH_INFO表
-            String prefix = "有效期至:";
-            if ("长期".equals(activeTime)) {
-                prefix = "有效期为:";
-            }
-            saveLog(roleId, orgId, appId, user, staffId, "10", prefix + activeTime);
             return "save";
         }
     }
 
-    private void saveLog(String roleId, String orgId, String appId, SecurityUser user, String staffId, String status, String changeContent) {
-        ApplyInfo applyInfo = applyInfoFacade.applyDetail(appId);
-        StaffAssignAuthLog staffAssignAuthLog = new StaffAssignAuthLog();
-        staffAssignAuthLog.setAppId(appId);
-        staffAssignAuthLog.setRoleId(roleId);
-        staffAssignAuthLog.setStaffId(staffId);
-        staffAssignAuthLog.setCreateTime(new Date());
-        staffAssignAuthLog.setStaffOrgId(orgId);
-        if (null != user) {
-            staffAssignAuthLog.setManagerId(user.getId());
-        }
-        staffAssignAuthLog.setStatus(status);
-        staffAssignAuthLog.setAppOrgId(applyInfo.getOrgCode()); // 之后取appOrgId
-        staffAssignAuthLog.setChangeContent(changeContent);
-        staffAssignAuthLogService.save(staffAssignAuthLog);
-    }
-
     public void deletedAuth(List<StaffAssignAuthInfo> staffAssignAuthInfos) {
         if (staffAssignAuthInfos == null) {
             return;
         }
         for (StaffAssignAuthInfo staffAssignAuthInfo : staffAssignAuthInfos) {
             this.delete(staffAssignAuthInfo.getId());
-            //记录取消授权日志
-            saveLog(staffAssignAuthInfo.getRoleId(), staffAssignAuthInfo.getStaffOrgId(), staffAssignAuthInfo.getAppId(), (SecurityUser) ContextUtils.getUserInfo(), staffAssignAuthInfo.getStaffId(), "30", "");
-        }
-    }
-
-    public void deletedAuthAndUpdateQuota(StaffAssignAuthInfo staffAssignAuthInfo, String appOrgId) {
-        SecurityUser user = UserContextUtils.getCurrentUser();
-        if (staffAssignAuthInfo == null) {
-            return;
-        }
-        this.delete(staffAssignAuthInfo.getId());
-        //记录取消授权日志
-
-        //修改配额
-        String appId = staffAssignAuthInfo.getAppId();
-        String roleId = staffAssignAuthInfo.getRoleId();
-        String orgId = staffAssignAuthInfo.getStaffOrgId();
-        OrgQuotaAuthInfo orgQuotaAuthInfo = orgQuotaAuthService.getOrgQuotaAuthInfo(appId, roleId, orgId);
-        int bjNum = 0;
-        int dfpNum = 0;
-        if (orgQuotaAuthInfo != null) {
-            bjNum = orgQuotaAuthInfo.getBjNum() - 1;
-            dfpNum = orgQuotaAuthInfo.getDfpNum() + 1;
         }
-        orgQuotaAuthService.updateQuotaWhileAuth(appId, orgId, roleId, appOrgId, user, bjNum, dfpNum, orgQuotaAuthInfo);
     }
 
     @Override
-    public ResponseStatus deleteAllStaffRole(String staffId) {
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.put("staffId", staffId);
-        List<StaffAssignAuthInfo> staffAssignAuthInfos = this.findByPropertyValue("staffId", staffId);
-        if (staffAssignAuthInfos == null) {
-            return ResponseStatus.success("删除角色授权成功!");
-        }
-        for (StaffAssignAuthInfo staffAssignAuthInfo : staffAssignAuthInfos) {
-            String appId = staffAssignAuthInfo.getAppId();
-
-            ApplyInfo applyInfo = applyInfoFacade.applyDetail(appId);
-            if (applyInfo == null) {
-                continue;
-            }
-            String orgCode = applyInfo.getOrgCode();
-            AuthOrgInfo appOrgInfo = authOrgInfoService.getByOrgCode(orgCode);
-            deletedAuthAndUpdateQuota(staffAssignAuthInfo, appOrgInfo.getId());
+    public void deleteExpireAuth() {
+        log.info("取消过期的服务授权开始");
+        setAuthSysSecurityUser();
+        List<StaffAssignAuthInfo> authExpired = staffAssignAuthInfoBPO.findAuthExpired();
+        if (CollectionUtils.isNotEmpty(authExpired)) {
+            authExpired.forEach(e-> staffAssignAuthInfoBPO.delete(e));
+            Map<String, List<StaffAssignAuthInfo>> collect = authExpired.stream().collect(Collectors.groupingBy(StaffAssignAuthInfo::getRoleId));
+            collect.forEach((roleId, list)-> logInfoFillService.sendRoleViewAuthLog(AuthResultEnum.SUC, null, list, ""));
         }
-
-        //删除用户时取消用户的所有角色授权,发送消息
-        JSONArray staffList = new JSONArray();
-        JSONObject staffObject = new JSONObject();
-        staffObject.put("id", staffId);
-        staffList.add(staffObject);
-        sendMessage(staffList, null);
-        return ResponseStatus.success("删除角色授权成功!");
-    }
-
-    @Override
-    public void authMonitor(SecurityUser user) {
-        List<StaffAssignAuthInfo> staffAssignAuthInfos = staffAssignAuthInfoBPO.findAuthExpired();
-        for (StaffAssignAuthInfo staffAssignAuthInfo : staffAssignAuthInfos) {
-            String appId = staffAssignAuthInfo.getAppId();
-            ApplyInfo applyInfo = applyInfoFacade.applyDetail(appId);
-            if (applyInfo == null) {
-                continue;
-            }
-            String orgCode = applyInfo.getOrgCode();
-            AuthOrgInfo appOrgInfo = authOrgInfoService.getByOrgCode(orgCode);
-            deletedAuthAndUpdateQuota(staffAssignAuthInfo, appOrgInfo.getId());
-
-            //发送消息
-            JSONArray staffList = new JSONArray();
-            JSONObject staffObject = new JSONObject();
-            staffObject.put("id", staffAssignAuthInfo.getStaffId());
-            staffList.add(staffObject);
-            sendMessage(staffList, staffAssignAuthInfo.getAppId());
-        }
-    }
-
-    @Override
-    public ResponseStatus changeStaffOrg(String oldOrgId, String newOrgId) {
-        List<StaffAssignAuthInfo> staffAssignAuthInfos = this.findByPropertyValue("staffOrgId", oldOrgId);
-        for (StaffAssignAuthInfo staffAssignAuthInfo : staffAssignAuthInfos) {
-            staffAssignAuthInfo.setStaffOrgId(newOrgId);
-        }
-        PersistentFactory.getHibernateDao().saveOrUpdateAll(staffAssignAuthInfos);
-        return ResponseStatus.success();
+        log.info("取消过期的服务授权开始");
     }
 
     @Override
@@ -584,14 +434,6 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
             //5、删除原勾选-->未勾选的角色授权
             deletedAuth(deleteUserRoles);
             //6、发送授权变更消息
-            JSONArray staffList = new JSONArray();
-            JSONObject staffObject = new JSONObject();
-            staffObject.put("id", dto.getUserId());
-            staffList.add(staffObject);
-            for (String appId : appIds) {
-                sendMessage(staffList, appId);
-            }
-
             logInfoFillService.sendUserViewAuthLog(AuthResultEnum.SUC, dto, logUserRoles, IpUtils.getRealIpAdrress(RequestUtils.getRequest()));
 
         } catch (Exception e) {
@@ -602,53 +444,12 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
         return ResponseStatus.success("保存成功!");
     }
 
-    /**
-     * 保存
-     *
-     * @param roleId     角色id
-     * @param orgId      被操作人机构id
-     * @param appId      应用id
-     * @param userId     审批人用户id
-     * @param userOrg    审批人机构
-     * @param activeTime 赋予被操作人时间
-     * @param staffId    被操作人id
-     */
-    @Override
-    public void saveStaffAssign(String roleId, String orgId, String appId,
-                                String userId, String userOrg, String activeTime, String staffId) {
-        StaffAssignAuthInfo staffAssignAuthInfo;
-        staffAssignAuthInfo = new StaffAssignAuthInfo();
-        staffAssignAuthInfo.setAppId(appId);
-        staffAssignAuthInfo.setRoleId(roleId);
-        staffAssignAuthInfo.setStaffOrgId(orgId);
-        staffAssignAuthInfo.setStaffId(staffId);
-        staffAssignAuthInfo.setCreateTime(new Date());
-        staffAssignAuthInfo.setManagerId(userId);
-        staffAssignAuthInfo.setMgeOrgId(userOrg);
-        staffAssignAuthInfo.setActiveTime(activeTime);
-        this.save(staffAssignAuthInfo);
-    }
 
     @Override
     public List<StaffAssignAuthInfo> getByStaffId(String staffId) {
         return staffAssignAuthInfoBPO.findByPropertyValue("staffId", staffId);
     }
 
-//    @Override
-//    public Integer getAppIdeNumber(String appId) {
-//        return staffAssignAuthInfoBPO.getAppIdNumber(appId);
-//    }
-//
-//    @Override
-//    public Integer getOrgIdRoleIdNumber(String orgId, String roleId) {
-//        return staffAssignAuthInfoBPO.getOrgIdRoleIdNumber(orgId, roleId);
-//    }
-//
-//    @Override
-//    public Integer getFuncNumber(String appId, String funcId) {
-//        return staffAssignAuthInfoBPO.getFuncNumber(appId, funcId);
-//    }
-
     @Override
     public List<String> getPermissionUpdateUserByAppId(String appId) {
         return staffAssignAuthInfoBPO.getStaffIdsByAppId(appId);
@@ -1094,11 +895,73 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public void batchSave(List<StaffAssignAuthInfo> roleAuths) {
-        if (CollectionUtils.isEmpty(roleAuths)) {
+    public void startRoleAuthApply(List<RoleAuthApply> authApplies) {
+        if (CollectionUtils.isEmpty(authApplies)) {
             return;
         }
-        roleAuths.forEach(e-> staffAssignAuthInfoBPO.save(e));
+
+        setAuthSysSecurityUser();
+
+        // 查询申请人员
+        List<String> userIds = authApplies.stream().map(RoleAuthApply::getUserId).distinct().collect(Collectors.toList());
+        List<AuthUserInfo> userInfos = authUserInfoService.findByIds(userIds);
+        Map<String, AuthUserInfo> userMap = userInfos.stream().collect(Collectors.toMap(AuthUserInfo::getId, e -> e));
+
+        // 查询应用中的角色
+        List<String> appIds = authApplies.stream().map(RoleAuthApply::getAppId).distinct().collect(Collectors.toList());
+        List<RoleInfo> roles = roleInfoService.getRolesByAppIds(appIds);
+        Map<String, Map<String, String>> appRoleMap = roles.stream().collect(Collectors.groupingBy(RoleInfo::getAppId,
+                Collectors.collectingAndThen(Collectors.toList(),
+                        e -> e.stream().collect(Collectors.toMap(RoleInfo::getCode, RoleInfo::getId)))));
+
+        List<StaffAssignAuthInfo> roleAuths = getStaffAssignAuthInfos(authApplies, appRoleMap, userMap);
+
+        if (CollectionUtils.isNotEmpty(roleAuths)) {
+            roleAuths.forEach(e-> staffAssignAuthInfoBPO.save(e));
+            Map<String, List<StaffAssignAuthInfo>> collect = roleAuths.stream().collect(Collectors.groupingBy(StaffAssignAuthInfo::getRoleId));
+            collect.forEach((roleId, list)-> logInfoFillService.sendRoleViewAuthLog(AuthResultEnum.SUC, list, null, ""));
+        }
+    }
+
+
+    private void setAuthSysSecurityUser() {
+        // 设置当前登录人为系统自动
+        SecurityUser securityUser = new SecurityUser();
+        securityUser.setName("权限服务审批回调处理");
+        UserContextUtils.setCurrentUser(securityUser);
+    }
+
+
+    private List<StaffAssignAuthInfo> getStaffAssignAuthInfos(List<RoleAuthApply> authApplies, Map<String, Map<String, String>> appRoleMap,
+                                                              Map<String, AuthUserInfo> userMap) {
+        Date createTime = new Date();
+        String activeTime = getActiveTime(authApplies);
+
+        return authApplies.stream().map(e -> {
+            StaffAssignAuthInfo authInfo = new StaffAssignAuthInfo();
+            String roleId = appRoleMap.get(e.getAppId()).get(e.getRoleCode());
+            authInfo.setRoleId(roleId);
+            authInfo.setAppId(e.getAppId());
+
+            AuthUserInfo authUserInfo = userMap.get(e.getUserId());
+            authInfo.setStaffId(e.getUserId());
+            authInfo.setStaffOrgId(authUserInfo.getOrgId());
+
+            authInfo.setCreateTime(createTime);
+            authInfo.setActiveTime(activeTime);
+            return authInfo;
+        }).collect(Collectors.toList());
+    }
+
+    private String getActiveTime(List<RoleAuthApply> authApplies) {
+        RoleAuthApply roleAuthApply = authApplies.get(0);
+        Date endTime = roleAuthApply.getEndTime();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        if (Objects.isNull(endTime)) {
+            return "长期";
+        } else {
+            return format.format(endTime);
+        }
     }
 
     private void setUserContext(AuthUserInfo manageUser) {

+ 0 - 104
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/StaffAssignAuthLogService.java

@@ -1,104 +0,0 @@
-
-
-package com.dragoninfo.dcuc.auth.auth.service.impl;
-
-
-import com.dragoninfo.dcuc.app.entity.ApplyInfo;
-import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
-import com.dragoninfo.dcuc.auth.auth.bpo.RoleInfoBPO;
-import com.dragoninfo.dcuc.auth.auth.bpo.StaffAssignAuthLogBPO;
-import com.dragoninfo.dcuc.auth.auth.entity.RoleInfo;
-import com.dragoninfo.dcuc.auth.auth.entity.StaffAssignAuthLog;
-import com.dragoninfo.dcuc.auth.auth.enumresources.LogTypeEnum;
-import com.dragoninfo.dcuc.auth.auth.service.IStaffAssignAuthLogService;
-import com.dragoninfo.dcuc.auth.sub.entity.AuthUserInfo;
-import com.dragoninfo.dcuc.auth.sub.service.IAuthUserInfoService;
-import com.dragoninfo.duceap.core.service.impl.BaseService;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import com.dragonsoft.duceap.core.search.Searchable;
-import org.hibernate.criterion.Order;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.text.SimpleDateFormat;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Service
-@Transactional
-public class StaffAssignAuthLogService extends BaseService<StaffAssignAuthLog, String> implements IStaffAssignAuthLogService {
-
-    @Autowired
-    private StaffAssignAuthLogBPO staffAssignAuthLogBPO;
-
-    @Autowired
-    private IApplyInfoFacade applyInfoFacade;
-
-    @Autowired
-    private IAuthUserInfoService authUserInfoService;
-
-    @Autowired
-    private RoleInfoBPO roleInfoBPO;
-
-    @Override
-    public Page<RoleInfo> roleListByUserIdAndAppId(String userId, String appId, Searchable searchable) {
-        searchable.removeSearchFilter("userId_eq");
-        searchable.removeSearchFilter("appId_eq");
-        Page<RoleInfo> roleInfos = staffAssignAuthLogBPO.roleListByUserIdAndAppId(userId, appId, searchable);
-        for (RoleInfo roleInfo : roleInfos) {
-            String roleAppId = roleInfo.getAppId();
-            ApplyInfo applyInfo = applyInfoFacade.applyDetail(roleAppId);
-            roleInfo.setAppId(applyInfo == null ? "" : applyInfo.getApplyName());
-        }
-        return roleInfos;
-    }
-
-    @Override
-    public List<StaffAssignAuthLog> staffAssignAuthLogList(String userId, String roleId) {
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.put("staffId", userId);
-        params.put("roleId", roleId);
-        return this.andsearch(StaffAssignAuthLog.class, params, Order.desc("createTime"));
-    }
-
-    @Override
-    public Page<Map<String, String>> operateList(SearchDTO searchDTO, String createUser) {
-        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        Searchable searchable = Searchable.toSearchable(searchDTO);
-        searchable.removeSearchFilter("createUser_eq");
-        searchable.removeSearchFilter("logType_eq");
-        Page<Map<String, String>> page = staffAssignAuthLogBPO.operateList(searchable, createUser);
-        Map<String, RoleInfo> roleMap = new HashMap<String, RoleInfo>();
-        Map<String, ApplyInfo> appMap = new HashMap<>();
-        Map<String, AuthUserInfo> userMap = new HashMap<>();
-        for (Map<String, String> logMap : page.getContent()) {
-            String roleId = logMap.get("roleId");
-            String appId = logMap.get("appId");
-            String userId = logMap.get("userId");
-            RoleInfo roleInfo = roleMap.containsKey(roleId) ? roleMap.get(roleId) : roleInfoBPO.get(roleId);
-            ApplyInfo applyInfo = null;
-            AuthUserInfo userInfo = null;
-            if (appMap.containsKey(appId)) {
-                applyInfo = appMap.get(appId);
-            } else {
-
-                applyInfo = applyInfoFacade.applyDetail(appId);
-            }
-            if (userMap.containsKey(userId)) {
-                userInfo = userMap.get(userId);
-            } else {
-
-                userInfo = authUserInfoService.findById(userId);
-            }
-            logMap.put("createTime", format.format(logMap.get("createTime")));
-            logMap.put("type", LogTypeEnum.RYSQ.getValue());
-            logMap.put("roleName", roleInfo != null ? roleInfo.getName() : "");
-            logMap.put("objectName", userInfo != null ? userInfo.getName() + "(" + userInfo.getOrgName() + ")" : "");
-            logMap.put("appName", applyInfo != null ? applyInfo.getApplyName() : "");
-        }
-        return page;
-    }
-}

+ 14 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/zerotrust/IRoleAuthApplyService.java

@@ -42,4 +42,18 @@ public interface IRoleAuthApplyService {
      * @param approvalResult
      */
     void updateApprovalResult(String processInstId, String approvalResult);
+
+    /**
+     * 查询将要开始的角色授权
+     * @return
+     */
+    List<RoleAuthApply> getStartToAuth();
+
+    /**
+     * 设置未待授权
+     *
+     * @param tobeAuthed
+     * @param value
+     */
+    void setToBeAuthed(List<RoleAuthApply> tobeAuthed, String value);
 }

+ 8 - 1
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/zerotrust/IServiceAuthApplyService.java

@@ -1,6 +1,5 @@
 package com.dragoninfo.dcuc.auth.auth.service.zerotrust;
 
-import com.dragoninfo.dcuc.auth.auth.dto.zerotrust.authapply.RoleAuthApplyDto;
 import com.dragoninfo.dcuc.auth.auth.dto.zerotrust.authapply.ServiceAuthApplyDto;
 import com.dragoninfo.dcuc.auth.auth.entity.zerotrust.ServiceAuthApply;
 import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
@@ -36,4 +35,12 @@ public interface IServiceAuthApplyService {
      * @param approvalResult
      */
     void updateApprovalResult(String processInstId, String approvalResult);
+
+    /**
+     * 获取即将开始的授权申请
+     * @return
+     */
+    List<ServiceAuthApply> getStartToAuth();
+
+    void setToBeAuthed(List<ServiceAuthApply> tobeAuthed, String value);
 }

+ 0 - 10
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/config/DcucAuthKafkaConfig.java

@@ -22,16 +22,6 @@ public class DcucAuthKafkaConfig {
      */
     private String appSecret;
 
-    /**
-     * 动态授权消息主题
-     */
-    private String messageTopic;
-
-    /**
-     * 角色授权变更消息主题
-     */
-    private String messageJssqTopic;
-
     /**
      * kafka服务地址
      */

+ 0 - 2
dcuc-auth-service/src/main/resources/application-auth.yml

@@ -20,8 +20,6 @@ dcuc:
     kafka:
       app-key: CUIA59559087
       app-secret: CUIA17401300
-      message-topic: 90120021
-      message-jssq-topic: 90220013
       kafka-servers: http://10.201.2.14:9981/dcms-manager
     #审批中心
     approval-center: