Example #1
0
  public void revokeStop(Connection con, String reason) throws Exception {
    PreparedStatement pstmt = null;
    String qry = "";
    int updateCount = 0;
    qry = "update t_ym_book set group_stop_status = 1 where group_status = 2 and group_id = ? ";
    pstmt = con.prepareStatement(qry);
    pstmt.setString(1, this.getGroup_id());
    updateCount = pstmt.executeUpdate();
    pstmt.close();

    if (updateCount != 1) throw new Exception("审批中的记录不是一条," + this.getGroup_name());
    AppInfo.revoke(con, this.getGroup_id(), "ym_group_book", "撤回  原因:" + reason);
  }
  public void start(Connection con, Job job, java.util.Map<String, Object> context)
      throws Exception {

    PreparedStatement pstmt = null;
    String sql = null;
    String szAgree = (String) context.get("approveFlag");
    String suggest = (String) context.get("suggest");
    Connection con_lwf = (Connection) context.get("con_lwf");

    // 驳回
    if (!szAgree.equals("1")) {
      sql =
          "update t_fl_teacher_experience set status=3 " + " where teach_exp_id = ? and status=2 ";
      pstmt = con.prepareStatement(sql);
      pstmt.setString(1, job.getAppId());
      pstmt.executeUpdate();
      pstmt.close();
    }

    TeacherExperience applyObj = TeacherExperience.getTeacherExperience(con, job.getAppId());
    if (!szAgree.equals("1")) {
      int msgWay = JMessageEnum.SYSTEM_MESSAGE;
      java.util.Set<String> set = null;

      set = AppInfo.getApproverIdsByWf_id(con_lwf, job.getWf_id());
      String appName = "学术文章审批:" + applyObj.getTeach_exp_title();

      String subject = appName + "审批未通过,原因:" + suggest;

      String toUserIds[] = new String[set.size()];
      int i = 0;
      for (java.util.Iterator<String> iter = set.iterator(); iter.hasNext(); i++) {
        toUserIds[i] = (String) iter.next();
      }
      JMessageAdapter.sendMessage(
          msgWay,
          toUserIds,
          subject,
          subject,
          "-1",
          "/fl/teachExperience/teachExperience.jsp?teach_exp_id=" + job.getAppId());
    } else {
      applyObj.pass(con_lwf);
    }
  }
  /**
   * 撤回
   *
   * @param con
   * @param con_id
   * @throws Exception
   */
  public void revoke(Connection con, String reason) throws Exception {
    PreparedStatement pstmt = null;
    String qry = "";
    int updateCount = 0;
    qry = "update t_ym_process_approval set status = 1 where status = 2 and approval_id = ? ";
    pstmt = con.prepareStatement(qry);
    pstmt.setString(1, this.getApproval_id());
    updateCount = pstmt.executeUpdate();
    pstmt.close();

    YmContract contract = YmContract.getYmContractByConId(con, this.getCon_id());
    if (updateCount != 1) throw new Exception("审批中的记录不是一条," + this.getApproval_id());
    AppInfo.revoke(con, this.getApproval_id(), "ym_process", "撤回  原因:" + reason);

    int msgWay = JMessageEnum.SYSTEM_MESSAGE;
    String toUserIds[] = new String[] {this.getApprover()};

    String subject =
        contract.getCstm_name() + "的" + this.getApproval_type_name() + "的审批被顾问撤回,撤回原因:" + reason;
    String url = "/ym/processControl.jsp?cmd=update&con_id=" + contract.getCon_id();
    JMessageAdapter.sendMessage(msgWay, toUserIds, subject, subject, "-1", url);
  }