Ver código fonte

bug单修改

zhouyy 4 meses atrás
pai
commit
0b30e96214

+ 10 - 6
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SalesOrderServiceImpl.java

@@ -13,6 +13,7 @@ import com.management.platform.mapper.*;
 import com.management.platform.service.*;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFRow;
@@ -553,12 +554,15 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
         List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, user.getCompanyId()));
 //        List<SalesOrderPayment> list = salesOrderPaymentService.list(new LambdaQueryWrapper<SalesOrderPayment>().eq(SalesOrderPayment::getOrderId, orderId));
         List<SalesOrderPayment> list = salesOrderPaymentMapper.getUnDelPaymentListByOId(orderId);
-        list.forEach(l->{
-            Optional<User> first = userList.stream().filter(u -> u.getId().equals(l.getCreatorId())).findFirst();
-            if(first.isPresent()){
-                l.setCreatorName(first.get().getName());
-            }
-        });
+        if(CollectionUtils.isNotEmpty(list)){
+            list.forEach(l->{
+                Optional<User> first = userList.stream().filter(u -> u.getId().equals(l.getCreatorId())).findFirst();
+                if(first.isPresent()){
+                    l.setCreatorName(first.get().getName());
+                }
+            });
+        }
+        msg.setData(list);
         return msg;
     }