|
@@ -257,11 +257,14 @@ public class OrderHandler {
|
|
|
|
|
|
if(promotionAmout > 69900){
|
|
|
addFullReduction(4,cartDtos);
|
|
|
- }else if(promotionAmout > 49900){
|
|
|
+ }
|
|
|
+ if(promotionAmout > 49900){
|
|
|
addFullReduction(3,cartDtos);
|
|
|
- }else if(toothKidsbrush > 0){
|
|
|
+ }
|
|
|
+ if(toothKidsbrush > 0){
|
|
|
addFullReduction(2,cartDtos);
|
|
|
- }else if(toothAuthbrush > 0){
|
|
|
+ }
|
|
|
+ if(toothAuthbrush > 0){
|
|
|
addFullReduction(1,cartDtos);
|
|
|
}
|
|
|
}
|
|
@@ -560,11 +563,14 @@ public class OrderHandler {
|
|
|
|
|
|
if(promotionAmout > 69900){
|
|
|
addFullReduction(4,cartDtos);
|
|
|
- }else if(promotionAmout > 49900){
|
|
|
+ }
|
|
|
+ if(promotionAmout > 49900){
|
|
|
addFullReduction(3,cartDtos);
|
|
|
- }else if(toothKidsbrush > 0){
|
|
|
+ }
|
|
|
+ if(toothKidsbrush > 0){
|
|
|
addFullReduction(2,cartDtos);
|
|
|
- }else if(toothAuthbrush > 0){
|
|
|
+ }
|
|
|
+ if(toothAuthbrush > 0){
|
|
|
addFullReduction(1,cartDtos);
|
|
|
}
|
|
|
}
|
|
@@ -1104,26 +1110,19 @@ public class OrderHandler {
|
|
|
private void addFullReduction(Integer type, List<CartDto> cartDtos){
|
|
|
switch (type){
|
|
|
case 4 :
|
|
|
- CartDto cd3 = getGiftCartDtos(314);
|
|
|
- CartDto cd4 = getGiftCartDtos(321);
|
|
|
- cartDtos.add(cd3);
|
|
|
- cartDtos.add(cd4);
|
|
|
+ addCartDtos(cartDtos,314);
|
|
|
+ addCartDtos(cartDtos,321);
|
|
|
break;
|
|
|
case 3 :
|
|
|
- CartDto cd5 = getGiftCartDtos(314);
|
|
|
- CartDto cd6 = getGiftCartDtos(315);
|
|
|
- cartDtos.add(cd5);
|
|
|
- cartDtos.add(cd6);
|
|
|
+ addCartDtos(cartDtos,314);
|
|
|
+ addCartDtos(cartDtos,315);
|
|
|
break;
|
|
|
case 2 :
|
|
|
- CartDto cd7 = getGiftCartDtos(314);
|
|
|
- CartDto cd8 = getGiftCartDtos(322);
|
|
|
- cartDtos.add(cd7);
|
|
|
- cartDtos.add(cd8);
|
|
|
+ addCartDtos(cartDtos,314);
|
|
|
+ addCartDtos(cartDtos,322);
|
|
|
break;
|
|
|
case 1 :
|
|
|
- CartDto cd9 = getGiftCartDtos(314);
|
|
|
- cartDtos.add(cd9);
|
|
|
+ addCartDtos(cartDtos,314);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -1131,6 +1130,24 @@ public class OrderHandler {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ * 添加赠品
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private void addCartDtos(List<CartDto> cartDtos,Integer id){
|
|
|
+ boolean flag = false;
|
|
|
+ for (CartDto cartDto : cartDtos) {
|
|
|
+ if(id.equals(cartDto.getCartColorId())){
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!flag){
|
|
|
+ CartDto cd = getGiftCartDtos(id);
|
|
|
+ cartDtos.add(cd);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
* 获取赠品信息
|
|
|
* @param colorId
|
|
|
* @return
|