From bdcb64f0293f27e2dfb3de12a60f6e8412cb962b Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 26 五月 2022 01:45:22 +0800
Subject: [PATCH] 退费修改为 从证书地址中获取

---
 service-order/src/main/java/com/java110/order/smo/impl/AsynNotifySubServiceImpl.java |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/service-order/src/main/java/com/java110/order/smo/impl/AsynNotifySubServiceImpl.java b/service-order/src/main/java/com/java110/order/smo/impl/AsynNotifySubServiceImpl.java
index d385549..22630f5 100644
--- a/service-order/src/main/java/com/java110/order/smo/impl/AsynNotifySubServiceImpl.java
+++ b/service-order/src/main/java/com/java110/order/smo/impl/AsynNotifySubServiceImpl.java
@@ -3,6 +3,7 @@
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.client.RestTemplate;
+import com.java110.core.context.SecureInvocation;
 import com.java110.dto.businessDatabus.BusinessDatabusDto;
 import com.java110.dto.businessTableHis.BusinessTableHisDto;
 import com.java110.dto.order.OrderDto;
@@ -17,7 +18,7 @@
 import com.java110.utils.util.StringUtil;
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
@@ -89,7 +90,7 @@
         }
         List<BusinessDatabusDto> databusDtos = DatabusCache.getDatabuss();
 
-        if (!hasTypeCd(databusDtos, businesses)) {
+        if (!hasTypeCd(databusDtos, businesses) || !SecureInvocation.secure(this.getClass())) {
             return ;
         }
 
@@ -203,14 +204,19 @@
     private JSONArray generateBusinessInsertInsertSql(OrderItemDto orderItemDto, BusinessTableHisDto businessTableHisDto) {
         JSONArray params = new JSONArray();
         JSONObject param = null;
+        JSONObject updateParam = null;
         String sql = "";
+        String updateSql = "";
         String logText = orderItemDto.getLogText();
 
         JSONObject logTextObj = JSONObject.parseObject(logText);
         JSONArray afterValues = logTextObj.getJSONArray("afterValue");
         for (int afterValueIndex = 0; afterValueIndex < afterValues.size(); afterValueIndex++) {
             sql = "insert into " + businessTableHisDto.getActionObjHis() + " ";
+            updateSql = "update " + businessTableHisDto.getActionObj() +" set b_id='"+orderItemDto.getbId()+"' where 1=1 ";
+
             param = new JSONObject();
+            updateParam = new JSONObject();
             JSONObject keyValue = afterValues.getJSONObject(afterValueIndex);
             if (keyValue.isEmpty()) {
                 continue;
@@ -223,6 +229,8 @@
                 }
                 keySql += (key + ",");
                 valueSql += (keyValue.getString(key) + ",");
+
+                updateSql += (" and "+key +"=" + keyValue.getString(key));
             }
             keySql += "operate,b_id";
             valueSql += "'ADD','" + orderItemDto.getbId() + "'";
@@ -234,7 +242,9 @@
             }
             sql = sql + keySql + ") " + valueSql + ") ";
             param.put("fallBackSql", sql);
+            updateParam.put("fallBackSql", updateSql);
             params.add(param);
+            params.add(updateParam);
         }
 
         return params;

--
Gitblit v1.8.0