コード例 #1
0
  private void generateDemoAudit() throws Exception {
    EnterpriseAudit auditModel = audit;
    EnterpriseBaseModel baseModel = audit.getBaseModel();
    String declareYear = (String) application.get(Constants.OPTION_SFDECLARE_YEAR);
    declareYear = Integer.parseInt(declareYear) + 1 + "";

    auditModel.setAuditStatus(EnterpriseAudit.EStatus.Pass.getValue());
    auditModel.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.Pass.getValue());
    /*
     * modified 2.21
     */
    // int count = auditService.getCount(baseModel, auditModel);
    if (baseModel.getEnterpriseStyle() == EnterpriseBaseModel.EStyle.Example.getValue()
        && Integer.parseInt((String) application.get(Constants.OPTION_SFDECLARE_YEAR))
                - Integer.parseInt(baseModel.getEnterpriseExpeYear())
            > 2) {
      EnterpriseAudit newDemAudit = new EnterpriseAudit();
      newDemAudit.setAuditEnterprise(baseModel.getEnterpriseName());
      newDemAudit.setAuditSecondStatus(EnterpriseAudit.EStatus.NotAudite.getValue());
      newDemAudit.setAuditStatus(EnterpriseAudit.EStatus.NotAudite.getValue());
      newDemAudit.setAuditType(2);
      java.util.Date date = new java.util.Date();
      DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
      newDemAudit.setDeclareDate(Date.valueOf(dateFormat.format(date)));
      newDemAudit.setEditable(true);
      newDemAudit.setBaseModel(baseModel);
      newDemAudit.setDeclareYear(declareYear);
      auditService.saveOrUpdate(newDemAudit);
    }
  }
コード例 #2
0
  public String get() throws Exception {
    //	UserModel userModel = (UserModel)session.get("USER");
    // 查找审批情况
    audit.setAuditType(1);
    audit.setAuditStatus(EnterpriseAudit.EStatus.Pass.getValue());

    if (baseModel.getEnterpriseCity() != null && baseModel.getEnterpriseCity() != 0) {
      // 找到count
      audit.setAuditSecondStatus(EnterpriseAudit.EStatus.NotPass.getValue());
      notPass = auditService.getCount(baseModel, audit);
      audit.setAuditSecondStatus(EnterpriseAudit.EStatus.Reject.getValue());
      notAudit = auditService.getCount(baseModel, audit);
      audit.setAuditSecondStatus(EnterpriseAudit.EStatus.Pass.getValue());
      pass = auditService.getCount(baseModel, audit);

      servletRequest.setAttribute("enterpriseCity", baseModel.getEnterpriseCity());
    }
    int startIndex = (page - 1) * Constants.DefaultPageSize;
    try {
      audit.setAuditStatus(EnterpriseAudit.EStatus.Pass.getValue());
      audit.setAuditSecondStatus(EnterpriseAudit.EStatus.Reject.getValue());
      audit.setAuditType(1);
      PaginationSupport<EnterpriseAudit> audits =
          auditService.getPageByYear(
              baseModel,
              audit,
              "",
              null,
              null,
              Constants.DefaultPageSize,
              startIndex,
              "priority",
              true);
      servletRequest.setAttribute("auditPage", audits);
    } catch (ServiceException e) {
      LOGGER.debug(e.getMessage());
    }
    return "datagrid";
  }
コード例 #3
0
  public String index() throws Exception {
    // UserModel userModel = (UserModel)session.get("USER");
    baseModel = new EnterpriseBaseModel();
    audit = new EnterpriseAudit();

    try {
      audit.setAuditStatus(EnterpriseAudit.EStatus.Pass.getValue());
      audit.setAuditSecondStatus(EnterpriseAudit.EStatus.Reject.getValue());
      audit.setAuditType(1);
      PaginationSupport<EnterpriseAudit> page =
          auditService.getPageByYear(
              baseModel, audit, "", null, null, Constants.DefaultPageSize, 0, "priority", true);
      servletRequest.setAttribute("auditPage", page);
    } catch (ServiceException e) {
      LOGGER.debug(e.getMessage());
    }
    return "index";
  }
コード例 #4
0
  public String save() throws Exception {
    String list = servletRequest.getParameter("idList");
    String[] auditList = list.split(";");
    audit = new EnterpriseAudit();
    for (String id : auditList) {
      audit = auditService.get(id);
      audit.setAuditSecondStatus(state);

      if (state == 1) audit.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.Pass.getValue());
      else if (state == 2)
        audit.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.NotPass.getValue());
      // 退回市局
      else if (state == 4) {
        audit.setAuditStatusBackup(null);
        audit.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.NotTj.getValue());
        audit.setAuditStatus(EnterpriseAudit.EStatus.Pass.getValue());
        // 退回企业
      } else if (state == 7) {
        audit.setAuditStatusBackup(null);
        audit.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.Check.getValue());
        // audit.setAuditStatus(EnterpriseAudit.EStatus.Check.getValue());
        // 查阅完毕
      } else {
        audit.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.NotTj.getValue());
        // audit.setAuditStatus(EnterpriseAudit.EStatus.NotAudite.getValue());
        // modified 4.25
        // 标记从科技厅退回
        audit.setAuditStatusBackup(1);
        rejectToEnt((String) application.get(Constants.OPTION_SDDECLARE_YEAR));
      }

      if (audit.getAuditType() == 1) { // 试点企业审核
        if (state == 1) { // 审核通过
          audit.getBaseModel().setEnterpriseStyle(EnterpriseBaseModel.EStyle.Example.getValue());
          audit
              .getBaseModel()
              .setEnterpriseExpeYear(audit.getDeclareYear()); // add EnterpriseExpeYear 11.1
        } else {
          audit.getBaseModel().setEnterpriseStyle(EnterpriseBaseModel.EStyle.NONE.getValue());
          audit.getBaseModel().setEnterpriseExpeYear(null);
          rejectService.expReject(
              audit.getBaseModel().getEnterpriseId(),
              (String) application.get(Constants.OPTION_SDDECLARE_YEAR));
        }
        // 不是 退回市局
        if (state != 4)
          audit.getBaseModel().setEnterpriseState(EnterpriseBaseModel.EStatus.NotApply.getValue());
      } else if (audit.getAuditType() == 2) { // 示范企业审核
        if (state == 1) { // 审核通过
          audit
              .getBaseModel()
              .setEnterpriseStyle(EnterpriseBaseModel.EStyle.demonstrate.getValue());
          audit
              .getBaseModel()
              .setEnterpriseDemoYear(audit.getDeclareYear()); // add EnterpriseExpeYear 11.1
        } else {
          audit.getBaseModel().setEnterpriseStyle(EnterpriseBaseModel.EStyle.NONE.getValue());
          audit.getBaseModel().setEnterpriseExpeYear(null);
        }
      } else if (audit.getAuditType() == 3) { // 年度审核
        // 不是 退回市局
        if (state != 4)
          audit.getBaseModel().setEnterpriseState(EnterpriseBaseModel.EStatus.NotApply.getValue());
        generateDemoAudit();
      }
      auditService.saveOrUpdate(audit);

      // 记录日志
      UserModel userModel = (UserModel) session.get("USER");
      eventService.saveSystemEvent(
          getMessageFromResource(
              "second.tijiao",
              new String[] {
                state == 1 ? getText("pass") : getText("notpass"),
                EnterpriseAudit.EStyle.values()[audit.getAuditType() - 1].getText(),
                audit.getAuditEnterprise()
              }),
          userModel);
    }
    return null;
  }