Browse Source

no message

FengChaoYu 1 week ago
parent
commit
4aaf689c6a

+ 15 - 14
mall-server-api/src/main/java/com/gree/mall/manager/config/aop/OperationLogAspect.java

@@ -1,6 +1,5 @@
 package com.gree.mall.manager.config.aop;
 
-import org.apache.commons.lang3.StringUtils;
 import com.gree.mall.manager.bean.admin.AdminUserCom;
 import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.plus.entity.AdminUser;
@@ -9,12 +8,11 @@ import com.gree.mall.manager.plus.service.AdminUserService;
 import com.gree.mall.manager.plus.service.OperationLogService;
 import com.gree.mall.manager.utils.CommonUtils;
 import com.gree.mall.manager.utils.IpUtil;
-import com.gree.mall.manager.utils.JwtUtils;
 import com.gree.mall.manager.utils.RedisUtil;
-import io.jsonwebtoken.Claims;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
@@ -33,6 +31,7 @@ import java.text.SimpleDateFormat;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 /**
  *  操作日志
@@ -101,17 +100,19 @@ public class OperationLogAspect {
             //获取登录用户的企业微信id
             AdminUserCom adminUser = commonLogic.getAdminUser(request);
             //记录
-            OperationLog operationLog = new OperationLog();
-            operationLog.setContent(nickName + "于" + dateStr + value);
-            operationLog.setModuleName(moduleName);
-            operationLog.setAdminUserId(adminUserId);
-            operationLog.setUserName(nickName);
-            operationLog.setNickName(nickName);
-            operationLog.setIp(IpUtil.getIpAddr(request));
-            operationLog.setCreateTime(new Date());
-            operationLog.setCompanyWechatId(adminUser.getCompanyWechatId());
-            operationLog.setCompanyName(adminUser.getCompanyName());
-            operationLogService.save(operationLog);
+            if (Objects.nonNull(adminUser)) {
+                OperationLog operationLog = new OperationLog();
+                operationLog.setContent(nickName + "于" + dateStr + value);
+                operationLog.setModuleName(moduleName);
+                operationLog.setAdminUserId(adminUserId);
+                operationLog.setUserName(nickName);
+                operationLog.setNickName(nickName);
+                operationLog.setIp(IpUtil.getIpAddr(request));
+                operationLog.setCreateTime(new Date());
+                operationLog.setCompanyWechatId(adminUser.getCompanyWechatId());
+                operationLog.setCompanyName(adminUser.getCompanyName());
+                operationLogService.save(operationLog);
+            }
         }
     }
 

+ 6 - 4
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseEsLogic.java

@@ -2,6 +2,7 @@ package com.gree.mall.manager.logic.workorder;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -1043,10 +1044,11 @@ public class OrderBaseEsLogic {
 
         List<OperatorLogBean> operatorList = new ArrayList<>();
         if (CollectionUtil.isNotEmpty(orderBaseIds)) {
-//            final List<List<String>> pageList = ListUtil.split(orderBaseIds, 10000);
-//            for (List<String> orderIdPageList : pageList) {
-//                operatorList.addAll(commonMapper.selectLastOrderOperatorLog(year, orderIdPageList));
-//            }
+            final List<List<String>> pageList = ListUtil.split(orderBaseIds, 10000);
+            for (List<String> orderIdPageList : pageList) {
+                log.info("导出分页查询: {}", orderIdPageList);
+                operatorList.addAll(commonMapper.selectLastOrderOperatorLog(year, orderIdPageList));
+            }
         }
 
         Map<String, List<OperatorLogBean>> operatorMap = null;

+ 1 - 1
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -1799,8 +1799,8 @@
                     <foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
                         #{item}
                     </foreach>
+                    AND company_wechat_id = 1
                 </if>
-                AND company_wechat_id = 1
             </where>
             GROUP BY
             order_base_id