From 50fb58286ed3b718c39a97e0987ee7561a295651 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 04 七月 2025 17:56:41 +0800
Subject: [PATCH] git ch

---
 server/service/src/main/java/com/doumee/service/business/third/SignService.java |   98 ++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 92 insertions(+), 6 deletions(-)

diff --git a/server/service/src/main/java/com/doumee/service/business/third/SignService.java b/server/service/src/main/java/com/doumee/service/business/third/SignService.java
index 73596b0..81e40c6 100644
--- a/server/service/src/main/java/com/doumee/service/business/third/SignService.java
+++ b/server/service/src/main/java/com/doumee/service/business/third/SignService.java
@@ -15,6 +15,7 @@
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.PostConstruct;
@@ -53,6 +54,8 @@
     private static String SERVICE_URL="https://api.sandbox.junziqian.com";
     private static  String APP_KEY="dcb4bd535a09df3c";
     private static  String APP_SECRET="b87c346edcb4bd535a09df3ca8c45d9a";
+    @Value("${debug_model}")
+    private Boolean debugModel;
 
     @Autowired
     private SystemDictDataBiz systemDictDataBiz;
@@ -259,7 +262,31 @@
      * @param email
      * @param postionJson
      */
+    public String applySignWidthQifengSet(String name,String fileUrl,String fullname,String creditCoe,String email,String postionJson,String singId,String notifyUrl,Float qifengSet){
+      return  applySignDoByParam(name,fileUrl,fullname,creditCoe,email,postionJson,singId,notifyUrl,qifengSet);
+    }
+    /**
+     * 鍙戣捣绛剧害
+     * @param name
+     * @param fileUrl
+     * @param fullname
+     * @param creditCoe
+     * @param email
+     * @param postionJson
+     */
     public String applySign(String name,String fileUrl,String fullname,String creditCoe,String email,String postionJson,String singId,String notifyUrl){
+      return  applySignDoByParam(name,fileUrl,fullname,creditCoe,email,postionJson,singId,notifyUrl,null);
+    }
+    /**
+     * 鍙戣捣绛剧害
+     * @param name
+     * @param fileUrl
+     * @param fullname
+     * @param creditCoe
+     * @param email
+     * @param postionJson
+     */
+    public String applySignDoByParam(String name,String fileUrl,String fullname,String creditCoe,String email,String postionJson,String singId,String notifyUrl,Float qifengSet){
       try {
           initParams();
           String url=SERVICE_URL+"/v2/sign/applySign";
@@ -285,6 +312,7 @@
 //          sReq.setSearchKey(postionJson);//鍏抽敭瀛� 瀵瑰簲positionType=2
           sReq.setSignId(singId);
           sReq.setNoNeedVerify(1);
+          sReq.setQiFengOffset(qifengSet);
           signatories.add(sReq);
           params.put("signatories",signatories.toJSONString());
           System.out.println("================"+JSONObject.toJSONString(params));
@@ -296,7 +324,7 @@
               return  json.getString("data");
           }
       }catch (Exception e){
-
+          e.printStackTrace();
       }
       return null;
 
@@ -304,7 +332,6 @@
     /**
      * 鍙戣捣绛剧害
      * @param name
-     * @param fileUrl
      * @param file
      * @param creditCoe
      * @param email
@@ -318,7 +345,7 @@
           params.put("serverCa",1); //浣跨敤浜戣瘉涔�
           params.put("file",new File(file));
           params.put("dealType",5); //鎸囧畾鍚堝悓鏂囦欢绛剧讲鏂瑰紡 5 涓洪儴鍒嗚嚜鍔ㄧ
-          params.put("positionType",2); //鎸囧畾閫氳繃琛ㄥ崟鍩熸柟寮忚缃瀛椾綅缃�
+          params.put("positionType",0); //鎸囧畾閫氳繃琛ㄥ崟鍩熸柟寮忚缃瀛椾綅缃�
           params.put("fileType",0);
           params.put("needQifengSign",1);
           params.put("notifyUrl",notifyUrl);
@@ -330,7 +357,7 @@
           sReq.setEmail(email); //鍦ㄥ悰瀛愮娉ㄥ唽璁よ瘉鐨勯偖绠�
 //        sReq.setChapteJson("[{\"page\":0,\"chaptes\":[{\"offsetX\":0.12,\"offsetY\":0.23}]},{\"page\":1,\"chaptes\":[{\"offsetX\":0.45,\"offsetY\":0.67}]}]");
 //          sReq.setChapteJson(postionJson);
-          sReq.setSearchKey(postionJson);
+//          sReq.setSearchKey(postionJson);
           sReq.setSignId(singId);
           sReq.setSearchConvertExtend("{\"fixX\":-80,\"fixY\":-80}");
           sReq.setNoNeedVerify(1);
@@ -345,9 +372,61 @@
               return  json.getString("data");
           }
       }catch (Exception e){
+          e.printStackTrace();
 
       }
       return null;
+
+    }
+
+    /**
+     * 鍙戣捣绛剧害
+     * @param name
+     * @param file
+     * @param creditCoe
+     * @param email
+     * @param postionJson
+     */
+    public String applySignLocalFileByParam(String name,String fullname,String file,String creditCoe,String email,String postionJson,String singId,String notifyUrl,Float qifengSet){
+        try {    initParams();
+            String url=SERVICE_URL+"/v2/sign/applySign";
+            Map<String, Object>  params=bodyParams;
+            params.put("contractName",name); //鍚堝悓鍚嶇О
+            params.put("serverCa",1); //浣跨敤浜戣瘉涔�
+            params.put("file",new File(file));
+            params.put("dealType",5); //鎸囧畾鍚堝悓鏂囦欢绛剧讲鏂瑰紡 5 涓洪儴鍒嗚嚜鍔ㄧ
+            params.put("positionType",0); //鎸囧畾閫氳繃琛ㄥ崟鍩熸柟寮忚缃瀛椾綅缃�
+            params.put("fileType",0);
+            params.put("needQifengSign",1);
+            params.put("notifyUrl",notifyUrl);
+            JSONArray signatories=new JSONArray();
+            SignatoryReq sReq=new SignatoryReq();
+            sReq.setFullName(fullname); //浼佷笟濮撳悕
+            sReq.setIdentityType(11); //璇佷欢绫诲瀷
+            sReq.setIdentityCard(creditCoe);//钀ヤ笟鎵х収鍙�
+            sReq.setEmail(email); //鍦ㄥ悰瀛愮娉ㄥ唽璁よ瘉鐨勯偖绠�
+//        sReq.setChapteJson("[{\"page\":0,\"chaptes\":[{\"offsetX\":0.12,\"offsetY\":0.23}]},{\"page\":1,\"chaptes\":[{\"offsetX\":0.45,\"offsetY\":0.67}]}]");
+//          sReq.setChapteJson(postionJson);
+//          sReq.setSearchKey(postionJson);
+            sReq.setSignId(singId);
+            sReq.setQiFengOffset(qifengSet);
+            sReq.setSearchConvertExtend("{\"fixX\":-80,\"fixY\":-80}");
+            sReq.setNoNeedVerify(1);
+            signatories.add(sReq);
+            params.put("signatories",signatories.toJSONString());
+            System.out.println(signatories.toJSONString());
+            String str= HttpClientUtils.init().getPost(url,null,params,true);
+            System.out.println(str);
+            saveInterfaceLog(url,"銆愮數瀛愮銆戝彂璧风绾�",JSONObject.toJSONString(params),str);
+            JSONObject json = JSONObject.parseObject(str);
+            if(json!=null && json.getBoolean("success")){
+                return  json.getString("data");
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+
+        }
+        return null;
 
     }
 
@@ -359,7 +438,10 @@
      * @param creditCode
      */
     public String signLink(String applyNo,String name,String creditCode) {
-        try {    initParams();
+        try {
+            //寤惰繜2绉�
+//            Thread.sleep(2*1000);
+            initParams();
             Map<String, Object> params = bodyParams;
             String url = SERVICE_URL + "/v2/sign/link";
             params.put("applyNo",applyNo); //鍙戣捣鍚堝悓绛剧讲鎺ュ彛杩斿洖鐨凙PL缂栧彿
@@ -371,7 +453,11 @@
             saveInterfaceLog(url,"銆愮數瀛愮銆戣幏鍙栫缃查摼鎺ュ湴鍧�",JSONObject.toJSONString(params),str);
             JSONObject json = JSONObject.parseObject(str);
             if(json!=null && json.getBoolean("success")){
-                return  json.getString("data");
+                String link =json.getString("data");
+                if(!debugModel){
+                    link = link.replace("https://h5","https://h7");
+                }
+                return link;
             }
         }catch (Exception e){
             e.printStackTrace();

--
Gitblit v1.9.3