Browse Source

电签证书相关

huangjn 3 years ago
parent
commit
d372a89141

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/RoleSignPfxUserVO.java

@@ -22,6 +22,9 @@ public class RoleSignPfxUserVO {
     @ApiModelProperty(value = "角色名")
     private String roleName;
 
+    @ApiModelProperty(value = "子角色集合")
+    private List<RoleSignPfxUserVO> childRoleList = new ArrayList<>();
+
     @ApiModelProperty(value = "个人签章集合")
     private List<SignPfxFile> signPfxFileList = new ArrayList<>();
 

+ 34 - 12
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/SignPfxFileController.java

@@ -125,6 +125,15 @@ public class SignPfxFileController extends BladeController {
 
 		//返回结果
 		List<RoleSignPfxUserVO> result = new ArrayList<>();
+		//企业章
+		RoleSignPfxUserVO pfxUnitVo = new RoleSignPfxUserVO();
+		pfxUnitVo.setRoleId(1L);
+		pfxUnitVo.setRoleName("单位证书");
+		List<SignPfxFile> unitPfxList = this.signPfxFileService.list(Wrappers.<SignPfxFile>lambdaQuery().eq(SignPfxFile::getContractId, contractId).eq(SignPfxFile::getIsDeleted, 0));
+		if(unitPfxList != null && unitPfxList.size() > 0){
+			pfxUnitVo.setSignPfxFileList(unitPfxList);
+		}
+		result.add(pfxUnitVo);
 
 		//循环角色,对项目人员进行分组
 		for(RoleVO vo : roleVOS){
@@ -133,20 +142,33 @@ public class SignPfxFileController extends BladeController {
 			pfxUserVo.setRoleId(vo.getId());
 			pfxUserVo.setRoleName(vo.getRoleName());
 
-			//循环项目人员,获取个人证书,如果没有个人证书则删除
-			Iterator<SaveUserInfoByProjectDTO> iterator = contractUserList.iterator();
-			while (iterator.hasNext()){
-				SaveUserInfoByProjectDTO next = iterator.next();
+			//处理子节点
+			List<RoleVO> childRoles =  vo.getChildren();
+			if(childRoles != null && childRoles.size() > 0){
+				for(RoleVO childVo : childRoles){
+					//设置实体
+					RoleSignPfxUserVO childPfxUserVo = new RoleSignPfxUserVO();
+					childPfxUserVo.setRoleId(childVo.getId());
+					childPfxUserVo.setRoleName(childVo.getRoleName());
+
+					//循环项目人员,获取个人证书,如果没有个人证书则删除
+					Iterator<SaveUserInfoByProjectDTO> iterator = contractUserList.iterator();
+					while (iterator.hasNext()){
+						SaveUserInfoByProjectDTO next = iterator.next();
 
-				if(next.getRoleId().equals(vo.getId().toString())){
-					//角色相符
-					SignPfxFile userSignPfx = this.signPfxFileService.getOne(Wrappers.<SignPfxFile>lambdaQuery().eq(SignPfxFile::getCertificateUserId, next.getUserId()));
-					if(userSignPfx == null){
-						iterator.remove();
-						continue;
+						if(next.getRoleId().equals(childVo.getId().toString())){
+							//角色相符
+							SignPfxFile userSignPfx = this.signPfxFileService.getOne(Wrappers.<SignPfxFile>lambdaQuery().eq(SignPfxFile::getCertificateUserId, next.getUserId()));
+							if(userSignPfx == null){
+								iterator.remove();
+								continue;
+							}
+							//存在证书则设置进结果对象的证书集合中
+							childPfxUserVo.getSignPfxFileList().add(userSignPfx);
+						}
 					}
-					//存在证书则设置进结果对象的证书集合中
-					pfxUserVo.getSignPfxFileList().add(userSignPfx);
+					//设置子集
+					pfxUserVo.getChildRoleList().add(childPfxUserVo);
 				}
 			}