diff --git a/com.actionsoft.apps.coe.pal.cooperation/lib/com.actionsoft.apps.coe.pal.cooperation.jar b/com.actionsoft.apps.coe.pal.cooperation/lib/com.actionsoft.apps.coe.pal.cooperation.jar index 8af637f4..828c33e0 100644 Binary files a/com.actionsoft.apps.coe.pal.cooperation/lib/com.actionsoft.apps.coe.pal.cooperation.jar and b/com.actionsoft.apps.coe.pal.cooperation/lib/com.actionsoft.apps.coe.pal.cooperation.jar differ diff --git a/com.actionsoft.apps.coe.pal.cooperation/src/com/actionsoft/apps/coe/pal/cooperation/web/CooperationWeb.java b/com.actionsoft.apps.coe.pal.cooperation/src/com/actionsoft/apps/coe/pal/cooperation/web/CooperationWeb.java index f3b8cdd3..f123b265 100644 --- a/com.actionsoft.apps.coe.pal.cooperation/src/com/actionsoft/apps/coe/pal/cooperation/web/CooperationWeb.java +++ b/com.actionsoft.apps.coe.pal.cooperation/src/com/actionsoft/apps/coe/pal/cooperation/web/CooperationWeb.java @@ -1219,19 +1219,32 @@ public class CooperationWeb extends ActionWeb { } } if (!isOlderVersion){ - CoeUser coeUserDao = new CoeUser(); - //pal最大用户量许可 - int maxUser = Quota.getMaxCoEPALUser(); - List coeUsers = coeUserDao.getCoeUsers(); - if (maxUser < coeUsers.size() + awsUsers.size()){ - //超出最大用户量 - return ResponseObject.newWarnResponse("用户数已超过许可总数(许可最大用户数" + maxUser + ")").toString(); + //有额外的aws平台用户 + if (!awsUsers.isEmpty()){ + CoeUser coeUserDao = new CoeUser(); + //pal最大用户量许可 + int maxUser = Quota.getMaxCoEPALUser(); + List coeUsers = coeUserDao.getCoeUsers(); + if (maxUser < coeUsers.size() + awsUsers.size()){ + //超出最大用户量 + return ResponseObject.newWarnResponse("用户数已超过许可总数(许可最大用户数" + maxUser + ")").toString(); + } + coeUserDao.batchInsert(awsUsers,false); + // 操作行为日志记录 + if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { + CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_COOPERATION, CoEOpLogConst.OP_UPDATE, CoEOpLogConst.INFO_USER_CREATE); + } } - coeUserDao.batchInsert(awsUsers,false); - // 操作行为日志记录 - if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { - CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_COOPERATION, CoEOpLogConst.OP_UPDATE, CoEOpLogConst.INFO_USER_CREATE); + //添加默认隐藏角色 + List roleList = new ArrayList<>(); + Timestamp now = new Timestamp(System.currentTimeMillis()); + for (CoeCooperationMemberModel memberModel : memberModels) { + CoeCooperationRoleModel roleModel = new CoeCooperationRoleModel(UUIDGener.getUUID(), teamId, memberModel.getUserId(), + "", 3, "", "", "", _uc.getUID(), now, _uc.getUID(), now,1); + roleList.add(roleModel); } + //批量插入用户隐藏角色 + api.createCooperationRoles(roleList); } // 保存 api.createCooperationMemebers(memberModels); @@ -1266,6 +1279,10 @@ public class CooperationWeb extends ActionWeb { } for (int i = 0; i < userIdArr.size(); i++) { api.removeCooperationMemeber(teamId, userIdArr.getString(i)); + if (!SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal", "IsOlderVersion", true)){ + //新版权限删除隐式用户角色 + api.removeCooperationHideRole(teamId,userIdArr.getString(i)); + } } return ro.toString(); }