|
@@ -236,8 +236,8 @@ public class OrderHandler {
|
|
|
int toothbrushTotal = 0;
|
|
|
int sum = 0;
|
|
|
boolean disable = false;
|
|
|
- boolean brushFlag = false;
|
|
|
- boolean combinationOffer = false;
|
|
|
+ Integer brushFlag = 0;
|
|
|
+ Integer combinationOffer = 0;
|
|
|
String element = systemService.selectOneShopRuleById(249).getRuleDesc();
|
|
|
String brushelEment = systemService.selectOneShopRuleById(253).getRuleDesc();
|
|
|
String combinationOfferColorIds = systemService.selectOneShopRuleById(259).getRuleDesc();
|
|
@@ -259,21 +259,21 @@ public class OrderHandler {
|
|
|
|
|
|
String[] els = element.split("-");
|
|
|
for(String el : els){
|
|
|
- if(cartDto.getProductType() == Integer.valueOf(el)){
|
|
|
+ if(cartDto.getProductType().equals(Integer.valueOf(el))){
|
|
|
disable = true;
|
|
|
toothbrushTotal += cartDto.getCartNum() * cartDto.getProductPrice();
|
|
|
}
|
|
|
}
|
|
|
String[] brushelEls = brushelEment.split("-");
|
|
|
for(String brushelEl : brushelEls){
|
|
|
- if(cartDto.getProductType() == Integer.valueOf(brushelEl)){
|
|
|
- brushFlag = true;
|
|
|
+ if(cartDto.getProductType().equals(Integer.valueOf(brushelEl))){
|
|
|
+ brushFlag += cartDto.getCartNum();
|
|
|
}
|
|
|
}
|
|
|
String[] coColorId = combinationOfferColorIds.split("-");
|
|
|
for(String colorId : coColorId){
|
|
|
if(cartDto.getCartColorId().equals(Integer.valueOf(colorId))){
|
|
|
- combinationOffer = true;
|
|
|
+ combinationOffer += cartDto.getCartNum();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -298,7 +298,7 @@ public class OrderHandler {
|
|
|
if(total >= couponItemDto.getCouponConsumeEnough()){
|
|
|
|
|
|
if(couponItemDto.getCouponIsNewPeople() == 1){
|
|
|
- if(member.getUserIdentity() != 1 || !brushFlag){
|
|
|
+ if(member.getUserIdentity() != 1 || brushFlag<1){
|
|
|
flag = false;
|
|
|
}
|
|
|
}else if(couponItemDto.getCouponIsPurchase() == 1){
|
|
@@ -318,9 +318,12 @@ public class OrderHandler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(channelType <= 0 && channelId <= 0 && !combinationOffer){
|
|
|
+ if(channelType <= 0 && channelId <= 0 && combinationOffer < 1){
|
|
|
+ dto.setCouponItems(list);
|
|
|
+ }else if(combinationOffer > 0 && brushFlag - combinationOffer > 0 ){
|
|
|
dto.setCouponItems(list);
|
|
|
}
|
|
|
+
|
|
|
dto.setCartId(cartIds);
|
|
|
dto.setPayTotal(total);
|
|
|
dto.setIsCustomize(isCustomize);
|
|
@@ -483,12 +486,17 @@ public class OrderHandler {
|
|
|
boolean isContainProduct = false;
|
|
|
boolean brush1Flag = false;
|
|
|
boolean brush2Flag = false;
|
|
|
+ Integer brusHeadNumber = 0;
|
|
|
+ Integer combinationOffer = 0;
|
|
|
|
|
|
String brushelEment = systemService.selectOneShopRuleById(253).getRuleDesc();
|
|
|
+
|
|
|
+ String combinationOfferColorIds = systemService.selectOneShopRuleById(259).getRuleDesc();
|
|
|
|
|
|
int brushelTotal = 0;
|
|
|
int brushHeadTotal = 0;
|
|
|
int brushelCouponTotal = 0;
|
|
|
+ int combinationOfferTotal = 0;
|
|
|
|
|
|
boolean isChannelProduct = false;
|
|
|
|
|
@@ -552,14 +560,29 @@ public class OrderHandler {
|
|
|
|
|
|
String[] brushelEls = brushelEment.split("-");
|
|
|
for(String brushelEl : brushelEls){
|
|
|
- if(cartDto.getProductType().equals(Integer.valueOf(brushelEl))){
|
|
|
+ if(cartDto.getProductType().equals(Integer.valueOf(brushelEl)) && cartDto.getCartProductId() != 310){
|
|
|
brush1Flag = true;
|
|
|
brush2Flag = true;
|
|
|
+
|
|
|
+ brusHeadNumber += cartDto.getCartNum();
|
|
|
brushHeadTotal += subTotal;
|
|
|
if(brushelCouponTotal == 0 || brushelCouponTotal < cartDto.getProductPrice()){
|
|
|
brushelCouponTotal = cartDto.getProductPrice();
|
|
|
}
|
|
|
}
|
|
|
+ if(cartDto.getCartProductId() == 310){
|
|
|
+
|
|
|
+ brusHeadNumber += cartDto.getCartNum();
|
|
|
+ combinationOfferTotal += subTotal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ String[] coColorId = combinationOfferColorIds.split("-");
|
|
|
+ for(String colorId : coColorId){
|
|
|
+ if(cartDto.getCartColorId().equals(Integer.valueOf(colorId))){
|
|
|
+ combinationOffer += cartDto.getCartNum();
|
|
|
+ }
|
|
|
}
|
|
|
}else if(cartDto.getProductStatus().intValue() != 1){
|
|
|
msg.setMessage(ResultInfo.cartNoStatusError);
|
|
@@ -622,6 +645,10 @@ public class OrderHandler {
|
|
|
msg.setMessage(ResultInfo.COUPON_NO_MEMBER);
|
|
|
return msg;
|
|
|
}
|
|
|
+ if(combinationOffer > 0 && brusHeadNumber - combinationOffer < 1){
|
|
|
+ msg.setMessage(ResultInfo.COUPON_YOUHUI);
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
}else if(couponType.getCouponIsPurchase() == 1){
|
|
|
if(!isContainProduct){
|
|
|
msg.setMessage(ResultInfo.COUPON_NO_TOOTH);
|