@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;
 }
 private List<AssemblyVO> convert2AssemblyVOs(List<AssemblyDO> dos) {
   List<AssemblyVO> vos = new ArrayList<>();
   for (AssemblyDO dO : dos) {
     AssemblyVO vo = BaseConvertor.convert(dO, AssemblyVO.class);
     vo.setGmtPlanToPublish(DateUtil.formatDateOnly(dO.getGmtPlanToPublish()));
     loadAssemblyUsers(vo);
     vos.add(vo);
   }
   return vos;
 }
  @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;
  }
 private List<AssemblyVO> convertPublishedAssemblyDOs2VOs(List<AssemblyDO> dos) {
   List<AssemblyVO> vos = new ArrayList<>();
   for (AssemblyDO dO : dos) {
     AssemblyVO vo = BaseConvertor.convert(dO, AssemblyVO.class);
     vo.setGmtPlanToPublish(DateUtil.formatDateOnly(dO.getGmtPlanToPublish()));
     vo.setGmtActualPublish(DateUtil.formatDateTime(dO.getGmtActualPublish()));
     vo.setGmtCodeReview(DateUtil.formatDateTime(dO.getGmtCodeReview()));
     vo.setGmtSelfTest(DateUtil.formatDateTime(dO.getGmtSelfTest()));
     vo.setGmtTestVerify(DateUtil.formatDateTime(dO.getGmtTestVerify()));
     vo.setGmtRiskSubmit(DateUtil.formatDateTime(dO.getGmtRiskSubmit()));
     vo.setGmtPublishAssessment(DateUtil.formatDateTime(dO.getGmtPublishAssessment()));
     vo.setGmtPreVerify(DateUtil.formatDateTime(dO.getGmtPreVerify()));
     loadAssemblyUsers(vo);
     vos.add(vo);
   }
   return vos;
 }
 @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;
 }