/** * 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"); }
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"); }