コード例 #1
0
ファイル: RentExpServiceImpl2.java プロジェクト: hrne/exp
  public RentExp findByExpApplNoFetchRelation(String expApplNo) {
    if (StringUtils.isBlank(expApplNo)) {
      String[] params = {
        Messages.getString(
            "applicationResources", "tw_com_skl_exp_kernel_model6_bo_ExpapplC_expApplNo", null)
      };
      // 傳入的參數 費用申請單號 錯誤
      throw new ExpRuntimeException(ErrorCode.A10007, params);
    }

    StringBuffer queryString = new StringBuffer();
    queryString.append("select distinct rentExp");
    queryString.append(" from RentExp rentExp");
    queryString.append(" left join rentExp.rentContract rentContract");
    queryString.append(" left join fetch rentExp.rentContract");
    queryString.append(" left join fetch rentContract.rentDeps");
    queryString.append(" left join fetch rentContract.lessors");
    queryString.append(" left join rentExp.expapplC expapplC");
    queryString.append(" left join fetch rentExp.expapplC");
    queryString.append(" left join expapplC.expItem expItem");
    queryString.append(" left join fetch expapplC.expItem");
    queryString.append(" left join fetch expItem.budgetItem");
    queryString.append(" left join fetch expapplC.applyUserInfo");
    queryString.append(" left join fetch expapplC.drawMoneyUserInfo");
    queryString.append(" left join fetch expapplC.deliverDaylist");
    queryString.append(" left join fetch expapplC.dailyStatement");
    // queryString.append(" left join fetch rentExp.expapplC.subpoena");
    queryString.append(" left join fetch expapplC.verifyUser");
    queryString.append(" left join fetch expapplC.actualVerifyUser");
    queryString.append(" inner join expapplC.createUser createUser");
    queryString.append(" inner join fetch expapplC.createUser");
    queryString.append(" inner join fetch createUser.department");
    queryString.append(" left join fetch expapplC.updateUser");
    queryString.append(" left join fetch expapplC.expapplCDetails");
    queryString.append(" left join expapplC.entryGroup entryGroup");
    queryString.append(" left join fetch expapplC.entryGroup");
    queryString.append(" inner join fetch entryGroup.entries");
    queryString.append(" left join entryGroup.entries entry");
    queryString.append(" left join fetch entry.entryGroup");
    queryString.append(" left join fetch entry.accTitle");
    queryString.append(" left join fetch entry.subpoena");
    queryString.append(" left join fetch entry.subpoenaD");
    queryString.append(" left join fetch entry.expapplCDetail");
    queryString.append(" where rentExp.expapplC.expApplNo =:expApplNo");

    Map<String, Object> params = new HashMap<String, Object>();
    params.put("expApplNo", expApplNo);

    List<RentExp> rentExp = getDao().findByNamedParams(queryString.toString(), params);

    if (CollectionUtils.isEmpty(rentExp)) {
      return null;
    } else {
      return rentExp.get(0);
    }
  }
コード例 #2
0
  /**
   * 執行查詢功能。
   *
   * @return
   */
  public String doQueryAction() {
    Calendar eDate = (Calendar) ((Map<String, Object>) getFindCriteriaMap()).get("eDate");
    if (eDate == null) {
      String[] paramStrs = {
        Messages.getString(
            "applicationResources",
            "tw_com_skl_exp_web_jsf_managed_gl_report_AirportExpandBizManagedBean_query_end_date",
            null)
      };
      // {0}欄位-必須有值。
      throw new ExpRuntimeException(ErrorCode.A10039, paramStrs);
    }

    Map<String, Object> params = new HashMap<String, Object>();
    // Crystal Report 檔案。
    CrystalReportConfigManagedBean crConfig = CrystalReportConfigManagedBean.getManagedBean();
    params.put(
        "rptName",
        crConfig.getReportRootPath() + crConfig.getEconomyInstituteBudgeExecuteReportName());
    params.put("eDate", DateUtils.getRocDateStrByCalendar(eDate));
    CrystalReportConfigManagedBean.generateReport(params);
    return "dialog:print";
  }