he2802 2 years ago
parent
commit
62b1b3c748

+ 28 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.controller.common;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -30,6 +31,7 @@ import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.system.bo.SysTenantAdminBo;
+import com.zhongzheng.modules.system.bo.SysTenantQueryBo;
 import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysTenantService;
@@ -379,4 +381,30 @@ public class CommonController
         String dualAuth = configService.selectConfigByKey("login.dual.auth");
         return AjaxResult.success("成功",dualAuth);
     }
+
+    /**
+     * 获取企业ID
+     */
+    @ApiOperation("获取企业ID")
+    @GetMapping("common/free/findTenantId")
+    public AjaxResult<String> findTenantId(SysTenantQueryBo bo) {
+        Long tenantId = iSysTenantService.findTenantId(bo);
+        if(Validator.isNotEmpty(tenantId)){
+            return AjaxResult.success("成功",tenantId.toString());
+        }else{
+            if(Validator.isNotEmpty(bo.getHostH5())&&bo.getHostH5().equals("120.79.166.78:19012")){
+                return AjaxResult.success("成功","867735392558919680");
+            }
+            if(Validator.isNotEmpty(bo.getHostLive())&&bo.getHostLive().equals("120.79.166.78:19012")){
+                return AjaxResult.success("成功","867735392558919680");
+            }
+            if(Validator.isNotEmpty(bo.getHostPc())&&bo.getHostPc().equals("120.79.166.78:19012")){
+                return AjaxResult.success("成功","867735392558919680");
+            }
+            if(Validator.isNotEmpty(bo.getHostAdmin())&&bo.getHostAdmin().equals("120.79.166.78:19012")){
+                return AjaxResult.success("成功","867735392558919680");
+            }
+            return AjaxResult.error("失败",null);
+        }
+    }
 }

+ 67 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/monitor/SysOperlogController.java

@@ -0,0 +1,67 @@
+package com.zhongzheng.controller.monitor;
+
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.modules.system.domain.SysOperLog;
+import com.zhongzheng.modules.system.service.ISysOperLogService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 操作日志记录
+ *
+ * @author zhongzheng
+ */
+@Api(tags ="操作日志记录")
+@RestController
+@RequestMapping("/monitor/operlog")
+public class SysOperlogController extends BaseController
+{
+    @Autowired
+    private ISysOperLogService operLogService;
+
+    @ApiOperation("操作日志分页列表")
+    @PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysOperLog operLog)
+    {
+        startPage();
+        List<SysOperLog> list = operLogService.selectOperLogList(operLog);
+        return getDataTable(list);
+    }
+
+    @Log(title = "操作日志", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
+    @GetMapping("/export")
+    public AjaxResult export(SysOperLog operLog)
+    {
+        List<SysOperLog> list = operLogService.selectOperLogList(operLog);
+        ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
+        return util.exportExcel(list, "操作日志");
+    }
+
+    @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
+    @DeleteMapping("/{operIds}")
+    public AjaxResult remove(@PathVariable Long[] operIds)
+    {
+        return toAjax(operLogService.deleteOperLogByIds(operIds));
+    }
+
+    @Log(title = "操作日志", businessType = BusinessType.CLEAN)
+    @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
+    @DeleteMapping("/clean")
+    public AjaxResult clean()
+    {
+        operLogService.cleanOperLog();
+        return AjaxResult.success();
+    }
+}

+ 3 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysMenuController.java

@@ -61,7 +61,9 @@ public class SysMenuController extends BaseController
     @GetMapping(value = "/{menuId}")
     public AjaxResult getInfo(@PathVariable Long menuId)
     {
-        return AjaxResult.success(menuService.selectMenuById(menuId));
+        SysMenu sysMenu = menuService.selectMenuById(menuId);
+        sysMenu.setTenantId(null);
+        return AjaxResult.success(sysMenu);
     }
 
     /**

+ 0 - 3
zhongzheng-api/src/main/java/com/zhongzheng/controller/base/LockController.java

@@ -45,7 +45,6 @@ public class LockController extends BaseController {
      */
     @ApiOperation("锁定行为")
     @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
-    @Log(title = "锁定行为", businessType = BusinessType.UPDATE)
     @PostMapping("/lockAction")
     public AjaxResult<Void> lockAction(@Validated @RequestBody ActionLockQueryBo bo) {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
@@ -59,7 +58,6 @@ public class LockController extends BaseController {
      */
     @ApiOperation("查看行为锁定状态")
     @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
-    @Log(title = "查看行为锁定状态", businessType = BusinessType.UPDATE)
     @PostMapping("/lockStatus")
     public AjaxResult<Void> lockStatus(@RequestBody ActionLockQueryBo bo) {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
@@ -78,7 +76,6 @@ public class LockController extends BaseController {
      */
     @ApiOperation("删除锁定状态")
     @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
-    @Log(title = "删除锁定状态", businessType = BusinessType.UPDATE)
     @PostMapping("/delLock")
     public AjaxResult delLock(@RequestBody ActionLockQueryBo bo) {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());

+ 2 - 1
zhongzheng-framework/src/main/java/com/zhongzheng/framework/aspectj/LogAspect.java

@@ -118,6 +118,7 @@ public class LogAspect
                     {
                         username = loginUser.getUser().getUserAccount();
                     }
+                    return ;
                 }
             }else{
                 TopLoginUser topLoginUser = SpringUtils.getBean(TopTokenService.class).getLoginUser(ServletUtils.getRequest());
@@ -139,7 +140,6 @@ public class LogAspect
 
             operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
             operLog.setOperName(username);
-
             if (e != null)
             {
                 operLog.setStatus(BusinessStatus.FAIL.ordinal());
@@ -149,6 +149,7 @@ public class LogAspect
             String className = joinPoint.getTarget().getClass().getName();
             String methodName = joinPoint.getSignature().getName();
             operLog.setMethod(className + "." + methodName + "()");
+            operLog.setTenantId(Long.parseLong(ServletUtils.getRequest().getHeader("TenantId")));
             // 设置请求方式
             operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
             // 处理设置注解上的参数

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/bo/SysTenantAddBo.java

@@ -109,4 +109,6 @@ public class SysTenantAddBo {
     /** 直播域名 */
     @ApiModelProperty("直播域名")
     private String hostLive;
+    @ApiModelProperty("后台域名")
+    private String hostAdmin;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/bo/SysTenantEditBo.java

@@ -105,4 +105,7 @@ public class SysTenantEditBo {
     /** 直播域名 */
     @ApiModelProperty("直播域名")
     private String hostLive;
+
+    @ApiModelProperty("后台域名")
+    private String hostAdmin;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/bo/SysTenantQueryBo.java

@@ -115,4 +115,7 @@ public class SysTenantQueryBo extends BaseEntity {
 	@ApiModelProperty("直播域名")
 	private String hostLive;
 
+	@ApiModelProperty("后台域名")
+	private String hostAdmin;
+
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/domain/SysLogininfor.java

@@ -77,6 +77,7 @@ public class SysLogininfor implements Serializable {
     @Excel(name = "提示消息")
     private String msg;
 
+
     /**
      * 访问时间
      */

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/domain/SysOperLog.java

@@ -151,7 +151,7 @@ public class SysOperLog implements Serializable {
     @TableField(exist = false)
     private Map<String, Object> params = new HashMap<>();
 
-
+    private Long tenantId;
     /**
      * 主键ID
      */

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/domain/SysTenant.java

@@ -78,5 +78,7 @@ private static final long serialVersionUID=1L;
     private String hostH5;
     /** 直播域名 */
     private String hostLive;
+    /** 后台域名 */
+    private String hostAdmin;
 
 }

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysOperLogServiceImpl.java

@@ -30,8 +30,8 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
      */
     @Override
     public void insertOperlog(SysOperLog operLog) {
-       /* operLog.setOperTime(new Date());
-        save(operLog);*/
+        operLog.setOperTime(new Date());
+        save(operLog);
     }
 
     /**