bug fix
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,6 +21,8 @@ public class ExpressOrder {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableField(value = "id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private int id;
|
||||
/**
|
||||
* 订单Sn
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.Query;
|
||||
import com.peanut.config.Constants;
|
||||
import com.peanut.modules.book.dao.BuyOrderDao;
|
||||
import com.peanut.modules.book.dao.ExpressOrderDao;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.book.vo.ExpressOrderResponseVo;
|
||||
@@ -59,6 +60,8 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
|
||||
@Autowired
|
||||
private CityService cityService;
|
||||
@Autowired
|
||||
private ExpressOrderDao expressOrderDao;
|
||||
|
||||
protected Logger logger = LoggerFactory.getLogger(BuyOrderServiceImpl.class);
|
||||
|
||||
@@ -236,6 +239,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
public Map<Integer, List<String>> decomposeShipment(Integer userId) {
|
||||
QueryWrapper<BuyOrder> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("del_flag", 0);
|
||||
queryWrapper.eq("order_status",1);
|
||||
queryWrapper.eq("userId", userId);
|
||||
queryWrapper.eq("address_modified", 0);
|
||||
List<BuyOrder> buyOrderList = list(queryWrapper);
|
||||
@@ -392,7 +396,8 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
String printTemplate = response.getPrintTemplate();
|
||||
expressOrder.setExpressOrderSn(expressOrderSn);
|
||||
expressOrder.setPrintTemplate(printTemplate);
|
||||
int expressOrderId = expressOrderService.getBaseMapper().insert(expressOrder);
|
||||
expressOrderDao.insert(expressOrder);
|
||||
int expressOrderId = expressOrder.getId();
|
||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
||||
buyOrderProduct.setExpressOrderId(expressOrderId);
|
||||
buyOrderProduct.setShipped(1);
|
||||
@@ -446,7 +451,16 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
}
|
||||
responseVo.setUserInfo(userResponseVo);
|
||||
}
|
||||
CouponResponseVo couponResponseVo = new CouponResponseVo();
|
||||
if (buyOrder.getCouponId() != null) {
|
||||
couponResponseVo.setCouponName(buyOrder.getCouponName());
|
||||
couponResponseVo.setCouponId(buyOrder.getCouponId());
|
||||
}
|
||||
responseVo.setCoupon(couponResponseVo);
|
||||
responseVo.setOrderPrice(buyOrder.getOrderMoney());
|
||||
responseVo.setRealPrice(buyOrder.getRealMoney());
|
||||
responseVo.setShippingPrice(buyOrder.getShippingMoney());
|
||||
responseVo.setDistrictPrice(buyOrder.getDistrictMoney());
|
||||
responseVo.setOrderType(buyOrder.getOrderType());
|
||||
BeanUtil.copyProperties(buyOrder, responseVo);
|
||||
ConsigneeVo consigneeVo = new ConsigneeVo();
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.peanut.modules.book.vo.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Description: 优惠券 Value Object
|
||||
* @Author: Cauchy
|
||||
@@ -9,4 +11,12 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class CouponResponseVo {
|
||||
/**
|
||||
* 优惠券名称
|
||||
*/
|
||||
String couponName;
|
||||
/**
|
||||
* 优惠券金额
|
||||
*/
|
||||
Integer couponId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user