From 4ff33b938d82e895515a31a15b9011a92508f649 Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Wed, 1 Oct 2025 23:56:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=89=93=E5=8D=B0=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20=E6=A0=87=E9=A2=98=E5=90=8E=E9=9D=A2=E5=8A=A0?= =?UTF-8?q?=E8=A7=84=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ShopOrderItemServiceImpl.java | 23 ++- .../impl/ShopOrderReturnServiceImpl.java | 21 +-- .../mapper/order/ShopOrderItemMapper.xml | 133 +++++++++++++----- 3 files changed, 116 insertions(+), 61 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderItemServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderItemServiceImpl.java index 19002f43..d2d4fd49 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderItemServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderItemServiceImpl.java @@ -28,7 +28,6 @@ import com.suisung.mall.shop.order.service.ShopOrderItemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.text.DecimalFormat; import java.util.*; import java.util.stream.Collectors; @@ -228,28 +227,24 @@ public class ShopOrderItemServiceImpl extends BaseServiceImpl selectOrderItemPrintInfo(String orderId) { + // 输入验证 if (StrUtil.isBlank(orderId)) { - return null; + return Collections.emptyList(); } List mList = shopOrderItemMapper.selectOrderItemPrintInfo(orderId); if (CollUtil.isEmpty(mList)) { - return null; + return Collections.emptyList(); } - DecimalFormat df2 = new DecimalFormat("#.##"); - List retList = new ArrayList<>(); - for (Map map : mList) { + return mList.stream().map(map -> { ShopStoreOrderProductPrintVO vo = new ShopStoreOrderProductPrintVO(); - vo.setProduct_sn((String) map.get("product_sn")); - vo.setItem_name((String) map.get("item_name")); + vo.setProduct_sn(Convert.toStr(map.get("product_sn"))); + vo.setItem_name(Convert.toStr(map.get("item_name"))); vo.setOrder_item_amount(Convert.toBigDecimal(map.get("order_item_amount"))); - vo.setOrder_item_quantity((Integer) map.get("order_item_quantity")); - - retList.add(vo); - } - - return retList; + vo.setOrder_item_quantity(Convert.toInt(map.get("order_item_quantity"))); + return vo; + }).collect(Collectors.toList()); } } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderReturnServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderReturnServiceImpl.java index eae5a6b9..f10dd34d 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderReturnServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderReturnServiceImpl.java @@ -58,10 +58,7 @@ import com.suisung.mall.shop.sfexpress.service.SFExpressApiService; import com.suisung.mall.shop.store.service.ShopStoreBaseService; import com.suisung.mall.shop.store.service.ShopStoreConfigService; import com.suisung.mall.shop.store.service.ShopStoreShippingAddressService; -import io.seata.core.context.RootContext; -import io.seata.core.exception.TransactionException; import io.seata.spring.annotation.GlobalTransactional; -import io.seata.tm.api.GlobalTransactionContext; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -968,7 +965,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl - order_item_id + + order_item_id , order_id, buyer_id, store_id, product_id, item_id, item_name, category_id, spec_id, spec_info, item_unit_price, item_unit_points, item_unit_sp, order_item_unit_price, @@ -38,24 +39,47 @@ INNER JOIN shop_product_index ON shop_order_item.product_id = shop_product_index.product_id - shop_order_info.store_id=#{map.store_id} - and shop_order_item.item_name like concat('%', #{map.item_name}, '%') - and shop_product_index.product_name like concat('%', #{map.product_name}, + + shop_order_info.store_id=#{map.store_id} + + + and shop_order_item.item_name like concat('%', #{map.item_name}, '%') + + + and shop_product_index.product_name like concat('%', #{map.product_name}, '%') - and shop_order_item.category_id=#{map.category_id} - and shop_order_item.product_id=#{map.product_id} - and shop_order_info.order_time >=#{map.order_st_time} - and shop_order_info.order_time <=#{map.order_ed_time} - and shop_order_delivery_address.da_province_id =#{map.da_province_id} + + and shop_order_item.category_id=#{map.category_id} - and shop_order_delivery_address.da_city_id =#{map.da_city_id} - and shop_order_delivery_address.da_county_id =#{map.da_county_id} - and shop_order_delivery_address.da_address like concat('%', + + and shop_order_item.product_id=#{map.product_id} + + + and shop_order_info.order_time >=#{map.order_st_time} + + + and shop_order_info.order_time <=#{map.order_ed_time} + + + and shop_order_delivery_address.da_province_id =#{map.da_province_id} + + + and shop_order_delivery_address.da_city_id =#{map.da_city_id} + + + and shop_order_delivery_address.da_county_id =#{map.da_county_id} + + + and shop_order_delivery_address.da_address like concat('%', #{map.da_address}, '%') - and shop_order_info.order_is_paid =#{map.order_is_paid} - and shop_order_info.subsite_id =#{map.subsite_id} + + and shop_order_info.order_is_paid =#{map.order_is_paid} + + + and shop_order_info.subsite_id =#{map.subsite_id} + GROUP BY shop_order_item.item_id @@ -68,29 +92,72 @@ left join shop_order_delivery_address a ON a.order_id = o.order_id left join shop_product_base b ON m.product_id = b.product_id - m.store_id=#{params.store_id} - and m.order_id=#{params.order_id} - and m.item_id=#{params.item_id} - and o.order_is_paid=#{params.order_is_paid} - and o.order_time >=#{params.order_st_time} - and o.order_time <=#{params.order_ed_time} - and o.order_time >=#{params.query_order_st_time} - and o.order_time <=#{params.query_order_ed_time} - and m.category_id=#{params.category_id} - and b.product_name like concat('%', #{params.product_name}, '%') - and m.product_id=#{params.product_id} - and a.da_province_id =#{params.da_province_id} - and a.da_city_id =#{params.da_city_id} - and a.da_county_id =#{params.da_county_id} - and a.da_address like concat('%', #{params.da_address}, '%') + + m.store_id=#{params.store_id} + + + and m.order_id=#{params.order_id} + + + and m.item_id=#{params.item_id} + + + and o.order_is_paid=#{params.order_is_paid} + + + and o.order_time >=#{params.order_st_time} + + + and o.order_time <=#{params.order_ed_time} + + + and o.order_time >=#{params.query_order_st_time} + + + and o.order_time <=#{params.query_order_ed_time} + + + and m.category_id=#{params.category_id} + + + and b.product_name like concat('%', #{params.product_name}, '%') + + + and m.product_id=#{params.product_id} + + + and a.da_province_id =#{params.da_province_id} + + + and a.da_city_id =#{params.da_city_id} + + + and a.da_county_id =#{params.da_county_id} + + + and a.da_address like concat('%', #{params.da_address}, '%') +