|
@@ -251,16 +251,13 @@ public class OrderHandler {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-// 1、买任意成人款牙刷送进口艾科弗牙膏
|
|
|
-// 2、买任意儿童款牙刷(普通、派火车款,亲子款)加送儿童护齿书籍(进口艾科弗牙膏+儿童护齿书籍)
|
|
|
-// 3、满499送进口艾科弗牙膏+进口Ora2漱口水(按实际支付金额)
|
|
|
-// 4、满699元送进口艾科弗牙膏+MAC口红(按实际支付金额)
|
|
|
-// 5、加送儿童护齿书籍
|
|
|
+ Integer num[] = new Integer[0];
|
|
|
if(toothKidsbrush > 0){
|
|
|
- addFullReduction(5,cartDtos);
|
|
|
+ addFullReduction(5,cartDtos,num);
|
|
|
}
|
|
|
if(toothAuthbrush > 0 || toothKidsbrush > 0){
|
|
|
- addFullReduction(1,cartDtos);
|
|
|
+ num = new Integer[]{toothKidsbrush+toothAuthbrush};
|
|
|
+ addFullReduction(1,cartDtos,num);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -324,7 +321,7 @@ public class OrderHandler {
|
|
|
}
|
|
|
String[] brushelEls = brushelEment.split("-");
|
|
|
for(String brushelEl : brushelEls){
|
|
|
- if(cartDto.getProductType().equals(Integer.valueOf(brushelEl))){ //判断订单中是否有刷头,有刷头 brushFlag 大于0;
|
|
|
+ if(cartDto.getCartProductId().equals(Integer.valueOf(brushelEl))){ //判断订单中是否有刷头,有刷头 brushFlag 大于0;
|
|
|
brushFlag += cartDto.getCartNum();
|
|
|
}
|
|
|
}
|
|
@@ -552,15 +549,13 @@ public class OrderHandler {
|
|
|
|
|
|
//非分销渠道,才能有促销
|
|
|
if (activityDate.isStatus()) {
|
|
|
-// 1、买任意成人款牙刷送进口艾科弗牙膏
|
|
|
-// 2、买任意儿童款牙刷(普通、派火车款,亲子款)加送儿童护齿书籍(进口艾科弗牙膏+儿童护齿书籍)
|
|
|
-// 3、满499送进口艾科弗牙膏+进口Ora2漱口水(按实际支付金额)
|
|
|
-// 4、满699元送进口艾科弗牙膏+MAC口红(按实际支付金额)
|
|
|
+ Integer num[] = new Integer[0];
|
|
|
if(toothKidsbrush > 0){
|
|
|
- addFullReduction(5,cartDtos);
|
|
|
+ addFullReduction(5,cartDtos,num);
|
|
|
}
|
|
|
if(toothAuthbrush > 0 || toothKidsbrush > 0){
|
|
|
- addFullReduction(1,cartDtos);
|
|
|
+ num = new Integer[]{toothKidsbrush+toothAuthbrush};
|
|
|
+ addFullReduction(1,cartDtos,num);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -673,7 +668,7 @@ public class OrderHandler {
|
|
|
|
|
|
String[] brushelEls = brushelEment.split("-");
|
|
|
for(String brushelEl : brushelEls){
|
|
|
- if(cartDto.getProductType().equals(Integer.valueOf(brushelEl)) && cartDto.getCartProductId() != 310){ //判断订单中是否有刷头,有刷头 brushFlag 为true;
|
|
|
+ if(cartDto.getCartProductId().equals(Integer.valueOf(brushelEl))){ //判断订单中是否有刷头,有刷头 brushFlag 为true;
|
|
|
brush1Flag = true;
|
|
|
brush2Flag = true;
|
|
|
//刷头个数
|
|
@@ -1097,25 +1092,25 @@ public class OrderHandler {
|
|
|
* @param cartDtos
|
|
|
* @return
|
|
|
*/
|
|
|
- private void addFullReduction(Integer type, List<CartDto> cartDtos){
|
|
|
+ private void addFullReduction(Integer type, List<CartDto> cartDtos,Integer num[]){
|
|
|
switch (type){
|
|
|
case 5 :
|
|
|
- addCartDtos(cartDtos,322);//儿童护齿书籍
|
|
|
- break;
|
|
|
- case 4 :
|
|
|
- addCartDtos(cartDtos,314);//牙膏
|
|
|
- addCartDtos(cartDtos,321);//MAC口红
|
|
|
- break;
|
|
|
- case 3 :
|
|
|
- addCartDtos(cartDtos,314);//牙膏
|
|
|
- addCartDtos(cartDtos,315);//漱口水
|
|
|
- break;
|
|
|
- case 2 :
|
|
|
- addCartDtos(cartDtos,314);//牙膏
|
|
|
- addCartDtos(cartDtos,322);//儿童护齿书籍
|
|
|
+ addCartDtos(cartDtos,322,1);//儿童护齿书籍
|
|
|
break;
|
|
|
+// case 4 :
|
|
|
+// addCartDtos(cartDtos,314,1);//牙膏
|
|
|
+// addCartDtos(cartDtos,321,1);//MAC口红
|
|
|
+// break;
|
|
|
+// case 3 :
|
|
|
+// addCartDtos(cartDtos,314,1);//牙膏
|
|
|
+// addCartDtos(cartDtos,315,1);//漱口水
|
|
|
+// break;
|
|
|
+// case 2 :
|
|
|
+// addCartDtos(cartDtos,314,1);//牙膏
|
|
|
+// addCartDtos(cartDtos,322,1);//儿童护齿书籍
|
|
|
+// break;
|
|
|
case 1 :
|
|
|
- addCartDtos(cartDtos,314);//牙膏
|
|
|
+ addCartDtos(cartDtos,314,num[0]);//牙膏
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -1127,7 +1122,7 @@ public class OrderHandler {
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
- private void addCartDtos(List<CartDto> cartDtos,Integer id){
|
|
|
+ private void addCartDtos(List<CartDto> cartDtos,Integer id,Integer num){
|
|
|
boolean flag = false;
|
|
|
for (CartDto cartDto : cartDtos) {
|
|
|
if(id.equals(cartDto.getCartColorId())){
|
|
@@ -1135,7 +1130,7 @@ public class OrderHandler {
|
|
|
}
|
|
|
}
|
|
|
if(!flag){
|
|
|
- CartDto cd = getGiftCartDtos(id);
|
|
|
+ CartDto cd = getGiftCartDtos(id,num);
|
|
|
cartDtos.add(cd);
|
|
|
}
|
|
|
}
|
|
@@ -1145,7 +1140,7 @@ public class OrderHandler {
|
|
|
* @param colorId
|
|
|
* @return
|
|
|
*/
|
|
|
- private CartDto getGiftCartDtos(Integer colorId){
|
|
|
+ private CartDto getGiftCartDtos(Integer colorId,Integer num){
|
|
|
CartDto cartDto = new CartDto();
|
|
|
Product product = productInfoService.selectProductByColorId(colorId);
|
|
|
if((product.getColorSoldNum()+1) > product.getColorAllNum()){
|
|
@@ -1154,7 +1149,7 @@ public class OrderHandler {
|
|
|
cartDto.setCartId(1);
|
|
|
cartDto.setCartProductId(product.getProductId());
|
|
|
cartDto.setCartColorId(colorId);
|
|
|
- cartDto.setCartNum(1);
|
|
|
+ cartDto.setCartNum(num);
|
|
|
cartDto.setProductName(product.getProductName());
|
|
|
cartDto.setProductType(product.getProductTypeId());
|
|
|
cartDto.setProductPrice(product.getColorDiscount());
|