コード例 #1
0
ファイル: NewsManageUCC.java プロジェクト: htsia/zghr
  public String createNews(NewsEditVO vo, List attList, String AuthorId)
      throws RollbackableException {
    NewsParamBO parambo = new NewsParamBO();
    NewsContentBO NewsContent = new NewsContentBO();
    String[] NewsScopeIds = null;
    String RoleId = "";
    parambo.setNewTopic(vo.getTopic());
    parambo.setInfoLevel(vo.getInfoLevel());
    parambo.setStartDate(vo.getStartDate());
    parambo.setEndDate(vo.getEndDate());
    parambo.setNewEndDate(vo.getNewEndDate());
    parambo.setReaderType(vo.getReaderType());
    parambo.setNewsSource(vo.getNewsSource());
    parambo.setPublicFlag(vo.getPublicFlag());
    parambo.setExpress(vo.getExpress());
    try {
      RoleId = findRoleId(AuthorId);
    } catch (Exception e) {
      throw new RollbackableException();
    }
    parambo.setAuthorId(AuthorId);
    parambo.setCreatorRoleId(RoleId);
    parambo.setSubmitDate(RunTools.getDate10());

    NewsContent.setNewContent(vo.getContent());
    NewsContent.setNewsFile(vo.getNewsFile());
    if (attList != null) {
      for (int i = 0; i < attList.size(); i++) {
        AttFileVO av = (AttFileVO) attList.get(i);
        if ("1".equals(av.getIndex())) {
          NewsContent.setAttTitle1(av.getAttTitle());
          NewsContent.setAttFile1(av.getAttFile());
        } else if ("2".equals(av.getIndex())) {
          NewsContent.setAttTitle2(av.getAttTitle());
          NewsContent.setAttFile2(av.getAttFile());
        } else if ("3".equals(av.getIndex())) {
          NewsContent.setAttTitle3(av.getAttTitle());
          NewsContent.setAttFile3(av.getAttFile());
        } else if ("4".equals(av.getIndex())) {
          NewsContent.setAttTitle4(av.getAttTitle());
          NewsContent.setAttFile4(av.getAttFile());
        } else if ("5".equals(av.getIndex())) {
          NewsContent.setAttTitle5(av.getAttTitle());
          NewsContent.setAttFile5(av.getAttFile());
        }
      }
    }

    if (vo.getScopeOrgIds() != null) {
      NewsScopeIds = vo.getScopeOrgIds().split("\\,");
    }
    this.newsmanageservice.createNews(parambo, NewsContent, NewsScopeIds);
    return NewsContent.getNewId();
  }
コード例 #2
0
ファイル: NewsManageUCC.java プロジェクト: htsia/zghr
  public void updateNews(NewsEditVO vo, List attList, String AuthorId)
      throws RollbackableException {
    NewsParamBO parambo = new NewsParamBO();
    NewsContentBO contentbo = new NewsContentBO();
    String scopeOrgIds = null;
    String[] NewsScope = null;
    String RoleId = "";

    parambo.setNewId(vo.getNewId());
    parambo.setNewTopic(vo.getTopic());
    parambo.setStartDate(vo.getStartDate());
    parambo.setEndDate(vo.getEndDate());
    parambo.setNewEndDate(vo.getNewEndDate());
    parambo.setReaderType(vo.getReaderType());
    parambo.setInfoLevel(vo.getInfoLevel());
    parambo.setNewsSource(CommonFuns.filterNull(vo.getNewsSource()));
    parambo.setPublicFlag(vo.getPublicFlag());
    parambo.setExpress(vo.getExpress());
    try {
      RoleId = findRoleId(AuthorId);
    } catch (Exception e) {
      throw new RollbackableException();
    }

    parambo.setAuthorId(AuthorId);
    parambo.setCreatorRoleId(RoleId);

    parambo.setSubmitDate(RunTools.getDate10());

    contentbo.setNewId(vo.getNewId());
    contentbo.setNewContent(vo.getContent());
    contentbo.setNewsFile(vo.getNewsFile());
    if (attList != null) {
      for (int i = 0; i < attList.size(); i++) {
        AttFileVO av = (AttFileVO) attList.get(i);
        if ("1".equals(av.getIndex())) {
          contentbo.setAttTitle1(av.getAttTitle());
          contentbo.setAttFile1(av.getAttFile());
        } else if ("2".equals(av.getIndex())) {
          contentbo.setAttTitle2(av.getAttTitle());
          contentbo.setAttFile2(av.getAttFile());
        } else if ("3".equals(av.getIndex())) {
          contentbo.setAttTitle3(av.getAttTitle());
          contentbo.setAttFile3(av.getAttFile());
        } else if ("4".equals(av.getIndex())) {
          contentbo.setAttTitle4(av.getAttTitle());
          contentbo.setAttFile4(av.getAttFile());
        } else if ("5".equals(av.getIndex())) {
          contentbo.setAttTitle5(av.getAttTitle());
          contentbo.setAttFile5(av.getAttFile());
        }
      }
    }

    scopeOrgIds = vo.getScopeOrgIds();
    if ((scopeOrgIds != null) || (scopeOrgIds.length() > 0)) {
      NewsScope = scopeOrgIds.split("\\,");
    }
    this.newsmanageservice.updateNewsParam(parambo);
    this.newsmanageservice.updateNewsContent(contentbo);
    this.newsmanageservice.updateNewsScopeByNewsId(vo.getNewId(), NewsScope);
  }