|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
5
|
5
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
6
|
6
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
7
|
7
|
import com.fadada.sdk.client.FddClientBase;
|
|
8
|
+import com.fadada.sdk.client.authForfadada.FindCertInfo;
|
8
|
9
|
import com.fadada.sdk.client.request.ExtsignReq;
|
9
|
10
|
import com.fadada.sdk.test.util.ConfigUtil;
|
10
|
11
|
import com.fadada.sdk.util.http.HttpsUtil;
|
|
@@ -147,6 +148,7 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
|
147
|
148
|
String result = base.invokeUploadDocs(taContract.getContractId().toString(), taContractBusiness.getContractTemplateName(), null, taContractBusiness.getContractTemplateAddress(), ".pdf");
|
148
|
149
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
149
|
150
|
if (!jsonObject.getString("code").equals("1000")){
|
|
151
|
+ taContractMapper.deleteById(taContract.getContractId());
|
150
|
152
|
throw new Exception(jsonObject.getString("msg"));
|
151
|
153
|
}
|
152
|
154
|
|
|
@@ -232,17 +234,36 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
|
232
|
234
|
req.setKeyword_strategy(taContractBusiness.getCustomerStrategy());
|
233
|
235
|
|
234
|
236
|
req.setDoc_title(taContractBusiness.getContractTemplateName());
|
235
|
|
- String redirectUrl = URLEncoder.encode("/onlineSelling/pages/raiseMoney/signResult?id=" + taContract.getInvoiceTargetId(), "utf-8");
|
|
237
|
+ String redirectUrl = "/onlineSelling/pages/raiseMoney/signResult?id=" + taContract.getInvoiceTargetId();
|
236
|
238
|
String return_url= fadadaProperties.getRedirectUrl() + "?appid=123&redirect="+ redirectUrl;
|
237
|
|
- req.setReturn_url(return_url);
|
|
239
|
+ req.setReturn_url(URLEncoder.encode(return_url, "utf-8"));
|
238
|
240
|
req.setNotify_url(fadadaProperties.getSignNotify());
|
239
|
241
|
String signUrl = base.invokeExtSignDIY(req,"1","0");
|
240
|
242
|
|
241
|
243
|
//更新乙方数据
|
242
|
|
- TaRaiseRecord taRaiseRecord = taRaiseRecordMapper.selectById(taContract.getInvoiceTargetId());
|
243
|
|
- taContract.setCustomerName(taRaiseRecord.getUserName());
|
244
|
|
- taContract.setCustomerTel(taRaiseRecord.getTel());
|
245
|
|
- taContract.setCustomerIdcard(taRaiseRecord.getIdcard());
|
|
244
|
+ //获取个人信息
|
|
245
|
+ log.info("个人正在从法大大获取最新数据,企业编号是 {}", taContractUser.getFadadaCode());
|
|
246
|
+ FindCertInfo personCertInfo = new FindCertInfo(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
|
|
247
|
+ String verified_serialno = taContractUser.getCertifiedSerialNumber();
|
|
248
|
+ String result = personCertInfo.invokeFindPersonCert(verified_serialno,
|
|
249
|
+ "1");
|
|
250
|
+ log.info("个人最新数据结果 {}",result);
|
|
251
|
+ JSONObject jsonObject = JSONObject.parseObject(result);
|
|
252
|
+ if (jsonObject.getInteger("code") != 1){
|
|
253
|
+ throw new Exception(jsonObject.getString("msg"));
|
|
254
|
+ }
|
|
255
|
+ //更新数据
|
|
256
|
+ String data = jsonObject.getString("data");
|
|
257
|
+ if (null !=data){
|
|
258
|
+ JSONObject dataJson = JSONObject.parseObject(data);
|
|
259
|
+ //个人信息
|
|
260
|
+ JSONObject personJson = dataJson.getJSONObject("person");
|
|
261
|
+ if (null != personJson){
|
|
262
|
+ taContract.setCustomerName(personJson.getString("personName"));
|
|
263
|
+ taContract.setCustomerTel(personJson.getString("mobile"));
|
|
264
|
+ taContract.setCustomerIdcard(personJson.getString("idCard"));
|
|
265
|
+ }
|
|
266
|
+ }
|
246
|
267
|
taContract.setCustomerTime(LocalDateTime.now());
|
247
|
268
|
taContractMapper.updateById(taContract);
|
248
|
269
|
return signUrl;
|