From ebe6ac21c6295229899a11fcd463a69b94d64309 Mon Sep 17 00:00:00 2001 From: dzq Date: Wed, 2 Jul 2025 15:42:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=99=BA=E8=83=BD=E6=9F=9C):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E5=85=83=E6=A0=BC=E4=BB=B7=E6=A0=BC=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=B9=B6=E4=BC=98=E5=8C=96=E8=AE=A2=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在CabinetDetailDTO中添加cellPrice字段 - 优化订单查询逻辑,避免重复数据 - 在GetBalanceResponse中添加ab98User信息 - 调整PaymentController中用户信息处理顺序 --- .../com/agileboot/api/controller/PaymentController.java | 8 +++++--- .../com/agileboot/api/response/GetBalanceResponse.java | 2 ++ .../domain/cabinet/cell/db/CabinetCellMapper.java | 2 +- .../smartCabinet/SmartCabinetApplicationService.java | 1 + .../domain/cabinet/smartCabinet/dto/CabinetDetailDTO.java | 1 + .../domain/shop/order/OrderApplicationService.java | 5 +++++ 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/agileboot-api/src/main/java/com/agileboot/api/controller/PaymentController.java b/agileboot-api/src/main/java/com/agileboot/api/controller/PaymentController.java index 5edf391..3ebae7c 100644 --- a/agileboot-api/src/main/java/com/agileboot/api/controller/PaymentController.java +++ b/agileboot-api/src/main/java/com/agileboot/api/controller/PaymentController.java @@ -293,9 +293,9 @@ public class PaymentController { return ResponseDTO.fail(new ApiException(ErrorCode.Client.COMMON_REQUEST_PARAMETERS_INVALID, "无效的openid参数")); } + Ab98UserEntity ab98User = ab98UserApplicationService.getByAb98UserId(qyUser.getAb98UserId()); try { if (qyUser.getAb98UserId()!= null) { - Ab98UserEntity ab98User = ab98UserApplicationService.getByAb98UserId(qyUser.getAb98UserId()); ab98User.setOpenid(openid); ab98User.updateById(); } @@ -309,7 +309,8 @@ public class PaymentController { qyUser.getCorpid(), qyUser.getBalance(), qyUser.getUseBalance(), - qyUser.getBalanceLimit()); + qyUser.getBalanceLimit(), + ab98User); return ResponseDTO.ok(response); } @@ -329,7 +330,8 @@ public class PaymentController { qyUser.getCorpid(), qyUser.getBalance(), qyUser.getUseBalance(), - qyUser.getBalanceLimit()); + qyUser.getBalanceLimit(), + null); return ResponseDTO.ok(response); } diff --git a/agileboot-api/src/main/java/com/agileboot/api/response/GetBalanceResponse.java b/agileboot-api/src/main/java/com/agileboot/api/response/GetBalanceResponse.java index ea7296a..c280ad3 100644 --- a/agileboot-api/src/main/java/com/agileboot/api/response/GetBalanceResponse.java +++ b/agileboot-api/src/main/java/com/agileboot/api/response/GetBalanceResponse.java @@ -1,5 +1,6 @@ package com.agileboot.api.response; +import com.agileboot.domain.ab98.user.db.Ab98UserEntity; import lombok.AllArgsConstructor; import lombok.Data; @@ -13,4 +14,5 @@ public class GetBalanceResponse { private BigDecimal balance; private BigDecimal useBalance; private BigDecimal balanceLimit; + private Ab98UserEntity ab98User; } diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/cell/db/CabinetCellMapper.java b/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/cell/db/CabinetCellMapper.java index 4aa266c..aa7f4bf 100644 --- a/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/cell/db/CabinetCellMapper.java +++ b/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/cell/db/CabinetCellMapper.java @@ -112,7 +112,7 @@ public interface CabinetCellMapper extends BaseMapper { "${ew.customSqlSegment} ") List selectLatestOrderInfoByCell(@Param(Constants.WRAPPER) Wrapper queryWrapper); - @Select("SELECT cc.* " + + @Select("SELECT DISTINCT cc.* " + "FROM cabinet_cell cc " + "INNER JOIN shop_order_goods sog ON cc.cell_id = sog.cell_id AND sog.deleted = 0 " + "INNER JOIN shop_order so ON sog.order_id = so.order_id AND so.deleted = 0 " + diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/smartCabinet/SmartCabinetApplicationService.java b/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/smartCabinet/SmartCabinetApplicationService.java index ce0cc67..338facb 100644 --- a/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/smartCabinet/SmartCabinetApplicationService.java +++ b/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/smartCabinet/SmartCabinetApplicationService.java @@ -352,6 +352,7 @@ public class SmartCabinetApplicationService { cellInfo.setCellNo(cell.getCellNo()); cellInfo.setPinNo(cell.getPinNo()); cellInfo.setStock(cell.getStock()); + cellInfo.setCellPrice(cell.getCellPrice()); return cellInfo; }).collect(Collectors.toList()); diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/smartCabinet/dto/CabinetDetailDTO.java b/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/smartCabinet/dto/CabinetDetailDTO.java index 73338b6..452662a 100644 --- a/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/smartCabinet/dto/CabinetDetailDTO.java +++ b/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/smartCabinet/dto/CabinetDetailDTO.java @@ -18,6 +18,7 @@ public class CabinetDetailDTO { private Integer cellNo; private Integer pinNo; private Integer stock; + private BigDecimal cellPrice; private ProductInfoDTO product; } diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/order/OrderApplicationService.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/order/OrderApplicationService.java index 538c10c..b642b10 100644 --- a/agileboot-domain/src/main/java/com/agileboot/domain/shop/order/OrderApplicationService.java +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/order/OrderApplicationService.java @@ -528,6 +528,11 @@ public class OrderApplicationService { } List orderGoods = orderGoodsService.list(orderGoodsQueryWrapper); + Set orderIds = orderGoods.stream().map(ShopOrderGoodsEntity::getOrderId).collect(Collectors.toSet()); + orderList = orderList.stream() + .filter(order -> orderIds.contains(order.getOrderId())) + .collect(Collectors.toList()); + QueryWrapper goodsQueryWrapper = new QueryWrapper<>(); goodsQueryWrapper.in("goods_id", orderGoods.stream().map(ShopOrderGoodsEntity::getGoodsId).collect(Collectors.toList())); List goods = goodsService.list(goodsQueryWrapper);