wangxiaoming пре 6 година
родитељ
комит
f2975e9f50

+ 0 - 1
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/cart/TempOrderDto.java

@@ -21,7 +21,6 @@ public class TempOrderDto implements java.io.Serializable{
 	@ValidatorInterface(validatorIsRule = "^[0-9]+[0-9]*]*$", isEnable = true)
 	private String orderAddressPostNum; // 收货地址邮编
 	
-	@ValidatorInterface(validatorIsRule = "^[1]([3][0-9]{1}|50|51|52|53|55|56|57|58|59|77|80|81|82|83|85|84|86|87|88|89|)[0-9]{8}$", isEnable = true)
 	private String orderAddressMoblie; // 收货人电话
 
 	@ValidatorInterface(validatorIsRule = "[^\\s]{1,}", isEnable = true)

+ 3 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/channel/ChannelPrice.java

@@ -27,6 +27,9 @@ public class ChannelPrice  implements  Serializable{
     private Integer channelOriginalPrice;
     //返利金额
     private Integer channelRebateAmount;
+
+    private Integer channelRebateType;
+
     //状态:1使用中 2:未使用
     private Integer channelPriceStatus;
     //创建时间

+ 10 - 9
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/order/OrderHandler.java

@@ -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);