Ejemplo n.º 1
0
 @Override
 public List<AssemblyVO> getAssembliesAtAppEnvByStatus(
     int appId, AppEnvEnum appEnvEnum, IntegrationStatusEnum integrationStatus) {
   List<AssemblyDO> dos = new ArrayList<>();
   switch (appEnvEnum) {
     case DEV:
       dos = assemblyDOMapper.selectAssembliesInDev(appId, integrationStatus.getDescription());
       break;
     case TEST:
       dos = assemblyDOMapper.selectAssembliesInTest(appId, integrationStatus.getDescription());
       break;
     case PRE:
       dos = assemblyDOMapper.selectAssembliesInPre(appId, integrationStatus.getDescription());
       break;
     case PRD:
       dos =
           assemblyDOMapper.selectAssembliesInPrd(
               appId, IntegrationStatusEnum.TOPUBLISH.getDescription());
       break;
   }
   List<AssemblyVO> vos = new ArrayList<AssemblyVO>();
   for (AssemblyDO dO : dos) {
     AssemblyVO vo = BaseConvertor.convert(dO, AssemblyVO.class);
     loadAssemblyUsers(vo);
     vo.setGmtPlanToPublish(DateUtil.formatDateOnly(dO.getGmtPlanToPublish()));
     switch (appEnvEnum) {
       case DEV:
         if (dO.getCodeReviewer() == null) {
           vo.setCodeReviewer("");
         }
         if (dO.getSelfTester() == null) {
           vo.setSelfTester("");
         }
         vo.setGmtCodeReview(DateUtil.formatDateTime(dO.getGmtCodeReview()));
         vo.setGmtSelfTest(DateUtil.formatDateTime(dO.getGmtSelfTest()));
         break;
       case TEST:
         if (dO.getTestEnvTester() == null) {
           vo.setTestEnvTester("");
         }
         if (dO.getPublishAssessor() == null) {
           vo.setPublishAssessor("");
         }
         vo.setGmtTestVerify(DateUtil.formatDateTime(dO.getGmtTestVerify()));
         vo.setGmtRiskSubmit(DateUtil.formatDateTime(dO.getGmtRiskSubmit()));
         vo.setGmtPublishAssessment(DateUtil.formatDateTime(dO.getGmtPublishAssessment()));
         break;
       case PRE:
         if (dO.getPreEnvTester() == null) {
           vo.setPreEnvTester("");
         }
         vo.setGmtPreVerify(DateUtil.formatDateTime(dO.getGmtPreVerify()));
         break;
       default:
         break;
     }
     vos.add(vo);
   }
   return vos;
 }
Ejemplo n.º 2
0
 @Override
 public List<AssemblyVO> searchTestingAssembliesByAppName(String appName, Page page) {
   List<AssemblyDO> dos = assemblyDOMapper.searchTestingAssembliesByAppName(appName, page);
   if (page != null) {
     page.setSearchedRecords(assemblyDOMapper.countTestingAssembliesByAppName(appName));
   }
   return convert2AssemblyVOs(dos);
 }
Ejemplo n.º 3
0
 @Override
 public List<AssemblyVO> searchPublishedAssembliesByAppName(String appName, Page page) {
   List<AssemblyVO> vos = new ArrayList<>();
   List<AssemblyDO> dos = assemblyDOMapper.searchAssembliesPublishedByAppName(appName, page);
   if (page != null) {
     page.setSearchedRecords(assemblyDOMapper.countAssembliesPublishedByAppName(appName));
   }
   return convertPublishedAssemblyDOs2VOs(dos);
 }
Ejemplo n.º 4
0
 @Override
 public List<AssemblyVO> getTestingAssemblies(Page page) {
   List<AssemblyDO> dos = assemblyDOMapper.selectTestingAssemblies(page);
   if (page != null) {
     int records = assemblyDOMapper.countTestingAssemblies();
     page.setTotalRecords(records);
     page.setSearchedRecords(records);
   }
   return convert2AssemblyVOs(dos);
 }
Ejemplo n.º 5
0
 @Override
 public List<AssemblyVO> getPublishedAssemblies(Page page) {
   List<AssemblyVO> vos = new ArrayList<>();
   List<AssemblyDO> dos = assemblyDOMapper.selectAssembliesPublished(page);
   if (page != null) {
     int records = assemblyDOMapper.countAssembliesPublished();
     page.setTotalRecords(records);
     page.setSearchedRecords(records);
   }
   return convertPublishedAssemblyDOs2VOs(dos);
 }
Ejemplo n.º 6
0
  @Override
  public boolean changeAssemblyStatus(
      List<Integer> assemblyId, AppEnvEnum appEnvEnum, IntegrationStatusEnum integrationStatus) {
    List<AssemblyDO> dos = new ArrayList<AssemblyDO>();

    for (int id : assemblyId) {
      AssemblyDO dO = new AssemblyDO();
      dO.setAssemblyId(id);
      switch (appEnvEnum) {
        case DEV:
          dO.setIntegrationStatusDev(integrationStatus.getDescription());
          break;
        case TEST:
          dO.setIntegrationStatusTest(integrationStatus.getDescription());
          break;
        case PRE:
          dO.setIntegrationStatusPre(integrationStatus.getDescription());
          break;
        case PRD:
          dO.setIntegrationStatusPrd(integrationStatus.getDescription());
          if (IntegrationStatusEnum.PUBLISHED == integrationStatus) {
            dO.setGmtActualPublish(new Date());
          }
          break;
      }
      dos.add(dO);
    }
    int count = assemblyDOMapper.updateBatch(dos);
    return count > 0 ? true : false;
  }
Ejemplo n.º 7
0
 @Override
 public boolean addAssembly(AssemblyVO assemblyVO) {
   AssemblyDO dO = BaseConvertor.convert(assemblyVO, AssemblyDO.class);
   String date = assemblyVO.getGmtPlanToPublish();
   dO.setGmtPlanToPublish(DateUtil.parseDateOnly(date));
   int count = assemblyDOMapper.insertSelective(dO);
   assemblyVO.setAssemblyId(dO.getAssemblyId());
   return count > 0 ? true : false;
 }
Ejemplo n.º 8
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;
   }
 }
Ejemplo n.º 9
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;
   }
 }
Ejemplo n.º 10
0
 @Override
 public List<AssemblyVO> getAssembliesByPrjId(int prjId) {
   List<AssemblyDO> dos = assemblyDOMapper.selectByPrjId(prjId);
   return convert2AssemblyVOs(dos);
 }
Ejemplo n.º 11
0
 @Override
 public Integer getAssessmentIdForAssembly(int assemblyId) {
   Integer assessmentId = assemblyDOMapper.selectAssessmentId(assemblyId);
   return assessmentId;
 }
Ejemplo n.º 12
0
 @Override
 public boolean updateAssembly(AssemblyDO assemblyDO) {
   int count = assemblyDOMapper.updateByPrimaryKeySelective(assemblyDO);
   return count > 0 ? true : false;
 }
Ejemplo n.º 13
0
 @Override
 public AssemblyDO getBranchNameAndGitLinkByAssemblyId(Integer assemblyId) {
   return assemblyDOMapper.selectBranchNameNGitLinkByAssemblyId(assemblyId);
 }
Ejemplo n.º 14
0
 @Override
 public boolean isPrjDone(int assemblyId) {
   int count = assemblyDOMapper.countNotPublishedPrjsForSpecificAssembly(assemblyId);
   return count == 0 ? true : false;
 }
Ejemplo n.º 15
0
 @Override
 public boolean resetAssemblyStatus(Integer assemblyId) {
   int count = assemblyDOMapper.reset(assemblyId);
   return count > 0 ? true : false;
 }
Ejemplo n.º 16
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);
 }
Ejemplo n.º 17
0
 @Override
 public List<Integer> getAssemblyIdsByPrjId(int prjId) {
   return assemblyDOMapper.selectAssemblyIdsByPrjId(prjId);
 }
Ejemplo n.º 18
0
 @Override
 public Integer getPrjIdByAssemblyId(Integer assemblyId) {
   return assemblyDOMapper.selectPrjIdByAssemblyId(assemblyId);
 }
Ejemplo n.º 19
0
 @Override
 public List<Integer> getPrjIdsByAssemblyIds(List<Integer> assemblyIds) {
   return assemblyDOMapper.selectPrjIdsByAssemblyIds(assemblyIds);
 }
Ejemplo n.º 20
0
 @Override
 public List<Integer> getAssociatedAppsInAssembliesByPrjId(int prjId) {
   return assemblyDOMapper.selectAppIdsByPrjId(prjId);
 }
Ejemplo n.º 21
0
 @Override
 public List<AssemblyDO> getBranchNamesAndGitLinksByAssemblyIds(List<Integer> assemblyIds) {
   return assemblyDOMapper.selectBranchNamesNGitLinksByAssemblyIds(assemblyIds);
 }
Ejemplo n.º 22
0
 @Override
 public AssemblyDO getAssemblyById(int assemblyId) {
   return assemblyDOMapper.selectByPrimaryKey(assemblyId);
 }