Пример #1
0
 // 获取指标
 private int getZhibiao(int batchId, int branchId, int academyId) throws Exception {
   int zhibiao = 0;
   AcademyEnrollQuota aeq =
       academyEnrollQuotaBiz.findAcademyEnrollQuotaByBatchIdAndBranchIdAndAcademyId(
           batchId, branchId, academyId);
   if (null != aeq) {
     zhibiao = aeq.getTarget();
   }
   return zhibiao;
 }
Пример #2
0
  /*
   * 查询学习中心指标
   *
   * @see
   * net.cedu.biz.enrollment.BranchEnrollQuotaBiz#findBranchEnrollQuotalist
   * (net.cedu.model.page.PageResult)
   */
  public List<BranchEnrollQuota> findBranchEnrollQuotalist(
      int batchId, PageResult<BranchEnrollQuota> pr) throws Exception {
    // 学习中心招生批次集合
    List<BranchEnrollQuota> branchEnrollQuotaList =
        branchenrollquotaDao.findBranchEnrollQuotaList(batchId);
    if (branchEnrollQuotaList != null && branchEnrollQuotaList.size() != 0) {
      BranchEnrollQuota branchenrollquota = null;
      // key:学习中心ID_全局批次ID_院校ID value:招生指标
      Map<String, Integer> targetMap = academyEnrollQuotaBiz.getTargetByBatch(batchId);
      // key:学习中心ID_全局批次ID_院校ID value:完成指标
      Map<String, Integer> targetComMap = studentDao.getCompleteCountAll(batchId);
      for (int i = 0; i < branchEnrollQuotaList.size(); i++) {
        branchenrollquota = branchEnrollQuotaList.get(i);
        // 学习中心名称
        Branch branch = branchBiz.findBranchById(branchenrollquota.getBranchId());
        if (branch != null) {
          branchenrollquota.setBranchName(branch.getName());
        }
        //
        List<Academy> academylst =
            academybatchbranchBiz.findAcademyByBranchIdAndGlobalBatchId(
                branchenrollquota.getBranchId(), branchenrollquota.getBatchId());
        if (academylst != null && academylst.size() > 0) {
          for (int j = 0; j < academylst.size(); j++) {
            // 克隆类
            Academy academy1 = academylst.get(j);
            Academy academy = academy1.clone();
            // 指标
            // academy.setTarget(getZhibiao(branchenrollquota.getBatchId(),branchenrollquota.getBranchId(), academy.getId()));
            Integer target = targetMap.get(branchenrollquota.getBranchId() + "_" + academy.getId());
            academy.setTarget(target == null ? 0 : target);
            // 完成指标
            // academy.setComplete(studentBiz.findStudentCount(batchId,academy.getId(),0));
            Integer targetCom =
                targetComMap.get(branchenrollquota.getBranchId() + "_" + academy.getId());
            academy.setComplete(targetCom == null ? 0 : targetCom);
            academylst.set(j, academy);
          }

          branchenrollquota.setAcademylst(academylst);
        }
      }
    }

    return branchEnrollQuotaList;
  }