feat(mall): 添加商品指导价和展示价
- 在 TzProdCommVo 中添加 guidingPrice 和 price 字段 - 在 TzProdCommServiceImpl 中查询并设置商品指导价和展示价 -优化订单状态更新逻辑,仅在存在 orderItemId 时进行更新- 移除 V3LakalaUserUtils 中的调试打印语句
This commit is contained in:
@@ -29,9 +29,7 @@ public class V3LakalaUserUtils extends BaseCommonDemo {
|
||||
cardBin.setOrderNo(CommonUtil.getOrderNo());
|
||||
cardBin.setOrgCode(KlkConstant.ORG_CODE);
|
||||
cardBin.setCardNo(acctNo);
|
||||
System.out.println("cardBin:"+cardBin);
|
||||
String cardBinResponse = LKLSDK.httpPost(cardBin);
|
||||
System.out.println(cardBinResponse);
|
||||
return JSON.parseObject(cardBinResponse);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.dromara.mall.domain.TzProdComm;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -115,5 +116,15 @@ public class TzProdCommVo implements Serializable {
|
||||
@ExcelProperty(value = "浏览量")
|
||||
private Long num;
|
||||
|
||||
/**
|
||||
* 商品指导价
|
||||
*/
|
||||
private BigDecimal guidingPrice;
|
||||
|
||||
/**
|
||||
* 商品展示价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -98,6 +98,12 @@ public class TzProdCommServiceImpl implements ITzProdCommService {
|
||||
vo.setUserAvatar(user.getPic());
|
||||
vo.setUserName(user.getRealName());
|
||||
}
|
||||
|
||||
TzProd prod = prodMapper.selectById(vo.getProdId());
|
||||
if(prod != null) {
|
||||
vo.setGuidingPrice(prod.getGuidingPrice());
|
||||
vo.setPrice(prod.getPrice());
|
||||
}
|
||||
}
|
||||
return page;
|
||||
}
|
||||
@@ -175,16 +181,18 @@ public class TzProdCommServiceImpl implements ITzProdCommService {
|
||||
@Override
|
||||
public Boolean insertByBo(TzProdCommBo bo) {
|
||||
//更新订单状态为已完成
|
||||
HyOrderItem orderItem = orderItemMapper.selectById(bo.getOrderItemId());
|
||||
orderItem.setStatus(5);
|
||||
orderItemMapper.updateById(orderItem);
|
||||
//更新总订单状态为已完成
|
||||
HyOrder order = orderMapper.selectById(bo.getOrderId());
|
||||
List<HyOrderItem> orderItems = orderItemMapper.selectList(Wrappers.lambdaQuery(HyOrderItem.class).eq(HyOrderItem::getOrderId, bo.getOrderId()));
|
||||
//判断订单是否已全部完成
|
||||
if (orderItems.stream().allMatch(item -> item.getStatus() == 5)) {
|
||||
order.setStatus(5);
|
||||
orderMapper.updateById(order);
|
||||
if (bo.getOrderItemId() != null) {
|
||||
HyOrderItem orderItem = orderItemMapper.selectById(bo.getOrderItemId());
|
||||
orderItem.setStatus(5);
|
||||
orderItemMapper.updateById(orderItem);
|
||||
//更新总订单状态为已完成
|
||||
HyOrder order = orderMapper.selectById(bo.getOrderId());
|
||||
List<HyOrderItem> orderItems = orderItemMapper.selectList(Wrappers.lambdaQuery(HyOrderItem.class).eq(HyOrderItem::getOrderId, bo.getOrderId()));
|
||||
//判断订单是否已全部完成
|
||||
if (orderItems.stream().allMatch(item -> item.getStatus() == 5)) {
|
||||
order.setStatus(5);
|
||||
orderMapper.updateById(order);
|
||||
}
|
||||
}
|
||||
// 根据商品ID查询商品信息
|
||||
TzProd prod = prodMapper.selectById(bo.getProdId());
|
||||
|
||||
Reference in New Issue
Block a user