魏熙美 6 anos atrás
pai
commit
535ad452fe

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/WxPayServiceI.java Ver arquivo

@@ -58,8 +58,9 @@ public interface WxPayServiceI {
58 58
 	 * 根据订单类型获取 金额 和 回调地址
59 59
 	 * @param type
60 60
 	 * @param orderNo
61
+	 * @param notifyType wx 微信, ali 支付宝
61 62
 	 * @return
62 63
 	 * @throws Exception
63 64
 	 */
64
-	Map<String,Object> getOrderPriceAndNotifyUrl(String type, String orderNo) throws Exception;
65
+	Map<String,Object> getOrderPriceAndNotifyUrl(String type, String orderNo, String notifyType) throws Exception;
65 66
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/AliPayServiceImpl.java Ver arquivo

@@ -86,7 +86,7 @@ public class AliPayServiceImpl implements AliPayServiceI {
86 86
 	public String AliPayOrder(String outTradeNo, String type, UserElement userElement) throws Exception {
87 87
 
88 88
 		String typeName = Constant.PAY_TYPE_BILL.equals(type) ? "物业缴费" : Constant.PAY_TYPE_CAR.equals(type) ? "车缴费" : "缴费";
89
-		Map<String, Object> orderPriceAndNotifyUrl = wxPayServiceI.getOrderPriceAndNotifyUrl(type, outTradeNo);
89
+		Map<String, Object> orderPriceAndNotifyUrl = wxPayServiceI.getOrderPriceAndNotifyUrl(type, outTradeNo, "ali");
90 90
 		
91 91
 		//下单
92 92
 		AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", ALI_APP_ID, APP_PRIVATE_KEY, "json", CHARSET_UTF8, ALIPAY_PUBLIC_KEY, "RSA2");

+ 5
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java Ver arquivo

@@ -98,7 +98,7 @@ public class WxPayServiceImpl implements WxPayServiceI {
98 98
 		HfWxConfig config = new HfWxConfig();
99 99
 		WXPay wxpay = new WXPay(config);
100 100
 
101
-		Map<String, Object> orderPriceAndNotifyUrl = getOrderPriceAndNotifyUrl(type, orderNo);
101
+		Map<String, Object> orderPriceAndNotifyUrl = getOrderPriceAndNotifyUrl(type, orderNo, "wx");
102 102
 
103 103
 		String typeName = Constant.PAY_TYPE_BILL.equals(type) ? "物业缴费" : Constant.PAY_TYPE_CAR.equals(type) ? "车缴费" : "缴费";
104 104
 
@@ -146,11 +146,12 @@ public class WxPayServiceImpl implements WxPayServiceI {
146 146
 	 * 根据订单类型获取 金额 和 回调地址
147 147
 	 * @param type
148 148
 	 * @param orderNo
149
+	 * @param notifyType wx 微信, ali 支付宝
149 150
 	 * @return
150 151
 	 * @throws Exception
151 152
 	 */
152 153
 	@Override
153
-	public Map<String,Object> getOrderPriceAndNotifyUrl(String type, String orderNo) throws Exception {
154
+	public Map<String,Object> getOrderPriceAndNotifyUrl(String type, String orderNo, String notifyType) throws Exception {
154 155
 		Map<String,Object> orderMap = Maps.newHashMap();
155 156
 
156 157
 		// 物业缴费
@@ -170,7 +171,7 @@ public class WxPayServiceImpl implements WxPayServiceI {
170 171
 			Long payPrice = billOrderList.stream().mapToLong(e -> tpBillInvoiceMapper.selectByPrimaryKey(e.getTpBillInvoiceId()).getPayPrice()).sum();
171 172
 			orderMap.put("orderNo", orderNo);
172 173
 			orderMap.put("payPrice", String.valueOf(payPrice));
173
-			orderMap.put("notifyUrl", payNotifyPerproties.getWxBillNotify());
174
+			orderMap.put("notifyUrl", "wx".equals(notifyType) ? payNotifyPerproties.getWxBillNotify() : payNotifyPerproties.getAliBillNotify());
174 175
 
175 176
 		} else if (Constant.PAY_TYPE_CAR.equals(type)) { // 车缴费
176 177
 			List<TaUserLicenseOrder> userLicenseOrders = taUserLicenseOrderMapper.selectByOrderNumber(orderNo);
@@ -188,7 +189,7 @@ public class WxPayServiceImpl implements WxPayServiceI {
188 189
 			Long payPrice = userLicenseOrders.stream().map(e -> Long.parseLong(e.getExtensionPrice())).count();
189 190
 			orderMap.put("orderNo", orderNo);
190 191
 			orderMap.put("payPrice", String.valueOf(payPrice));
191
-			orderMap.put("notifyUrl", payNotifyPerproties.getWxCarNotify());
192
+			orderMap.put("notifyUrl", "wx".equals(notifyType) ? payNotifyPerproties.getWxCarNotify() : payNotifyPerproties.getAliCarNotify());
192 193
 		}
193 194
 
194 195
 		return orderMap;