| 
														
															@@ -110,6 +110,7 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             appUserInfo.setMinaOpenid(payOrderRequest.getOpenId());   //2是小程序 
														 | 
														
														 | 
														
															             appUserInfo.setMinaOpenid(payOrderRequest.getOpenId());   //2是小程序 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<AppUserInfo> appUserInfoList =appUserInfoService.Authentication(appUserInfo); 
														 | 
														
														 | 
														
															         List<AppUserInfo> appUserInfoList =appUserInfoService.Authentication(appUserInfo); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //logger.info("用户信息:" + appUserInfoList.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Map<String ,Object> resultMap = new HashMap<>();            //返回结果集 
														 | 
														
														 | 
														
															         Map<String ,Object> resultMap = new HashMap<>();            //返回结果集 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //判断登录人员是否验证成功 
														 | 
														
														 | 
														
															         //判断登录人员是否验证成功 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if(appUserInfoList!=null && appUserInfoList.size()>0){ 
														 | 
														
														 | 
														
															         if(appUserInfoList!=null && appUserInfoList.size()>0){ 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -155,6 +156,7 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             String oilPersonnel = ""; 
														 | 
														
														 | 
														
															             String oilPersonnel = ""; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             //使用list原因:一个枪号对应多个加油员场景 
														 | 
														
														 | 
														
															             //使用list原因:一个枪号对应多个加油员场景 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             List<Map> mapResultList = payOrderMapper.selectPersonelName(params); 
														 | 
														
														 | 
														
															             List<Map> mapResultList = payOrderMapper.selectPersonelName(params); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            logger.info("加油员信息:"+ mapResultList.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if(mapResultList != null && mapResultList.size() > 0){ 
														 | 
														
														 | 
														
															             if(mapResultList != null && mapResultList.size() > 0){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 for (Map per : mapResultList){ 
														 | 
														
														 | 
														
															                 for (Map per : mapResultList){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     if(per.containsKey("personelName") && per.get("personelName").toString() !=null && per.get("personelName").toString() !=""){ 
														 | 
														
														 | 
														
															                     if(per.containsKey("personelName") && per.get("personelName").toString() !=null && per.get("personelName").toString() !=""){ 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -164,17 +166,23 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 if(oilPersonnel !=""){ 
														 | 
														
														 | 
														
															                 if(oilPersonnel !=""){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     payOrder.setOilPersonnel(oilPersonnel.substring(0, oilPersonnel.length()-1));   //加油员 
														 | 
														
														 | 
														
															                     payOrder.setOilPersonnel(oilPersonnel.substring(0, oilPersonnel.length()-1));   //加油员 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if(mapResultList.get(0).containsKey("stationName") && mapResultList.get(0).get("stationName").toString() !="" && mapResultList.get(0).get("stationName").toString() !=null ){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    payOrder.setStationName(mapResultList.get(0).get("stationName").toString());        //油站名称 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             String orderType = payOrderRequest.getOrderType();                          //获取订单类型 
														 | 
														
														 | 
														
															             String orderType = payOrderRequest.getOrderType();                          //获取订单类型 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            logger.info("订单类型:" + orderType); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if(orderType.equals("1")){                                                  //订单类型是油品时计算 
														 | 
														
														 | 
														
															             if(orderType.equals("1")){                                                  //订单类型是油品时计算 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 resultMap = this.calculateAmt(payOrderRequest);                         //计算油价 加油升数 优惠金额 实收金额 优惠价格 
														 | 
														
														 | 
														
															                 resultMap = this.calculateAmt(payOrderRequest);                         //计算油价 加油升数 优惠金额 实收金额 优惠价格 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 payOrder.setOilPirce(resultMap.get("oilPrice").toString()); 
														 | 
														
														 | 
														
															                 payOrder.setOilPirce(resultMap.get("oilPrice").toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 payOrder.setOrderLiters(resultMap.get("oilLiters").toString()); 
														 | 
														
														 | 
														
															                 payOrder.setOrderLiters(resultMap.get("oilLiters").toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 payOrder.setDiscountAmt(Double.valueOf(resultMap.get("discountAmt").toString())); 
														 | 
														
														 | 
														
															                 payOrder.setDiscountAmt(Double.valueOf(resultMap.get("discountAmt").toString())); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 payOrder.setAmt(Double.valueOf(resultMap.get("amt").toString())); 
														 | 
														
														 | 
														
															                 payOrder.setAmt(Double.valueOf(resultMap.get("amt").toString())); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                String stationCardEnabledFlag = electronicMembershipCardService.getStationCardEnabledFlag(payOrderRequest.getStationId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                logger.info("油站是否开启电子会员卡功能: " +stationCardEnabledFlag); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                //查询油站是否开启电子会员卡功能 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(stationCardEnabledFlag.equals("1")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    Map<String, String> map = this.selectCardBalance(payOrderRequest.getStationId(), payOrderRequest.getOilName(), appUserInfoList.get(0).getUnionId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    resultMap.put("balance", map.get("balance"));   //电子卡余额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    resultMap.put("cardOilsType", map.get("cardOilsType"));     //电子卡类型1.汽油; 2.柴油 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             payOrder.setReceivableAmt(payOrderRequest.getReceivableAmt());                //订单应收金额 
														 | 
														
														 | 
														
															             payOrder.setReceivableAmt(payOrderRequest.getReceivableAmt());                //订单应收金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             String oilName =payOrderRequest.getOilName(); 
														 | 
														
														 | 
														
															             String oilName =payOrderRequest.getOilName(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -199,17 +207,12 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     payOrder.setOilType("2"); 
														 | 
														
														 | 
														
															                     payOrder.setOilType("2"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     break; 
														 | 
														
														 | 
														
															                     break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            payOrder.setOilType(orderType); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            String stationCardEnabledFlag = electronicMembershipCardService.getStationCardEnabledFlag(payOrderRequest.getStationId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            //查询油站是否开启电子会员卡功能 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            if(stationCardEnabledFlag.equals("1")){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                String balance = this.selectCardBalance(payOrderRequest.getStationId(), oilName, appUserInfoList.get(0).getUnionId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                resultMap.put("balance", balance); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            payOrder.setOrderType(orderType); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             StationInfo stationInfo = new StationInfo(); 
														 | 
														
														 | 
														
															             StationInfo stationInfo = new StationInfo(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             stationInfo.setStationId(payOrderRequest.getStationId()); 
														 | 
														
														 | 
														
															             stationInfo.setStationId(payOrderRequest.getStationId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             StationInfo stationInfos = stationService.selectStationInfo(stationInfo); 
														 | 
														
														 | 
														
															             StationInfo stationInfos = stationService.selectStationInfo(stationInfo); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if(stationInfos !=null){ 
														 | 
														
														 | 
														
															             if(stationInfos !=null){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                payOrder.setStationName(stationInfos.getStationName()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 //获取油站图片和名称 
														 | 
														
														 | 
														
															                 //获取油站图片和名称 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 resultMap.put("stationPic", stationInfos.getStationPic()); 
														 | 
														
														 | 
														
															                 resultMap.put("stationPic", stationInfos.getStationPic()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 resultMap.put("stationName", stationInfos.getStationName()); 
														 | 
														
														 | 
														
															                 resultMap.put("stationName", stationInfos.getStationName()); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -221,10 +224,6 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     resultMap.put("ordNo", ordNo); 
														 | 
														
														 | 
														
															                     resultMap.put("ordNo", ordNo); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     break; 
														 | 
														
														 | 
														
															                     break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 case "2":       //非油品 
														 | 
														
														 | 
														
															                 case "2":       //非油品 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    Map<String, String> m = stationService.getStationAppIdAndAppSecret(payOrderRequest.getStationId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    if(m.containsKey("stationName") && m.get("stationName") !=null){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        payOrder.setStationName(m.get("stationName")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     payOrder.setAmt(Double.valueOf(payOrderRequest.getReceivableAmt()));        //非油品金额 
														 | 
														
														 | 
														
															                     payOrder.setAmt(Double.valueOf(payOrderRequest.getReceivableAmt()));        //非油品金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     payOrder.setDiscountAmt(Double.valueOf(0));                                 //优惠金额 
														 | 
														
														 | 
														
															                     payOrder.setDiscountAmt(Double.valueOf(0));                                 //优惠金额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     payOrder.setOilPirce(payOrderRequest.getReceivableAmt().toString());        //非油品价格 
														 | 
														
														 | 
														
															                     payOrder.setOilPirce(payOrderRequest.getReceivableAmt().toString());        //非油品价格 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -247,7 +246,7 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     //查询用户电子会员卡余额 
														 | 
														
														 | 
														
															     //查询用户电子会员卡余额 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    public String  selectCardBalance(Integer stationId, String oilName, String unionId) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public Map<String, String>  selectCardBalance(Integer stationId, String oilName, String unionId) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         String cardOilsType =""; 
														 | 
														
														 | 
														
															         String cardOilsType =""; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         switch (oilName){                               //根据油品名称存储电子卡油品类型 1.柴油 2 汽油 
														 | 
														
														 | 
														
															         switch (oilName){                               //根据油品名称存储电子卡油品类型 1.柴油 2 汽油 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             case "92#": 
														 | 
														
														 | 
														
															             case "92#": 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -275,10 +274,15 @@ public class PayOrderController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         customerElectronicCard.setUnionId(unionId); 
														 | 
														
														 | 
														
															         customerElectronicCard.setUnionId(unionId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         CustomerElectronicCard electronicCardInfo = electronicMembershipCardService.getElectronicCardInfoByUnionId(customerElectronicCard); 
														 | 
														
														 | 
														
															         CustomerElectronicCard electronicCardInfo = electronicMembershipCardService.getElectronicCardInfoByUnionId(customerElectronicCard); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         BigDecimal balance = null; 
														 | 
														
														 | 
														
															         BigDecimal balance = null; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String cardOilsType1 =""; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if(electronicCardInfo !=null){ 
														 | 
														
														 | 
														
															         if(electronicCardInfo !=null){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             balance = electronicCardInfo.getAmt(); 
														 | 
														
														 | 
														
															             balance = electronicCardInfo.getAmt(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            cardOilsType1 = electronicCardInfo.getCardOilsType(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        return balance.toString(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Map<String, String> result = new HashMap<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        result.put("balance",balance.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        result.put("cardOilsType",cardOilsType1); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return result; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /*** 
														 | 
														
														 | 
														
															     /*** 
														 |