From 4f6bdfb31697377020126710bdbd500a363ba278 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期一, 08 九月 2025 13:41:13 +0800
Subject: [PATCH] 定时任务,优惠卷领取状态
---
framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java | 90 ++++++++++++++++++++++++++++++---------------
1 files changed, 60 insertions(+), 30 deletions(-)
diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java
index ac37897..8102863 100644
--- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java
@@ -27,6 +27,7 @@
import cn.lili.modules.goods.entity.dos.Goods;
import cn.lili.modules.goods.entity.dto.GoodsCompleteMessage;
import cn.lili.modules.goods.service.GoodsService;
+import cn.lili.modules.lmk.domain.vo.OrderCountVO;
import cn.lili.modules.lmk.enums.general.AdminRoleEnum;
import cn.lili.modules.member.entity.dos.Member;
import cn.lili.modules.member.entity.dto.MemberAddressDTO;
@@ -97,6 +98,7 @@
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
+import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.*;
import java.util.concurrent.TimeUnit;
@@ -251,6 +253,41 @@
}
@Override
+ public OrderCountVO countByIdOrder(String id) {
+ OrderSearchParams orderSearchParams = new OrderSearchParams();
+
+ orderSearchParams.setOrderStatus(OrderStatusEnum.COMPLETED.name());
+ orderSearchParams.setMemberId(id);
+ QueryWrapper queryWrapper = orderSearchParams.queryWrapper();
+ queryWrapper.groupBy("o.id");
+ queryWrapper.orderByDesc("o.id");
+ List<OrderSimpleVO> list = this.baseMapper.queryByParamsCount(queryWrapper);
+ OrderCountVO orderCountVO = new OrderCountVO();
+ orderCountVO.setOrderNumCount(0);
+ orderCountVO.setOrderPriceCount(BigDecimal.ZERO);
+ if (CollectionUtil.isEmpty(list)) {
+ return orderCountVO;
+ }else {
+ for (OrderSimpleVO vo : list) {
+ if (vo == null) {
+ System.out.println("鍑虹幇绌哄厓绱�");
+ continue; // 璺宠繃null鍏冪礌锛屾垨鏍规嵁涓氬姟澶勭悊
+ }
+ orderCountVO.setOrderNumCount(orderCountVO.getOrderNumCount() + 1);
+
+ // 閲戦绱姞锛氱敤BigDecimal澶勭悊锛岄伩鍏嶇簿搴﹂棶棰�
+ BigDecimal flowPrice = vo.getFlowPrice() != null ?
+ BigDecimal.valueOf(vo.getFlowPrice()) : BigDecimal.ZERO;
+
+ // 鐢˙igDecimal鐨刟dd鏂规硶绱姞
+ BigDecimal totalPrice = orderCountVO.getOrderPriceCount().add(flowPrice);
+ orderCountVO.setOrderPriceCount(totalPrice);
+
+ }
+ }
+ return orderCountVO;
+ }
+ @Override
public IPage<OrderSimpleVO> queryByParams(OrderSearchParams orderSearchParams,Boolean needHide) {
QueryWrapper queryWrapper = orderSearchParams.queryWrapper();
queryWrapper.groupBy("o.id");
@@ -265,17 +302,8 @@
}
}
- for (OrderSimpleVO vo : page.getRecords()){
- Member member = memberMapperMapper.selectById(vo.getMemberId());
- if (member != null){
- vo.setNickName(member.getNickName());
- }
- }
return page;
}
-
-
-
@Override
public IPage<OrderSimpleXcxVO> queryByXcxParams(OrderSearchXcxParams orderSearchParams) {
QueryWrapper queryWrapper = orderSearchParams.queryWrapper();
@@ -424,8 +452,6 @@
vo.setConsigneeMobile(CommonUtil.maskMobile(vo.getConsigneeMobile()));
}
}
-
-
XSSFWorkbook workbook = initOrderExportData(orderExportDTOS);
try {
// 璁剧疆鍝嶅簲澶�
@@ -517,6 +543,7 @@
throw new ServiceException(ResultCode.ORDER_CAN_NOT_CANCEL);
}
}
+
@Override
@@ -1436,7 +1463,7 @@
// 鍒涘缓琛ㄥご
Row header = sheet.createRow(0);
String[] headers = {"涓昏鍗曠紪鍙�", "瀛愯鍗曠紪鍙�", "閫夎喘鍟嗗搧", "鍟嗗搧鏁伴噺", "鍟嗗搧ID", "鍟嗗搧鍗曚环", "璁㈠崟搴斾粯閲戦",
- "杩愯垂", "浼樻儬鎬婚噾棰�", "骞冲彴浼樻儬", "鍟嗗浼樻儬", "鍟嗗鏀逛环", "鏀粯鏂瑰紡", "鏀朵欢浜�", "鏀朵欢浜烘墜鏈哄彿",
+ "杩愯垂", "浼樻儬鎬婚噾棰�", "骞冲彴浼樻儬", "鍟嗗浼樻儬", "鍟嗗鏀逛环", "鏀粯鏂瑰紡","涔板鍚嶇О", "鏀朵欢浜�", "鏀朵欢浜烘墜鏈哄彿",
"鐪�", "甯�", "鍖�", "琛楅亾", "璇︾粏鍦板潃", "涔板鐣欒█", "璁㈠崟鎻愪氦鏃堕棿", "鏀粯瀹屾垚鏃堕棿", "鏉ユ簮",
"璁㈠崟鐘舵��", "璁㈠崟绫诲瀷", "鍞悗鐘舵��", "鍙栨秷鍘熷洜", "鍙戣揣鏃堕棿", "瀹屾垚鏃堕棿", "搴楅摵"};
@@ -1461,24 +1488,27 @@
row.createCell(10).setCellValue(dto.getStoreMarketingCost()!=null?dto.getStoreMarketingCost():0);
row.createCell(11).setCellValue(dto.getUpdatePrice()!=null?dto.getUpdatePrice():0);
row.createCell(12).setCellValue(dto.getPaymentMethod());
- row.createCell(13).setCellValue(dto.getConsigneeName());
- row.createCell(14).setCellValue(dto.getConsigneeMobile());
- row.createCell(15).setCellValue(dto.getProvince());
- row.createCell(16).setCellValue(dto.getCity());
- row.createCell(17).setCellValue(dto.getDistrict());
- row.createCell(18).setCellValue(dto.getStreet());
- row.createCell(19).setCellValue(dto.getConsigneeDetail());
- row.createCell(20).setCellValue(dto.getRemark());
- row.createCell(21).setCellValue(dto.getCreateTime());
- row.createCell(22).setCellValue(dto.getPaymentTime());
- row.createCell(23).setCellValue(dto.getClientType());
- row.createCell(24).setCellValue(dto.getOrderStatus());
- row.createCell(25).setCellValue(dto.getOrderType());
- row.createCell(26).setCellValue(dto.getAfterSaleStatus());
- row.createCell(27).setCellValue(dto.getCancelReason());
- row.createCell(28).setCellValue(dto.getLogisticsTime());
- row.createCell(29).setCellValue(dto.getCompleteTime());
- row.createCell(30).setCellValue(dto.getStoreName());
+
+ row.createCell(13).setCellValue(dto.getNickName());
+
+ row.createCell(14).setCellValue(dto.getConsigneeName());
+ row.createCell(15).setCellValue(dto.getConsigneeMobile());
+ row.createCell(16).setCellValue(dto.getProvince());
+ row.createCell(17).setCellValue(dto.getCity());
+ row.createCell(18).setCellValue(dto.getDistrict());
+ row.createCell(19).setCellValue(dto.getStreet());
+ row.createCell(20).setCellValue(dto.getConsigneeDetail());
+ row.createCell(21).setCellValue(dto.getRemark());
+ row.createCell(22).setCellValue(dto.getCreateTime());
+ row.createCell(23).setCellValue(dto.getPaymentTime());
+ row.createCell(24).setCellValue(dto.getClientType());
+ row.createCell(25).setCellValue(dto.getOrderStatus());
+ row.createCell(26).setCellValue(dto.getOrderType());
+ row.createCell(27).setCellValue(dto.getAfterSaleStatus());
+ row.createCell(28).setCellValue(dto.getCancelReason());
+ row.createCell(29).setCellValue(dto.getLogisticsTime());
+ row.createCell(30).setCellValue(dto.getCompleteTime());
+ row.createCell(31).setCellValue(dto.getStoreName());
}
//淇敼鍒楀
--
Gitblit v1.8.0