コード例 #1
0
ファイル: RARAction.java プロジェクト: noikiy/ismp_manager
 /**
  * 更新 应用系统权限分配记录
  *
  * @param mapping
  * @param form
  * @param request
  * @param response
  * @return
  * @throws IOException
  */
 public ActionForward upRARInfo(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws IOException {
   String asrid = request.getParameter("asrid");
   String rarid = request.getParameter("rarid");
   String name = request.getParameter("name");
   String operator = request.getParameter("operator");
   if (HtmlFactory.isNotEmpty(rarid)) {
     AppSysRole asr = new AppSysRole();
     if (HtmlFactory.isNotEmpty(asrid)) {
       asr.setId(Integer.valueOf(asrid));
     }
     if (HtmlFactory.isNotEmpty(name)) {
       name = HtmlFactory.conversionCoding(name, "GBK");
     }
     if (HtmlFactory.isNotEmpty(operator)) {
       operator = HtmlFactory.conversionCoding(operator, "GBK");
     }
     String falg = "成功!";
     try {
       RoleAssignRecords rar = roleAssignRecordsService.findById(Integer.valueOf(rarid));
       rar.setRole(asr);
       rar.setUser(name);
       rar.setOperator(operator);
       rar.setLastUpdateTime(new Timestamp(new Date().getTime()));
       roleAssignRecordsService.update(rar);
     } catch (Exception e) {
       falg = "失败!";
     } finally {
       try {
         systemlogservice.saveSystemLog(
             LogUtil.userName,
             LogUtil.roleName,
             SystemModelInfo.MOD_SYSM_user_other,
             "更新 应用系统权限分配记录",
             new Timestamp(System.currentTimeMillis()),
             falg);
       } catch (Exception e) {
         logger.debug("连接日志出错", e);
       }
     }
   }
   return null;
 }
コード例 #2
0
ファイル: RARAction.java プロジェクト: noikiy/ismp_manager
 /**
  * 查询 应用系统权限分配记录 RAR (RoleAssignRecords 简写)
  *
  * @param mapping
  * @param form
  * @param request
  * @param response
  * @return
  * @throws IOException
  */
 public ActionForward getRARInfo(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws IOException {
   RARForm appSysInfoForm = (RARForm) form;
   String asid = request.getParameter("asid");
   if (HtmlFactory.isNotEmpty(asid)) {
     PMPage page = HtmlFactory.getPage(request);
     StringBuffer sbf = new StringBuffer();
     String user[][] = {
       {"id", "getId"},
       {"username", "getUser"},
       {"ctime", "getCreateTime"},
       {"operator", "getOperator"}
     };
     String security[][] = {{"roleid", "getId"}, {"rolename", "getName"}};
     AppSysInfo asi = new AppSysInfo();
     asi.setId(Integer.valueOf(asid));
     appSysInfoForm.getRar().setAppSys(asi);
     List<RoleAssignRecords> list =
         roleAssignRecordsService.findConditionsInfo(
             appSysInfoForm.getRar(),
             page,
             appSysInfoForm.getCreateStartDate(),
             appSysInfoForm.getCreateEndDate());
     for (RoleAssignRecords rar : list) {
       Object objs[][] = {{rar, user}, {rar.getRole(), security}};
       HtmlFactory.getDataArray(objs, sbf, "RAR");
     }
     HtmlFactory.getDataArray(page.getPageInfo(), sbf, "PAGE");
     HtmlFactory.flushData(response, sbf);
   }
   return null;
 }