Kaynağa Gözat

系统日志修改

git-svn-id: https://192.168.57.71/svn/jsgkj@1183 931142cf-59ea-a443-aa0e-51397b428577
ld_zhouk 8 yıl önce
ebeveyn
işleme
7dd1030cc3

+ 14 - 10
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/common/util/UserSessionListener.java

@@ -57,16 +57,20 @@ public class UserSessionListener implements HttpSessionListener {
             clientIp = (String) session.getAttribute(Constants.SESSION_KEY_IP);
         }
 
-        // 数据库日志
-        SysLogModel log = new SysLogModel();
-        log.setLogType(Constants.LOG_TYPE_4);
-        log.setLogPath(UserSessionListener.class.getName());
-        log.setLogParam("");
-        log.setLogMsg("用户:[" + user.getLoginName() + "|" + user.getRealName() + "]登出系统!");
-        log.setClientIp(clientIp);
-        // 保存数据库
-        sysLogService.add(log, user);
-        logger.info("生成系统日志[日志描述:{},客户端IP:{}]", log.getLogMsg(), clientIp);
+        try {
+            // 数据库日志
+            SysLogModel log = new SysLogModel();
+            log.setLogType(Constants.LOG_TYPE_4);
+            log.setLogPath(UserSessionListener.class.getName());
+            log.setLogParam("");
+            log.setLogMsg("用户:[" + user.getLoginName() + "|" + user.getRealName() + "]登出系统!");
+            log.setClientIp(clientIp);
+            // 保存数据库
+            sysLogService.add(log, user);
+            logger.info("生成系统日志[日志描述:{},客户端IP:{}]", log.getLogMsg(), clientIp);
+        } catch (Exception ex) {
+            logger.error("生成系统日志发生异常:", ex);
+        }
     }
 
     private Object getObjectFromApplication(ServletContext servletContext) {

+ 18 - 15
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/DictCtl.java

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.alibaba.fastjson.JSONArray;
 import com.xt.js.gkaq.common.BaseCtl;
+import com.xt.js.gkaq.common.log.annotation.SysLog;
 import com.xt.js.gkaq.frame.model.CodeModel;
 import com.xt.js.gkaq.frame.model.CodeModelDto;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
@@ -25,7 +26,7 @@ import com.yuanxd.tools.utils.WebJsonResult;
 import com.yuanxd.tools.utils.string.StringUtils;
 
 /**
- * 锟街碉拷锟斤拷锟斤拷锟斤拷
+ * 字典管理控制
  */
 @Controller
 @RequestMapping(value = "/dict", produces = "application/json; charset=utf-8")
@@ -34,7 +35,7 @@ public class DictCtl extends BaseCtl {
     private CodeService codeService;
 
     /**
-     * 锟斤拷锟斤拷锟斤拷
+     * 进入首
      * 
      * @param model
      * @return
@@ -45,7 +46,7 @@ public class DictCtl extends BaseCtl {
     }
 
     /**
-     * 锟斤拷始锟斤拷页锟斤拷锟斤拷锟斤拷锟�
+     * 初始化页面加载树
      * 
      * @return
      */
@@ -58,7 +59,7 @@ public class DictCtl extends BaseCtl {
     }
 
     /**
-     * 锟斤拷始锟斤拷页锟斤拷锟斤拷锟斤拷锟斤拷
+     * 初始化页面加载数据
      * 
      * @param vo
      * @return
@@ -66,8 +67,9 @@ public class DictCtl extends BaseCtl {
      */
     @RequestMapping("list")
     @ResponseBody
+    @SysLog(description="字典列表查询")
     public PageInfo<CodeModelDto> getPageInfo(DictVo vo) throws UnsupportedEncodingException {
-        // 锟斤拷始锟斤拷锟斤拷锟斤拷
+        // 初始化参数
         if (null == vo.getPage() || vo.getPage() < 1) {
             vo.setPage(1);
         }
@@ -92,13 +94,14 @@ public class DictCtl extends BaseCtl {
     }
 
     /**
-     * 锟斤拷取锟斤拷
+     * 获取记
      * 
      * @param id
      * @return
      */
     @RequestMapping("getRecord")
     @ResponseBody
+    @SysLog(description="获取字典数据")
     public CodeModel getRecord(String id) {
 
         CodeModel model = codeService.findById(id);
@@ -106,7 +109,7 @@ public class DictCtl extends BaseCtl {
     }
 
     /**
-     * 删锟斤拷锟铰�
+     * 删除记录
      * 
      * @param ids
      * @return
@@ -114,6 +117,7 @@ public class DictCtl extends BaseCtl {
     @RequestMapping("delRecodes")
     @ResponseBody
     @Transactional
+    @SysLog(description="删除字典数据")
     public int delRecodes(String ids) {
 
         int cnt = 0;
@@ -121,8 +125,6 @@ public class DictCtl extends BaseCtl {
             String[] idArr = ids.split(",");
             for (String id : idArr) {
                 if (StringUtils.isNotEmpty(id)) {
-                    cnt += codeService.deleteByPid(id);
-                    cnt += codeService.deleteByID(id);
                     delByPid(id);
                 }
             }
@@ -131,7 +133,7 @@ public class DictCtl extends BaseCtl {
     }
 
     /**
-     * 锟捷癸拷删锟斤拷
+     * 递归删除
      * 
      * @param id
      */
@@ -153,22 +155,23 @@ public class DictCtl extends BaseCtl {
     }
 
     /**
-     * 锟斤拷锟斤拷锟铰�
+     * 保存记录
      * 
      * @param vo
      * @return
      */
     @RequestMapping("save")
     @ResponseBody
+    @SysLog(description="保存字典数据")
     public WebJsonResult save(DictVo dictVo) {
 
         if (StringUtils.isEmpty(dictVo.getId())) {
-            // 锟斤拷锟斤拷
+            // 新增
             CodeModel codeModel = new CodeModel();
             BeanUtils.copyProperties(dictVo, codeModel);
             codeService.add(codeModel);
         } else {
-            // 锟斤拷锟斤拷
+            // 更新
             CodeModel codeModel = codeService.findById(dictVo.getId());
             BeanUtils.copyProperties(dictVo, codeModel);
             codeService.update(codeModel);
@@ -177,7 +180,7 @@ public class DictCtl extends BaseCtl {
     }
 
     /**
-     * 锟斤拷取锟街碉拷锟叫憋拷
+     * 获取字典列表
      * 
      * @param pcode
      * @return
@@ -191,7 +194,7 @@ public class DictCtl extends BaseCtl {
     }
 
     /**
-     * 锟斤拷取锟斤拷锟斤拷锟街碉拷锟叫憋拷
+     * 获取父类字典列表
      * 
      * @return
      */

+ 5 - 0
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/GroupCtl.java

@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.alibaba.fastjson.JSONArray;
 import com.xt.js.gkaq.common.BaseCtl;
+import com.xt.js.gkaq.common.log.annotation.SysLog;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
 import com.xt.js.gkaq.frame.model.GroupButtonModel;
 import com.xt.js.gkaq.frame.model.GroupMenuModel;
@@ -60,6 +61,7 @@ public class GroupCtl extends BaseCtl {
      */
     @RequestMapping("list")
     @ResponseBody
+    @SysLog(description="分组列表查询")
     public PageInfo<GroupModelDto> getPageInfo(GroupVo vo) throws UnsupportedEncodingException {
         // 初始化参数
         if (null == vo.getPage() || vo.getPage() < 1) {
@@ -86,6 +88,7 @@ public class GroupCtl extends BaseCtl {
      */
     @RequestMapping("getRecord")
     @ResponseBody
+    @SysLog(description="获取分组数据")
     public GroupModel getRecord(String id) {
 
         GroupModel model = groupService.findById(id);
@@ -101,6 +104,7 @@ public class GroupCtl extends BaseCtl {
     @RequestMapping("delRecodes")
     @ResponseBody
     @Transactional
+    @SysLog(description="删除分组数据")
     public int delRecodes(String ids) {
 
         int cnt = 0;
@@ -128,6 +132,7 @@ public class GroupCtl extends BaseCtl {
     @RequestMapping("save")
     @ResponseBody
     @Transactional
+    @SysLog(description="保存分组数据")
     public WebJsonResult save(GroupVo vo) {
 
         GroupModel model = new GroupModel();

+ 3 - 0
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/MenuButtonCtl.java

@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.xt.js.gkaq.common.BaseCtl;
+import com.xt.js.gkaq.common.log.annotation.SysLog;
 import com.xt.js.gkaq.frame.model.ButtonModel;
 import com.xt.js.gkaq.frame.service.ButtonService;
 import com.xt.js.gkaq.web.vo.ButtonVo;
@@ -26,6 +27,7 @@ public class MenuButtonCtl extends BaseCtl {
 
     @RequestMapping("getRecord")
     @ResponseBody
+    @SysLog(description="获取菜单按钮数据")
     public ButtonModel getRecord(String id) {
 
         ButtonModel btnModel = buttonService.findById(id);
@@ -40,6 +42,7 @@ public class MenuButtonCtl extends BaseCtl {
      */
     @RequestMapping("save")
     @ResponseBody
+    @SysLog(description="保存菜单按钮数据")
     public WebJsonResult save(ButtonVo btnVo) {
 
         if (StringUtils.isEmpty(btnVo.getBtnId())) {

+ 10 - 7
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/MenuCtl.java

@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.alibaba.fastjson.JSONArray;
 import com.xt.js.gkaq.common.BaseCtl;
 import com.xt.js.gkaq.common.Constants;
+import com.xt.js.gkaq.common.log.annotation.SysLog;
 import com.xt.js.gkaq.frame.model.MenuModel;
 import com.xt.js.gkaq.frame.service.ButtonService;
 import com.xt.js.gkaq.frame.service.MenuService;
@@ -47,7 +48,6 @@ public class MenuCtl extends BaseCtl {
         return "frame/menu";
     }
 
-
     /**
      * 初始化页面加载树
      * 
@@ -70,6 +70,7 @@ public class MenuCtl extends BaseCtl {
      */
     @RequestMapping("list")
     @ResponseBody
+    @SysLog(description="菜单列表查询")
     public PageInfo<MenuModel> getPageInfo(MenuVo vo) throws UnsupportedEncodingException {
         // 初始化参数
         if (null == vo.getPage() || vo.getPage() < 1) {
@@ -111,9 +112,9 @@ public class MenuCtl extends BaseCtl {
      * @param id
      * @return
      */
-
     @RequestMapping("getRecord")
     @ResponseBody
+    @SysLog(description="获取菜单数据")
     public MenuModel getRecord(String id) {
 
         MenuModel menuModel = menuService.findById(id);
@@ -129,6 +130,7 @@ public class MenuCtl extends BaseCtl {
     @RequestMapping("delRecodes")
     @ResponseBody
     @Transactional
+    @SysLog(description="删除菜单数据")
     public int delRecodes(String ids) {
 
         int cnt = 0;
@@ -144,7 +146,7 @@ public class MenuCtl extends BaseCtl {
     }
 
     /**
-     * 锟捷癸拷删锟斤拷
+     * 递归删除
      * 
      * @param id
      */
@@ -152,7 +154,7 @@ public class MenuCtl extends BaseCtl {
 
         MenuModel model = menuService.findById(id);
         if (model == null) {
-            // 删锟斤拷
+            // 删除按
             buttonService.deleteLogicByID(id);
             return;
         }
@@ -162,7 +164,7 @@ public class MenuCtl extends BaseCtl {
                 delByPid(data.getId());
             }
         } else {
-            // 删锟斤拷末锟斤拷锟剿碉拷锟斤拷锟斤拷锟侥帮拷
+            // 删除末级菜单关联的按
             buttonService.deleteByMenu(id);
         }
         menuService.deleteLogicByID(id);
@@ -176,15 +178,16 @@ public class MenuCtl extends BaseCtl {
      */
     @RequestMapping("save")
     @ResponseBody
+    @SysLog(description="保存菜单数据")
     public WebJsonResult save(MenuVo menuVo) {
 
         if (StringUtils.isEmpty(menuVo.getId())) {
-            // 锟斤拷锟斤拷
+            // 新增
             MenuModel menuModel = new MenuModel();
             BeanUtils.copyProperties(menuVo, menuModel);
             menuService.add(menuModel);
         } else {
-            // 锟斤拷锟斤拷
+            // 更新
             MenuModel menuModel = menuService.findById(menuVo.getId());
             BeanUtils.copyProperties(menuVo, menuModel);
             menuService.update(menuModel);

+ 5 - 1
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/OrgCtl.java

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.alibaba.fastjson.JSONArray;
 import com.xt.js.gkaq.common.BaseCtl;
+import com.xt.js.gkaq.common.log.annotation.SysLog;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
 import com.xt.js.gkaq.frame.model.OrgModel;
 import com.xt.js.gkaq.frame.model.OrgModelDto;
@@ -66,6 +67,7 @@ public class OrgCtl extends BaseCtl {
      */
     @RequestMapping("list")
     @ResponseBody
+    @SysLog(description="组织列表查询")
     public PageInfo<OrgModelDto> getPageInfo(OrgVo vo) throws UnsupportedEncodingException {
         // 初始化参数
         if (null == vo.getPage() || vo.getPage() < 1) {
@@ -99,6 +101,7 @@ public class OrgCtl extends BaseCtl {
      */
     @RequestMapping("getRecord")
     @ResponseBody
+    @SysLog(description="获取组织数据")
     public OrgModelDto getRecord(String id) {
 
         OrgModelDto model = orgService.findById(id);
@@ -114,6 +117,7 @@ public class OrgCtl extends BaseCtl {
     @RequestMapping("delRecodes")
     @ResponseBody
     @Transactional
+    @SysLog(description="删除组织数据")
     public int delRecodes(String ids) {
 
         int cnt = 0;
@@ -159,6 +163,7 @@ public class OrgCtl extends BaseCtl {
      */
     @RequestMapping("save")
     @ResponseBody
+    @SysLog(description="保存组织数据")
     public WebJsonResult save(OrgVo vo) {
 
         if (StringUtils.isEmpty(vo.getId())) {
@@ -189,5 +194,4 @@ public class OrgCtl extends BaseCtl {
         return JSONArray.toJSONString(list);
     }
 
-
 }

+ 5 - 0
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/ParamCtl.java

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.xt.js.gkaq.common.BaseCtl;
+import com.xt.js.gkaq.common.log.annotation.SysLog;
 import com.xt.js.gkaq.frame.model.ParamModel;
 import com.xt.js.gkaq.frame.service.ParamService;
 import com.xt.js.gkaq.web.vo.ParamVo;
@@ -49,6 +50,7 @@ public class ParamCtl extends BaseCtl {
      */
     @RequestMapping("list")
     @ResponseBody
+    @SysLog(description="参数列表查询")
     public PageInfo<ParamModel> getPageInfo(ParamVo vo) {
         // 初始化参数
         if (null == vo.getPage() || vo.getPage() < 1) {
@@ -74,6 +76,7 @@ public class ParamCtl extends BaseCtl {
      */
     @RequestMapping("getRecord")
     @ResponseBody
+    @SysLog(description="获取参数数据")
     public ParamModel getRecord(String id) {
 
         ParamModel model = paramService.findById(id);
@@ -89,6 +92,7 @@ public class ParamCtl extends BaseCtl {
     @RequestMapping("delRecodes")
     @ResponseBody
     @Transactional
+    @SysLog(description="删除参数数据")
     public int delRecodes(String ids) {
 
         int cnt = 0;
@@ -111,6 +115,7 @@ public class ParamCtl extends BaseCtl {
      */
     @RequestMapping("save")
     @ResponseBody
+    @SysLog(description="保存参数数据")
     public WebJsonResult save(ParamVo vo) {
 
         if (StringUtils.isEmpty(vo.getId())) {

+ 5 - 0
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/RoleCtl.java

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.alibaba.fastjson.JSONArray;
 import com.xt.js.gkaq.common.BaseCtl;
+import com.xt.js.gkaq.common.log.annotation.SysLog;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
 import com.xt.js.gkaq.frame.model.RoleButtonModel;
 import com.xt.js.gkaq.frame.model.RoleMenuModel;
@@ -60,6 +61,7 @@ public class RoleCtl extends BaseCtl {
      */
     @RequestMapping("list")
     @ResponseBody
+    @SysLog(description="角色列表查询")
     public PageInfo<RoleModel> getPageInfo(RoleVo vo) throws UnsupportedEncodingException {
         // 初始化参数
         if (null == vo.getPage() || vo.getPage() < 1) {
@@ -90,6 +92,7 @@ public class RoleCtl extends BaseCtl {
      */
     @RequestMapping("getRecord")
     @ResponseBody
+    @SysLog(description="获取角色数据")
     public RoleModel getRecord(String id) {
 
         RoleModel model = roleService.findById(id);
@@ -105,6 +108,7 @@ public class RoleCtl extends BaseCtl {
     @RequestMapping("delRecodes")
     @ResponseBody
     @Transactional
+    @SysLog(description="删除角色数据")
     public int delRecodes(String ids) {
 
         int cnt = 0;
@@ -132,6 +136,7 @@ public class RoleCtl extends BaseCtl {
     @RequestMapping("save")
     @ResponseBody
     @Transactional
+    @SysLog(description="保存角色数据")
     public WebJsonResult save(RoleVo vo) {
 
         RoleModel model = new RoleModel();

+ 5 - 0
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/XzqhCtl.java

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.alibaba.fastjson.JSONArray;
 import com.xt.js.gkaq.common.BaseCtl;
+import com.xt.js.gkaq.common.log.annotation.SysLog;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
 import com.xt.js.gkaq.frame.model.XzqhModel;
 import com.xt.js.gkaq.frame.service.XzqhService;
@@ -52,6 +53,7 @@ public class XzqhCtl extends BaseCtl {
      */
     @RequestMapping("list")
     @ResponseBody
+    @SysLog(description="行政区划列表查询")
     public PageInfo<XzqhModel> getPageInfo(XzqhVo vo) throws UnsupportedEncodingException {
         // 初始化参数
         if (null == vo.getPage() || vo.getPage() < 1) {
@@ -82,6 +84,7 @@ public class XzqhCtl extends BaseCtl {
      */
     @RequestMapping("getRecord")
     @ResponseBody
+    @SysLog(description="获取行政区划数据")
     public XzqhModel getRecord(String id) {
 
         XzqhModel model = xzqhService.findById(id);
@@ -97,6 +100,7 @@ public class XzqhCtl extends BaseCtl {
     @RequestMapping("delRecodes")
     @ResponseBody
     @Transactional
+    @SysLog(description="删除行政区划数据")
     public int delRecodes(String ids) {
 
         int cnt = 0;
@@ -119,6 +123,7 @@ public class XzqhCtl extends BaseCtl {
      */
     @RequestMapping("save")
     @ResponseBody
+    @SysLog(description="保存行政区划数据")
     public WebJsonResult save(XzqhVo vo) {
 
         if (StringUtils.isEmpty(vo.getId())) {