Explorar el Código

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

魏超 hace 5 años
padre
commit
00ad462b2e

+ 22
- 14
pom.xml Ver fichero

@@ -10,7 +10,7 @@
10 10
 	</parent>
11 11
 	<groupId>com.huiju</groupId>
12 12
 	<artifactId>estateagents</artifactId>
13
-	<version>v3.5.18</version>
13
+	<version>v3.5.19</version>
14 14
 	<name>estateages</name>
15 15
 	<description>置业经纪人</description>
16 16
 
@@ -174,17 +174,25 @@
174 174
 			</plugin>
175 175
 		</plugins>
176 176
 		<resources>
177
-			<resource>
178
-				<directory>src/main/resources</directory>
179
-				<filtering>true</filtering>
180
-				<includes>
181
-					<include>application.yml</include>
182
-					<include>application-${profiles.active}.yml</include>
183
-					<include>mapper/**/*.xml</include>
184
-					<include>log/*.xml</include>
185
-				</includes>
186
-			</resource>
187
-		</resources>
188
-	</build>
177
+				<resource>
178
+					<directory>${basedir}/src/main/resources/lib</directory>
179
+					<targetPath>BOOT-INF/lib/</targetPath>
180
+					<includes>
181
+						<include>**/*.jar</include>
182
+					</includes>
183
+				</resource>
184
+                <resource>
185
+                    <directory>src/main/resources</directory>
186
+                    <filtering>true</filtering>
187
+                    <includes>
188
+                        <include>application.yml</include>
189
+                        <include>application-${profiles.active}.yml</include>
190
+                        <include>mapper/**/*.xml</include>
191
+                        <include>log/*.xml</include>
192
+                        <include>lib/*.jar</include>
193
+                    </includes>
194
+                </resource>
195
+            </resources>
196
+        </build>
189 197
 
190
-</project>
198
+    </project>

+ 5
- 0
src/main/java/com/huiju/estateagents/common/CommConstant.java Ver fichero

@@ -801,4 +801,9 @@ public class CommConstant {
801 801
     public static final String AUTO_AUTH_STATUS = "3000";
802 802
 
803 803
     public static final String  AUTH_SUCCESS_DESC = "签章成功";
804
+
805
+    /**
806
+     * 审核通过
807
+     */
808
+    public static final Integer STATUS_VERIFY_PASS = 4;
804 809
 }

+ 20
- 7
src/main/java/com/huiju/estateagents/eContract/controller/TaCompanyController.java Ver fichero

@@ -99,7 +99,7 @@ public class TaCompanyController extends BaseController {
99 99
             queryWrapper.like(StringUtils.isNotBlank(companyName), "company_name", companyName);
100 100
             queryWrapper.like(StringUtils.isNotBlank(companyCode), "company_code", companyCode);
101 101
             queryWrapper.eq(StringUtils.isNotBlank(certifiedStatus), "certified_status", certifiedStatus);
102
-            queryWrapper.eq("status", 2);
102
+            queryWrapper.eq("status", 4);
103 103
             queryWrapper.orderByDesc("create_date");
104 104
 
105 105
             IPage<TaCompany> result = iTaCompanyService.page(pg, queryWrapper);
@@ -299,7 +299,7 @@ public class TaCompanyController extends BaseController {
299 299
                                        @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
300 300
                                        @RequestParam(value = "companyName", required = false) String companyName,
301 301
                                        @RequestParam(value = "companyCode", required = false) String companyCode,
302
-                                       @RequestParam(value = "certifiedStatus", required = false) String status) {
302
+                                       @RequestParam(value = "status", required = false) String status) {
303 303
         ResponseBean responseBean = new ResponseBean();
304 304
         try {
305 305
             //使用分页插件
@@ -409,7 +409,7 @@ public class TaCompanyController extends BaseController {
409 409
             JSONArray jsonArray = JSONObject.parseObject(ids).getJSONArray("ids");
410 410
             for (Object id : jsonArray) {
411 411
                 TaCompany company = iTaCompanyService.getById((Integer) id);
412
-                if (CommConstant.STATUS_UNACCALIMED.equals(company.getStatus())){
412
+                if (!CommConstant.STATUS_VERIFY_PASS.equals(company.getStatus())){
413 413
                     company.setStatus(CommConstant.STATUS_DELETE);
414 414
                     iTaCompanyService.updateById(company);
415 415
                     successNum++;
@@ -522,10 +522,23 @@ public class TaCompanyController extends BaseController {
522 522
                                   @RequestParam(value = "msg_digest",required = false) String msg_digest,
523 523
                                   HttpServletRequest request) {
524 524
         logger.info("企业认证回调函数参数:交易号 {},合同编号 {},签章结果代码 {},签章结果描述 ,{}, 下载地址{}, 查看地址 {},请求时间 {}, 摘要 {} ",transaction_id,contract_id,result_code,result_desc,download_url,viewpdf_url,timestamp,msg_digest);
525
-        TaContract taContract = iTaContractService.getById(contract_id);
526
-        taContract.setContractDownloadUrl(download_url);
527
-        taContract.setContractViewUrl(viewpdf_url);
528
-        iTaContractService.updateById(taContract);
525
+        Map<String, String[]> parameterMap = request.getParameterMap();
526
+        if ("3000".equals(result_code)){
527
+            TaContract taContract = iTaContractService.getById(parameterMap.get("contract_id")[0]);
528
+            taContract.setContractDownloadUrl(download_url);
529
+            taContract.setContractViewUrl(viewpdf_url);
530
+            taContract.setStatus(CommConstant.STATUS_NORMAL);
531
+            taContract.setReason(parameterMap.get("result_desc")[0]);
532
+            iTaContractService.updateById(taContract);
533
+        }else{
534
+            TaContract taContract = iTaContractService.getById(parameterMap.get("contract_id")[0]);
535
+            taContract.setContractDownloadUrl(download_url);
536
+            taContract.setContractViewUrl(viewpdf_url);
537
+            //签署失败
538
+            taContract.setStatus(2);
539
+            taContract.setReason(parameterMap.get("result_desc")[0]);
540
+            iTaContractService.updateById(taContract);
541
+        }
529 542
     }
530 543
 
531 544
     /**

+ 22
- 0
src/main/java/com/huiju/estateagents/eContract/controller/TaContractController.java Ver fichero

@@ -297,4 +297,26 @@ public class TaContractController extends BaseController {
297 297
     }
298 298
 
299 299
 
300
+    /**
301
+     * 自动签署合同
302
+     */
303
+    @RequestMapping(value = "/wx/contract/check", method = RequestMethod.POST)
304
+    public ResponseBean checkContract(@RequestBody TaRaiseRecord taRaiseRecord, HttpServletRequest request) {
305
+        ResponseBean responseBean = new ResponseBean();
306
+        try {
307
+            String openid = getOpenId(request);
308
+            List<TaPerson> taPersons = taPersonService.getPersonsByOpenId(openid);
309
+            if (null == taPersons || taPersons.size() != 1) {
310
+                return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
311
+            }
312
+            TaPerson person = taPersons.get(0);
313
+            TaContract taContract = iTaContractService.checkContract(taRaiseRecord, person);
314
+            responseBean.addSuccess(taContract);
315
+        } catch (Exception e) {
316
+            e.printStackTrace();
317
+            logger.error("taCompanyList -=- {}", e.toString());
318
+            responseBean.addError(e.getMessage());
319
+        }
320
+        return responseBean;
321
+    }
300 322
 }

+ 5
- 1
src/main/java/com/huiju/estateagents/eContract/controller/TaContractUserController.java Ver fichero

@@ -11,6 +11,7 @@ import com.huiju.estateagents.eContract.service.ITaContractUserService;
11 11
 import com.huiju.estateagents.entity.TaPerson;
12 12
 import com.huiju.estateagents.entity.TaRaiseRecord;
13 13
 import com.huiju.estateagents.service.ITaPersonService;
14
+import com.huiju.estateagents.service.ITaRaiseRecordService;
14 15
 import org.slf4j.Logger;
15 16
 import org.slf4j.LoggerFactory;
16 17
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,6 +41,9 @@ public class TaContractUserController extends BaseController {
40 41
     @Autowired
41 42
     public ITaPersonService taPersonService;
42 43
 
44
+    @Autowired
45
+    private ITaRaiseRecordService taRaiseRecordService;
46
+
43 47
     /**
44 48
      * 分页查询列表
45 49
      * @param pageNum
@@ -166,7 +170,7 @@ public class TaContractUserController extends BaseController {
166 170
                 return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
167 171
             }
168 172
             TaPerson person = taPersons.get(0);
169
-            TaContractUser taContractUser = iTaContractUserService.newFirstCustomerInfo(person,taRaiseRecord);
173
+            TaContractUser taContractUser = iTaContractUserService.newFirstCustomerInfo(person,taRaiseRecordService.getById(taRaiseRecord.getRaiseRecordId()));
170 174
             responseBean.addSuccess(taContractUser);
171 175
         } catch (Exception e) {
172 176
             e.printStackTrace();

+ 5
- 0
src/main/java/com/huiju/estateagents/eContract/entity/TaContract.java Ver fichero

@@ -147,6 +147,11 @@ public class TaContract implements Serializable {
147 147
      */
148 148
     private String personId;
149 149
 
150
+    /**
151
+     * 原因
152
+     */
153
+    private String reason;
154
+
150 155
     /**
151 156
      * 状态
152 157
      */

+ 8
- 0
src/main/java/com/huiju/estateagents/eContract/service/ITaContractService.java Ver fichero

@@ -64,4 +64,12 @@ public interface ITaContractService extends IService<TaContract> {
64 64
      * @return
65 65
      */
66 66
     String manualContract(TaContract taContract, TaPerson person) throws Exception;
67
+
68
+    /**
69
+     * 检查签署合同状态
70
+     * @param taRaiseRecord
71
+     * @param person
72
+     * @return
73
+     */
74
+    TaContract checkContract(TaRaiseRecord taRaiseRecord, TaPerson person) throws Exception;
67 75
 }

+ 3
- 4
src/main/java/com/huiju/estateagents/eContract/service/impl/TaCompanyServiceImpl.java Ver fichero

@@ -87,7 +87,6 @@ public class TaCompanyServiceImpl extends ServiceImpl<TaCompanyMapper, TaCompany
87 87
         taCompany.setCertifiedStatus(CommConstant.CERTIFIED_STATUS_REGISTERED);
88 88
         taCompany.setCreateDate(LocalDateTime.now());
89 89
         taCompany.setStatus(CommConstant.STATUS_UNACCALIMED);
90
-        taCompany.setAuthorizeStatus("3001");
91 90
         taCompanyMapper.insert(taCompany);
92 91
         return taCompany;
93 92
     }
@@ -255,9 +254,9 @@ public class TaCompanyServiceImpl extends ServiceImpl<TaCompanyMapper, TaCompany
255 254
      */
256 255
     private String getFddServerHost(String miniappId,String subUrl) {
257 256
         TaMiniapp taMiniapp = taMiniappMapper.selectById(miniappId);
258
-        int index = subUrl.indexOf(File.separator);
259
-        int twoIndex = subUrl.indexOf(File.separator,index);
260
-        int threeIndex = subUrl.indexOf(File.separator,twoIndex);
257
+        int index = subUrl.indexOf("/");
258
+        int twoIndex = subUrl.indexOf("/",index+1);
259
+        int threeIndex = subUrl.indexOf("/",twoIndex+1);
261 260
         String newUrl = StringUtils.isEmpty(taMiniapp.getFddServerHost()) ? subUrl : taMiniapp.getFddServerHost() + subUrl.substring(threeIndex);
262 261
         return newUrl;
263 262
     }

+ 59
- 7
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractServiceImpl.java Ver fichero

@@ -10,6 +10,7 @@ import com.fadada.sdk.test.util.ConfigUtil;
10 10
 import com.fadada.sdk.util.http.HttpsUtil;
11 11
 import com.huiju.estateagents.base.ResponseBean;
12 12
 import com.huiju.estateagents.bo.request.ContractRecordRequestBO;
13
+import com.huiju.estateagents.common.MD5Utils;
13 14
 import com.huiju.estateagents.common.StringUtils;
14 15
 import com.huiju.estateagents.config.FadadaProperties;
15 16
 import com.huiju.estateagents.eContract.entity.TaContract;
@@ -100,12 +101,29 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
100 101
     public TaContract autoContract(TaRaiseRecord taRaiseRecord, TaPerson person) throws Exception {
101 102
         taRaiseRecord = taRaiseRecordMapper.selectById(taRaiseRecord.getRaiseRecordId());
102 103
 
104
+
105
+
103 106
         //根据raiseId获取合同的所有参数
104 107
         TaContractBusiness taContractBusiness = taContractMapper.selectContractInfoByRaiseId(taRaiseRecord.getRaiseId());
105 108
         if (null == taContractBusiness){
106 109
             throw new Exception("无合同模板,请和置业顾问联系");
107 110
         }
108 111
 
112
+        //检查是否签署过本合同
113
+        QueryWrapper<TaContract> queryWrapper = new QueryWrapper<>();
114
+        queryWrapper.eq("building_id",taRaiseRecord.getBuildingId());
115
+        queryWrapper.eq("org_id",taRaiseRecord.getOrgId());
116
+        queryWrapper.eq("target_type","raise");
117
+        queryWrapper.eq("target_id",Integer.valueOf(taRaiseRecord.getRaiseId()));
118
+        queryWrapper.eq("invoice_target_type","raise_record");
119
+        queryWrapper.eq("invoice_target_id",taRaiseRecord.getRaiseRecordId());
120
+        queryWrapper.eq("company_id",taContractBusiness.getCompanyId());
121
+        queryWrapper.eq("person_id",person.getPersonId());
122
+        TaContract oldContract = taContractMapper.selectOne(queryWrapper);
123
+        if (null != oldContract){
124
+            return oldContract;
125
+        }
126
+
109 127
         //先入合同表
110 128
         TaContract taContract = new TaContract();
111 129
         taContract.setBuildingId(taRaiseRecord.getBuildingId());
@@ -118,10 +136,11 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
118 136
         taContract.setCompanyId(taContractBusiness.getCompanyId());
119 137
         taContract.setCreateDate(LocalDateTime.now());
120 138
         taContract.setStatus(0);
139
+        taContract.setPersonId(person.getPersonId());
121 140
         taContractMapper.insert(taContract);
122 141
 
123 142
         //上传合同
124
-        FddClientBase base = new FddClientBase(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),getFddServerHost(person.getMiniappId(),fadadaProperties.getServeHost()));
143
+        FddClientBase base = new FddClientBase(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
125 144
         String result = base.invokeUploadDocs(taContract.getContractId().toString(), taContractBusiness.getContractTemplateName(), null, taContractBusiness.getContractTemplateAddress(), ".pdf");
126 145
         JSONObject jsonObject = JSONObject.parseObject(result);
127 146
         if (!jsonObject.getString("code").equals("1000")){
@@ -148,7 +167,6 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
148 167
         //反更新合同地址
149 168
         taContract.setContractDownloadUrl(autoSignResultJson.getString("download_url"));
150 169
         taContract.setContractViewUrl(autoSignResultJson.getString("viewpdf_url"));
151
-        taContract.setStatus(1);
152 170
         taContractMapper.updateById(taContract);
153 171
 
154 172
         //企业名称
@@ -162,9 +180,9 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
162 180
      */
163 181
     private String getFddServerHost(String miniappId,String subUrl) {
164 182
         TaMiniapp taMiniapp = taMiniappMapper.selectById(miniappId);
165
-        int index = subUrl.indexOf(File.separator);
166
-        int twoIndex = subUrl.indexOf(File.separator,index);
167
-        int threeIndex = subUrl.indexOf(File.separator,twoIndex);
183
+        int index = subUrl.indexOf("/");
184
+        int twoIndex = subUrl.indexOf("/",index+1);
185
+        int threeIndex = subUrl.indexOf("/",twoIndex+1);
168 186
         String newUrl = StringUtils.isEmpty(taMiniapp.getFddServerHost()) ? subUrl : taMiniapp.getFddServerHost() + subUrl.substring(threeIndex);
169 187
         return newUrl;
170 188
     }
@@ -180,9 +198,12 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
180 198
     public String manualContract(TaContract taContract, TaPerson person) throws Exception {
181 199
         //获取客户信息
182 200
         QueryWrapper<TaContractUser> queryWrapper = new QueryWrapper<>();
183
-        queryWrapper.eq("mini_openid",person.getMiniOpenid());
201
+        queryWrapper.eq("mini_openid", MD5Utils.md5(person.getMiniOpenid()));
184 202
         TaContractUser taContractUser = taContractUserMapper.selectOne(queryWrapper);
185 203
 
204
+        if (taContract.getStatus() == 1){
205
+            throw new Exception("已经成功签署,无需再次签署");
206
+        }
186 207
         //根据raiseId获取合同的所有参数
187 208
         TaContractBusiness taContractBusiness = taContractMapper.selectContractInfoByRaiseId(taContract.getTargetId().toString());
188 209
         if (null == taContractBusiness){
@@ -193,7 +214,7 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
193 214
         String timeStamp = HttpsUtil.getTimeStamp();
194 215
         String transaction_id = "TRAN_" + timeStamp;
195 216
 
196
-        FddClientBase base = new FddClientBase(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),getFddServerHost(person.getMiniappId(),fadadaProperties.getServeHost()));
217
+        FddClientBase base = new FddClientBase(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
197 218
         ExtsignReq req = new ExtsignReq();
198 219
         req.setCustomer_id(taContractUser.getFadadaCode());
199 220
         req.setTransaction_id(transaction_id);
@@ -206,4 +227,35 @@ public class TaContractServiceImpl extends ServiceImpl<TaContractMapper, TaContr
206 227
         String signUrl = base.invokeExtSign(req);
207 228
         return signUrl;
208 229
     }
230
+
231
+    /**
232
+     * 检查签署合同状态
233
+     *
234
+     * @param taRaiseRecord
235
+     * @param person
236
+     * @return
237
+     */
238
+    @Override
239
+    public TaContract checkContract(TaRaiseRecord taRaiseRecord, TaPerson person) throws Exception {
240
+        taRaiseRecord = taRaiseRecordMapper.selectById(taRaiseRecord.getRaiseRecordId());
241
+
242
+        //根据raiseId获取合同的所有参数
243
+        TaContractBusiness taContractBusiness = taContractMapper.selectContractInfoByRaiseId(taRaiseRecord.getRaiseId());
244
+        if (null == taContractBusiness){
245
+            throw new Exception("无合同模板,请和置业顾问联系");
246
+        }
247
+
248
+        //检查是否签署过本合同
249
+        QueryWrapper<TaContract> queryWrapper = new QueryWrapper<>();
250
+        queryWrapper.eq("building_id",taRaiseRecord.getBuildingId());
251
+        queryWrapper.eq("org_id",taRaiseRecord.getOrgId());
252
+        queryWrapper.eq("target_type","raise");
253
+        queryWrapper.eq("target_id",Integer.valueOf(taRaiseRecord.getRaiseId()));
254
+        queryWrapper.eq("invoice_target_type","raise_record");
255
+        queryWrapper.eq("invoice_target_id",taRaiseRecord.getRaiseRecordId());
256
+        queryWrapper.eq("company_id",taContractBusiness.getCompanyId());
257
+        queryWrapper.eq("person_id",person.getPersonId());
258
+        TaContract oldContract = taContractMapper.selectOne(queryWrapper);
259
+        return oldContract;
260
+    }
209 261
 }

+ 13
- 11
src/main/java/com/huiju/estateagents/eContract/service/impl/TaContractUserServiceImpl.java Ver fichero

@@ -7,6 +7,7 @@ import com.fadada.sdk.client.FddClientBase;
7 7
 import com.fadada.sdk.client.authForfadada.FindCertInfo;
8 8
 import com.fadada.sdk.client.authForfadada.GetPersonVerifyUrl;
9 9
 import com.huiju.estateagents.common.CommConstant;
10
+import com.huiju.estateagents.common.MD5Utils;
10 11
 import com.huiju.estateagents.common.StringUtils;
11 12
 import com.huiju.estateagents.config.FadadaProperties;
12 13
 import com.huiju.estateagents.eContract.entity.TaContractUser;
@@ -57,18 +58,19 @@ public class TaContractUserServiceImpl extends ServiceImpl<TaContractUserMapper,
57 58
     public TaContractUser newFirstCustomerInfo(TaPerson person, TaRaiseRecord taRaiseRecord) throws Exception {
58 59
         //首先判断是否注册过账号
59 60
         QueryWrapper<TaContractUser> queryWrapper = new QueryWrapper<>();
60
-        queryWrapper.eq("mini_openid",person.getMiniOpenid());
61
+        queryWrapper.eq("mini_openid",MD5Utils.md5(person.getMiniOpenid()));
61 62
         TaContractUser taContractUser = taContractUserMapper.selectOne(queryWrapper);
62 63
         if (null != taContractUser) {
63 64
             taContractUser.setRaiseRecordId(taRaiseRecord.getRaiseRecordId());
65
+            taContractUser.setCertifiedAddress(getFddServerHost(person.getMiniappId(),taContractUser.getCertifiedAddress()));
64 66
             return taContractUser;
65 67
         }
66 68
         //没有法大大账号的先注册
67 69
         log.info("========法大大个人注册=======");
68 70
         //在法大大注册个人用户
69
-        FddClientBase base = new FddClientBase(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),getFddServerHost(person.getMiniappId(),fadadaProperties.getServeHost()));
71
+        FddClientBase base = new FddClientBase(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
70 72
         //小程序open——id为注册账号
71
-        String open_id = person.getMiniOpenid();
73
+        String open_id = MD5Utils.md5(person.getMiniOpenid());
72 74
         //account_type 1是个人注册
73 75
         String result =base.invokeregisterAccount(open_id,"1");
74 76
         log.info("法大大注册信息{}", result);
@@ -88,17 +90,17 @@ public class TaContractUserServiceImpl extends ServiceImpl<TaContractUserMapper,
88 90
         newContractUser.setOrgId(CommConstant.STATUS_UNACCALIMED);
89 91
 
90 92
         log.info("正在申请个人认证,客户编码是{}",jsonObject.getString("data"));
91
-        GetPersonVerifyUrl personverify = new GetPersonVerifyUrl(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),getFddServerHost(person.getMiniappId(),fadadaProperties.getServeHost()));
93
+        GetPersonVerifyUrl personverify = new GetPersonVerifyUrl(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
92 94
         String customer_id = jsonObject.getString("data");
93 95
         //0:三要素标准方案; 1:三要素补充方案;
94
-        String verifyed_way = "0";
96
+        String verifyed_way = "1";
95 97
         String page_modify = "1";
96 98
         String notify_url = fadadaProperties.getCompanyNotify();
97 99
         String return_url= "/onlineSelling/pages/raiseMoney/Certification?id=" + taRaiseRecord.getRaiseRecordId();
98 100
         String customer_ident_type = "0";
99 101
         String personResult = personverify.invokePersonVerifyUrl(customer_id,verifyed_way,
100 102
                 page_modify,notify_url,return_url,null,customer_ident_type,
101
-                null,null,null,"1",null);
103
+                taRaiseRecord.getIdcard(),taRaiseRecord.getTel(),null,"1","1");
102 104
 
103 105
         String data = JSON.parseObject(personResult).getString("data");
104 106
         if (null !=data){
@@ -120,9 +122,9 @@ public class TaContractUserServiceImpl extends ServiceImpl<TaContractUserMapper,
120 122
      */
121 123
     private String getFddServerHost(String miniappId,String subUrl) {
122 124
         TaMiniapp taMiniapp = taMiniappMapper.selectById(miniappId);
123
-        int index = subUrl.indexOf(File.separator);
124
-        int twoIndex = subUrl.indexOf(File.separator,index);
125
-        int threeIndex = subUrl.indexOf(File.separator,twoIndex);
125
+        int index = subUrl.indexOf("/");
126
+        int twoIndex = subUrl.indexOf("/",index+1);
127
+        int threeIndex = subUrl.indexOf("/",twoIndex+1);
126 128
         String newUrl = StringUtils.isEmpty(taMiniapp.getFddServerHost()) ? subUrl : taMiniapp.getFddServerHost() + subUrl.substring(threeIndex);
127 129
         return newUrl;
128 130
     }
@@ -137,10 +139,10 @@ public class TaContractUserServiceImpl extends ServiceImpl<TaContractUserMapper,
137 139
     public TaContractUser getFirstCustomerInfo(TaPerson person) throws Exception {
138 140
         //注册账号信息
139 141
         QueryWrapper<TaContractUser> queryWrapper = new QueryWrapper<>();
140
-        queryWrapper.eq("mini_openid",person.getMiniOpenid());
142
+        queryWrapper.eq("mini_openid",MD5Utils.md5(person.getMiniOpenid()));
141 143
         TaContractUser taContractUser = taContractUserMapper.selectOne(queryWrapper);
142 144
         log.info("个人正在从法大大获取最新数据,企业编号是 {}", taContractUser.getFadadaCode());
143
-        FindCertInfo personCertInfo = new FindCertInfo(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),getFddServerHost(person.getMiniappId(),fadadaProperties.getServeHost()));
145
+        FindCertInfo personCertInfo = new FindCertInfo(fadadaProperties.getAppId(),fadadaProperties.getAppSecret(),fadadaProperties.getVersion(),fadadaProperties.getServeHost());
144 146
         String verified_serialno = taContractUser.getCertifiedSerialNumber();
145 147
         String result = personCertInfo.invokeFindPersonCert(verified_serialno,
146 148
                 "1");

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaBuildingServiceImpl.java Ver fichero

@@ -369,7 +369,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
369 369
                 // 若开启邀请制,校验该用户是否在邀请列表中
370 370
                 QueryWrapper<TaRaiseInvite> taRaiseInviteQueryWrapper = new QueryWrapper<>();
371 371
                 taRaiseInviteQueryWrapper.eq("org_id", orgId);
372
-                taRaiseInviteQueryWrapper.eq("invite_tel", person.getTel());
372
+                taRaiseInviteQueryWrapper.eq("invite_tel", person.getPhone());
373 373
                 taRaiseInviteQueryWrapper.eq("sales_batch_id", record.getSalesBatchId());
374 374
                 TaRaiseInvite taRaiseInvite = iTaRaiseInviteService.getOne(taRaiseInviteQueryWrapper);
375 375
                 if (taRaiseInvite != null) {

+ 11
- 6
src/main/java/com/huiju/estateagents/service/impl/TaRaiseRecordServiceImpl.java Ver fichero

@@ -412,10 +412,10 @@ public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, T
412 412
         }
413 413
 
414 414
         // 是否展示签署合同入口
415
-        if (CommConstant.STATUS_NORMAL == taRaiseRecord.getStatus() || CommConstant.PAY_STATUS_PAID == taRaiseRecord.getPayStatus()) {
415
+        if (CommConstant.STATUS_NORMAL == taRaiseRecord.getStatus() && CommConstant.PAY_STATUS_PAID.equals(taRaiseRecord.getPayStatus())) {
416 416
             // 是否有认筹业务合同配置
417 417
             QueryWrapper<TaContractBusiness> taContractBusinessQueryWrapper = new QueryWrapper<>();
418
-            taContractBusinessQueryWrapper.eq("target_id", raiseRecordId);
418
+            taContractBusinessQueryWrapper.eq("target_id", taRaiseRecord.getRaiseId());
419 419
             taContractBusinessQueryWrapper.eq("org_id", orgId);
420 420
             taContractBusinessQueryWrapper.eq("status", CommConstant.STATUS_NORMAL);
421 421
             TaContractBusiness taContractBusiness = iTaContractBusinessService.getOne(taContractBusinessQueryWrapper);
@@ -423,16 +423,21 @@ public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, T
423 423
                 // 是否有有关联的认筹合同
424 424
                 QueryWrapper<TaContract> taContractQueryWrapper = new QueryWrapper<>();
425 425
                 taContractQueryWrapper.eq("org_id", orgId);
426
-                taContractQueryWrapper.eq("company_id", taContractBusiness.getCompanyId());
426
+                taContractQueryWrapper.eq("target_type", "raise");
427 427
                 taContractQueryWrapper.eq("target_id", taRaiseRecord.getRaiseId());
428
+                taContractQueryWrapper.eq("invoice_target_type", "raise_record");
429
+                taContractQueryWrapper.eq("invoice_target_id", taRaiseRecord.getRaiseRecordId());
430
+                taContractQueryWrapper.eq("company_id", taContractBusiness.getCompanyId());
431
+                taContractQueryWrapper.eq("building_id", taRaiseRecord.getBuildingId());
428 432
                 taContractQueryWrapper.eq("person_id", personId);
429 433
                 TaContract taContract = iTaContractService.getOne(taContractQueryWrapper);
430 434
                 if (taContract != null) {
431
-                    if (taContract.getCustomerTime() == null) {
432
-                        taRaiseRecord.setShowContract(1);
433
-                    } else {
435
+                    // 合同状态正常
436
+                    if (CommConstant.STATUS_NORMAL == taContract.getStatus()) {
434 437
                         taRaiseRecord.setShowContract(0);
435 438
                         map.put("taContract", taContract);
439
+                    } else {
440
+                        taRaiseRecord.setShowContract(1);
436 441
                     }
437 442
                 } else {
438 443
                     taRaiseRecord.setShowContract(1);

+ 22
- 22
src/test/java/com/huiju/estateagents/FdadaTest.java Ver fichero

@@ -77,44 +77,44 @@ public class FdadaTest {
77 77
     /*=============法大大实名测试=============*/
78 78
     @Test
79 79
     public void Test1(){
80
-        regAccount();//1注册账号
81
-        getAuthCompanyurl();//2获取企业实名认证地址
82
-        getAuthPersonurl();//3获取个人实名认证地址
83
-        findPersonCertInfo();//17 查询个人实名认证信息
84
-        findCompanyCertInfo();//18 查询企业实名认证信息
85
-        GetFileForUUID();//19 通过uuid下载文件
86
-        ApplyCert();//4实名证书申请
87
-        ApplyNumCert();//5编号证书申请
88
-        addSignature1();//6印章上传
89
-        addSignature2();//6印章上传
90
-        customSignature();//7自定义印章
80
+//        regAccount();//1注册账号
81
+//        getAuthCompanyurl();//2获取企业实名认证地址
82
+//        getAuthPersonurl();//3获取个人实名认证地址
83
+//        findPersonCertInfo();//17 查询个人实名认证信息
84
+//        findCompanyCertInfo();//18 查询企业实名认证信息
85
+//        GetFileForUUID();//19 通过uuid下载文件
86
+//        ApplyCert();//4实名证书申请
87
+//        ApplyNumCert();//5编号证书申请
88
+//        addSignature1();//6印章上传
89
+//        addSignature2();//6印章上传
90
+//        customSignature();//7自定义印章
91 91
 
92 92
     }
93 93
     @Test
94 94
     public void Test2(){
95
-        uploadContract();//8合同上传
96
-        uploadTemplate();//9模板上传
97
-        GenerateContract();//10模板填充
95
+//        uploadContract();//8合同上传
96
+//        uploadTemplate();//9模板上传
97
+//        GenerateContract();//10模板填充
98 98
     }
99 99
 
100 100
     @Test
101 101
     public void Test3(){
102
-        uploadContract();//8合同上传
103
-        extsign();//12手动签署接口
104
-        extsignAuto();//11自动签署
105
-        viewContract();//13合同查看
106
-        downloadContract();//14合同下载
107
-        contractFiling();//15合同归档
102
+//        uploadContract();//8合同上传
103
+//        extsign();//12手动签署接口
104
+//        extsignAuto();//11自动签署
105
+//        viewContract();//13合同查看
106
+//        downloadContract();//14合同下载
107
+//        contractFiling();//15合同归档
108 108
     }
109 109
 
110 110
     @Test
111 111
     public void Test4(){
112
-        addSignature2();
112
+//        addSignature2();
113 113
     }
114 114
 
115 115
     @Test
116 116
     public void Test5(){
117
-        autoAuthSeal();
117
+//        autoAuthSeal();
118 118
     }
119 119
 
120 120
     public void autoAuthSeal(){