Browse Source

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

魏超 5 years ago
parent
commit
e7ef6ef452

+ 1
- 0
src/main/java/com/huiju/estateagents/config/FadadaProperties.java View File

18
     private String authReturnUrl;
18
     private String authReturnUrl;
19
     private String authNotifyUrl;
19
     private String authNotifyUrl;
20
     private String signNotify;
20
     private String signNotify;
21
+    private String redirectUrl;
21
 }
22
 }

+ 10
- 1
src/main/java/com/huiju/estateagents/eContract/controller/TaContractController.java View File

1
 package com.huiju.estateagents.eContract.controller;
1
 package com.huiju.estateagents.eContract.controller;
2
 
2
 
3
 import com.alibaba.fastjson.JSONObject;
3
 import com.alibaba.fastjson.JSONObject;
4
+import com.fadada.sdk.client.FddClientBase;
4
 import com.huiju.estateagents.base.BaseController;
5
 import com.huiju.estateagents.base.BaseController;
5
 import com.huiju.estateagents.base.ResponseBean;
6
 import com.huiju.estateagents.base.ResponseBean;
6
 import com.huiju.estateagents.bo.request.ContractRecordRequestBO;
7
 import com.huiju.estateagents.bo.request.ContractRecordRequestBO;
7
 import com.huiju.estateagents.common.CommonUtils;
8
 import com.huiju.estateagents.common.CommonUtils;
9
+import com.huiju.estateagents.config.FadadaProperties;
8
 import com.huiju.estateagents.eContract.entity.TaContract;
10
 import com.huiju.estateagents.eContract.entity.TaContract;
9
 import com.huiju.estateagents.eContract.entity.TaContractUser;
11
 import com.huiju.estateagents.eContract.entity.TaContractUser;
10
 import com.huiju.estateagents.eContract.service.ITaContractService;
12
 import com.huiju.estateagents.eContract.service.ITaContractService;
55
     @Autowired
57
     @Autowired
56
     public ITaPersonService taPersonService;
58
     public ITaPersonService taPersonService;
57
 
59
 
60
+    @Autowired
61
+    private FadadaProperties fadadaProperties;
62
+
58
     /**
63
     /**
59
      * 条件查询合同列表 -- admin端
64
      * 条件查询合同列表 -- admin端
60
      *
65
      *
209
                 taContract.setArchivesTime(LocalDateTime.now());
214
                 taContract.setArchivesTime(LocalDateTime.now());
210
             }
215
             }
211
             if (iTaContractService.updateById(taContract)) {
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
             } else {
222
             } else {
214
                 responseBean.addError("fail");
223
                 responseBean.addError("fail");
215
             }
224
             }

+ 9
- 3
src/main/java/com/huiju/estateagents/eContract/service/impl/TaCompanyServiceImpl.java View File

117
          * 1:对公打款;
117
          * 1:对公打款;
118
          * 2:纸质审核',
118
          * 2:纸质审核',
119
          */
119
          */
120
-        String verifyed_way = "1";
120
+        String verifyed_way = "0";
121
         //是否允许客户页面修改1允许
121
         //是否允许客户页面修改1允许
122
         String page_modify = "1";
122
         String page_modify = "1";
123
         String m_verified_way = "1";
123
         String m_verified_way = "1";
178
                 taCompany.setStatus(companyJson.getInteger("status"));
178
                 taCompany.setStatus(companyJson.getInteger("status"));
179
                 taCompany.setReason(companyJson.getString("auditFailReason"));
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 View File

32
 import org.springframework.transaction.annotation.Transactional;
32
 import org.springframework.transaction.annotation.Transactional;
33
 
33
 
34
 import java.io.File;
34
 import java.io.File;
35
+import java.net.URLEncoder;
35
 import java.time.LocalDate;
36
 import java.time.LocalDate;
36
 import java.time.LocalDateTime;
37
 import java.time.LocalDateTime;
37
 import java.util.Map;
38
 import java.util.Map;
121
         queryWrapper.eq("person_id",person.getPersonId());
122
         queryWrapper.eq("person_id",person.getPersonId());
122
         TaContract oldContract = taContractMapper.selectOne(queryWrapper);
123
         TaContract oldContract = taContractMapper.selectOne(queryWrapper);
123
         if (null != oldContract){
124
         if (null != oldContract){
125
+            oldContract.setContractDownloadUrl(getFddDownServerHost(person.getMiniappId(),oldContract.getContractDownloadUrl()));
126
+            oldContract.setContractViewUrl(getFddDownServerHost(person.getMiniappId(),oldContract.getContractViewUrl()));
124
             return oldContract;
127
             return oldContract;
125
         }
128
         }
126
 
129
 
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
         taContract.setCompanyName(taContractBusiness.getCompanyName());
175
         taContract.setCompanyName(taContractBusiness.getCompanyName());
176
+        taContract.setSignatoryName(taContractBusiness.getCompanyName());
177
+        taContract.setSignatoryTime(LocalDateTime.now());
178
+        taContract.setArchives(false);
179
+        taContractMapper.updateById(taContract);
174
         return taContract;
180
         return taContract;
175
     }
181
     }
176
 
182
 
178
      * 替换法大大服务器地址
184
      * 替换法大大服务器地址
179
      * @return
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
         TaMiniapp taMiniapp = taMiniappMapper.selectById(miniappId);
191
         TaMiniapp taMiniapp = taMiniappMapper.selectById(miniappId);
183
         int index = subUrl.indexOf("/");
192
         int index = subUrl.indexOf("/");
184
         int twoIndex = subUrl.indexOf("/",index+1);
193
         int twoIndex = subUrl.indexOf("/",index+1);
185
         int threeIndex = subUrl.indexOf("/",twoIndex+1);
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
         return newUrl;
196
         return newUrl;
188
     }
197
     }
189
 
198
 
221
         req.setContract_id(taContract.getContractId().toString());
230
         req.setContract_id(taContract.getContractId().toString());
222
         req.setSign_keyword(taContractBusiness.getCustomerKeywords());
231
         req.setSign_keyword(taContractBusiness.getCustomerKeywords());
223
         req.setKeyword_strategy(taContractBusiness.getCustomerStrategy());
232
         req.setKeyword_strategy(taContractBusiness.getCustomerStrategy());
233
+
224
         req.setDoc_title(taContractBusiness.getContractTemplateName());
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
         req.setNotify_url(fadadaProperties.getSignNotify());
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
         return signUrl;
248
         return signUrl;
229
     }
249
     }
230
 
250
 
256
         queryWrapper.eq("company_id",taContractBusiness.getCompanyId());
276
         queryWrapper.eq("company_id",taContractBusiness.getCompanyId());
257
         queryWrapper.eq("person_id",person.getPersonId());
277
         queryWrapper.eq("person_id",person.getPersonId());
258
         TaContract oldContract = taContractMapper.selectOne(queryWrapper);
278
         TaContract oldContract = taContractMapper.selectOne(queryWrapper);
279
+        oldContract.setContractDownloadUrl(getFddDownServerHost(person.getMiniappId(),oldContract.getContractDownloadUrl()));
280
+        oldContract.setContractViewUrl(getFddDownServerHost(person.getMiniappId(),oldContract.getContractViewUrl()));
259
         return oldContract;
281
         return oldContract;
260
     }
282
     }
261
 }
283
 }

+ 3
- 2
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractUserServiceImpl.java View File

25
 import org.springframework.stereotype.Service;
25
 import org.springframework.stereotype.Service;
26
 
26
 
27
 import java.io.File;
27
 import java.io.File;
28
+import java.net.URLEncoder;
28
 import java.time.LocalDateTime;
29
 import java.time.LocalDateTime;
29
 
30
 
30
 /**
31
 /**
87
         newContractUser.setAuthStatus(CommConstant.CERTIFIED_STATUS_REGISTERED);
88
         newContractUser.setAuthStatus(CommConstant.CERTIFIED_STATUS_REGISTERED);
88
         newContractUser.setCreateDate(LocalDateTime.now());
89
         newContractUser.setCreateDate(LocalDateTime.now());
89
         newContractUser.setOrgId(person.getOrgId());
90
         newContractUser.setOrgId(person.getOrgId());
90
-        newContractUser.setOrgId(CommConstant.STATUS_UNACCALIMED);
91
 
91
 
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());
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 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
         String customer_ident_type = "0";
101
         String customer_ident_type = "0";
101
         String personResult = personverify.invokePersonVerifyUrl(customer_id,verifyed_way,
102
         String personResult = personverify.invokePersonVerifyUrl(customer_id,verifyed_way,
102
                 page_modify,notify_url,return_url,null,customer_ident_type,
103
                 page_modify,notify_url,return_url,null,customer_ident_type,

+ 7
- 16
src/main/java/com/huiju/estateagents/service/impl/TaRaiseServiceImpl.java View File

186
         String[] inviteTelArr = StringUtils.isEmpty(taRaise.getInviteTel()) ?
186
         String[] inviteTelArr = StringUtils.isEmpty(taRaise.getInviteTel()) ?
187
                 new String[]{} : taRaise.getInviteTel().split("\n");
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
         Arrays.asList(inviteTelArr).stream().distinct().forEach(record -> {
194
         Arrays.asList(inviteTelArr).stream().distinct().forEach(record -> {
190
             TaRaiseInvite taRaiseInvite = new TaRaiseInvite();
195
             TaRaiseInvite taRaiseInvite = new TaRaiseInvite();
191
             taRaiseInvite.setOrgId(orgId);
196
             taRaiseInvite.setOrgId(orgId);
193
             taRaiseInvite.setBuildingId(taRaise.getBuildingId());
198
             taRaiseInvite.setBuildingId(taRaise.getBuildingId());
194
             taRaiseInvite.setSalesBatchId(taRaise.getSalesBatchId());
199
             taRaiseInvite.setSalesBatchId(taRaise.getSalesBatchId());
195
             taRaiseInvite.setCreateDate(LocalDateTime.now());
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
         return taRaiseInviteService.saveBatch(taRaiseInviteList);
204
         return taRaiseInviteService.saveBatch(taRaiseInviteList);
214
     }
205
     }

+ 1
- 0
src/main/resources/application-blue.yml View File

89
   authReturnUrl: "http://localhost:8000/#/eContract/seal/detail?id="
89
   authReturnUrl: "http://localhost:8000/#/eContract/seal/detail?id="
90
   authNotifyUrl: "https://dev.pawoma.cn/api/fadd/autoAuthCompanySeal"
90
   authNotifyUrl: "https://dev.pawoma.cn/api/fadd/autoAuthCompanySeal"
91
   signNotify: "https://dev.pawoma.cn/api/fadd/sign"
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 View File

86
   authServeHost: "http://test.api.fabigbig.com:8888/api/"
86
   authServeHost: "http://test.api.fabigbig.com:8888/api/"
87
   serveHost: "https://testapi08.fadada.com/api/"
87
   serveHost: "https://testapi08.fadada.com/api/"
88
   companyNotify: "https://dev.pawoma.cn/api/fadd/company"
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
   authNotifyUrl: "https://dev.pawoma.cn/api/fadd/autoAuthCompanySeal"
90
   authNotifyUrl: "https://dev.pawoma.cn/api/fadd/autoAuthCompanySeal"
91
   signNotify: "https://dev.pawoma.cn/api/fadd/sign"
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 View File

85
 
85
 
86
 #法大大服务器地址
86
 #法大大服务器地址
87
 fadada:
87
 fadada:
88
-  appId: ""
89
-  appSecret: ""
88
+  appId: "403057"
89
+  appSecret: "xcIaK36Vc09yXXRdinXYcXhW"
90
   version: "2.0"
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
   companyNotify: "https://dev.pawoma.cn/api/fadd/company"
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 View File

85
 
85
 
86
 #法大大服务器地址
86
 #法大大服务器地址
87
 fadada:
87
 fadada:
88
-  appId: ""
89
-  appSecret: ""
88
+  appId: "403057"
89
+  appSecret: "xcIaK36Vc09yXXRdinXYcXhW"
90
   version: "2.0"
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
   companyNotify: "https://dev.pawoma.cn/api/fadd/company"
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"