Pārlūkot izejas kodu

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents into dev

魏超 5 gadus atpakaļ
vecāks
revīzija
e7ef6ef452

+ 1
- 0
src/main/java/com/huiju/estateagents/config/FadadaProperties.java Parādīt failu

@@ -18,4 +18,5 @@ public class FadadaProperties {
18 18
     private String authReturnUrl;
19 19
     private String authNotifyUrl;
20 20
     private String signNotify;
21
+    private String redirectUrl;
21 22
 }

+ 10
- 1
src/main/java/com/huiju/estateagents/eContract/controller/TaContractController.java Parādīt failu

@@ -1,10 +1,12 @@
1 1
 package com.huiju.estateagents.eContract.controller;
2 2
 
3 3
 import com.alibaba.fastjson.JSONObject;
4
+import com.fadada.sdk.client.FddClientBase;
4 5
 import com.huiju.estateagents.base.BaseController;
5 6
 import com.huiju.estateagents.base.ResponseBean;
6 7
 import com.huiju.estateagents.bo.request.ContractRecordRequestBO;
7 8
 import com.huiju.estateagents.common.CommonUtils;
9
+import com.huiju.estateagents.config.FadadaProperties;
8 10
 import com.huiju.estateagents.eContract.entity.TaContract;
9 11
 import com.huiju.estateagents.eContract.entity.TaContractUser;
10 12
 import com.huiju.estateagents.eContract.service.ITaContractService;
@@ -55,6 +57,9 @@ public class TaContractController extends BaseController {
55 57
     @Autowired
56 58
     public ITaPersonService taPersonService;
57 59
 
60
+    @Autowired
61
+    private FadadaProperties fadadaProperties;
62
+
58 63
     /**
59 64
      * 条件查询合同列表 -- admin端
60 65
      *
@@ -209,7 +214,11 @@ public class TaContractController extends BaseController {
209 214
                 taContract.setArchivesTime(LocalDateTime.now());
210 215
             }
211 216
             if (iTaContractService.updateById(taContract)) {
212
-                responseBean.addSuccess(taContract);
217
+                FddClientBase base = new FddClientBase(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
218
+                String contract_id = taContract.getContractId().toString();
219
+                String result = base.invokeContractFilling(contract_id);
220
+                logger.info("合同归档结果{}",result);
221
+                responseBean.addSuccess(iTaContractService.getById(taContract.getContractId()));
213 222
             } else {
214 223
                 responseBean.addError("fail");
215 224
             }

+ 9
- 3
src/main/java/com/huiju/estateagents/eContract/service/impl/TaCompanyServiceImpl.java Parādīt failu

@@ -117,7 +117,7 @@ public class TaCompanyServiceImpl extends ServiceImpl<TaCompanyMapper, TaCompany
117 117
          * 1:对公打款;
118 118
          * 2:纸质审核',
119 119
          */
120
-        String verifyed_way = "1";
120
+        String verifyed_way = "0";
121 121
         //是否允许客户页面修改1允许
122 122
         String page_modify = "1";
123 123
         String m_verified_way = "1";
@@ -178,8 +178,14 @@ public class TaCompanyServiceImpl extends ServiceImpl<TaCompanyMapper, TaCompany
178 178
                 taCompany.setStatus(companyJson.getInteger("status"));
179 179
                 taCompany.setReason(companyJson.getString("auditFailReason"));
180 180
 
181
-                DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.s");
182
-                taCompany.setVerifyTime(StringUtils.isEmpty(companyJson.getString("auditorTime")) ? null : LocalDateTime.parse(companyJson.getString("auditorTime"),df));
181
+                DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
182
+                String auditorTime = companyJson.getString("auditorTime");
183
+                if (!StringUtils.isEmpty(auditorTime)){
184
+                    int index = auditorTime.lastIndexOf(".");
185
+                    String substringTime = auditorTime.substring(0, index);
186
+                    taCompany.setVerifyTime(LocalDateTime.parse(substringTime,df));
187
+                }
188
+                taCompany.setVerifyTime(null);
183 189
             }
184 190
 
185 191
             //银行卡信息

+ 31
- 9
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractServiceImpl.java Parādīt failu

@@ -32,6 +32,7 @@ import org.springframework.stereotype.Service;
32 32
 import org.springframework.transaction.annotation.Transactional;
33 33
 
34 34
 import java.io.File;
35
+import java.net.URLEncoder;
35 36
 import java.time.LocalDate;
36 37
 import java.time.LocalDateTime;
37 38
 import java.util.Map;
@@ -121,6 +122,8 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
121 122
         queryWrapper.eq("person_id",person.getPersonId());
122 123
         TaContract oldContract = taContractMapper.selectOne(queryWrapper);
123 124
         if (null != oldContract){
125
+            oldContract.setContractDownloadUrl(getFddDownServerHost(person.getMiniappId(),oldContract.getContractDownloadUrl()));
126
+            oldContract.setContractViewUrl(getFddDownServerHost(person.getMiniappId(),oldContract.getContractViewUrl()));
124 127
             return oldContract;
125 128
         }
126 129
 
@@ -165,12 +168,15 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
165 168
         }
166 169
 
167 170
         //反更新合同地址
168
-        taContract.setContractDownloadUrl(autoSignResultJson.getString("download_url"));
169
-        taContract.setContractViewUrl(autoSignResultJson.getString("viewpdf_url"));
170
-        taContractMapper.updateById(taContract);
171
-
172
-        //企业名称
171
+        taContract.setContractDownloadUrl(getFddDownServerHost(person.getMiniappId(),autoSignResultJson.getString("download_url")));
172
+        taContract.setContractViewUrl(getFddDownServerHost(person.getMiniappId(),autoSignResultJson.getString("viewpdf_url")));
173
+        taContract.setContractName(taContractBusiness.getContractTemplateName());
174
+        //合同详情
173 175
         taContract.setCompanyName(taContractBusiness.getCompanyName());
176
+        taContract.setSignatoryName(taContractBusiness.getCompanyName());
177
+        taContract.setSignatoryTime(LocalDateTime.now());
178
+        taContract.setArchives(false);
179
+        taContractMapper.updateById(taContract);
174 180
         return taContract;
175 181
     }
176 182
 
@@ -178,12 +184,15 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
178 184
      * 替换法大大服务器地址
179 185
      * @return
180 186
      */
181
-    private String getFddServerHost(String miniappId,String subUrl) {
187
+    private String getFddDownServerHost(String miniappId,String subUrl) {
188
+        if (StringUtils.isEmpty(subUrl)){
189
+            return subUrl;
190
+        }
182 191
         TaMiniapp taMiniapp = taMiniappMapper.selectById(miniappId);
183 192
         int index = subUrl.indexOf("/");
184 193
         int twoIndex = subUrl.indexOf("/",index+1);
185 194
         int threeIndex = subUrl.indexOf("/",twoIndex+1);
186
-        String newUrl = StringUtils.isEmpty(taMiniapp.getFddServerHost()) ? subUrl : taMiniapp.getFddServerHost() + subUrl.substring(threeIndex);
195
+        String newUrl = StringUtils.isEmpty(taMiniapp.getFddDownloadHost()) ? subUrl : taMiniapp.getFddDownloadHost() + subUrl.substring(threeIndex);
187 196
         return newUrl;
188 197
     }
189 198
 
@@ -221,10 +230,21 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
221 230
         req.setContract_id(taContract.getContractId().toString());
222 231
         req.setSign_keyword(taContractBusiness.getCustomerKeywords());
223 232
         req.setKeyword_strategy(taContractBusiness.getCustomerStrategy());
233
+
224 234
         req.setDoc_title(taContractBusiness.getContractTemplateName());
225
-        req.setReturn_url("/onlineSelling/pages/raiseMoney/signResult");
235
+        String redirectUrl = URLEncoder.encode("/onlineSelling/pages/raiseMoney/signResult?id=" + taContract.getInvoiceTargetId(), "utf-8");
236
+        String return_url=  fadadaProperties.getRedirectUrl() + "?appid=123&redirect="+ redirectUrl;
237
+        req.setReturn_url(return_url);
226 238
         req.setNotify_url(fadadaProperties.getSignNotify());
227
-        String signUrl = base.invokeExtSign(req);
239
+        String signUrl = base.invokeExtSignDIY(req,"1","0");
240
+
241
+        //更新乙方数据
242
+        TaRaiseRecord taRaiseRecord = taRaiseRecordMapper.selectById(taContract.getInvoiceTargetId());
243
+        taContract.setCustomerName(taRaiseRecord.getUserName());
244
+        taContract.setCustomerTel(taRaiseRecord.getTel());
245
+        taContract.setCustomerIdcard(taRaiseRecord.getIdcard());
246
+        taContract.setCustomerTime(LocalDateTime.now());
247
+        taContractMapper.updateById(taContract);
228 248
         return signUrl;
229 249
     }
230 250
 
@@ -256,6 +276,8 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
256 276
         queryWrapper.eq("company_id",taContractBusiness.getCompanyId());
257 277
         queryWrapper.eq("person_id",person.getPersonId());
258 278
         TaContract oldContract = taContractMapper.selectOne(queryWrapper);
279
+        oldContract.setContractDownloadUrl(getFddDownServerHost(person.getMiniappId(),oldContract.getContractDownloadUrl()));
280
+        oldContract.setContractViewUrl(getFddDownServerHost(person.getMiniappId(),oldContract.getContractViewUrl()));
259 281
         return oldContract;
260 282
     }
261 283
 }

+ 3
- 2
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractUserServiceImpl.java Parādīt failu

@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
25 25
 import org.springframework.stereotype.Service;
26 26
 
27 27
 import java.io.File;
28
+import java.net.URLEncoder;
28 29
 import java.time.LocalDateTime;
29 30
 
30 31
 /**
@@ -87,7 +88,6 @@ public class TaContractUserServiceImpl extends ServiceImpl<TaContractUserMapper,
87 88
         newContractUser.setAuthStatus(CommConstant.CERTIFIED_STATUS_REGISTERED);
88 89
         newContractUser.setCreateDate(LocalDateTime.now());
89 90
         newContractUser.setOrgId(person.getOrgId());
90
-        newContractUser.setOrgId(CommConstant.STATUS_UNACCALIMED);
91 91
 
92 92
         log.info("正在申请个人认证,客户编码是{}",jsonObject.getString("data"));
93 93
         GetPersonVerifyUrl personverify = new GetPersonVerifyUrl(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
@@ -96,7 +96,8 @@ public class TaContractUserServiceImpl extends ServiceImpl<TaContractUserMapper,
96 96
         String verifyed_way = "1";
97 97
         String page_modify = "1";
98 98
         String notify_url = fadadaProperties.getCompanyNotify();
99
-        String return_url= "/onlineSelling/pages/raiseMoney/Certification?id=" + taRaiseRecord.getRaiseRecordId();
99
+        String redirectUrl = URLEncoder.encode("/onlineSelling/pages/raiseMoney/Certification?id=" + taRaiseRecord.getRaiseRecordId(), "utf-8");
100
+        String return_url=  fadadaProperties.getAuthReturnUrl() + "?appid=123&redirect="+ redirectUrl;
100 101
         String customer_ident_type = "0";
101 102
         String personResult = personverify.invokePersonVerifyUrl(customer_id,verifyed_way,
102 103
                 page_modify,notify_url,return_url,null,customer_ident_type,

+ 7
- 16
src/main/java/com/huiju/estateagents/service/impl/TaRaiseServiceImpl.java Parādīt failu

@@ -186,6 +186,11 @@ public class TaRaiseServiceImpl extends ServiceImpl<TaRaiseMapper, TaRaise> impl
186 186
         String[] inviteTelArr = StringUtils.isEmpty(taRaise.getInviteTel()) ?
187 187
                 new String[]{} : taRaise.getInviteTel().split("\n");
188 188
 
189
+        QueryWrapper<TaRaiseInvite> taRaiseInviteQueryWrapper = new QueryWrapper<>();
190
+        taRaiseInviteQueryWrapper.eq("org_id", orgId);
191
+        taRaiseInviteQueryWrapper.eq("raise_id", taRaise.getRaiseId());
192
+        taRaiseInviteService.remove(taRaiseInviteQueryWrapper);
193
+
189 194
         Arrays.asList(inviteTelArr).stream().distinct().forEach(record -> {
190 195
             TaRaiseInvite taRaiseInvite = new TaRaiseInvite();
191 196
             taRaiseInvite.setOrgId(orgId);
@@ -193,22 +198,8 @@ public class TaRaiseServiceImpl extends ServiceImpl<TaRaiseMapper, TaRaise> impl
193 198
             taRaiseInvite.setBuildingId(taRaise.getBuildingId());
194 199
             taRaiseInvite.setSalesBatchId(taRaise.getSalesBatchId());
195 200
             taRaiseInvite.setCreateDate(LocalDateTime.now());
196
-
197
-            // 为新增 直接增加,跳过重复添加数据校验
198
-            if (isAdd) {
199
-                taRaiseInvite.setInviteTel(record);
200
-                taRaiseInviteList.add(taRaiseInvite);
201
-            } else {
202
-                QueryWrapper<TaRaiseInvite> taRaiseInviteQueryWrapper = new QueryWrapper<>();
203
-                taRaiseInviteQueryWrapper.eq("org_id", orgId);
204
-                taRaiseInviteQueryWrapper.eq("raise_id", taRaise.getRaiseId());
205
-                taRaiseInviteQueryWrapper.eq("invite_tel", record);
206
-                TaRaiseInvite queryResult = taRaiseInviteService.getOne(taRaiseInviteQueryWrapper);
207
-                if (queryResult == null) {
208
-                    taRaiseInvite.setInviteTel(record);
209
-                    taRaiseInviteList.add(taRaiseInvite);
210
-                }
211
-            }
201
+            taRaiseInvite.setInviteTel(record);
202
+            taRaiseInviteList.add(taRaiseInvite);
212 203
         });
213 204
         return taRaiseInviteService.saveBatch(taRaiseInviteList);
214 205
     }

+ 1
- 0
src/main/resources/application-blue.yml Parādīt failu

@@ -89,3 +89,4 @@ fadada:
89 89
   authReturnUrl: "http://localhost:8000/#/eContract/seal/detail?id="
90 90
   authNotifyUrl: "https://dev.pawoma.cn/api/fadd/autoAuthCompanySeal"
91 91
   signNotify: "https://dev.pawoma.cn/api/fadd/sign"
92
+  redirectUrl: "https://dev.pawoma.cn/other/redirect.html"

+ 2
- 1
src/main/resources/application-green.yml Parādīt failu

@@ -86,6 +86,7 @@ fadada:
86 86
   authServeHost: "http://test.api.fabigbig.com:8888/api/"
87 87
   serveHost: "https://testapi08.fadada.com/api/"
88 88
   companyNotify: "https://dev.pawoma.cn/api/fadd/company"
89
-  authReturnUrl: "http://dev.pawoma.cn/#/eContract/seal/list"
89
+  authReturnUrl: "http://localhost:8000/#/eContract/seal/detail?id="
90 90
   authNotifyUrl: "https://dev.pawoma.cn/api/fadd/autoAuthCompanySeal"
91 91
   signNotify: "https://dev.pawoma.cn/api/fadd/sign"
92
+  redirectUrl: "https://dev.pawoma.cn/other/redirect.html"

+ 8
- 4
src/main/resources/application-prod-blue.yml Parādīt failu

@@ -85,9 +85,13 @@ pay-refund: https://lt.pawoma.cn/api/refund/
85 85
 
86 86
 #法大大服务器地址
87 87
 fadada:
88
-  appId: ""
89
-  appSecret: ""
88
+  appId: "403057"
89
+  appSecret: "xcIaK36Vc09yXXRdinXYcXhW"
90 90
   version: "2.0"
91
-  serveHost: "https://testapi.fadada.com:8443/api/"
91
+  authServeHost: "http://test.api.fabigbig.com:8888/api/"
92
+  serveHost: "https://testapi08.fadada.com/api/"
92 93
   companyNotify: "https://dev.pawoma.cn/api/fadd/company"
93
-  signNotify: "https://dev.pawoma.cn/api/fadd/sign"
94
+  authReturnUrl: "http://localhost:8000/#/eContract/seal/detail?id="
95
+  authNotifyUrl: "https://dev.pawoma.cn/api/fadd/autoAuthCompanySeal"
96
+  signNotify: "https://dev.pawoma.cn/api/fadd/sign"
97
+  redirectUrl: "https://dev.pawoma.cn/other/redirect.html"

+ 8
- 4
src/main/resources/application-prod-green.yml Parādīt failu

@@ -85,9 +85,13 @@ pay-refund: https://lt.pawoma.cn/api/refund/
85 85
 
86 86
 #法大大服务器地址
87 87
 fadada:
88
-  appId: ""
89
-  appSecret: ""
88
+  appId: "403057"
89
+  appSecret: "xcIaK36Vc09yXXRdinXYcXhW"
90 90
   version: "2.0"
91
-  serveHost: "https://testapi.fadada.com:8443/api/"
91
+  authServeHost: "http://test.api.fabigbig.com:8888/api/"
92
+  serveHost: "https://testapi08.fadada.com/api/"
92 93
   companyNotify: "https://dev.pawoma.cn/api/fadd/company"
93
-  signNotify: "https://dev.pawoma.cn/api/fadd/sign"
94
+  authReturnUrl: "http://localhost:8000/#/eContract/seal/detail?id="
95
+  authNotifyUrl: "https://dev.pawoma.cn/api/fadd/autoAuthCompanySeal"
96
+  signNotify: "https://dev.pawoma.cn/api/fadd/sign"
97
+  redirectUrl: "https://dev.pawoma.cn/other/redirect.html"