Selaa lähdekoodia

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

张延森 5 vuotta sitten
vanhempi
commit
2b31a65a2d

+ 25
- 0
src/main/java/com/huiju/estateagents/eContract/controller/TaCompanyController.java Näytä tiedosto

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.Query;
6 6
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
7 7
 import com.baomidou.mybatisplus.core.metadata.IPage;
8 8
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
9
+import com.fadada.sdk.client.authForfadada.FindCertInfo;
9 10
 import com.huiju.estateagents.base.BaseController;
10 11
 import com.huiju.estateagents.base.ResponseBean;
11 12
 import com.huiju.estateagents.common.CommConstant;
@@ -434,6 +435,7 @@ public class TaCompanyController extends BaseController {
434 435
                                   @RequestParam(value = "authenticationType",required = false) String authenticationType,
435 436
                                   @RequestParam(value = "status",required = false) String status,
436 437
                                   HttpServletRequest request) {
438
+        Map<String, String[]> parameterMap = request.getParameterMap();
437 439
         logger.info("企业认证回调函数参数:交易号{},认证类型{},状态,{}, 人员名称{}",serialNo,authenticationType,status);
438 440
         //企业认证
439 441
         if ("2".equals(authenticationType)){
@@ -452,6 +454,29 @@ public class TaCompanyController extends BaseController {
452 454
             taContractUserQueryWrapper.eq("certified_serial_number",serialNo);
453 455
             TaContractUser taContractUser = iTaContractUserService.getOne(taContractUserQueryWrapper);
454 456
             taContractUser.setStatus(Integer.valueOf(status));
457
+            //如果状态是失败的情况下就发送短信
458
+            if (status.equals("1")){
459
+                logger.info("发送短信");
460
+                //获取个人信息
461
+                logger.info("个人正在从法大大获取最新数据,企业编号是 {}", taContractUser.getFadadaCode());
462
+                FindCertInfo personCertInfo = new FindCertInfo(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
463
+                String verified_serialno = taContractUser.getCertifiedSerialNumber();
464
+                String result = personCertInfo.invokeFindPersonCert(verified_serialno,
465
+                        "1");
466
+                logger.info("个人最新数据结果 {}",result);
467
+                JSONObject jsonObject = JSONObject.parseObject(result);
468
+                //更新数据
469
+                String data = jsonObject.getString("data");
470
+                if (null !=data){
471
+                    JSONObject dataJson = JSONObject.parseObject(data);
472
+                    //个人信息
473
+                    JSONObject personJson = dataJson.getJSONObject("person");
474
+                    if (null != personJson){
475
+                        taCompanySealUtil.sendFddSms(taContractUser.getCertifiedAddress(),personJson.getString("mobile"));
476
+                    }
477
+                }
478
+
479
+            }
455 480
             taContractUser.setAuthStatus("autoSign");
456 481
             iTaContractUserService.updateById(taContractUser);
457 482
         }

+ 22
- 0
src/main/java/com/huiju/estateagents/eContract/service/impl/TaCompanySealUtil.java Näytä tiedosto

@@ -134,4 +134,26 @@ public class TaCompanySealUtil {
134 134
 
135 135
         return HttpsUtil.doPost(fadadaProperties.getAuthServeHost() + "default_signature.api", params);
136 136
     }
137
+
138
+    public String sendFddSms(String sourceUrl, String mobile){
139
+        ArrayList params = new ArrayList();
140
+
141
+        try {
142
+            String timeStamp = HttpsUtil.getTimeStamp();
143
+            String messageContent = "[${platform}]因小程序不支持人脸识别认证,请点击下面的链接开始人脸识别认证,认证通过后请回到小程序重新开始签署合同!${shortUrl}";
144
+            String sha1 = FddEncryptTool.sha1(fadadaProperties.getAppId() + FddEncryptTool.md5Digest(timeStamp) + FddEncryptTool.sha1(fadadaProperties.getAppSecret() + "10080" + messageContent + "2" + mobile + "2" + sourceUrl));
145
+            String msgDigest = new String(FddEncryptTool.Base64Encode(sha1.getBytes()));
146
+            params.add(new BasicNameValuePair("source_url", sourceUrl));
147
+            params.add(new BasicNameValuePair("expire_time", "10080"));
148
+            params.add(new BasicNameValuePair("mobile", mobile));
149
+            params.add(new BasicNameValuePair("message_type", "2"));
150
+            params.add(new BasicNameValuePair("message_content", messageContent));
151
+            params.add(new BasicNameValuePair("sms_template_type", "2"));
152
+        } catch (Exception var7) {
153
+            var7.printStackTrace();
154
+            throw new RuntimeException(var7);
155
+        }
156
+
157
+        return HttpsUtil.doPost(fadadaProperties.getAuthServeHost() + "push_short_url_sms.api", params);
158
+    }
137 159
 }

+ 3
- 2
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractServiceImpl.java Näytä tiedosto

@@ -113,7 +113,7 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
113 113
 
114 114
         //检查是否签署过本合同
115 115
         QueryWrapper<TaContract> queryWrapper = new QueryWrapper<>();
116
-        queryWrapper.eq("building_id",taRaiseRecord.getBuildingId());
116
+         queryWrapper.eq("building_id",taRaiseRecord.getBuildingId());
117 117
         queryWrapper.eq("org_id",taRaiseRecord.getOrgId());
118 118
         queryWrapper.eq("target_type","raise");
119 119
         queryWrapper.eq("target_id",Integer.valueOf(taRaiseRecord.getRaiseId()));
@@ -234,7 +234,8 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
234 234
         req.setKeyword_strategy(taContractBusiness.getCustomerStrategy());
235 235
 
236 236
         req.setDoc_title(taContractBusiness.getContractTemplateName());
237
-        String redirectUrl = "/onlineSelling/pages/raiseMoney/signResult?id=" + taContract.getInvoiceTargetId();
237
+        String redirectUrl = URLEncoder.encode(URLEncoder.encode(
238
+                "/onlineSelling/pages/raiseMoney/signResult?id=" + taContract.getInvoiceTargetId(), "utf-8"), "utf-8");
238 239
         String return_url=  fadadaProperties.getRedirectUrl() + "?appid=123&redirect="+ redirectUrl;
239 240
         req.setReturn_url(URLEncoder.encode(return_url, "utf-8"));
240 241
         req.setNotify_url(fadadaProperties.getSignNotify());

+ 1
- 1
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractUserServiceImpl.java Näytä tiedosto

@@ -96,7 +96,7 @@ 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 redirectUrl = "/onlineSelling/pages/raiseMoney/Certification?id=" + taRaiseRecord.getRaiseRecordId();
99
+        String redirectUrl = URLEncoder.encode(URLEncoder.encode("/onlineSelling/pages/raiseMoney/Certification?id=" + taRaiseRecord.getRaiseRecordId(), "utf-8"), "utf-8");
100 100
         String return_url=  fadadaProperties.getAuthReturnUrl() + "?appid=123&redirect="+ redirectUrl;
101 101
         String customer_ident_type = "0";
102 102
         String personResult = personverify.invokePersonVerifyUrl(customer_id,verifyed_way,