From c3b5bbea29386128bb09da0978fb70da0b5dce39 Mon Sep 17 00:00:00 2001
From: xiaogang <905166056@qq.com>
Date: 星期六, 13 三月 2021 17:31:10 +0800
Subject: [PATCH] 1、优化发布广告2、优化字母车位3、优化小区联系方式

---
 service-front/src/main/java/com/java110/front/smo/payment/adapt/fuiouPay/FuiouOweFeeToNotifyAdapt.java |   33 ++++++++++++++++++++++++++-------
 1 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/service-front/src/main/java/com/java110/front/smo/payment/adapt/fuiouPay/FuiouOweFeeToNotifyAdapt.java b/service-front/src/main/java/com/java110/front/smo/payment/adapt/fuiouPay/FuiouOweFeeToNotifyAdapt.java
index 743639f..3acd2f9 100644
--- a/service-front/src/main/java/com/java110/front/smo/payment/adapt/fuiouPay/FuiouOweFeeToNotifyAdapt.java
+++ b/service-front/src/main/java/com/java110/front/smo/payment/adapt/fuiouPay/FuiouOweFeeToNotifyAdapt.java
@@ -21,7 +21,7 @@
 import com.java110.dto.fee.FeeDto;
 import com.java110.dto.smallWeChat.SmallWeChatDto;
 import com.java110.front.properties.WechatAuthProperties;
-import com.java110.front.smo.payment.adapt.IPayNotifyAdapt;
+import com.java110.front.smo.payment.adapt.IOweFeeToNotifyAdapt;
 import com.java110.utils.cache.CommonCache;
 import com.java110.utils.constant.CommonConstant;
 import com.java110.utils.constant.ServiceConstant;
@@ -58,7 +58,7 @@
  */
 
 @Component(value = "fuiouOweFeeToNotifyAdapt")
-public class FuiouOweFeeToNotifyAdapt implements IPayNotifyAdapt {
+public class FuiouOweFeeToNotifyAdapt implements IOweFeeToNotifyAdapt {
 
     private static final Logger logger = LoggerFactory.getLogger(FuiouOweFeeToNotifyAdapt.class);
 
@@ -77,7 +77,7 @@
      * @return
      * @throws Exception
      */
-    public String confirmPayFee(String param) {
+    public String confirmPayFee(String param, String wId) {
         JSONObject resJson = new JSONObject();
         resJson.put("result_code", "010002");
         resJson.put("result_msg", "澶辫触");
@@ -87,7 +87,7 @@
             String resultCode = map.getString("result_code");
             if ("000000".equals(resultCode)) {
                 //鏇存柊鏁版嵁
-                int result = confirmPayFee(map);
+                int result = confirmPayFee(map, wId);
                 if (result > 0) {
                     //鏀粯鎴愬姛
                     resJson.put("result_code", "000000");
@@ -103,8 +103,7 @@
     }
 
 
-    public int confirmPayFee(JSONObject map) {
-        String wId = map.get("wId").toString();
+    public int confirmPayFee(JSONObject map, String wId) {
         wId = wId.replace(" ", "+");
         ResponseEntity<String> responseEntity = null;
 
@@ -133,7 +132,8 @@
         //鏌ヨ鐢ㄦ埛ID
         JSONObject paramIn = JSONObject.parseObject(order);
         paramIn.put("oId", orderId);
-        String url = ServiceConstant.SERVICE_API_URL + "/api/feeApi/payOweFee";
+        freshFees(paramIn);
+        String url = ServiceConstant.SERVICE_API_URL + "/api/fee.payOweFee";
         responseEntity = this.callCenterService(restTemplate, "-1", paramIn.toJSONString(), url, HttpMethod.POST);
 
         if (responseEntity.getStatusCode() != HttpStatus.OK) {
@@ -143,6 +143,25 @@
     }
 
 
+    private void freshFees(JSONObject paramIn) {
+        if (!paramIn.containsKey("fees")) {
+            return;
+        }
+
+        JSONArray fees = paramIn.getJSONArray("fees");
+        JSONObject fee = null;
+        for (int feeIndex = 0; feeIndex < fees.size(); feeIndex++) {
+            fee = fees.getJSONObject(feeIndex);
+            if (fee.containsKey("deadlineTime")) {
+                fee.put("startTime", fee.getString("endTime"));
+                fee.put("endTime", fee.getString("deadlineTime"));
+                fee.put("receivedAmount", fee.getString("feePrice"));
+                fee.put("state", "");
+            }
+        }
+    }
+
+
     /**
      * 璋冪敤涓績鏈嶅姟
      *

--
Gitblit v1.8.0