Bläddra i källkod

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

魏超 5 år sedan
förälder
incheckning
28949c664f

+ 33
- 1
src/main/java/com/huiju/estateagents/controller/TaHousingResourcesController.java Visa fil

59
     @Autowired
59
     @Autowired
60
     public ITaSalesBatchService taSalesBatchService;
60
     public ITaSalesBatchService taSalesBatchService;
61
 
61
 
62
+    @Autowired
63
+    private ITaRaiseService iTaRaiseService;
64
+
65
+    @Autowired
66
+    ITaPersonService iTaPersonService;
67
+
68
+    @Autowired
69
+    private ITaRaiseInviteService iTaRaiseInviteService;
70
+
62
     /**
71
     /**
63
      * 分页查询列表
72
      * 分页查询列表
64
      *
73
      *
240
                                              HttpServletRequest request) {
249
                                              HttpServletRequest request) {
241
         ResponseBean responseBean = new ResponseBean();
250
         ResponseBean responseBean = new ResponseBean();
242
         Integer orgId = getOrgId(request);
251
         Integer orgId = getOrgId(request);
252
+        String openid = getOpenId(request);
243
         String personId = getPersonId(request);
253
         String personId = getPersonId(request);
244
-
254
+        List<TaPerson> persons = iTaPersonService.getPersonsByOpenId(openid);
255
+        if (null == persons || persons.size() == 0) {
256
+            return ResponseBean.error("当前账户信息异常, 清除缓存重试", ResponseBean.ERROR_UNAVAILABLE);
257
+        }
258
+        TaPerson person = persons.get(0);
245
         logger.info("TaHouseingResourcesController.listHousingResources 接收参数:orgId:{},salesBatchId:{},startPrice:{},endPrice:{},apartmentId:{},source:{}",
259
         logger.info("TaHouseingResourcesController.listHousingResources 接收参数:orgId:{},salesBatchId:{},startPrice:{},endPrice:{},apartmentId:{},source:{}",
246
                 orgId, salesBatchId, startPrice, endPrice, apartmentId, source);
260
                 orgId, salesBatchId, startPrice, endPrice, apartmentId, source);
247
 
261
 
248
         try {
262
         try {
263
+            // 查询批次下认筹是否开启邀请制
264
+            QueryWrapper<TaRaise> taRaiseQueryWrapper = new QueryWrapper<>();
265
+            taRaiseQueryWrapper.eq("org_id", orgId);
266
+            taRaiseQueryWrapper.eq("sales_batch_id", salesBatchId);
267
+            taRaiseQueryWrapper.eq("status", CommConstant.STATUS_NORMAL);
268
+            TaRaise taRaise = iTaRaiseService.getOne(taRaiseQueryWrapper);
269
+
270
+            if (CommConstant.STATUS_NORMAL == taRaise.getInvite()) {
271
+                // 若开启邀请制,校验该用户是否在邀请列表中
272
+                QueryWrapper<TaRaiseInvite> taRaiseInviteQueryWrapper = new QueryWrapper<>();
273
+                taRaiseInviteQueryWrapper.eq("org_id", orgId);
274
+                taRaiseInviteQueryWrapper.eq("invite_tel", person.getPhone());
275
+                taRaiseInviteQueryWrapper.eq("sales_batch_id", salesBatchId);
276
+                TaRaiseInvite taRaiseInvite = iTaRaiseInviteService.getOne(taRaiseInviteQueryWrapper);
277
+                if (null == taRaiseInvite) {
278
+                    return ResponseBean.error("仅限被邀请用户查看房源",ResponseBean.ERROR_ILLEGAL_PARAMS);
279
+                }
280
+            }
249
             //获取所有楼房的预选热度和认筹热度
281
             //获取所有楼房的预选热度和认筹热度
250
             List<TaHousingResourcesPO> taHousingResourcesPOList = iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId, personId, source);
282
             List<TaHousingResourcesPO> taHousingResourcesPOList = iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId, personId, source);
251
             //此处处理我的预选,我的认筹,和我的锁定
283
             //此处处理我的预选,我的认筹,和我的锁定

+ 6
- 0
src/main/java/com/huiju/estateagents/eContract/service/impl/TaCompanyServiceImpl.java Visa fil

201
             //企业法人、代理人信息
201
             //企业法人、代理人信息
202
             JSONObject managerJson = dataJson.getJSONObject("manager");
202
             JSONObject managerJson = dataJson.getJSONObject("manager");
203
             if (null != managerJson){
203
             if (null != managerJson){
204
+                //0:个人; 1:法人; 2:代理人,
205
+                if (managerJson.getString("type").equals("1")){
206
+                    taCompany.setCompanyManagerType("legal");
207
+                }else if (managerJson.getString("type").equals("2")){
208
+                    taCompany.setCompanyManagerType("agent");
209
+                }
204
                 taCompany.setUserName(managerJson.getString("personName"));
210
                 taCompany.setUserName(managerJson.getString("personName"));
205
                 taCompany.setTel(managerJson.getString("mobile"));
211
                 taCompany.setTel(managerJson.getString("mobile"));
206
                 taCompany.setIdCard(managerJson.getString("idCard"));
212
                 taCompany.setIdCard(managerJson.getString("idCard"));

+ 27
- 6
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractServiceImpl.java Visa fil

5
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.fadada.sdk.client.FddClientBase;
7
 import com.fadada.sdk.client.FddClientBase;
8
+import com.fadada.sdk.client.authForfadada.FindCertInfo;
8
 import com.fadada.sdk.client.request.ExtsignReq;
9
 import com.fadada.sdk.client.request.ExtsignReq;
9
 import com.fadada.sdk.test.util.ConfigUtil;
10
 import com.fadada.sdk.test.util.ConfigUtil;
10
 import com.fadada.sdk.util.http.HttpsUtil;
11
 import com.fadada.sdk.util.http.HttpsUtil;
147
         String result = base.invokeUploadDocs(taContract.getContractId().toString(), taContractBusiness.getContractTemplateName(), null, taContractBusiness.getContractTemplateAddress(), ".pdf");
148
         String result = base.invokeUploadDocs(taContract.getContractId().toString(), taContractBusiness.getContractTemplateName(), null, taContractBusiness.getContractTemplateAddress(), ".pdf");
148
         JSONObject jsonObject = JSONObject.parseObject(result);
149
         JSONObject jsonObject = JSONObject.parseObject(result);
149
         if (!jsonObject.getString("code").equals("1000")){
150
         if (!jsonObject.getString("code").equals("1000")){
151
+            taContractMapper.deleteById(taContract.getContractId());
150
             throw new Exception(jsonObject.getString("msg"));
152
             throw new Exception(jsonObject.getString("msg"));
151
         }
153
         }
152
 
154
 
232
         req.setKeyword_strategy(taContractBusiness.getCustomerStrategy());
234
         req.setKeyword_strategy(taContractBusiness.getCustomerStrategy());
233
 
235
 
234
         req.setDoc_title(taContractBusiness.getContractTemplateName());
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
         String return_url=  fadadaProperties.getRedirectUrl() + "?appid=123&redirect="+ redirectUrl;
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
         req.setNotify_url(fadadaProperties.getSignNotify());
240
         req.setNotify_url(fadadaProperties.getSignNotify());
239
         String signUrl = base.invokeExtSignDIY(req,"1","0");
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
         taContract.setCustomerTime(LocalDateTime.now());
267
         taContract.setCustomerTime(LocalDateTime.now());
247
         taContractMapper.updateById(taContract);
268
         taContractMapper.updateById(taContract);
248
         return signUrl;
269
         return signUrl;

+ 2
- 2
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractUserServiceImpl.java Visa fil

96
         String verifyed_way = "1";
96
         String verifyed_way = "1";
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 = URLEncoder.encode("/onlineSelling/pages/raiseMoney/Certification?id=" + taRaiseRecord.getRaiseRecordId(), "utf-8");
99
+        String redirectUrl = "/onlineSelling/pages/raiseMoney/Certification?id=" + taRaiseRecord.getRaiseRecordId();
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,
103
-                page_modify,notify_url,return_url,null,customer_ident_type,
103
+                page_modify,notify_url,URLEncoder.encode(return_url, "utf-8"),null,customer_ident_type,
104
                 taRaiseRecord.getIdcard(),taRaiseRecord.getTel(),null,"1","1");
104
                 taRaiseRecord.getIdcard(),taRaiseRecord.getTel(),null,"1","1");
105
 
105
 
106
         String data = JSON.parseObject(personResult).getString("data");
106
         String data = JSON.parseObject(personResult).getString("data");