Kaynağa Gözat

feat:登录日志信息加上区分端的

hmc 1 yıl önce
ebeveyn
işleme
46874154f5

+ 1 - 0
zkqy-framework/src/main/java/com/zkqy/framework/aspectj/LogAspect.java

@@ -95,6 +95,7 @@ public class LogAspect {
             }
             operLog.setTenantId(tenantId);
             operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
+            operLog.setWhichApplication("1");
             // 请求的地址
             String ip = IpUtils.getIpAddr();
             operLog.setOperIp(ip);

+ 3 - 0
zkqy-framework/src/main/java/com/zkqy/framework/manager/factory/AsyncFactory.java

@@ -65,6 +65,7 @@ public class AsyncFactory
                 logininfor.setBrowser(browser);
                 logininfor.setOs(os);
                 logininfor.setMsg(message);
+                logininfor.setWhichApplication("1");
                 // 日志状态
                 if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER))
                 {
@@ -114,6 +115,8 @@ public class AsyncFactory
                 logininfor.setMsg(message);
                 // 增加租户标识
                 logininfor.setTenantId(tenantId);
+                // 增加登录端标识
+                logininfor.setWhichApplication("1");
                 // 日志状态
                 if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER))
                 {

+ 1 - 1
zkqy-framework/src/main/java/com/zkqy/framework/security/handle/LogoutSuccessHandlerImpl.java

@@ -46,7 +46,7 @@ public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
             tokenService.delLoginUser(loginUser.getToken());
             Long tenantId = loginUser.getTenantId() == null ? 0L : loginUser.getTenantId();
             // 记录用户退出日志
-            AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
+            AsyncManager.me().execute(AsyncFactory.recordLogininfor(tenantId,userName, Constants.LOGOUT, "退出成功"));
         }
         ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.success("退出成功")));
     }

+ 14 - 0
zkqy-system/src/main/java/com/zkqy/system/domain/SysLogininfor.java

@@ -77,6 +77,20 @@ public class SysLogininfor extends BaseEntity {
      */
     private Long tenantId;
 
+    /**
+     *
+     * @return
+     */
+    private String whichApplication;
+
+    public String getWhichApplication() {
+        return whichApplication;
+    }
+
+    public void setWhichApplication(String whichApplication) {
+        this.whichApplication = whichApplication;
+    }
+
     public Long getInfoId() {
         return infoId;
     }

+ 11 - 0
zkqy-system/src/main/java/com/zkqy/system/domain/SysOperLog.java

@@ -87,6 +87,17 @@ public class SysOperLog extends BaseEntity
     @Excel(name = "消耗时间", suffix = "毫秒")
     private Long costTime;
 
+    @Excel(name = "登录的那个端", suffix = "毫秒")
+    private String whichApplication;
+
+    public String getWhichApplication() {
+        return whichApplication;
+    }
+
+    public void setWhichApplication(String whichApplication) {
+        this.whichApplication = whichApplication;
+    }
+
     /**
      * 租户ID
      */

+ 2 - 2
zkqy-system/src/main/resources/mapper/system/SysLogininforMapper.xml

@@ -18,8 +18,8 @@
 	</resultMap>
 
 	<insert id="insertLogininfor" parameterType="SysLogininfor">
-		insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time,tenant_id)
-		values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate(),#{tenantId})
+		insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time,tenant_id,which_application)
+		values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate(),#{tenantId},#{whichApplication})
 	</insert>
 
 	<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">

+ 2 - 2
zkqy-system/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -31,8 +31,8 @@
 	</sql>
 
 	<insert id="insertOperlog" parameterType="SysOperLog">
-		insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time,tenant_id)
-		values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate(),#{tenantId})
+		insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time,tenant_id,which_application)
+		values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate(),#{tenantId},#{whichApplication})
 	</insert>
 
 	<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">

+ 20 - 0
zkqy-ui/src/views/system/bpmnPro/data/index.js

@@ -71,5 +71,25 @@ export const formList = [
     formKey: "AppearanceInspection",
     formName: "外观检测",
   },
+  {
+    formKey: "Loading",
+    formName: "JY-上料",
+  },
+  {
+    formKey: "Processing",
+    formName: "JY-加工",
+  },
+  {
+    formKey: "Assemble",
+    formName: "JY-组装",
+  },
+  {
+    formKey: "Detection",
+    formName: "JY-检验",
+  },
+  {
+    formKey: "WareHousing",
+    formName: "JY-入库",
+  }
 ]