浏览代码

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

魏超 5 年前
父节点
当前提交
8e3f2abb06

+ 6
- 0
src/main/java/com/huiju/estateagents/common/CommConstant.java 查看文件

473
      */
473
      */
474
     public static final String MESSAGE_CONTENT_OF_HOUSE = "house";
474
     public static final String MESSAGE_CONTENT_OF_HOUSE = "house";
475
 
475
 
476
+    /**
477
+     * 合同签订通知
478
+     * 必须存在表   td_miniapp_template_type 中
479
+     */
480
+    public static final String MESSAGE_CONTRACT_SIGNING = "contract-signing";
481
+
476
     /**
482
     /**
477
      * 活动以结束
483
      * 活动以结束
478
      */
484
      */

+ 1
- 1
src/main/java/com/huiju/estateagents/controller/TaHousingResourcesController.java 查看文件

267
             taRaiseQueryWrapper.eq("status", CommConstant.STATUS_NORMAL);
267
             taRaiseQueryWrapper.eq("status", CommConstant.STATUS_NORMAL);
268
             TaRaise taRaise = iTaRaiseService.getOne(taRaiseQueryWrapper);
268
             TaRaise taRaise = iTaRaiseService.getOne(taRaiseQueryWrapper);
269
 
269
 
270
-            if (CommConstant.STATUS_NORMAL == taRaise.getInvite()) {
270
+            if (null != taRaise && CommConstant.STATUS_NORMAL == taRaise.getInvite()) {
271
                 // 若开启邀请制,校验该用户是否在邀请列表中
271
                 // 若开启邀请制,校验该用户是否在邀请列表中
272
                 QueryWrapper<TaRaiseInvite> taRaiseInviteQueryWrapper = new QueryWrapper<>();
272
                 QueryWrapper<TaRaiseInvite> taRaiseInviteQueryWrapper = new QueryWrapper<>();
273
                 taRaiseInviteQueryWrapper.eq("org_id", orgId);
273
                 taRaiseInviteQueryWrapper.eq("org_id", orgId);

+ 25
- 0
src/main/java/com/huiju/estateagents/eContract/controller/TaCompanyController.java 查看文件

6
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
7
 import com.baomidou.mybatisplus.core.metadata.IPage;
7
 import com.baomidou.mybatisplus.core.metadata.IPage;
8
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
8
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
9
+import com.fadada.sdk.client.authForfadada.FindCertInfo;
9
 import com.huiju.estateagents.base.BaseController;
10
 import com.huiju.estateagents.base.BaseController;
10
 import com.huiju.estateagents.base.ResponseBean;
11
 import com.huiju.estateagents.base.ResponseBean;
11
 import com.huiju.estateagents.common.CommConstant;
12
 import com.huiju.estateagents.common.CommConstant;
434
                                   @RequestParam(value = "authenticationType",required = false) String authenticationType,
435
                                   @RequestParam(value = "authenticationType",required = false) String authenticationType,
435
                                   @RequestParam(value = "status",required = false) String status,
436
                                   @RequestParam(value = "status",required = false) String status,
436
                                   HttpServletRequest request) {
437
                                   HttpServletRequest request) {
438
+        Map<String, String[]> parameterMap = request.getParameterMap();
437
         logger.info("企业认证回调函数参数:交易号{},认证类型{},状态,{}, 人员名称{}",serialNo,authenticationType,status);
439
         logger.info("企业认证回调函数参数:交易号{},认证类型{},状态,{}, 人员名称{}",serialNo,authenticationType,status);
438
         //企业认证
440
         //企业认证
439
         if ("2".equals(authenticationType)){
441
         if ("2".equals(authenticationType)){
452
             taContractUserQueryWrapper.eq("certified_serial_number",serialNo);
454
             taContractUserQueryWrapper.eq("certified_serial_number",serialNo);
453
             TaContractUser taContractUser = iTaContractUserService.getOne(taContractUserQueryWrapper);
455
             TaContractUser taContractUser = iTaContractUserService.getOne(taContractUserQueryWrapper);
454
             taContractUser.setStatus(Integer.valueOf(status));
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
             taContractUser.setAuthStatus("autoSign");
480
             taContractUser.setAuthStatus("autoSign");
456
             iTaContractUserService.updateById(taContractUser);
481
             iTaContractUserService.updateById(taContractUser);
457
         }
482
         }

+ 22
- 0
src/main/java/com/huiju/estateagents/eContract/service/impl/TaCompanySealUtil.java 查看文件

134
 
134
 
135
         return HttpsUtil.doPost(fadadaProperties.getAuthServeHost() + "default_signature.api", params);
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
 }

+ 4
- 2
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractServiceImpl.java 查看文件

113
 
113
 
114
         //检查是否签署过本合同
114
         //检查是否签署过本合同
115
         QueryWrapper<TaContract> queryWrapper = new QueryWrapper<>();
115
         QueryWrapper<TaContract> queryWrapper = new QueryWrapper<>();
116
-        queryWrapper.eq("building_id",taRaiseRecord.getBuildingId());
116
+         queryWrapper.eq("building_id",taRaiseRecord.getBuildingId());
117
         queryWrapper.eq("org_id",taRaiseRecord.getOrgId());
117
         queryWrapper.eq("org_id",taRaiseRecord.getOrgId());
118
         queryWrapper.eq("target_type","raise");
118
         queryWrapper.eq("target_type","raise");
119
         queryWrapper.eq("target_id",Integer.valueOf(taRaiseRecord.getRaiseId()));
119
         queryWrapper.eq("target_id",Integer.valueOf(taRaiseRecord.getRaiseId()));
234
         req.setKeyword_strategy(taContractBusiness.getCustomerStrategy());
234
         req.setKeyword_strategy(taContractBusiness.getCustomerStrategy());
235
 
235
 
236
         req.setDoc_title(taContractBusiness.getContractTemplateName());
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
         String return_url=  fadadaProperties.getRedirectUrl() + "?appid=123&redirect="+ redirectUrl;
239
         String return_url=  fadadaProperties.getRedirectUrl() + "?appid=123&redirect="+ redirectUrl;
239
         req.setReturn_url(URLEncoder.encode(return_url, "utf-8"));
240
         req.setReturn_url(URLEncoder.encode(return_url, "utf-8"));
240
         req.setNotify_url(fadadaProperties.getSignNotify());
241
         req.setNotify_url(fadadaProperties.getSignNotify());
266
         }
267
         }
267
         taContract.setCustomerTime(LocalDateTime.now());
268
         taContract.setCustomerTime(LocalDateTime.now());
268
         taContractMapper.updateById(taContract);
269
         taContractMapper.updateById(taContract);
270
+
269
         return signUrl;
271
         return signUrl;
270
     }
272
     }
271
 
273
 

+ 3
- 3
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractUserServiceImpl.java 查看文件

92
         log.info("正在申请个人认证,客户编码是{}",jsonObject.getString("data"));
92
         log.info("正在申请个人认证,客户编码是{}",jsonObject.getString("data"));
93
         GetPersonVerifyUrl personverify = new GetPersonVerifyUrl(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
93
         GetPersonVerifyUrl personverify = new GetPersonVerifyUrl(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
94
         String customer_id = jsonObject.getString("data");
94
         String customer_id = jsonObject.getString("data");
95
-        //0:三要素标准方案; 1:三要素补充方案;
96
-        String verifyed_way = "1";
95
+        //0:三要素标准方案; 1:三要素补充方案 4 纯三要素方案
96
+        String verifyed_way = "4";
97
         String page_modify = "1";
97
         String page_modify = "1";
98
         String notify_url = fadadaProperties.getCompanyNotify();
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
         String return_url=  fadadaProperties.getAuthReturnUrl() + "?appid=123&redirect="+ redirectUrl;
100
         String return_url=  fadadaProperties.getAuthReturnUrl() + "?appid=123&redirect="+ redirectUrl;
101
         String customer_ident_type = "0";
101
         String customer_ident_type = "0";
102
         String personResult = personverify.invokePersonVerifyUrl(customer_id,verifyed_way,
102
         String personResult = personverify.invokePersonVerifyUrl(customer_id,verifyed_way,