|
@@ -9,6 +9,8 @@ import com.iamberry.wechat.core.entity.cart.SendPayDto;
|
|
import com.iamberry.wechat.core.entity.cart.TempOrderDto;
|
|
import com.iamberry.wechat.core.entity.cart.TempOrderDto;
|
|
import com.iamberry.wechat.core.entity.channel.ChannelPrice;
|
|
import com.iamberry.wechat.core.entity.channel.ChannelPrice;
|
|
import com.iamberry.wechat.core.entity.channel.ChannelRebate;
|
|
import com.iamberry.wechat.core.entity.channel.ChannelRebate;
|
|
|
|
+import com.iamberry.wechat.core.entity.channel.ChildChannel;
|
|
|
|
+import com.iamberry.wechat.core.entity.channel.MainChannel;
|
|
import com.iamberry.wechat.core.entity.coupon.CouponItem;
|
|
import com.iamberry.wechat.core.entity.coupon.CouponItem;
|
|
import com.iamberry.wechat.core.entity.coupon.CouponItemDto;
|
|
import com.iamberry.wechat.core.entity.coupon.CouponItemDto;
|
|
import com.iamberry.wechat.core.entity.coupon.CouponType;
|
|
import com.iamberry.wechat.core.entity.coupon.CouponType;
|
|
@@ -24,6 +26,8 @@ import com.iamberry.wechat.face.cart.CartService;
|
|
import com.iamberry.wechat.face.cart.ProductInfoService;
|
|
import com.iamberry.wechat.face.cart.ProductInfoService;
|
|
import com.iamberry.wechat.face.channel.ChannelPriceService;
|
|
import com.iamberry.wechat.face.channel.ChannelPriceService;
|
|
import com.iamberry.wechat.face.channel.ChannelRebateService;
|
|
import com.iamberry.wechat.face.channel.ChannelRebateService;
|
|
|
|
+import com.iamberry.wechat.face.channel.ChildChannelService;
|
|
|
|
+import com.iamberry.wechat.face.channel.MainChannelService;
|
|
import com.iamberry.wechat.face.coupon.CouponItemService;
|
|
import com.iamberry.wechat.face.coupon.CouponItemService;
|
|
import com.iamberry.wechat.face.coupon.CouponTypeService;
|
|
import com.iamberry.wechat.face.coupon.CouponTypeService;
|
|
import com.iamberry.wechat.face.customized.CustomizedToothService;
|
|
import com.iamberry.wechat.face.customized.CustomizedToothService;
|
|
@@ -113,6 +117,10 @@ public class OrderHandler {
|
|
private ChannelPriceService channelPriceService;
|
|
private ChannelPriceService channelPriceService;
|
|
@Autowired
|
|
@Autowired
|
|
private ChannelRebateService channelRebateService;
|
|
private ChannelRebateService channelRebateService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MainChannelService mainChannelService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ChildChannelService childChannelService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 支付前,调用方法
|
|
* 支付前,调用方法
|
|
@@ -140,6 +148,16 @@ public class OrderHandler {
|
|
isCustomize = "1";
|
|
isCustomize = "1";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(channelType > 0 && channelId > 0){
|
|
|
|
+ if(channelType == 1){
|
|
|
|
+ MainChannel mainChannel = mainChannelService.getMainChannelById(channelId);
|
|
|
|
+ dto.setChannelName(mainChannel.getMainChannelName());
|
|
|
|
+ }else{
|
|
|
|
+ ChildChannel childChannel = childChannelService.getChildChannelById(channelId);
|
|
|
|
+ dto.setChannelName( childChannel.getChildChannelName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (cartIds == null || isCustomize==null) {
|
|
if (cartIds == null || isCustomize==null) {
|
|
msg.setMessage(ResultInfo.cartEmptyError);
|
|
msg.setMessage(ResultInfo.cartEmptyError);
|
|
return msg;
|
|
return msg;
|
|
@@ -479,7 +497,7 @@ public class OrderHandler {
|
|
if (cartDto.getProductStatus() != null && cartDto.getProductStatus().intValue() == 1) {
|
|
if (cartDto.getProductStatus() != null && cartDto.getProductStatus().intValue() == 1) {
|
|
cartIds.add(cartDto.getCartId());
|
|
cartIds.add(cartDto.getCartId());
|
|
Integer subTotal = cartDto.getCartNum() * cartDto.getProductPrice(); // 小计
|
|
Integer subTotal = cartDto.getCartNum() * cartDto.getProductPrice(); // 小计
|
|
-
|
|
|
|
|
|
+ Integer discount = 0,price=0;
|
|
total += subTotal;
|
|
total += subTotal;
|
|
|
|
|
|
/*上朵分销,*/
|
|
/*上朵分销,*/
|
|
@@ -487,6 +505,8 @@ public class OrderHandler {
|
|
ChannelPrice channelPrice = channelPriceService.getChannelPriceByChannel(temp.getChannelId(),temp.getChannelType(),cartDto.getCartColorId());
|
|
ChannelPrice channelPrice = channelPriceService.getChannelPriceByChannel(temp.getChannelId(),temp.getChannelType(),cartDto.getCartColorId());
|
|
if(channelPrice != null){
|
|
if(channelPrice != null){
|
|
subTotal = cartDto.getCartNum() * channelPrice.getChannelPriceOffer();
|
|
subTotal = cartDto.getCartNum() * channelPrice.getChannelPriceOffer();
|
|
|
|
+ discount = channelPrice.getChannelPriceOffer();
|
|
|
|
+ price =channelPrice.getChannelOriginalPrice();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
channelTotal += subTotal;
|
|
channelTotal += subTotal;
|
|
@@ -494,14 +514,25 @@ public class OrderHandler {
|
|
|
|
|
|
OrderItem item = new OrderItem();
|
|
OrderItem item = new OrderItem();
|
|
item.setItemNum(cartDto.getCartNum());
|
|
item.setItemNum(cartDto.getCartNum());
|
|
- item.setItemProductDiscount(cartDto.getProductPrice());
|
|
|
|
|
|
+
|
|
|
|
+ if(discount > 0 ){
|
|
|
|
+ item.setItemProductDiscount(discount);
|
|
|
|
+ }else{
|
|
|
|
+ item.setItemProductDiscount(cartDto.getProductPrice());
|
|
|
|
+ }
|
|
|
|
+
|
|
item.setItemProductId(cartDto.getCartProductId());
|
|
item.setItemProductId(cartDto.getCartProductId());
|
|
item.setItemProductName(cartDto.getProductName());
|
|
item.setItemProductName(cartDto.getProductName());
|
|
item.setItemProductPic(cartDto.getProductIntroduceImg());
|
|
item.setItemProductPic(cartDto.getProductIntroduceImg());
|
|
item.setItemSalesOrderid(order.getSalesOrderid());
|
|
item.setItemSalesOrderid(order.getSalesOrderid());
|
|
item.setItemTotal(subTotal);
|
|
item.setItemTotal(subTotal);
|
|
item.setItemProductType(cartDto.getProductType());
|
|
item.setItemProductType(cartDto.getProductType());
|
|
- item.setItemProductPrice(cartDto.getProductDiscount());
|
|
|
|
|
|
+ if(price > 0 ){
|
|
|
|
+ item.setItemProductPrice(price);
|
|
|
|
+ }else{
|
|
|
|
+ item.setItemProductPrice(cartDto.getProductDiscount());
|
|
|
|
+ }
|
|
|
|
+
|
|
item.setItemColorId(cartDto.getCartColorId());
|
|
item.setItemColorId(cartDto.getCartColorId());
|
|
list.add(item);
|
|
list.add(item);
|
|
|
|
|