/**
   * Method execute
   *
   * @param mapping
   * @param form
   * @param request
   * @param response
   * @return ActionForward
   */
  public ActionForward updateCredencechar(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    try {
      IdAF idaf = (IdAF) form;
      String paraId = idaf.getId().toString();
      ICredencecharBS credencecharBS =
          (ICredencecharBS)
              BSUtils.getBusinessService("credencecharBS", this, mapping.getModuleConfig());

      // 根据ID判断记录是否存在
      boolean temp_isCredencechar = credencecharBS.isCredencecharById(paraId);
      if (!temp_isCredencechar) {
        ActionMessages messages = new ActionMessages();
        messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("该记录不存在,不能修改!", false));
        saveErrors(request, messages);
        return mapping.findForward("credencecharShowAC");
      }

      // 根据ID 查询出凭证字 和 凭证字名称
      CredencecharDTO credencecharDTO = credencecharBS.queryCredencecharParamExplainInfo(paraId);
      String paramExplain = credencecharDTO.getParamExplain();
      String paramExplainExplain = credencecharDTO.getParamExplainExplain();
      request.setAttribute("paraId", paraId);
      request.setAttribute("paramExplain", paramExplain);
      request.setAttribute("paramExplainExplain", paramExplainExplain);

      request.setAttribute("updateInfo", "updateInfo");
    } catch (Exception e) {
      e.printStackTrace();
    }
    return mapping.findForward("credencecharShowAC");
  }
  // 删除AA202表中记录,条件是:id=选择的id 除AA203表中记录,条件是:变更清册id=选择的id
  public ActionForward remove(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    ActionMessages messages = null;
    try {
      IdAF idaf = (IdAF) form;
      SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
      String ip = securityInfo.getUserInfo().getUserIp();
      String name = securityInfo.getUserInfo().getUsername();
      String id = idaf.getId().toString();
      IChgslarybaseBS chgslarybaseBS =
          (IChgslarybaseBS)
              BSUtils.getBusinessService("chgslarybaseBS", this, mapping.getModuleConfig());
      chgslarybaseBS.deleteAllChgPaymentTailMaintain(new Integer(id), ip, name, securityInfo);
      messages = new ActionMessages();
      messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("删除成功!", false));
      saveErrors(request, messages);
    } catch (BusinessException e) {
      messages = new ActionMessages();
      messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(e.getMessage(), false));
      saveErrors(request, messages);
      return mapping.findForward("chgslarybaseTbShowAC.do");
    }

    return mapping.findForward("chgslarybaseTbShowAC.do");
  }
  public ActionForward update(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    try {
      IdAF idaf = (IdAF) form;
      String id = idaf.getId().toString();
      Pagination pagination = new Pagination();
      IChgslarybaseBS chgslarybaseBS =
          (IChgslarybaseBS)
              BSUtils.getBusinessService("chgslarybaseBS", this, mapping.getModuleConfig());
      String orgid = chgslarybaseBS.findOrgidById(id);
      String type = "2";

      pagination.getQueryCriterions().put("org.id", orgid);
      request.setAttribute("type", "0");
      request.getSession().setAttribute(ChgslarybaseTaShowAC.PAGINATION_KEY, pagination);

    } catch (BusinessException e) {
      ActionMessages messages = new ActionMessages();
      messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(e.getMessage(), false));
      saveErrors(request, messages);
      return mapping.findForward("chgslarybaseTbShowAC.do");
    }
    return mapping.findForward("chgslarybaseTaShowAC.do");
  }
 // 撤消提交数据
 public ActionForward pproval(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   ActionMessages messages = null;
   try {
     IdAF idaf = (IdAF) form;
     SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
     String id = idaf.getId().toString();
     IChgslarybaseBS chgslarybaseBS =
         (IChgslarybaseBS)
             BSUtils.getBusinessService("chgslarybaseBS", this, mapping.getModuleConfig());
     String orgid = chgslarybaseBS.queryOrgidByChgPaymentHeadID(id);
     String flag = "2";
     chgslarybaseBS.removePickInChgPaymentTailMaintain(id, orgid, securityInfo, flag);
     messages = new ActionMessages();
     messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("撤消提交成功!", false));
     saveErrors(request, messages);
   } catch (BusinessException e) {
     messages = new ActionMessages();
     messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(e.getMessage(), false));
     saveErrors(request, messages);
     return mapping.findForward("chgslarybaseTbShowAC.do");
   }
   return mapping.findForward("chgslarybaseTbShowAC.do");
 }
  public ActionForward use(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    saveToken(request);
    ActionMessages messages = null;
    try {
      Pagination pagination = (Pagination) request.getSession().getAttribute(PAGINATION_KEY);
      IdAF idaf = (IdAF) form;
      String id = idaf.getId().toString();
      String chgMonth = request.getParameter("chgMonth2");
      SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
      String ip = securityInfo.getUserInfo().getUserIp();
      String name = securityInfo.getUserInfo().getUsername();
      pagination.getQueryCriterions().put("id", id);
      pagination.getQueryCriterions().put("chgMonth", chgMonth);
      pagination.getQueryCriterions().put("ip", ip);
      pagination.getQueryCriterions().put("name", name);

      IChgslarybaseBS chgslarybaseBS =
          (IChgslarybaseBS)
              BSUtils.getBusinessService("chgslarybaseBS", this, mapping.getModuleConfig());

      chgslarybaseBS.useChgPaymentSalaryBaseMaintain(pagination);
      chgslarybaseBS.setAa202_wsh(idaf.getId().toString());
      messages = new ActionMessages();
      messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("启用成功!", false));
      saveErrors(request, messages);
    } catch (BusinessException e) {
      messages = new ActionMessages();
      messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(e.getMessage(), false));
      saveErrors(request, messages);
      return mapping.findForward("chgslarybaseTbShowAC.do");
    }

    return mapping.findForward("chgslarybaseTbShowAC.do");
  }
 public ActionForward deleteCredencechar(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response) {
   try {
     IdAF idaf = (IdAF) form;
     String paraId = idaf.getId().toString();
     ICredencecharBS credencecharBS =
         (ICredencecharBS)
             BSUtils.getBusinessService("credencecharBS", this, mapping.getModuleConfig());
     // 权限
     SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
     // bookId
     String bookId = securityInfo.getBookId();
     // 根据ID 判断是否有记录
     boolean temp_credencechar = credencecharBS.isCredencecharById(paraId);
     if (temp_credencechar) { // 有记录
       // 判断该记录的FN102.para_id在FN201.CREDENCE_CHARACTER or FN210.CREDENCE_CHARACTER中是否存在
       boolean temp_Existence = credencecharBS.isCredencecharByParamValue(paraId, bookId);
       if (temp_Existence) { // 不存在
         // 删除 paramId 记录
         credencecharBS.deleteCredencecharInfo(paraId, securityInfo);
       } else { // 存在
         ActionMessages messages = new ActionMessages();
         messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("该条记录已被应用,不允许删除!", false));
         saveErrors(request, messages);
       }
     } else {
       // 没有记录
       ActionMessages messages = new ActionMessages();
       messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("该记录已删除!", false));
       saveErrors(request, messages);
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
   return mapping.findForward("credencecharShowAC");
 }