|
@@ -164,8 +164,10 @@ public class OrderHandler {
|
|
|
|
|
|
int total = 0;
|
|
|
int sum = 0;
|
|
|
- boolean disable = false;
|
|
|
+ boolean disable = false;
|
|
|
+ boolean brushFlag = false;
|
|
|
String element = systemService.selectOneShopRuleById(249).getRuleDesc();
|
|
|
+ String brushelEment = systemService.selectOneShopRuleById(253).getRuleDesc();
|
|
|
|
|
|
List<CartDto> tempCarts = new ArrayList<CartDto>();
|
|
|
for (CartDto cartDto : cartDtos) {
|
|
@@ -183,6 +185,13 @@ public class OrderHandler {
|
|
|
disable = true;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ String[] brushelEls = brushelEment.split("-");
|
|
|
+ for(String brushelEl : brushelEls){
|
|
|
+ if(cartDto.getProductType() == Integer.valueOf(brushelEl)){
|
|
|
+ brushFlag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if (sum <= 0) {
|
|
|
msg.setMessage(ResultInfo.cartEmptyError);
|
|
@@ -205,8 +214,8 @@ public class OrderHandler {
|
|
|
if(total >= couponItemDto.getCouponConsumeEnough()){
|
|
|
|
|
|
|
|
|
- if(couponItemDto.getCouponIsNewPeople() == 1 && member.getUserIdentity() != 1){
|
|
|
- if(!disable){
|
|
|
+ if(couponItemDto.getCouponIsNewPeople() == 1){
|
|
|
+ if(member.getUserIdentity() != 1 || !brushFlag){
|
|
|
flag = false;
|
|
|
}
|
|
|
}else if(couponItemDto.getCouponIsPurchase() == 1){
|
|
@@ -332,6 +341,11 @@ public class OrderHandler {
|
|
|
|
|
|
|
|
|
boolean isContainProduct = false;
|
|
|
+ boolean brushFlag = false;
|
|
|
+
|
|
|
+ String brushelEment = systemService.selectOneShopRuleById(253).getRuleDesc();
|
|
|
+
|
|
|
+ int brushelTotal = 0;
|
|
|
|
|
|
int total = 0;
|
|
|
|
|
@@ -358,13 +372,24 @@ public class OrderHandler {
|
|
|
item.setItemProductPrice(cartDto.getProductDiscount());
|
|
|
item.setItemColorId(cartDto.getCartColorId());
|
|
|
list.add(item);
|
|
|
+
|
|
|
+
|
|
|
+ if(cartDto.getProductType() == 100){
|
|
|
+ isContainProduct = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] brushelEls = brushelEment.split("-");
|
|
|
+ for(String brushelEl : brushelEls){
|
|
|
+ if(cartDto.getProductType() == Integer.valueOf(brushelEl)){
|
|
|
+ brushFlag = true;
|
|
|
+ brushelTotal += subTotal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}else if(cartDto.getProductStatus().intValue() != 1){
|
|
|
msg.setMessage(ResultInfo.cartNoStatusError);
|
|
|
return msg;
|
|
|
}
|
|
|
- if(cartDto.getProductType() == 100){
|
|
|
- isContainProduct = true;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -404,22 +429,32 @@ public class OrderHandler {
|
|
|
msg.setMessage(ResultInfo.COUPON_CONSUME_NO_ENOUGH);
|
|
|
return msg;
|
|
|
}
|
|
|
- if(member.getUserIdentity() != 1){
|
|
|
- if(couponItem.getCouponIsNewPeople() == 1 && !isContainProduct){
|
|
|
+
|
|
|
+
|
|
|
+ if(couponItemDto.getCouponIsNewPeople() == 1){
|
|
|
+ if(member.getUserIdentity() != 1 || !brushFlag){
|
|
|
msg.setMessage(ResultInfo.COUPON_NO_MEMBER);
|
|
|
return msg;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- if(couponType.getCouponIsPurchase() == 1){
|
|
|
+ }else if(couponType.getCouponIsPurchase() == 1){
|
|
|
if(!isContainProduct){
|
|
|
- msg.setMessage(ResultInfo.COUPON_NO_TOOTH);
|
|
|
+ msg.setMessage(ResultInfo.COUPON_NO_TOOTH);
|
|
|
return msg;
|
|
|
}
|
|
|
}
|
|
|
+ int br = 0;
|
|
|
|
|
|
if(couponType.getCouponType()==1){
|
|
|
- total=total-couponType.getCouponReduce();
|
|
|
+ if(couponItemDto.getCouponIsNewPeople() == 1){
|
|
|
+ br = brushelTotal - couponType.getCouponReduce();
|
|
|
+ if(br <= 0){
|
|
|
+ total=total-brushelTotal;
|
|
|
+ }else{
|
|
|
+ total=total-couponType.getCouponReduce();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ total=total-couponType.getCouponReduce();
|
|
|
+ }
|
|
|
}else if(couponType.getCouponType()==2){
|
|
|
Integer all = new Integer(total);
|
|
|
total=total*couponType.getCouponReduce()/100;
|