|
@@ -310,7 +310,9 @@ public class OrderHandler {
|
|
|
}
|
|
|
}
|
|
|
/*插入优惠券*/
|
|
|
- dto.setCouponItems(list);
|
|
|
+ if(channelType <= 0 && channelId <= 0){
|
|
|
+ dto.setCouponItems(list);
|
|
|
+ }
|
|
|
dto.setCartId(cartIds);// 购物车ID
|
|
|
dto.setPayTotal(total); // 支付金额,单位为分
|
|
|
dto.setIsCustomize(isCustomize);//判断是否为定制牙刷
|
|
@@ -398,11 +400,7 @@ public class OrderHandler {
|
|
|
msg.setMessage("电话号码为空,请重新添加收货地址信息!");
|
|
|
return msg;
|
|
|
}
|
|
|
-
|
|
|
- String regExp = "^((13[0-9])|(15[0-9])|(18[0-9])|(17[0-9])|(147))\\d{8}$";
|
|
|
- Pattern p = Pattern.compile(regExp);
|
|
|
- Matcher m = p.matcher(temp.getOrderAddressMoblie());
|
|
|
- if(!m.matches()){
|
|
|
+ if(temp.getOrderAddressMoblie().length() != 11){
|
|
|
msg.setMessage("电话号码错误,请重新添加收货地址信息!");
|
|
|
return msg;
|
|
|
}
|
|
@@ -484,6 +482,8 @@ public class OrderHandler {
|
|
|
int brushHeadTotal = 0; // 刷头总金额
|
|
|
int brushelCouponTotal = 0; //优惠总价
|
|
|
|
|
|
+ boolean isChannelProduct = false; //没有上朵分销商品
|
|
|
+
|
|
|
int total = 0; // 需要支付的总额, 单位为分
|
|
|
int channelTotal = 0; // 如果有分销,此值为分销总额,没有就与total值等同
|
|
|
/** 提前准备订单项数据 */
|
|
@@ -507,6 +507,7 @@ public class OrderHandler {
|
|
|
subTotal = cartDto.getCartNum() * channelPrice.getChannelPriceOffer();
|
|
|
discount = channelPrice.getChannelPriceOffer();
|
|
|
price =channelPrice.getChannelOriginalPrice();
|
|
|
+ isChannelProduct = true; //上朵分销减价
|
|
|
}
|
|
|
}
|
|
|
channelTotal += subTotal;
|
|
@@ -543,7 +544,7 @@ public class OrderHandler {
|
|
|
|
|
|
String[] brushelEls = brushelEment.split("-");
|
|
|
for(String brushelEl : brushelEls){
|
|
|
- if(cartDto.getProductType() == Integer.valueOf(brushelEl)){ //判断订单中是否有刷头,有刷头 brushFlag 为true;
|
|
|
+ if(cartDto.getProductType().equals(Integer.valueOf(brushelEl))){ //判断订单中是否有刷头,有刷头 brushFlag 为true;
|
|
|
brush1Flag = true;
|
|
|
brush2Flag = true;
|
|
|
brushHeadTotal += subTotal;
|
|
@@ -572,8 +573,8 @@ public class OrderHandler {
|
|
|
CouponItemDto couponItemDto=new CouponItemDto();
|
|
|
CouponItem couponItem=new CouponItem();
|
|
|
boolean hasCoupon=false;
|
|
|
- //获取优惠券不为空
|
|
|
- if(couponId!=null && !couponId.equals("")){
|
|
|
+ //获取优惠券不为空 //////////////////////上朵分销不能使用优惠券
|
|
|
+ if(couponId!=null && !couponId.equals("") && isChannelProduct==false){
|
|
|
hasCoupon=true;
|
|
|
//查询优惠券,获取对应的金额
|
|
|
couponItemDto = couponItemService.getCouponItemById(couponId);
|