feat(智能柜): 添加单元格价格字段并优化订单查询逻辑
- 在CabinetDetailDTO中添加cellPrice字段 - 优化订单查询逻辑,避免重复数据 - 在GetBalanceResponse中添加ab98User信息 - 调整PaymentController中用户信息处理顺序
This commit is contained in:
parent
e48735a463
commit
ebe6ac21c6
|
@ -293,9 +293,9 @@ public class PaymentController {
|
||||||
return ResponseDTO.fail(new ApiException(ErrorCode.Client.COMMON_REQUEST_PARAMETERS_INVALID, "无效的openid参数"));
|
return ResponseDTO.fail(new ApiException(ErrorCode.Client.COMMON_REQUEST_PARAMETERS_INVALID, "无效的openid参数"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ab98UserEntity ab98User = ab98UserApplicationService.getByAb98UserId(qyUser.getAb98UserId());
|
||||||
try {
|
try {
|
||||||
if (qyUser.getAb98UserId()!= null) {
|
if (qyUser.getAb98UserId()!= null) {
|
||||||
Ab98UserEntity ab98User = ab98UserApplicationService.getByAb98UserId(qyUser.getAb98UserId());
|
|
||||||
ab98User.setOpenid(openid);
|
ab98User.setOpenid(openid);
|
||||||
ab98User.updateById();
|
ab98User.updateById();
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,8 @@ public class PaymentController {
|
||||||
qyUser.getCorpid(),
|
qyUser.getCorpid(),
|
||||||
qyUser.getBalance(),
|
qyUser.getBalance(),
|
||||||
qyUser.getUseBalance(),
|
qyUser.getUseBalance(),
|
||||||
qyUser.getBalanceLimit());
|
qyUser.getBalanceLimit(),
|
||||||
|
ab98User);
|
||||||
return ResponseDTO.ok(response);
|
return ResponseDTO.ok(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +330,8 @@ public class PaymentController {
|
||||||
qyUser.getCorpid(),
|
qyUser.getCorpid(),
|
||||||
qyUser.getBalance(),
|
qyUser.getBalance(),
|
||||||
qyUser.getUseBalance(),
|
qyUser.getUseBalance(),
|
||||||
qyUser.getBalanceLimit());
|
qyUser.getBalanceLimit(),
|
||||||
|
null);
|
||||||
return ResponseDTO.ok(response);
|
return ResponseDTO.ok(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.agileboot.api.response;
|
package com.agileboot.api.response;
|
||||||
|
|
||||||
|
import com.agileboot.domain.ab98.user.db.Ab98UserEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ -13,4 +14,5 @@ public class GetBalanceResponse {
|
||||||
private BigDecimal balance;
|
private BigDecimal balance;
|
||||||
private BigDecimal useBalance;
|
private BigDecimal useBalance;
|
||||||
private BigDecimal balanceLimit;
|
private BigDecimal balanceLimit;
|
||||||
|
private Ab98UserEntity ab98User;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ public interface CabinetCellMapper extends BaseMapper<CabinetCellEntity> {
|
||||||
"${ew.customSqlSegment} ")
|
"${ew.customSqlSegment} ")
|
||||||
List<CabinetCellLatestOrderDTO> selectLatestOrderInfoByCell(@Param(Constants.WRAPPER) Wrapper<?> queryWrapper);
|
List<CabinetCellLatestOrderDTO> selectLatestOrderInfoByCell(@Param(Constants.WRAPPER) Wrapper<?> queryWrapper);
|
||||||
|
|
||||||
@Select("SELECT cc.* " +
|
@Select("SELECT DISTINCT cc.* " +
|
||||||
"FROM cabinet_cell 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_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 " +
|
"INNER JOIN shop_order so ON sog.order_id = so.order_id AND so.deleted = 0 " +
|
||||||
|
|
|
@ -352,6 +352,7 @@ public class SmartCabinetApplicationService {
|
||||||
cellInfo.setCellNo(cell.getCellNo());
|
cellInfo.setCellNo(cell.getCellNo());
|
||||||
cellInfo.setPinNo(cell.getPinNo());
|
cellInfo.setPinNo(cell.getPinNo());
|
||||||
cellInfo.setStock(cell.getStock());
|
cellInfo.setStock(cell.getStock());
|
||||||
|
cellInfo.setCellPrice(cell.getCellPrice());
|
||||||
|
|
||||||
return cellInfo;
|
return cellInfo;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
|
@ -18,6 +18,7 @@ public class CabinetDetailDTO {
|
||||||
private Integer cellNo;
|
private Integer cellNo;
|
||||||
private Integer pinNo;
|
private Integer pinNo;
|
||||||
private Integer stock;
|
private Integer stock;
|
||||||
|
private BigDecimal cellPrice;
|
||||||
private ProductInfoDTO product;
|
private ProductInfoDTO product;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -528,6 +528,11 @@ public class OrderApplicationService {
|
||||||
}
|
}
|
||||||
List<ShopOrderGoodsEntity> orderGoods = orderGoodsService.list(orderGoodsQueryWrapper);
|
List<ShopOrderGoodsEntity> orderGoods = orderGoodsService.list(orderGoodsQueryWrapper);
|
||||||
|
|
||||||
|
Set<Long> orderIds = orderGoods.stream().map(ShopOrderGoodsEntity::getOrderId).collect(Collectors.toSet());
|
||||||
|
orderList = orderList.stream()
|
||||||
|
.filter(order -> orderIds.contains(order.getOrderId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
QueryWrapper<ShopGoodsEntity> goodsQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopGoodsEntity> goodsQueryWrapper = new QueryWrapper<>();
|
||||||
goodsQueryWrapper.in("goods_id", orderGoods.stream().map(ShopOrderGoodsEntity::getGoodsId).collect(Collectors.toList()));
|
goodsQueryWrapper.in("goods_id", orderGoods.stream().map(ShopOrderGoodsEntity::getGoodsId).collect(Collectors.toList()));
|
||||||
List<ShopGoodsEntity> goods = goodsService.list(goodsQueryWrapper);
|
List<ShopGoodsEntity> goods = goodsService.list(goodsQueryWrapper);
|
||||||
|
|
Loading…
Reference in New Issue