魏熙美 6 years ago
parent
commit
535ad452fe

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

58
 	 * 根据订单类型获取 金额 和 回调地址
58
 	 * 根据订单类型获取 金额 和 回调地址
59
 	 * @param type
59
 	 * @param type
60
 	 * @param orderNo
60
 	 * @param orderNo
61
+	 * @param notifyType wx 微信, ali 支付宝
61
 	 * @return
62
 	 * @return
62
 	 * @throws Exception
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 View File

86
 	public String AliPayOrder(String outTradeNo, String type, UserElement userElement) throws Exception {
86
 	public String AliPayOrder(String outTradeNo, String type, UserElement userElement) throws Exception {
87
 
87
 
88
 		String typeName = Constant.PAY_TYPE_BILL.equals(type) ? "物业缴费" : Constant.PAY_TYPE_CAR.equals(type) ? "车缴费" : "缴费";
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
 		AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", ALI_APP_ID, APP_PRIVATE_KEY, "json", CHARSET_UTF8, ALIPAY_PUBLIC_KEY, "RSA2");
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 View File

98
 		HfWxConfig config = new HfWxConfig();
98
 		HfWxConfig config = new HfWxConfig();
99
 		WXPay wxpay = new WXPay(config);
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
 		String typeName = Constant.PAY_TYPE_BILL.equals(type) ? "物业缴费" : Constant.PAY_TYPE_CAR.equals(type) ? "车缴费" : "缴费";
103
 		String typeName = Constant.PAY_TYPE_BILL.equals(type) ? "物业缴费" : Constant.PAY_TYPE_CAR.equals(type) ? "车缴费" : "缴费";
104
 
104
 
146
 	 * 根据订单类型获取 金额 和 回调地址
146
 	 * 根据订单类型获取 金额 和 回调地址
147
 	 * @param type
147
 	 * @param type
148
 	 * @param orderNo
148
 	 * @param orderNo
149
+	 * @param notifyType wx 微信, ali 支付宝
149
 	 * @return
150
 	 * @return
150
 	 * @throws Exception
151
 	 * @throws Exception
151
 	 */
152
 	 */
152
 	@Override
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
 		Map<String,Object> orderMap = Maps.newHashMap();
155
 		Map<String,Object> orderMap = Maps.newHashMap();
155
 
156
 
156
 		// 物业缴费
157
 		// 物业缴费
170
 			Long payPrice = billOrderList.stream().mapToLong(e -> tpBillInvoiceMapper.selectByPrimaryKey(e.getTpBillInvoiceId()).getPayPrice()).sum();
171
 			Long payPrice = billOrderList.stream().mapToLong(e -> tpBillInvoiceMapper.selectByPrimaryKey(e.getTpBillInvoiceId()).getPayPrice()).sum();
171
 			orderMap.put("orderNo", orderNo);
172
 			orderMap.put("orderNo", orderNo);
172
 			orderMap.put("payPrice", String.valueOf(payPrice));
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
 		} else if (Constant.PAY_TYPE_CAR.equals(type)) { // 车缴费
176
 		} else if (Constant.PAY_TYPE_CAR.equals(type)) { // 车缴费
176
 			List<TaUserLicenseOrder> userLicenseOrders = taUserLicenseOrderMapper.selectByOrderNumber(orderNo);
177
 			List<TaUserLicenseOrder> userLicenseOrders = taUserLicenseOrderMapper.selectByOrderNumber(orderNo);
188
 			Long payPrice = userLicenseOrders.stream().map(e -> Long.parseLong(e.getExtensionPrice())).count();
189
 			Long payPrice = userLicenseOrders.stream().map(e -> Long.parseLong(e.getExtensionPrice())).count();
189
 			orderMap.put("orderNo", orderNo);
190
 			orderMap.put("orderNo", orderNo);
190
 			orderMap.put("payPrice", String.valueOf(payPrice));
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
 		return orderMap;
195
 		return orderMap;