浏览代码

修改五一劳动节活动

wangxiaoming 6 年之前
父节点
当前提交
5d8f7585a6
共有 1 个文件被更改,包括 11 次插入19 次删除
  1. 11 19
      tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/order/OrderHandler.java

+ 11 - 19
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/order/OrderHandler.java

@@ -220,9 +220,9 @@ public class OrderHandler {
 				if(cd.getProductType() == 100){		//当订单中有电动牙刷时,+1
 					toothAllbrush += cd.getCartNum();
 				}
-				if(cd.getColorToothType() == 2){	//牙刷分类 1:非牙刷,非刷头 2:成人牙刷 3:儿童牙刷 4:亲子款(成人+儿童) 5:刷头
+				if(cd.getColorToothType() == 2){	//牙刷分类 1:赠品(非牙刷,非刷头 2:成人牙刷 3:儿童牙刷 4:亲子款(成人+儿童) 5:刷头
 					toothAuthbrush += cd.getCartNum();
-				}else if(cd.getColorToothType() == 3){
+				}else if(cd.getColorToothType() == 3 || cd.getColorToothType() == 4){
 					toothKidsbrush += cd.getCartNum();
 				}
 
@@ -237,7 +237,7 @@ public class OrderHandler {
 				if(activityDate.isStatus()){
 
 					/*计算促销之后的支付金额*/
-					Integer promotionAmout = allAmount;	//促销之后的金额
+					Integer promotionAmout = allAmount;	//促销之后的金额 -- 总金额减去满减,满减的优先级高一些
 
 					SalesActivities sa = new SalesActivities();
 					sa.setSalesActivitiesStatus(1);
@@ -255,16 +255,11 @@ public class OrderHandler {
 //					2、买任意儿童款牙刷(普通、派火车款,亲子款)加送儿童护齿书籍(进口艾科弗牙膏+儿童护齿书籍)
 //					3、满499送进口艾科弗牙膏+进口Ora2漱口水(按实际支付金额)
 //					4、满699元送进口艾科弗牙膏+MAC口红(按实际支付金额)
-					if(promotionAmout > 69900){
-						addFullReduction(4,cartDtos);
-					}
-					if(promotionAmout > 49900){
-						addFullReduction(3,cartDtos);
-					}
+//					5、加送儿童护齿书籍
 					if(toothKidsbrush > 0){
-						addFullReduction(2,cartDtos);
+						addFullReduction(5,cartDtos);
 					}
-					if(toothAuthbrush > 0){
+					if(toothAuthbrush > 0 || toothKidsbrush > 0){
 						addFullReduction(1,cartDtos);
 					}
 				}
@@ -561,16 +556,10 @@ public class OrderHandler {
 //					2、买任意儿童款牙刷(普通、派火车款,亲子款)加送儿童护齿书籍(进口艾科弗牙膏+儿童护齿书籍)
 //					3、满499送进口艾科弗牙膏+进口Ora2漱口水(按实际支付金额)
 //					4、满699元送进口艾科弗牙膏+MAC口红(按实际支付金额)
-					if(promotionAmout > 69900){
-						addFullReduction(4,cartDtos);
-					}
-					if(promotionAmout > 49900){
-						addFullReduction(3,cartDtos);
-					}
 					if(toothKidsbrush > 0){
-						addFullReduction(2,cartDtos);
+						addFullReduction(5,cartDtos);
 					}
-					if(toothAuthbrush > 0){
+					if(toothAuthbrush > 0 || toothKidsbrush > 0){
 						addFullReduction(1,cartDtos);
 					}
 				}
@@ -1110,6 +1099,9 @@ public class OrderHandler {
 	 */
 	private void addFullReduction(Integer type, List<CartDto> cartDtos){
 		switch (type){
+			case 5 :
+				addCartDtos(cartDtos,322);//儿童护齿书籍
+				break;
 			case 4 :
 				addCartDtos(cartDtos,314);//牙膏
 				addCartDtos(cartDtos,321);//MAC口红