| 
														
															@@ -139,12 +139,25 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     //获取用户的优惠券 
														 | 
														
														 | 
														
															                     //获取用户的优惠券 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     if(stationInfos.getCouponEnabledFlag() !=null && stationInfos.getCouponEnabledFlag().equals("1")){ 
														 | 
														
														 | 
														
															                     if(stationInfos.getCouponEnabledFlag() !=null && stationInfos.getCouponEnabledFlag().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         Integer stationId = payOrderRequest.getStationId(); 
														 | 
														
														 | 
														
															                         Integer stationId = payOrderRequest.getStationId(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         //集团下 
														 | 
														
														 | 
														
															                         //集团下 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         if(stationInfos.getCouponFlag() !=null && stationInfos.getCouponFlag().equals("1")){ 
														 | 
														
														 | 
														
															                         if(stationInfos.getCouponFlag() !=null && stationInfos.getCouponFlag().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                             stationId=stationInfos.getGroupId(); 
														 | 
														
														 | 
														
															                             stationId=stationInfos.getGroupId(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         } 
														 | 
														
														 | 
														
															                         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        resultMap.put("userCouponsList", this.getUserCoupon(appUserInfos.getUnionId(), stationId)); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //设置了扫码后支付成功后的领取 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        String couponIssueId = "";                              //领取方式ID 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        resultMap.put("couponIssueId", couponIssueId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponIssueId = this.getCouponIssue(stationId).get(0).getCouponIssueId(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        if(StringUtils.isNotBlank(couponIssueId)){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            resultMap.put("couponIssueId", couponIssueId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        List<UserCoupon> userCouponsList = new ArrayList<>();       //用户的优惠券 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        resultMap.put("userCouponsList", userCouponsList); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        userCouponsList = this.getUserCoupon(appUserInfos.getUnionId(), stationId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        if(userCouponsList !=null && userCouponsList.size()>0){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            resultMap.put("userCouponsList", userCouponsList); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     if(oilsType.equals("3")){                                                       //订单类型是油品时计算 
														 | 
														
														 | 
														
															                     if(oilsType.equals("3")){                                                       //订单类型是油品时计算 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         payOrder.setOrderType("2"); 
														 | 
														
														 | 
														
															                         payOrder.setOrderType("2"); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -484,7 +497,12 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         payOrderResultInfo.setDzkAmt(amt.toString());                           //电子卡支付金额 
														 | 
														
														 | 
														
															         payOrderResultInfo.setDzkAmt(amt.toString());                           //电子卡支付金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         payOrderResultInfo.setDzkDiscountAmt(dzkDiscountAmt.toString());        //电子卡优惠金额 
														 | 
														
														 | 
														
															         payOrderResultInfo.setDzkDiscountAmt(dzkDiscountAmt.toString());        //电子卡优惠金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         payOrderResultInfo.setBalance("0"); 
														 | 
														
														 | 
														
															         payOrderResultInfo.setBalance("0"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        payOrderResultInfo.setCardOilsType("4"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String oilName = params.get("oilName").toString(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Oil oil = new Oil(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        oil.setOilName(oilName); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Oil oilInfo = sysDictDataService.selectOilType(oil); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        payOrderResultInfo.setCardOilsType(oilInfo.getOilsType()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         payOrderResultInfo.setOilsCardFlag("0"); 
														 | 
														
														 | 
														
															         payOrderResultInfo.setOilsCardFlag("0"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         payOrderResultInfo.setCardEnabledFlag("0"); 
														 | 
														
														 | 
														
															         payOrderResultInfo.setCardEnabledFlag("0"); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1348,12 +1366,200 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             payOrderResultInfo.setBalance(map.get("balance")); 
														 | 
														
														 | 
														
															             payOrderResultInfo.setBalance(map.get("balance")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             payOrderResultInfo.setOilsCardFlag(map.get("oilsCardFlag")); 
														 | 
														
														 | 
														
															             payOrderResultInfo.setOilsCardFlag(map.get("oilsCardFlag")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             payOrderResultInfo.setCardOilsType(map.get("cardOilsType")); 
														 | 
														
														 | 
														
															             payOrderResultInfo.setCardOilsType(map.get("cardOilsType")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            //获取用户的优惠券 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            //payOrderResultInfo.setUserCouponsList(this.getUserCoupon(params.get("unionId").toString(), Integer.valueOf(params.get("stationId").toString()))); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return  payOrderResultInfo; 
														 | 
														
														 | 
														
															         return  payOrderResultInfo; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    //获取客户所拥有的优惠券并计算支付金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public List<UserCoupon> getUserCouponAscList(PayOrderResultInfo p){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Integer stationId = p.getStationId(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String unionId = p.getUnionId(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<UserCoupon> userCouponsCalAndAscList = 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()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            List<UserCoupon> userCouponsList = couponService.selectUserCoupons(userCoupon); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //循环计算优惠券金额 并排序 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(userCouponsList !=null && userCouponsList.size()>0){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                for (UserCoupon uc: userCouponsList){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    // 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    uc.getCouponThresholdAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    String status = uc.getStatus(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if(status !=null && status.equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //返回前端使用优惠券后的计算金额计算后 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        CouponReckonAmt couponReckonAmt = new CouponReckonAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //couponReckonAmt.setAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        String amt = p.getAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        String discountAmt = p.getDiscountAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        String oilPrice = p.getOilPrice(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        String discountPrice = p.getDiscountPrice(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        String dzkAmt = p.getDzkAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        String dzkDiscountAmt = p.getDzkDiscountAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        String oilLiters = p.getOilLiters(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setAmt(amt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setDiscountAmt(discountAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setOilPrice(oilPrice); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setDiscountPrice(discountPrice); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setDzkAmt(dzkAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setDzkDiscountAmt(dzkDiscountAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setOilLiters(oilLiters); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //优惠券时间类型 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        String availableControl = uc.getAvailableControl(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        switch (availableControl){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            case "0": 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                couponReckonAmt = this.calCouponDiscount(couponReckonAmt, uc, p); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            case "1": 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                boolean activityDay_1 = this.isActivityDay("1", uc.getCycleDays()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                if(activityDay_1) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                    //指定每周几 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                    couponReckonAmt = this.calCouponDiscount(couponReckonAmt, uc, p); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            case "2": 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                boolean activityDay_2 = this.isActivityDay("2", uc.getCycleDays()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                if(activityDay_2) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                    //指定每月的几号 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                    couponReckonAmt = this.calCouponDiscount(couponReckonAmt, uc, p); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            case "3": 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                boolean activityDay_3 = this.isActivityDay("3", uc.getAppointedDays()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                if (activityDay_3) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                    //指定日 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                    couponReckonAmt = this.calCouponDiscount(couponReckonAmt, uc, p); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        uc.setCouponReckonAmt(couponReckonAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                //根据支付金额大小进行优惠券排序 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return userCouponsCalAndAscList; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    /*** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     * //计算使用优惠券后金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     * @param c         //返回前端使用优惠券后的计算 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     * @param uc        //用户所持有该张优惠券的信息 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     * @return 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public CouponReckonAmt calCouponDiscount(CouponReckonAmt c, UserCoupon uc, PayOrderResultInfo p){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        CouponReckonAmt couponReckonAmt = c; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String amt = c.getAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String discountAmt = c.getDiscountAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String dzkAmt = c.getDzkAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String dzkDiscountAmt = c.getDzkDiscountAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String oilLiters = c.getOilLiters(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String discountPrice = c.getDiscountPrice(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        BigDecimal couponAmt = uc.getCouponAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String receivableAmt = p.getReceivableAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        BigDecimal dzkAmtNew = new BigDecimal(dzkAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        BigDecimal amtNew = new BigDecimal(amt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        BigDecimal discountPriceNew = new BigDecimal(discountPrice); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        BigDecimal discountAmtNew = new BigDecimal(discountAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        BigDecimal dzkDiscountAmtNew = new BigDecimal(dzkDiscountAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                //根据优惠券类型计算金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        switch (uc.getCouponType()){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            case "1":       //现金券 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(p.getAllDiscountType().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //表示等级 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if(uc.getIsGradeFlag().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        amtNew = new BigDecimal(amt).subtract(couponAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        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()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(p.getAllDiscountType().equals("2")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //表示营销 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if(uc.getIsMarketFlag().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //优惠券后的优惠金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        amtNew = new BigDecimal(amt).subtract(couponAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //优惠券后的优惠价格 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        discountAmtNew = discountAmtNew.add(couponAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setAmt(amtNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(uc.getIsCardFlag().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //与电子卡共享 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    dzkAmtNew = new BigDecimal(dzkAmt).subtract(couponAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    dzkAmtNew = dzkAmtNew.signum() == -1 ? new BigDecimal("0.01") : dzkAmtNew; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    discountPriceNew = dzkAmtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    dzkDiscountAmtNew = dzkDiscountAmtNew.add(couponAmt); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    couponReckonAmt.setDzkDiscountAmt(dzkDiscountAmtNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    couponReckonAmt.setDzkAmt(dzkAmtNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            case "2":       //折扣券 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(p.getAllDiscountType().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //表示等级 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if(uc.getIsGradeFlag().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //表示与等级共享 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        amtNew = new BigDecimal(amt).multiply(couponAmt).divide(new BigDecimal("100")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        discountAmtNew = new BigDecimal(receivableAmt).subtract(amtNew); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setAmt(amtNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(p.getAllDiscountType().equals("2")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //表示营销 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if(uc.getIsMarketFlag().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //优惠券后的优惠金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        amtNew = new BigDecimal(amt).multiply(couponAmt).divide(new BigDecimal("100")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        amtNew = amtNew.signum() == -1 ? new BigDecimal("0.01") : amtNew; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //优惠券后的优惠价格 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        discountPriceNew = amtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        discountAmtNew = new BigDecimal(receivableAmt).subtract(amtNew); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setDiscountAmt(discountAmtNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        couponReckonAmt.setAmt(amtNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(uc.getIsCardFlag().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //与电子卡共享 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    dzkAmtNew = new BigDecimal(dzkAmt).multiply(couponAmt).divide(new BigDecimal("100")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    dzkAmtNew = dzkAmtNew.signum() == -1 ? new BigDecimal("0.01") : dzkAmtNew; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    discountPriceNew = dzkAmtNew.divide(new BigDecimal(oilLiters), 2, BigDecimal.ROUND_HALF_UP); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    dzkDiscountAmtNew = new BigDecimal(receivableAmt).subtract(dzkAmtNew); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    couponReckonAmt.setDzkDiscountAmt(dzkDiscountAmtNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    couponReckonAmt.setDiscountPrice(discountPriceNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    couponReckonAmt.setDzkAmt(dzkAmtNew.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return couponReckonAmt; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     //获取客户所拥有的优惠券 
														 | 
														
														 | 
														
															     //获取客户所拥有的优惠券 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public List<UserCoupon> getUserCoupon(String unionId, Integer stationId){ 
														 | 
														
														 | 
														
															     public List<UserCoupon> getUserCoupon(String unionId, Integer stationId){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<UserCoupon> userCouponsList = new ArrayList<>(); 
														 | 
														
														 | 
														
															         List<UserCoupon> userCouponsList = new ArrayList<>(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1376,6 +1582,17 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return userCouponsList; 
														 | 
														
														 | 
														
															         return userCouponsList; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    //获取支付后 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public List<CouponIssue> getCouponIssue(Integer stationId){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        CouponIssue c = new CouponIssue(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        c.setStationId(stationId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        c.setIssueType("3"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        c.setStatus("1"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<CouponIssue> couponIssuesList = couponService.selectCouponIssueList(c); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return couponIssuesList; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     //查询用户电子会员卡余额 
														 | 
														
														 | 
														
															     //查询用户电子会员卡余额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public Map<String, String>  selectCardBalance(CustomerElectronicCard card, Map params) { 
														 | 
														
														 | 
														
															     public Map<String, String>  selectCardBalance(CustomerElectronicCard card, Map params) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         CustomerElectronicCard customerElectronicCard = new CustomerElectronicCard(); 
														 | 
														
														 | 
														
															         CustomerElectronicCard customerElectronicCard = new CustomerElectronicCard(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1473,12 +1690,12 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /*** 
														 | 
														
														 | 
														
															     /*** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * 计算使用优惠券金额 
														 | 
														
														 | 
														
															      * 计算使用优惠券金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @param ordNo 
														 | 
														
														 | 
														
															      * @param ordNo 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-     * @param couponId 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     * @param id 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @return 
														 | 
														
														 | 
														
															      * @return 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      */ 
														 | 
														
														 | 
														
															      */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @RequestMapping(value = "/calculateCouponDiscount", method = RequestMethod.GET) 
														 | 
														
														 | 
														
															     @RequestMapping(value = "/calculateCouponDiscount", method = RequestMethod.GET) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @ResponseBody 
														 | 
														
														 | 
														
															     @ResponseBody 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    public String calculateCouponDiscount(@RequestParam String ordNo, @RequestParam Integer couponId){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public String calculateCouponDiscount(@RequestParam String ordNo, @RequestParam Integer id){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Gson gson =new Gson(); 
														 | 
														
														 | 
														
															         Gson gson =new Gson(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         ResultData resultData =null; 
														 | 
														
														 | 
														
															         ResultData resultData =null; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         PayOrder payOrder = new PayOrder(); 
														 | 
														
														 | 
														
															         PayOrder payOrder = new PayOrder(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1490,10 +1707,10 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if(stationInfos !=null && stationInfos.getCouponEnabledFlag().equals("1")){ 
														 | 
														
														 | 
														
															         if(stationInfos !=null && stationInfos.getCouponEnabledFlag().equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             Map<String ,Object> resultMap = new HashMap<>();                //返回结果集 
														 | 
														
														 | 
														
															             Map<String ,Object> resultMap = new HashMap<>();                //返回结果集 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if(infoMap !=null){ 
														 | 
														
														 | 
														
															             if(infoMap !=null){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                Coupon coupon = new Coupon(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if(couponId !=null){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    coupon.setId(couponId); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    Coupon couponInfo = couponService.selectCouponInfo(coupon); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                UserCoupon u = new UserCoupon(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(id !=null){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    u.setId(id); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    UserCoupon couponInfo = couponService.selectUserCouponInfo(u); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     if(couponInfo !=null){ 
														 | 
														
														 | 
														
															                     if(couponInfo !=null){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         String oilName = infoMap.get("oilName").toString(); 
														 | 
														
														 | 
														
															                         String oilName = infoMap.get("oilName").toString(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         String oilNames = couponInfo.getOilName(); 
														 | 
														
														 | 
														
															                         String oilNames = couponInfo.getOilName(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1677,14 +1894,37 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /*** 
														 | 
														
														 | 
														
															     /*** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * 计算使用优惠券金额 
														 | 
														
														 | 
														
															      * 计算使用优惠券金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @param ordNo 
														 | 
														
														 | 
														
															      * @param ordNo 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-     * @param couponId 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     * @param id 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @return 
														 | 
														
														 | 
														
															      * @return 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      */ 
														 | 
														
														 | 
														
															      */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @RequestMapping(value = "/updateOrderCoupon", method = RequestMethod.GET) 
														 | 
														
														 | 
														
															     @RequestMapping(value = "/updateOrderCoupon", method = RequestMethod.GET) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @ResponseBody 
														 | 
														
														 | 
														
															     @ResponseBody 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    public String updateOrderCoupon(@RequestParam String ordNo, @RequestParam Integer couponId){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public String updateOrderCoupon(@RequestParam String ordNo, @RequestParam Integer id){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Gson gson =new Gson(); 
														 | 
														
														 | 
														
															         Gson gson =new Gson(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         ResultData resultData =null; 
														 | 
														
														 | 
														
															         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); 
														 | 
														
														 | 
														
															         return  gson.toJson(resultData); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 |