| 
					
				 | 
			
			
				@@ -359,27 +359,34 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     CustomerLabel customerLabel_info = labelService.getCustomerLabel(customerLabel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if(customerLabel_info !=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         customerLabel.setUpdateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        customerLabel.setCreateBy(payOrderResultInfo.getLabelCreateBy()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        if(payOrderResultInfo.getLabelUpdateBy() !=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                            customerLabel.setUpdateBy(payOrderResultInfo.getLabelUpdateBy()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         customerLabel.setLabelId(payOrderRequest.getLabelId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         labelService.updateCustomerLabel(customerLabel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         customerLabel.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         customerLabel.setDelFlag("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //customerLabel.setCreateBy(payOrderResultInfo.getLabelCreateBy()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         customerLabel.setLabelId(payOrderRequest.getLabelId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         labelService.insertCustomerLabel(customerLabel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                /* 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 * *********************************************************************************************************************** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 * 说明: payOrderResultInfo.setAllDiscountType (计算优惠券时所自定义的参数区别优惠方案): 1、表示等级优惠;2、表示营销优惠;3、标签优惠; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 * *********************************************************************************************************************** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //按照正常优惠计算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 CustomerLabel customerLabelInfo = labelService.getCustomerLabel(customerLabel); //获取该用户是否在标签组内 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if(payOrderRequest.getLabelFlag() !=null && payOrderRequest.getLabelFlag().equals("1") && customerLabelInfo !=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //表示此用户为标签用户,计算标签用户优惠 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     params.put("labelId", customerLabelInfo.getLabelId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     payOrderResultInfo = this.calculateLabelDiscount(params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    payOrderResultInfo.setOilName(params.get("oilName").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    payOrderResultInfo.setUnionId(params.get("unionId").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    payOrderResultInfo.setStationId(Integer.valueOf(params.get("stationId").toString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    payOrderResultInfo.setAllDiscountType("3"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    payOrderResultInfo.setUserCouponsList(this.getUserCouponAscList(payOrderResultInfo)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //不为标签用户时 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     switch (discountSetting){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -387,47 +394,40 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo = this.calculateGradeDiscount(params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setOilName(params.get("oilName").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setUnionId(params.get("unionId").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            payOrderResultInfo.setAllDiscountType("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setStationId(Integer.valueOf(params.get("stationId").toString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            payOrderResultInfo.setUserCouponsList(this.getUserCouponAscList(payOrderResultInfo)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            payOrderResultInfo.setAllDiscountType("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         case "1":    //满减方案 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo = this.calculateManJianDiscount(params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setOilName(params.get("oilName").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setUnionId(params.get("unionId").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            payOrderResultInfo.setAllDiscountType("2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setStationId(Integer.valueOf(params.get("stationId").toString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            payOrderResultInfo.setUserCouponsList(this.getUserCouponAscList(payOrderResultInfo)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            payOrderResultInfo.setAllDiscountType("2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         case "2":    //立减方案 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo = this.calculateLiJianDiscount(params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setOilName(params.get("oilName").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setUnionId(params.get("unionId").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            payOrderResultInfo.setAllDiscountType("2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setStationId(Integer.valueOf(params.get("stationId").toString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            payOrderResultInfo.setUserCouponsList(this.getUserCouponAscList(payOrderResultInfo)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            payOrderResultInfo.setAllDiscountType("2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         case "3":    //独立直降 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo = this.calculateZhiJiangDiscount(params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setOilName(params.get("oilName").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setUnionId(params.get("unionId").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            payOrderResultInfo.setAllDiscountType("2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setStationId(Integer.valueOf(params.get("stationId").toString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            payOrderResultInfo.setUserCouponsList(this.getUserCouponAscList(payOrderResultInfo)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            payOrderResultInfo.setAllDiscountType("2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         case "4":    //计算阶梯直降 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo = this.calculateJieTiZhiJiangDiscount(params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setOilName(params.get("oilName").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setUnionId(params.get("unionId").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            payOrderResultInfo.setAllDiscountType("2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             payOrderResultInfo.setStationId(Integer.valueOf(params.get("stationId").toString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            payOrderResultInfo.setUserCouponsList(this.getUserCouponAscList(payOrderResultInfo)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            payOrderResultInfo.setAllDiscountType("2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //优惠券计算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    payOrderResultInfo.setUserCouponsList(this.getUserCouponAscList(payOrderResultInfo)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1542,7 +1542,7 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        uc.setCouponNo(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        uc.setCouponNo("");         //隐藏优惠券核销码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         uc.setCouponReckonAmt(couponReckonAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1554,7 +1554,7 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return userCouponsList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /*** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /* 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * //计算使用优惠券后金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @param c         //返回前端使用优惠券后的计算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @param uc        //用户所持有该张优惠券的信息 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1579,12 +1579,12 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         BigDecimal dzkDiscountAmtNew = new BigDecimal(dzkDiscountAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         BigDecimal dzkDiscountPriceNew = new BigDecimal(dzkDiscountPrice); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //根据优惠券类型计算金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        switch (uc.getCouponType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            case "1":       //现金券 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(p.getAllDiscountType().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //表示等级 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(uc.getIsGradeFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //表示等级叠加 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if("1".equals(p.getAllDiscountType())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if("1".equals(uc.getIsGradeFlag())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                switch (uc.getCouponType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "1": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = new BigDecimal(amt).subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if(!oilLiters.equals("0.00")){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1594,7 +1594,25 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         discountAmtNew = discountAmtNew.add(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "2": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        BigDecimal zheKouAmt = new BigDecimal(amt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = discountAmtNew.add(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = amtNew.subtract(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = discountAmtNew.setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //表示不叠加 则只使用优惠券 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                switch (uc.getCouponType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "1": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = new BigDecimal(receivableAmt).subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if(!oilLiters.equals("0.00")){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1605,23 +1623,59 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         discountAmtNew = discountAmtNew.add(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "2": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        //优惠券折扣金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        BigDecimal zheKouAmt = new BigDecimal(receivableAmt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = new BigDecimal("0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = discountAmtNew.add(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = amtNew.subtract(discountAmtNew); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = discountAmtNew.setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(p.getAllDiscountType().equals("2")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //表示营销 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(uc.getIsMarketFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //优惠券后的优惠金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //表示营销叠加 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if("2".equals(p.getAllDiscountType())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if("1".equals(uc.getIsMarketFlag())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                switch (uc.getCouponType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "1": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = new BigDecimal(amt).subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //优惠券后的优惠价格 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         discountAmtNew = discountAmtNew.add(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "2": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        BigDecimal zheKouAmt = new BigDecimal(amt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = discountAmtNew.add(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = amtNew.subtract(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = discountAmtNew.setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //不叠加营销 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                switch (uc.getCouponType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "1": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         //优惠券后的优惠金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = new BigDecimal(receivableAmt).subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1634,45 +1688,15 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(p.getCardEnabledFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(uc.getIsCardFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //与电子卡共享 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        dzkAmtNew = new BigDecimal(dzkAmt).subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        dzkAmtNew = dzkAmtNew.signum() == -1 ? new BigDecimal("0.01") : dzkAmtNew.setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        dzkDiscountAmtNew = dzkDiscountAmtNew.add(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        couponReckonAmt.setDzkDiscountAmt(dzkDiscountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        couponReckonAmt.setDzkAmt(dzkAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            dzkDiscountPriceNew = dzkAmtNew.divide(new BigDecimal(oilLiters), 2 ,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        couponReckonAmt.setDzkDiscountPrice(dzkDiscountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //与电子卡共享 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        dzkAmtNew = new BigDecimal(receivableAmt).subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        dzkAmtNew = dzkAmtNew.signum() == -1 ? new BigDecimal("0.01") : dzkAmtNew.setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        dzkDiscountAmtNew = new BigDecimal("0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        dzkDiscountAmtNew = dzkDiscountAmtNew.add(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        couponReckonAmt.setDzkDiscountAmt(dzkDiscountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        couponReckonAmt.setDzkAmt(dzkAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            dzkDiscountPriceNew = dzkAmtNew.divide(new BigDecimal(oilLiters), 2 ,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        couponReckonAmt.setDzkDiscountPrice(dzkDiscountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            case "2":       //折扣券 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(p.getAllDiscountType().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //表示等级 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(uc.getIsGradeFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //表示与等级共享 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //优惠券折扣金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        BigDecimal zheKouAmt = new BigDecimal(amt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "2": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        //优惠券后的优惠金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        BigDecimal zheKouAmt = new BigDecimal(receivableAmt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = new BigDecimal("0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         discountAmtNew = discountAmtNew.add(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        amtNew = amtNew.subtract(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = amtNew.subtract(discountAmtNew); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        //优惠券后的优惠价格 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1680,12 +1704,30 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //优惠券折扣金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        BigDecimal zheKouAmt = new BigDecimal(receivableAmt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        discountAmtNew = new BigDecimal("0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //表示标签叠加 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if("3".equals(p.getAllDiscountType())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if("1".equals(uc.getIsLabelFlag())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                switch (uc.getCouponType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "1": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = new BigDecimal(amt).subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = discountAmtNew.add(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "2": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        BigDecimal zheKouAmt = new BigDecimal(amt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         discountAmtNew = discountAmtNew.add(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        amtNew = amtNew.subtract(discountAmtNew); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = amtNew.subtract(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1694,25 +1736,25 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(p.getAllDiscountType().equals("2")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //表示营销 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(uc.getIsMarketFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                switch (uc.getCouponType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "1": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         //优惠券后的优惠金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        BigDecimal zheKouAmt = new BigDecimal(amt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        discountAmtNew = discountAmtNew.add(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        amtNew = amtNew.subtract(zheKouAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        amtNew = new BigDecimal(receivableAmt).subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         //优惠券后的优惠价格 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        discountAmtNew = discountAmtNew.setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = new BigDecimal("0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        discountAmtNew = discountAmtNew.add(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "2": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         //优惠券后的优惠金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         BigDecimal zheKouAmt = new BigDecimal(receivableAmt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         discountAmtNew = new BigDecimal("0.00"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1727,14 +1769,31 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setAmt(amtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(p.getCardEnabledFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(uc.getIsCardFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //表示电子卡 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if("1".equals(p.getCardEnabledFlag())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ("1".equals(uc.getIsCardFlag())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                switch (uc.getCouponType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "1": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        //与电子卡共享 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        dzkAmtNew = new BigDecimal(dzkAmt).subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        dzkAmtNew = dzkAmtNew.signum() == -1 ? new BigDecimal("0.01") : dzkAmtNew.setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        dzkDiscountAmtNew = dzkDiscountAmtNew.add(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDzkDiscountAmt(dzkDiscountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDzkAmt(dzkAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            dzkDiscountPriceNew = dzkAmtNew.divide(new BigDecimal(oilLiters), 2 ,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDzkDiscountPrice(dzkDiscountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "2": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         //与电子卡共享 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         BigDecimal zheKouDzkAmt = new BigDecimal(dzkAmt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         dzkDiscountAmtNew = dzkDiscountAmtNew.add(zheKouDzkAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //System.out.println("电子卡优惠金额:"+dzkDiscountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         dzkAmtNew = dzkAmtNew.subtract(zheKouDzkAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         dzkAmtNew = dzkAmtNew.signum() == -1 ? new BigDecimal("0.01") : dzkAmtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         dzkDiscountAmtNew = dzkDiscountAmtNew.setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1744,11 +1803,27 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             dzkDiscountPriceNew = dzkAmtNew.divide(new BigDecimal(oilLiters), 2 ,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDzkDiscountPrice(dzkDiscountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                switch (uc.getCouponType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "1": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        //与电子卡共享 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        dzkAmtNew = new BigDecimal(receivableAmt).subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        dzkAmtNew = dzkAmtNew.signum() == -1 ? new BigDecimal("0.01") : dzkAmtNew.setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        dzkDiscountAmtNew = new BigDecimal("0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        dzkDiscountAmtNew = dzkDiscountAmtNew.add(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDzkDiscountAmt(dzkDiscountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDzkAmt(dzkAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if(!oilLiters.equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            dzkDiscountPriceNew = dzkAmtNew.divide(new BigDecimal(oilLiters), 2 ,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        couponReckonAmt.setDzkDiscountPrice(dzkDiscountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    case "2": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         BigDecimal zheKouDzkAmt = new BigDecimal(receivableAmt).multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         dzkDiscountAmtNew = new BigDecimal("0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         dzkDiscountAmtNew = dzkDiscountAmtNew.add(zheKouDzkAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        //System.out.println("电子卡优惠金额:"+dzkDiscountAmtNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         dzkAmtNew = dzkAmtNew.subtract(dzkDiscountAmtNew); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         dzkAmtNew = dzkAmtNew.signum() == -1 ? new BigDecimal("0.01") : dzkAmtNew.setScale(2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         dzkDiscountAmtNew = dzkDiscountAmtNew.setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1758,39 +1833,19 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             dzkDiscountPriceNew = dzkAmtNew.divide(new BigDecimal(oilLiters), 2 ,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         couponReckonAmt.setDzkDiscountPrice(dzkDiscountPriceNew.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return couponReckonAmt; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //获取客户所拥有的优惠券 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    public List<UserCoupon> getUserCoupon(String unionId, Integer stationId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        List<UserCoupon> userCouponsList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        StationInfo stationInfo = new StationInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        stationInfo.setStationId(stationId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        StationInfo stationInfos = stationService.selectStationInfo(stationInfo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        if(stationInfos !=null && stationInfos.getCouponEnabledFlag() !=null && stationInfos.getCouponEnabledFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            UserCoupon userCoupon = new UserCoupon(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            userCoupon.setStationId(stationId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            if(stationInfos.getCouponFlag() !=null && stationInfos.getCouponFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                userCoupon.setStationId(stationInfos.getGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            userCoupon.setUnionId(unionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            userCoupon.setCouponIsUsed("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            userCoupon.setExpireFlag("0");                  // SQL 条件判断 过期标志: 1 代表使用的优惠券已过期查询参数; 0 代表未过期有效的优惠券 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            userCoupon.setNoVerificationVerFlag("0");       //SQL 条件判断 查询没有异业券的参数标识: 0代表只有加油券 1代表只有异业券 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            userCoupon.setCurrentTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            userCouponsList = couponService.selectUserCoupons(userCoupon); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        return userCouponsList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //获取支付后 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /* 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 获取领取方式 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param stationId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public List<CouponIssue> getCouponIssue(Integer stationId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         CouponIssue c = new CouponIssue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         c.setStationId(stationId); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1800,7 +1855,12 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return couponIssuesList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //查询用户电子会员卡余额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /* 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 查询用户电子会员卡余额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param card 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param params 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Map<String, String>  selectCardBalance(CustomerElectronicCard card, Map params) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         CustomerElectronicCard customerElectronicCard = new CustomerElectronicCard(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         customerElectronicCard.setCardOilsType(card.getCardOilsType()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1855,8 +1915,8 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /*** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * //营销方案活动日优惠 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /* 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 营销方案活动日优惠 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @param discountType              活动日时间类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @param discountDate              活动日时间字符串,格式:1,2,3,4,5 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1894,249 +1954,8 @@ public class PayOrderController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return boo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    /*** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//     * 计算使用优惠券金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//     * @param ordNo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//     * @param id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    @RequestMapping(value = "/calculateCouponDiscount", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    @ResponseBody 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    public String calculateCouponDiscount(@RequestParam String ordNo, @RequestParam Integer id){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        Gson gson =new Gson(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        ResultData resultData =null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        PayOrder payOrder = new PayOrder(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        payOrder.setOrderNo(ordNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        Map<String, Object> infoMap = payOrderService.getOrderInfoAndUserInfoByOrderNo(payOrder); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        StationInfo stationInfo = new StationInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        stationInfo.setStationId(Integer.valueOf(infoMap.get("stationId").toString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        StationInfo stationInfos = stationService.selectStationInfo(stationInfo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        if(stationInfos !=null && stationInfos.getCouponEnabledFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            Map<String ,Object> resultMap = new HashMap<>();                //返回结果集 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            if(infoMap !=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                UserCoupon u = new UserCoupon(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                if(id !=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                    u.setId(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                    UserCoupon couponInfo = couponService.selectUserCouponInfo(u); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                    if(couponInfo !=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        String oilName = infoMap.get("oilName").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        String oilNames = couponInfo.getOilName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        //判断该油品是否能用该张张优惠券 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        boolean contains = oilNames.contains(oilName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        if(contains){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                            String status = couponInfo.getStatus(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                            //该优惠券是否有效 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                            if(status !=null && status.equals("1")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                PayOrderResultInfo p = new PayOrderResultInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                BigDecimal receivableAmt = new BigDecimal(infoMap.get("receivableAmt").toString());  //应收金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                BigDecimal couponThresholdAmt = couponInfo.getCouponThresholdAmt();                  //门槛金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                p.setReceivableAmt(receivableAmt.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                //判断该订单是否满足该优惠券门槛金额要求 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                if(!(receivableAmt.compareTo(couponThresholdAmt) == -1)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    String isMarketFlag = couponInfo.getIsMarketFlag(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    String isCardFlag = couponInfo.getIsCardFlag(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    String isGradeFlag = couponInfo.getIsGradeFlag(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    BigDecimal amt = new BigDecimal(infoMap.get("amt").toString());                      //实收金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    p.setAmt(amt.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    BigDecimal dzkAmt = new BigDecimal(infoMap.get("dzkAmt").toString());                //电子卡金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    p.setDzkAmt(dzkAmt.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    BigDecimal oilPrice = new BigDecimal(infoMap.get("oilPirce").toString());            //油品价格 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    BigDecimal orderLiters = new BigDecimal(infoMap.get("orderLiters").toString());      //电子卡金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    p.setOilLiters(orderLiters.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    BigDecimal couponAmt = couponInfo.getCouponAmt();                                       //优惠券金额:金额 比例值 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    String couponType = couponInfo.getCouponType();                                         //优惠劵类型 1现金劵,2折扣券,3兑换券 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    String cardEnabledFlag = stationInfos.getCardEnabledFlag();                             //是否开启电子卡 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    //计算优惠券优惠后金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    CalCouponAmtInfo cal = new CalCouponAmtInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    cal.setReceivableAmt(receivableAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    cal.setAmt(amt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    cal.setCardEnabledFlag(cardEnabledFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    cal.setCouponAmt(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    cal.setCouponType(couponType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    cal.setDzkAmt(dzkAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    cal.setIsCardFlag(isCardFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    cal.setIsGradeFlag(isGradeFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    cal.setIsMarketFlag(isMarketFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    //使用优惠券时返回结果 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    PayOrderResultInfo resultCalCoupon = calCouponAmt(cal); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    //查询优惠券使用时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    String availableControl = couponInfo.getAvailableControl();         //时间类型选择 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    switch (availableControl){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                        case "0": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            p.setAmt(resultCalCoupon.getAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            p.setDiscountAmt(receivableAmt.subtract(new BigDecimal(resultCalCoupon.getAmt())).toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            p.setDzkAmt(resultCalCoupon.getDzkAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            p.setDzkDiscountAmt(receivableAmt.subtract(new BigDecimal(resultCalCoupon.getDzkAmt())).toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                        case "1": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            boolean activityDay = this.isActivityDay("1", couponInfo.getCycleDays()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            if(activityDay){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setDzkAmt(resultCalCoupon.getDzkAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setDzkDiscountAmt(receivableAmt.subtract(new BigDecimal(resultCalCoupon.getDzkAmt())).toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setAmt(resultCalCoupon.getAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setDiscountAmt(receivableAmt.subtract(new BigDecimal(resultCalCoupon.getAmt())).toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                        case "2": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            boolean activityDay2 = this.isActivityDay("2", couponInfo.getCycleDays()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            if(activityDay2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setDzkAmt(resultCalCoupon.getDzkAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setDzkDiscountAmt(receivableAmt.subtract(new BigDecimal(resultCalCoupon.getDzkAmt())).toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setAmt(resultCalCoupon.getAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setDiscountAmt(receivableAmt.subtract(new BigDecimal(resultCalCoupon.getAmt())).toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                        case "3": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            boolean activityDay3 = this.isActivityDay("3", couponInfo.getCycleDays()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            if(activityDay3){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setDzkAmt(resultCalCoupon.getDzkAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setDzkDiscountAmt(receivableAmt.subtract(new BigDecimal(resultCalCoupon.getDzkAmt())).toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setAmt(resultCalCoupon.getAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                                p.setDiscountAmt(receivableAmt.subtract(new BigDecimal(resultCalCoupon.getAmt())).toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    BigDecimal discountPrice = oilPrice; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    if(!orderLiters.toString().equals("0.00")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                        //.setScale(2, BigDecimal.ROUND_HALF_UP) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                        discountPrice = (new BigDecimal(p.getAmt()).divide(orderLiters, 2, BigDecimal.ROUND_HALF_UP)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    resultMap.put("discountPrice", discountPrice.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    resultMap.put("discountAmt", p.getDiscountAmt());               //优惠金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    resultMap.put("amt", p.getAmt());                               //实收价格 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    resultMap.put("receivableAmt", p.getReceivableAmt());           //应收价格 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    resultMap.put("oilLiters", p.getOilLiters()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    resultMap.put("amt_dzk", p.getDzkAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    resultMap.put("discountAmt_dzk", p.getDzkDiscountAmt());          //电子卡优惠金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    resultMap.put("ordNo", ordNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    resultData = ResultData.success(resultMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                    resultData = ResultData.error(CodeMsg.COUPON_NOT_COUPONTHRESHOLDAMT); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                                resultData = ResultData.error(CodeMsg.COUPON_LOSE_EFFECTIVE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                            resultData = ResultData.error(CodeMsg.COUPON_NOT_CONTATINS_OILNAME); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        resultData = ResultData.error(CodeMsg.NO_COUPON); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                resultData = ResultData.error(CodeMsg.NO_ORDER); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            resultData = ResultData.error(CodeMsg.NO_ENABLE_COUPON); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        return gson.toJson(resultData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //计算优惠券金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public PayOrderResultInfo calCouponAmt(CalCouponAmtInfo calCouponAmtInfo){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        PayOrderResultInfo p = new PayOrderResultInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        BigDecimal receivableAmt = calCouponAmtInfo.getReceivableAmt();         // 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        BigDecimal amt = calCouponAmtInfo.getAmt(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        BigDecimal couponAmt = calCouponAmtInfo.getCouponAmt();                 //优惠券优惠值 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        BigDecimal dzkAmt = calCouponAmtInfo.getDzkAmt();                       //优惠券电子卡金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String cardEnabledFlag = calCouponAmtInfo.getCardEnabledFlag();         //是否开启电子卡 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        switch (calCouponAmtInfo.getCouponType()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            case "1": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //现金券 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //与营销方案,电子卡互斥 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                BigDecimal subtract = receivableAmt.subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                subtract = subtract.signum() == -1 ? new BigDecimal("0.01") : subtract; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                p.setAmt(subtract.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //是否开启电子卡 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(cardEnabledFlag.equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    p.setDzkAmt(subtract.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //是否与电子卡叠加 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (calCouponAmtInfo.getIsCardFlag().equals("1")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        BigDecimal dzkAmtSub = dzkAmt.subtract(couponAmt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        dzkAmtSub = dzkAmtSub.signum() == -1 ? new BigDecimal("0.01") : dzkAmtSub; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        p.setDzkAmt(dzkAmtSub.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //是否与营销方案叠加 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (calCouponAmtInfo.getIsMarketFlag().equals("1")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    BigDecimal marketSub = amt.subtract(calCouponAmtInfo.getCouponAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    marketSub = marketSub.signum() == -1 ? new BigDecimal("0.01") : marketSub; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    p.setAmt(marketSub.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //是否与等级叠加 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(calCouponAmtInfo.getIsGradeFlag().equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    // 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            case "2": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //折扣券 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                BigDecimal multiply = calCouponAmtInfo.getReceivableAmt().multiply(calCouponAmtInfo.getCouponAmt()).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                multiply = receivableAmt.subtract(multiply).setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                p.setAmt(multiply.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(cardEnabledFlag.equals("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    p.setDzkAmt(multiply.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //是否与电子卡叠加 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (calCouponAmtInfo.getIsCardFlag().equals("1")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        BigDecimal multiplyCard = dzkAmt.multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        multiplyCard = dzkAmt.subtract(multiplyCard).setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        p.setDzkAmt(multiplyCard.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //是否与营销方案叠加 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (calCouponAmtInfo.getIsMarketFlag().equals("1")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    BigDecimal multiplyMarket = amt.multiply(couponAmt).divide(new BigDecimal("100")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    multiplyMarket = amt.subtract(multiplyMarket).setScale(2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    p.setAmt(multiplyMarket.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return p; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    /*** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//     * 计算使用优惠券金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//     * @param ordNo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//     * @param id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    @RequestMapping(value = "/updateOrderCoupon", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    @ResponseBody 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    public String updateOrderCoupon(@RequestParam String ordNo, @RequestParam Integer id){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        Gson gson =new Gson(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        ResultData resultData =null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        PayOrder payOrder = payOrderService.selectOrderInfoByOrdNo(ordNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        UserCoupon userCoupon = new UserCoupon(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        userCoupon.setCouponId(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        UserCoupon ucr = couponService.selectUserCouponInfo(userCoupon); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        PayOrder p = new PayOrder(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        p.setDiscountCoupon(id.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        p.setDiscountCouponAmt(Double.valueOf(ucr.getCouponAmt().toString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        Double amt = payOrder.getAmt(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        String couponType = ucr.getCouponType(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        BigDecimal couponAmt = ucr.getCouponAmt(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        CalCouponAmtInfo calCouponAmtInfo = new CalCouponAmtInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-////        calCouponAmtInfo.setReceivableAmt(payOrder.getReceivableAmt()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-////        calCouponAmtInfo.setIsMarketFlag(userCoupon.getIsMarketFlag()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-////        calCouponAmtInfo.setIsGradeFlag(ucr.get); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        this.calCouponAmt(calCouponAmtInfo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// //       p.setAmt(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        p.setOrderNo(ordNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        payOrderService.getUpdatePayOrder(p); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        resultData = ResultData.success(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        return  gson.toJson(resultData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /* 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 根据订单号获取订单信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * produces="application/json;charset=UTF-8",consumes = "application/json", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @RequestBody String orderno 
			 |