|  |  | 
 |  |  | import com.zy.asrs.wcs.system.entity.OperationRecord; | 
 |  |  | import com.zy.asrs.wcs.system.entity.User; | 
 |  |  | import com.zy.asrs.wcs.system.service.OperationRecordService; | 
 |  |  | import com.zy.asrs.wcs.utils.Utils; | 
 |  |  | import com.zy.asrs.wcs.utils.CommonUtils; | 
 |  |  | import org.aspectj.lang.JoinPoint; | 
 |  |  | import org.aspectj.lang.annotation.*; | 
 |  |  | import org.aspectj.lang.reflect.MethodSignature; | 
 |  |  | 
 |  |  |         User user = getLoginUser(); | 
 |  |  |         if (user != null) { | 
 |  |  |             record.setUserId(user.getId()); | 
 |  |  |             record.setHostId(user.getHostId()); | 
 |  |  | //            record.setHostId(user.getHostId()); | 
 |  |  |         } | 
 |  |  |         // 记录请求地址、请求方式、ip | 
 |  |  |         ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); | 
 |  |  | 
 |  |  |         // 记录异常信息 | 
 |  |  |         if (e != null) { | 
 |  |  |             record.setResult(0); | 
 |  |  |             record.setErr(Utils.sub(e.toString(), MAX_LENGTH)); | 
 |  |  |             record.setErr(CommonUtils.sub(e.toString(), MAX_LENGTH)); | 
 |  |  |         } else { | 
 |  |  |             record.setResult(1); | 
 |  |  |         } | 
 |  |  | 
 |  |  |         } | 
 |  |  |         // 记录请求参数 | 
 |  |  |         if (ol.param() && request != null) { | 
 |  |  |             record.setRequest(Utils.sub(getParams(joinPoint, request), MAX_LENGTH)); | 
 |  |  |             record.setRequest(CommonUtils.sub(getParams(joinPoint, request), MAX_LENGTH)); | 
 |  |  |         } | 
 |  |  |         // 记录请求结果 | 
 |  |  |         if (ol.result() && result != null) { | 
 |  |  |             record.setResponse(Utils.sub(JSON.toJSONString(result), MAX_LENGTH)); | 
 |  |  |             record.setResponse(CommonUtils.sub(JSON.toJSONString(result), MAX_LENGTH)); | 
 |  |  |         } | 
 |  |  |         operationRecordService.saveAsync(record); | 
 |  |  |     } | 
 |  |  | 
 |  |  |  | 
 |  |  |         Map<String, String[]> map = Collections.unmodifiableMap(request.getParameterMap()); | 
 |  |  |         for (Map.Entry<String, String[]> entry : map.entrySet()) { | 
 |  |  |             paramsMap.put(entry.getKey(), Utils.join(entry.getValue(), ",")); | 
 |  |  |             paramsMap.put(entry.getKey(), CommonUtils.join(entry.getValue(), ",")); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (paramsMap.keySet().size() > 0) { |