Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
f2ca18953b
|
|
@ -18,6 +18,8 @@ import java.util.List;
|
||||||
public interface TbActivateInRecordMapper extends BaseMapper<TbActivateInRecord> {
|
public interface TbActivateInRecordMapper extends BaseMapper<TbActivateInRecord> {
|
||||||
|
|
||||||
@Select("SELECT" +
|
@Select("SELECT" +
|
||||||
|
" pro.cover_img as productCover, " +
|
||||||
|
" pro.name as productName, " +
|
||||||
" inRecord.id as id," +
|
" inRecord.id as id," +
|
||||||
" inRecord.full_amount as fullAmount," +
|
" inRecord.full_amount as fullAmount," +
|
||||||
" inRecord.discount_amount as discountAmount," +
|
" inRecord.discount_amount as discountAmount," +
|
||||||
|
|
|
||||||
|
|
@ -165,8 +165,21 @@ public class TbCashierCart implements Serializable {
|
||||||
private String platformType;
|
private String platformType;
|
||||||
// 优惠券id
|
// 优惠券id
|
||||||
private Integer userCouponId;
|
private Integer userCouponId;
|
||||||
|
private BigDecimal memberPrice;
|
||||||
|
private Integer isMember;
|
||||||
|
|
||||||
public void copy(TbCashierCart source){
|
public void copy(TbCashierCart source){
|
||||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据是否会员充值价格
|
||||||
|
*/
|
||||||
|
public void resetTotalAmount() {
|
||||||
|
if (isMember != null && isMember == 1) {
|
||||||
|
totalAmount = BigDecimal.valueOf(totalNumber).multiply(memberPrice).add(packFee);
|
||||||
|
}else {
|
||||||
|
totalAmount = BigDecimal.valueOf(totalNumber).multiply(salePrice).add(packFee);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,8 @@ public class TbOrderDetail implements Serializable {
|
||||||
@Column(name = "`return_num`")
|
@Column(name = "`return_num`")
|
||||||
private String returnNum;
|
private String returnNum;
|
||||||
|
|
||||||
|
private BigDecimal memberPrice;
|
||||||
|
|
||||||
public void copy(TbOrderDetail source){
|
public void copy(TbOrderDetail source){
|
||||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -550,6 +550,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
tbCashierCart.setCategoryId(product.getCategoryId());
|
tbCashierCart.setCategoryId(product.getCategoryId());
|
||||||
tbCashierCart.setNote(addCartDTO.getNote());
|
tbCashierCart.setNote(addCartDTO.getNote());
|
||||||
tbCashierCart.setPlatformType(OrderPlatformTypeEnum.PC.getValue());
|
tbCashierCart.setPlatformType(OrderPlatformTypeEnum.PC.getValue());
|
||||||
|
tbCashierCart.setMemberPrice(productSku.getMemberPrice());
|
||||||
cashierCartRepository.save(tbCashierCart);
|
cashierCartRepository.save(tbCashierCart);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1127,7 +1128,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
// 就餐模式信息
|
// 就餐模式信息
|
||||||
ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(createOrderDTO.getShopId(), createOrderDTO.getTableId(), createOrderDTO.getUseType());
|
ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(createOrderDTO.getShopId(), createOrderDTO.getTableId(), createOrderDTO.getUseType());
|
||||||
|
|
||||||
OrderCartInfoDTO cartInfoDTO = getCartForCreateOrder(shopEatTypeInfoDTO, createOrderDTO.getMasterId());
|
OrderCartInfoDTO cartInfoDTO = getCartForCreateOrder(shopEatTypeInfoDTO, createOrderDTO.getMasterId(), shopUser);
|
||||||
if (cartInfoDTO.getOrderId() == null) {
|
if (cartInfoDTO.getOrderId() == null) {
|
||||||
createOrderDTO.setOrderId(shopEatTypeInfoDTO.isDineInAfter() ?
|
createOrderDTO.setOrderId(shopEatTypeInfoDTO.isDineInAfter() ?
|
||||||
getCurrentOrderId(shopEatTypeInfoDTO) : null);
|
getCurrentOrderId(shopEatTypeInfoDTO) : null);
|
||||||
|
|
@ -1306,7 +1307,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
return infoDTO;
|
return infoDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
private OrderCartInfoDTO getCartForCreateOrder(ShopEatTypeInfoDTO shopEatTypeInfoDTO, String masterId) {
|
private OrderCartInfoDTO getCartForCreateOrder(ShopEatTypeInfoDTO shopEatTypeInfoDTO, String masterId, TbShopUser shopUser) {
|
||||||
OrderCartInfoDTO cartInfoDTO = new OrderCartInfoDTO();
|
OrderCartInfoDTO cartInfoDTO = new OrderCartInfoDTO();
|
||||||
|
|
||||||
List<TbCashierCart> allCashierCarts = mpCashierCartService.selectByShopEatType(shopEatTypeInfoDTO, masterId);
|
List<TbCashierCart> allCashierCarts = mpCashierCartService.selectByShopEatType(shopEatTypeInfoDTO, masterId);
|
||||||
|
|
@ -1343,7 +1344,14 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
if (TableConstant.CashierCart.Status.CREATE.equalsVals(tbCashierCart.getStatus())) {
|
if (TableConstant.CashierCart.Status.CREATE.equalsVals(tbCashierCart.getStatus())) {
|
||||||
cartInfoDTO.setNewAddTotalAmount(cartInfoDTO.getNewAddTotalAmount().add(tbCashierCart.getTotalAmount()));
|
cartInfoDTO.setNewAddTotalAmount(cartInfoDTO.getNewAddTotalAmount().add(tbCashierCart.getTotalAmount()));
|
||||||
}
|
}
|
||||||
|
tbCashierCart.resetTotalAmount();
|
||||||
|
if (shopUser != null) {
|
||||||
|
if (shopUser.getIsVip() == 0) {
|
||||||
|
tbCashierCart.setIsMember(0);
|
||||||
|
}else {
|
||||||
|
tbCashierCart.setIsMember(tbCashierCart.getMemberPrice() == null ? 0 : 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
cartInfoDTO.setTotalAmount(cartInfoDTO.getTotalAmount().add(tbCashierCart.getTotalAmount()));
|
cartInfoDTO.setTotalAmount(cartInfoDTO.getTotalAmount().add(tbCashierCart.getTotalAmount()));
|
||||||
}
|
}
|
||||||
cartInfoDTO.setCashierCartIds(cartIdList);
|
cartInfoDTO.setCashierCartIds(cartIdList);
|
||||||
|
|
@ -1427,6 +1435,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
orderDetail.setProductSkuName(productSku.getSpecSnap());
|
orderDetail.setProductSkuName(productSku.getSpecSnap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
orderDetail.setMemberPrice(cashierCart.getMemberPrice());
|
||||||
orderDetail.setNote(cashierCart.getNote());
|
orderDetail.setNote(cashierCart.getNote());
|
||||||
orderDetail.setCreateTime(DateUtil.date().toTimestamp());
|
orderDetail.setCreateTime(DateUtil.date().toTimestamp());
|
||||||
orderDetail.setNum(cashierCart.getNumber());
|
orderDetail.setNum(cashierCart.getNumber());
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,12 @@ public class TbUserCouponVo {
|
||||||
private BigDecimal discountAmount;
|
private BigDecimal discountAmount;
|
||||||
private Integer couponId;
|
private Integer couponId;
|
||||||
private Integer proId;
|
private Integer proId;
|
||||||
|
// 商品名称
|
||||||
|
private String productName;
|
||||||
|
private String productCover;
|
||||||
//优惠券名称
|
//优惠券名称
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
//优惠券类型 1 满减 2 商品券
|
//优惠券类型 1 满减 2 商品券
|
||||||
private Integer type;
|
private Integer type;
|
||||||
//数量
|
//数量
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue