|
@@ -71,7 +71,51 @@ public class Guiji_Base_Service {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 远程接口调用日志信息新增日志
|
|
|
+ * 接口调用日志不进行Websocket推送 不需要用户登录
|
|
|
+ */
|
|
|
+ public void addLog(BaseBusinessEntity baseBusinessEntity){
|
|
|
+ HttpServletRequest request = ServletUtils.getRequest();
|
|
|
+ String osAndBrowser[] = HttpUtil.getOsAndBrowserInfo(request).split("---");
|
|
|
+ String os = osAndBrowser[0];
|
|
|
+ String browser = osAndBrowser[1];
|
|
|
+ String ipaddress = HttpUtil.getIPAddress(request);
|
|
|
+ //添加操作日志
|
|
|
+ //SysUser sysUser = userInfoUtil.getLoginUserInfo();
|
|
|
+ TULog tuLog = new TULog();
|
|
|
+ tuLog.setId(UUID.fastUUID().toString());
|
|
|
+ tuLog.setOs(os);
|
|
|
+ tuLog.setBrowser(browser);
|
|
|
+ tuLog.setInterfaceinfoId(baseBusinessEntity.getInterfaceinfoId());
|
|
|
+ tuLog.setInterfaceinfoName(baseBusinessEntity.getInterfaceinfoName());
|
|
|
+ tuLog.setIpaddress(ipaddress);
|
|
|
+ //tuLog.setLoginUser(sysUser.getUserId());
|
|
|
+ //tuLog.setLoginName(sysUser.getLoginName());
|
|
|
+ /** 记录操作状态、请求参数、返回结果、异常记录 lm 20220810 add **/
|
|
|
+ tuLog.setOperationStatus(baseBusinessEntity.getOperationStatus());
|
|
|
+ tuLog.setParam(baseBusinessEntity.getParam());
|
|
|
+ tuLog.setResults(baseBusinessEntity.getResults());
|
|
|
+ tuLog.setExceptionLog(baseBusinessEntity.getExceptionLog());
|
|
|
+ /** 记录操作状态、请求参数、返回结果、异常记录 lm 20220810 add **/
|
|
|
+// tuLog.setOperationQuantity(new Long(ls.size()));
|
|
|
+ //共享接口
|
|
|
+// tuLog.setPlatformInterfacetype("platform_interfacetype_1");
|
|
|
+ //归集接口
|
|
|
+// tuLog.setPlatformInterfacetype("platform_interfacetype_2");
|
|
|
+ String interfaceinfoName = tuLog.getInterfaceinfoName();
|
|
|
+ if(interfaceinfoName != null && !interfaceinfoName.equals("")){
|
|
|
+ String interfacetype = interfaceinfoName.split("-")[0];//共享-自来水公司-用水量检测 归集-市医药-种植采集数
|
|
|
+ if(interfacetype.equals("共享")){
|
|
|
+ tuLog.setPlatformInterfacetype("platform_interfacetype_1");
|
|
|
+ }else if(interfacetype.equals("归集")){
|
|
|
+ tuLog.setPlatformInterfacetype("platform_interfacetype_2");
|
|
|
+ }else {
|
|
|
+ tuLog.setPlatformInterfacetype(baseBusinessEntity.getInterfacetype());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ tuLog.setPlatformInterfacetype(baseBusinessEntity.getInterfacetype());
|
|
|
+ }
|
|
|
+ tuLogMapper.insertTULog(tuLog);
|
|
|
+ }
|
|
|
}
|