@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);
 }
 @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;
   }
 }
 @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;
   }
 }
 @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;
 }
 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);
 }
 @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);
 }
 @Override
 public int getAmountOfAssemblyForUserInPrj(int userId, int prjId) {
   return assemblyUserCfgDOMapper.countAssembliesForUserInPrj(userId, prjId);
 }
 @Override
 public List<Integer> getAssemblyUserIds(List<Integer> assemblyIds) {
   return assemblyUserCfgDOMapper.selectAssemblyUserIdsByAssemblyIdList(assemblyIds);
 }
 @Override
 public boolean ifUserBelongsToAssembly(int userId, RoleEnum roleEnum, int assemblyId) {
   int count =
       assemblyUserCfgDOMapper.countUserInAssembly(assemblyId, userId, roleEnum.getRoleName());
   return count > 0 ? true : false;
 }
 @Override
 public List<AssemblyUserCfgDO> loadAssemblyUsersByAssemblyId(int assemblyId) {
   List<AssemblyUserCfgDO> users =
       assemblyUserCfgDOMapper.selectAssemblyUsersByAssemblyId(assemblyId);
   return users;
 }
 @Override
 public boolean removeAssemblyUsers(int assemblyId) {
   int count = assemblyUserCfgDOMapper.deleteUsersByAssemblyId(assemblyId);
   return count > 0 ? true : false;
 }