Пример #1
0
 @Override
 public List<Integer> getAssemblyUserIdsByRoleList(
     List<Integer> assemblyIds, List<RoleEnum> roleList) {
   List<String> roleNameList = new ArrayList<>();
   for (RoleEnum roleEnum : roleList) {
     roleNameList.add(roleEnum.getRoleName());
   }
   return assemblyUserCfgDOMapper.selectAssemblyUserIdsByRoleList(assemblyIds, roleNameList);
 }
Пример #2
0
 @Override
 public boolean removeBatchAssemblyAndRelatedUsers(List<Integer> assemblyIds) {
   int count = assemblyUserCfgDOMapper.deleteUsersByAssemblyIds(assemblyIds);
   if (count > 0) {
     count = assemblyDOMapper.deleteBatch(assemblyIds);
     return count > 0 ? true : false;
   } else {
     return false;
   }
 }
Пример #3
0
 @Override
 public boolean removeAssemblyAndRelatedUsers(int assemblyId) {
   int count = assemblyUserCfgDOMapper.deleteUsersByAssemblyId(assemblyId);
   if (count > 0) {
     count = assemblyDOMapper.deleteByPrimaryKey(assemblyId);
     return count > 0 ? true : false;
   } else {
     return false;
   }
 }
Пример #4
0
 @Override
 public boolean addAssemblyUsers(int assemblyId, List<UserGroup> userGroupList) {
   List<AssemblyUserCfgDO> list = new ArrayList<AssemblyUserCfgDO>();
   for (UserGroup ug : userGroupList) {
     AssemblyUserCfgDO dO = new AssemblyUserCfgDO();
     dO.setAssemblyId(assemblyId);
     dO.setUserId(ug.getUserId());
     dO.setRoleName(ug.getRoleName());
     list.add(dO);
   }
   int count = assemblyUserCfgDOMapper.insertBatch(list);
   return count > 0 ? true : false;
 }
Пример #5
0
 private void loadAssemblyUsers(AssemblyVO vo) {
   String developers = "", testers = "";
   int assemblyId = vo.getAssemblyId();
   List<AssemblyUserCfgDO> users =
       assemblyUserCfgDOMapper.selectAssemblyUsersByAssemblyId(assemblyId);
   for (AssemblyUserCfgDO user : users) {
     switch (RoleEnum.valueOf(user.getRoleName())) {
       case DEV:
         developers += user.getRealName() + " ";
         break;
       case TEST:
         testers += user.getRealName() + " ";
         break;
       default:
         break;
     }
   }
   vo.setDevelopers(developers);
   vo.setTesters(testers);
 }
Пример #6
0
 @Override
 public List<AssemblyVO> getAssembliesForUserInPrj(int userId, int prjId) {
   List<Integer> ids = assemblyUserCfgDOMapper.selectAssemblyIdsForUserInPrj(userId, prjId);
   List<AssemblyDO> dos = assemblyDOMapper.selectByAssemblyIdList(ids);
   return convert2AssemblyVOs(dos);
 }
Пример #7
0
 @Override
 public int getAmountOfAssemblyForUserInPrj(int userId, int prjId) {
   return assemblyUserCfgDOMapper.countAssembliesForUserInPrj(userId, prjId);
 }
Пример #8
0
 @Override
 public List<Integer> getAssemblyUserIds(List<Integer> assemblyIds) {
   return assemblyUserCfgDOMapper.selectAssemblyUserIdsByAssemblyIdList(assemblyIds);
 }
Пример #9
0
 @Override
 public boolean ifUserBelongsToAssembly(int userId, RoleEnum roleEnum, int assemblyId) {
   int count =
       assemblyUserCfgDOMapper.countUserInAssembly(assemblyId, userId, roleEnum.getRoleName());
   return count > 0 ? true : false;
 }
Пример #10
0
 @Override
 public List<AssemblyUserCfgDO> loadAssemblyUsersByAssemblyId(int assemblyId) {
   List<AssemblyUserCfgDO> users =
       assemblyUserCfgDOMapper.selectAssemblyUsersByAssemblyId(assemblyId);
   return users;
 }
Пример #11
0
 @Override
 public boolean removeAssemblyUsers(int assemblyId) {
   int count = assemblyUserCfgDOMapper.deleteUsersByAssemblyId(assemblyId);
   return count > 0 ? true : false;
 }