Sunshine
2024-11-04 919ed870ea1def0cfdd1dff23bec204975e7f34c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
package com.nova.sankuai.domain.api.hengyidai;
 
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.nova.sankuai.domain.api.hengyidai.dto.HyConfirmDto;
import com.nova.sankuai.domain.api.hengyidai.dto.HyGetContractsDto;
import com.nova.sankuai.domain.api.hengyidai.dto.HyGetRepayUrlDto;
import com.nova.sankuai.domain.api.hengyidai.dto.HyGetSignUrlDto;
import com.nova.sankuai.domain.api.hengyidai.response.*;
import com.nova.sankuai.domain.entity.Customer;
import com.nova.sankuai.domain.enums.customerinfo.MonthlyIncomeEnum;
import com.nova.sankuai.domain.enums.customerinfo.UseOfLoanEnum;
import com.nova.sankuai.domain.enums.yixin.*;
import com.nova.sankuai.security.HttpClientUtil;
import lombok.Data;
import org.apache.commons.lang.StringUtils;
import org.apache.http.util.TextUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
 
 
/**
 * 恒易贷对接
 */
@Data
@Component
public class HyUtil {
 
 
    @Autowired
    private HySignUtil hySignUtil;
 
 
    /**
     * 撞库
     *
     * @param idCardMd5 身份证MD5值
     * @return
     */
    public HyResponse<HyCollisionLibraryResponse> checkUser(String idCardMd5, Logger log, String logNumber) {
        String url = "/checkUser";
        JSONObject root = new JSONObject();
        //撞库参数,身份证号 MD5 加密
        root.put("collidParameter", idCardMd5);
        //撞库类型
        root.put("collidType", 3);
        try {
            log.info("日志编号:" + logNumber + "撞库参数 -> {}", root);
            String request = hySignUtil.buildRequest(root.toJSONString());
            log.info("日志编号:" + logNumber + "撞库参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "撞库返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                if (null != hyResponse.getData()) {
                    HyCollisionLibraryResponse response = JSON.parseObject(hyResponse.getData().toString(), HyCollisionLibraryResponse.class);
                    hyResponse.setData(response);
                }
                log.info("日志编号:" + logNumber + "撞库返回结果 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("撞库接口异常->:{}", e.getMessage());
        }
        return null;
    }
 
    /**
     * 进件
     *
     * @param customer
     * @param log
     * @param logNumber
     * @return
     */
    public HyResponse pushPhaseOne(Customer customer, String orderNo, Logger log, String logNumber) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //采集时间
        String dateString = formatter.format(customer.getApplyDate());
        //orderTime(订单创建时间),(applytim)申请时间
        String format = formatter.format(new Date(System.currentTimeMillis()));
        String url = "/pushPhaseOne";
        JSONObject root = new JSONObject();
        //进件单号
        root.put("orderNo", orderNo);
        //用户基本信息
        JSONObject userBaseInfo = new JSONObject();
        //手机号
        userBaseInfo.put("mobile", customer.getPhone());
        //姓名
        userBaseInfo.put("name", customer.getName());
        //当前居住地址
        userBaseInfo.put("currentAddress", customer.getAddress());
        //婚姻状况类型 详见“婚姻类型”枚举
        userBaseInfo.put("marriageType", formatHyMarriage(customer.getMaritalStatus()));
        //受教育程度类型 详见“教育程度类型”枚举
        userBaseInfo.put("educationType", formatHyEducation(customer.getEducation()));
        //住房类型
        userBaseInfo.put("houseType", formatHyHouse(customer.getLivest()));
        //月收入 例如:5000。 必须是具体数值,不能传区间。单位:元。
        userBaseInfo.put("inCome", formatMonthly(customer.getMonthlyIncome()));
        //借款用途 详见“借款用途类型”枚举
        userBaseInfo.put("loanUsageType", formatHyLoanUsageType(customer.getUseOfLoan()));
 
        root.put("userBaseInfo", userBaseInfo);
        //身份证信息
        JSONObject identityInfo = new JSONObject();
        //姓名(OCR 扫描)
        identityInfo.put("name", customer.getName());
        //身 份 证 号(OCR 扫描)
        identityInfo.put("idNum", customer.getIdCard());
        //性别(OCR 扫描) 1为女,2为男
        identityInfo.put("sex", "女".equals(customer.getSex()) ? 1 : 2);
        //民族(OCR 扫描)
        identityInfo.put("nation", customer.getNation());
        //地址(OCR 扫描)
        identityInfo.put("identityAddress", customer.getIdAddress());
        //发 证 机 关(OCR 扫描)
        identityInfo.put("issueAgency", customer.getSignOrganization());
        //有效期(OCR扫描)格式:2012.10.01-2022.10.01或 2017.10.13-长期
        if (null != customer.getIdLongTerm() && "1".equals(customer.getIdLongTerm())) {
            StringBuffer buffer = new StringBuffer(customer.getIdValidDateBegin());
            buffer.insert(4, ".");
            buffer.insert(7, ".");
            identityInfo.put("periodValidityDate", buffer.toString() + "-长期");
        } else {
            StringBuffer buffer = new StringBuffer(customer.getIdValidDateBegin());
            buffer.insert(4, ".");
            buffer.insert(7, ".");
            StringBuffer dateEnd = new StringBuffer(customer.getIdValidDateEnd());
            dateEnd.insert(4, ".");
            dateEnd.insert(7, ".");
            identityInfo.put("periodValidityDate", buffer.toString() + "-" + dateEnd.toString());
        }
 
        root.put("identityInfo", identityInfo);
        //借款信息
        JSONObject applyInfo = new JSONObject();
        //订单创建时间 格式:yyyy-MM-dd HH:mm:ss
 
        applyInfo.put("orderTime", format);
        //申请金额 单位:分
        if (customer.getLoanAmount() != null) {
            applyInfo.put("applyAmount", customer.getLoanAmount() * 100);
        } else {
            applyInfo.put("applyAmount", "500000");
        }
 
        //申请期限
        applyInfo.put("applyPeriodNum", customer.getLoanTerm());
        //申请期限单位 1:天,2:月,暂时只支持:月
        applyInfo.put("applyPeriodNumUnit", 2);
 
        root.put("applyInfo", applyInfo);
        //联系人信息
        JSONObject contactsInfo = new JSONObject();
        //第 一 联 系 人 名称
        contactsInfo.put("contactOneName", customer.getRelationshipName());
        //第 一 联 系 人 手机号
        contactsInfo.put("contactOneMobile", customer.getRelationshipPhone());
        //第 一 联 系 人 类型 详见“联系人一类型”枚举
        contactsInfo.put("contactOneType", formatHomeRelation(customer.getRelationship()));
        //第 二 联 系 人 名称
        contactsInfo.put("contactTwoName", customer.getContactName());
        //第 二 联 系 人 手机号
        contactsInfo.put("contactTwoMobile", customer.getContactPhone());
        //第 二 联 系 人 类型 详见“联系人二类型”枚举
        contactsInfo.put("contactTwoType", formatFriendRelation(customer.getContactRelation()));
 
        root.put("contactsInfo", contactsInfo);
        //所在公司信息
        JSONObject companyInfo = new JSONObject();
        //公司名称
        companyInfo.put("companyName", customer.getCompanyName());
        //公司电话
        companyInfo.put("companyTel", customer.getCompanyPhone());
        //公司地址
        companyInfo.put("companyAddress", customer.getCompanyAddress());
        //公司性质类型 详见“公司性质类型”枚举
        companyInfo.put("companyNatureType", formatHyCompanyNature(customer.getCompanyNature()));
 
        root.put("companyInfo", companyInfo);
        //设备信息
        JSONObject deviceInfo = new JSONObject();
        //系统类型 ios 或 android
        if (StringUtils.isNotEmpty(customer.getOs())) {
            deviceInfo.put("osType", customer.getOs().toLowerCase());
        }
        //设备品牌 例如:华为
        if (StringUtils.isNotEmpty(customer.getDeviceBrand())) {
            deviceInfo.put("deviceBrand", customer.getDeviceBrand());
        } else {
            deviceInfo.put("deviceBrand", "华为");
        }
        //设备型号 例如: P30
        deviceInfo.put("deviceModel", "0000-0000");
        //设备号,安 卓 设 备 取imei,IOS 设备取idfa
        if ("ios".equals(customer.getOs())) {
            if (null != customer.getIdfa()) deviceInfo.put("imei", customer.getIdfa());
        } else {
            if (null != customer.getImei()) deviceInfo.put("imei", customer.getImei());
        }
        //登录设备 ip
        deviceInfo.put("ip", customer.getClientIp());
        //GSM 设备唯一号IMEI
        //deviceInfo.put("gsmImei", "");
        //CMDA 设备唯一号 MEID
        //deviceInfo.put("cdmaMeid", "");
        //网络类型
        //deviceInfo.put("networkType", "");
        //运营商
        //deviceInfo.put("serviceName", "");
        //无线局域网 ip 地址
        if (null != customer.getIpAddres()) deviceInfo.put("lanAddress", customer.getIpAddres());
        //内存大小
        //deviceInfo.put("mem", "");
        //数据来源
        //deviceInfo.put("dataSource", );
        //是否是模拟器
        //deviceInfo.put("isSimulator",);
 
        root.put("deviceInfo", deviceInfo);
        //位置信息
        JSONObject positionInfo = new JSONObject();
        //经度
        if (StringUtils.isNotEmpty(customer.getLng())) {
            positionInfo.put("applyY", customer.getLng());
        } else {
            positionInfo.put("applyY", "0000-0000");
        }
        //纬度
        if (StringUtils.isNotEmpty(customer.getLat())) {
            positionInfo.put("applyX", customer.getLat());
        } else {
            positionInfo.put("applyX", "0000-0000");
        }
 
        //申请时的位置 示例:省+市+区/县+详细地址,例:江苏省苏州市张家港市**镇***
        positionInfo.put("applypos", "0000-0000");
 
        //申请时间 示例:yyyy-MM-dd HH:mm:ss
        positionInfo.put("applytim", format);
 
        root.put("positionInfo", positionInfo);
 
        log.info("日志编号:" + logNumber + "进件参数 -> {}", root);
 
        //活体信息
        JSONObject liveInfo = new JSONObject();
        //身份证正面图片 Base64 编码
        liveInfo.put("idCardFrontImge", HySignUtil.pictureToBase64(customer.getIdCardFrontPath()));
        //身份证反面图片 Base64 编码
        liveInfo.put("idCardBackImge", HySignUtil.pictureToBase64(customer.getIdCardBackPath()));
        //人脸图片 Base64 编码
        liveInfo.put("faceImge", HySignUtil.pictureToBase64(customer.getFacePhotoPath()));
        //有源对比得分
        liveInfo.put("score", customer.getVerifySimilarity());
        //采集时间 格式:yyyy-MM-dd HH:mm:ss
        liveInfo.put("createTime", dateString);
 
        root.put("liveInfo", liveInfo);
        try {
//            log.info("日志编号:" + logNumber + "进件参数 -> {}", root);
            String request = hySignUtil.buildRequest(JSON.toJSONString(root));
//            log.info("日志编号:" + logNumber + "进件参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "进件返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                log.info("日志编号:" + logNumber + "进件返回 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("进件接口异常->:{}", e.getMessage());
        }
        return null;
    }
 
    /**
     * 婚姻状况
     *
     * @param marriage
     * @return
     */
    private String formatHyMarriage(String marriage) {
        if (YiXinMaritalStatusEnum.MaritalStatus_6.getCode().equals(marriage)) {
            //已婚
            return "201";
        } else if (YiXinMaritalStatusEnum.MaritalStatus_5.getCode().equals(marriage)) {
            //未婚
            return "202";
        } else if (YiXinMaritalStatusEnum.MaritalStatus_7.getCode().equals(marriage)) {
            //离异
            return "203";
        } else if (YiXinMaritalStatusEnum.MaritalStatus_8.getCode().equals(marriage)) {
            //丧偶
            return "204";
        } else {
            return "202";
        }
    }
 
    /**
     * 教育程度
     *
     * @param eduction
     * @return
     */
    private String formatHyEducation(String eduction) {
        /*if (YiXinEducationEnum.JUNIOR_HIGH_SCHOOL.getCode().equals(eduction)) {
            //初中
            return "252";
        } else */
        if (YiXinEducationEnum.COLLEGE_DEGREE.getCode().equals(eduction)) {
            //大专
            return "254";
        } else if (YiXinEducationEnum.HIGH_SCHOOL.getCode().equals(eduction)) {
            //高中/中专/技校
            return "253";
        } else if (YiXinEducationEnum.BACHELOR_DEGREE.getCode().equals(eduction)) {
            //大学本科
            return "255";
        } /*else if (YiXinEducationEnum.PRIMARY_SCHOOL.getCode().equals(eduction)) {
            //初中及以下
            return "251";
        } else if (YiXinEducationEnum.DOCTORAL_CANDIDATE.getCode().equals(eduction)) {
            //博士
            return "257";
        }*/ else if (YiXinEducationEnum.MASTER_CANDIDATE.getCode().equals(eduction)) {
            //硕士
            return "256";
        } else {
            return eduction;
        }
    }
 
    /**
     * 住房类型
     *
     * @param houseType
     * @return
     */
    private String formatHyHouse(String houseType) {
        if (YiXinLivestEnum.LIVEST_1.getCode().equals(houseType)) {
            //自建房
            return "102";
        } else if (YiXinLivestEnum.LIVEST_5.getCode().equals(houseType)) {
            //租房
            return "101";
        } else if (YiXinLivestEnum.LIVEST_4.getCode().equals(houseType)) {
            //宿舍
            return "105";
        } else if (YiXinLivestEnum.LIVEST_3.getCode().equals(houseType)) {
            //父母同住
            return "106";
        } else if (YiXinLivestEnum.LIVEST_7.getCode().equals(houseType)) {
            //其他
            return "107";
        } else {
            return "107";
        }
    }
 
    private Integer formatMonthly(Integer monthlyIncome) {
        if (MonthlyIncomeEnum.Income_1W_UNDER.getCode().equals(monthlyIncome)) {
            return 10000;
        } else if (MonthlyIncomeEnum.Income_1W_3W.getCode().equals(monthlyIncome)) {
            return 30000;
        } else if (MonthlyIncomeEnum.Income_3W_UPPER.getCode().equals(monthlyIncome)) {
            return 30000;
        } else {
            return 10000;
        }
    }
 
 
    /**
     * 借款用途
     *
     * @param loanUsageType
     * @return
     */
    private String formatHyLoanUsageType(String loanUsageType) {
        if (UseOfLoanEnum.Loan_7.getCode().equals(loanUsageType) || UseOfLoanEnum.Loan_18.getCode().equals(loanUsageType)) {
            //装修房屋
            return "411";
        } else if (UseOfLoanEnum.Loan_8.getCode().equals(loanUsageType)) {
            //教育支出
            return "412";
        } else if (UseOfLoanEnum.Loan_25.getCode().equals(loanUsageType)) {
            //医疗支出
            return "413";
        } else if (UseOfLoanEnum.Loan_16.getCode().equals(loanUsageType)) {
            //旅游酒店机票
            return "414";
        } else if (UseOfLoanEnum.Loan_17.getCode().equals(loanUsageType)) {
            //购置车辆
            return "415";
        } else if (UseOfLoanEnum.Loan_9.getCode().equals(loanUsageType) || UseOfLoanEnum.Loan_10.getCode().equals(loanUsageType)
                || UseOfLoanEnum.Loan_14.getCode().equals(loanUsageType) || UseOfLoanEnum.Loan_15.getCode().equals(loanUsageType)
                || UseOfLoanEnum.Loan_19.getCode().equals(loanUsageType) || UseOfLoanEnum.Loan_23.getCode().equals(loanUsageType)
                || UseOfLoanEnum.Loan_24.getCode().equals(loanUsageType)) {
            //购置家具、家电
            return "416";
        } else if (UseOfLoanEnum.Loan_11.getCode().equals(loanUsageType)) {
            //婚庆开销
            return "423";
        } else {
            return loanUsageType;
        }
    }
 
    /**
     * 公司性质类型
     *
     * @param companyNature
     * @return
     */
    private String formatHyCompanyNature(String companyNature) {
        if (YiXinCompanyNatureEnum.Nature_1.getCode().equals(companyNature)) {
            //事业单位
            return "308";
        } else if (YiXinCompanyNatureEnum.Nature_4.getCode().equals(companyNature)) {
            //个体工商户
            return "302";
        } else if (YiXinCompanyNatureEnum.Nature_2.getCode().equals(companyNature)) {
            //国企
            return "305";
        } else if (YiXinCompanyNatureEnum.Nature_3.getCode().equals(companyNature)) {
            //外商投资企业
            return "301";
        } else if (YiXinCompanyNatureEnum.Nature_6.getCode().equals(companyNature)) {
            //其他
            return "300";
        } else {
            return "300";
        }
    }
 
    /**
     * 第一联系人类型
     *
     * @param contactType
     * @return
     */
    private String formatHomeRelation(String contactType) {
        if (YiXinHomeRelationEnum.PARENTS.getCode().equals(contactType)) {
            //父母
            return "501";
        } else if (YiXinHomeRelationEnum.CHILD.getCode().equals(contactType)) {
            //子女
            return "502";
        } else if (YiXinHomeRelationEnum.SPOUSE.getCode().equals(contactType)) {
            //配偶
            return "503";
        } else {
            return contactType;
        }
    }
 
    /**
     * 第二联系人类型
     *
     * @param contactType
     * @return
     */
    private String formatFriendRelation(String contactType) {
        if (YiXinFriendRelationEnum.RELATIVES.getCode().equals(contactType)) {
            //亲属
            return "601";
        } else if (YiXinFriendRelationEnum.FRIEND.getCode().equals(contactType)) {
            //朋友
            return "602";
        } else if (YiXinFriendRelationEnum.COLLEAGUE.getCode().equals(contactType)) {
            //同事
            return "603";
        } else {
            return "602";
        }
    }
 
    /**
     * 审核结果查询
     * 渠道方调用该接口获取平台方审核结果
     *
     * @param orderNo
     * @param log
     * @param logNumber
     * @return
     */
    public HyResponse<HyGetAuditResultResponse> getAuditResult(String orderNo, Logger log, String logNumber) {
        String url = "/getAuditResult";
        JSONObject root = new JSONObject();
        //进件单号
        root.put("orderNo", orderNo);
        try {
            log.info("日志编号:" + logNumber + "审核结果查询参数 -> {}", root);
            String request = hySignUtil.buildRequest(JSON.toJSONString(root));
            log.info("日志编号:" + logNumber + "审核结果查询参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "审核结果查询返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                if (null != hyResponse.getData()) {
                    HyGetAuditResultResponse response = JSON.parseObject(hyResponse.getData().toString(), HyGetAuditResultResponse.class);
                    hyResponse.setData(response);
                }
                log.info("日志编号:" + logNumber + "审核结果查询返回 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("审核结果查询接口异常->:{}", e.getMessage());
        }
        return null;
    }
 
    /**
     * 订单状态查询
     *
     * @param orderNo
     * @param log
     * @param logNumber
     * @return
     */
    public HyResponse<HyGetOrderStatusResponse> getOrderStatus(String orderNo, Logger log, String logNumber) {
        String url = "/getOrderStatus";
        JSONObject root = new JSONObject();
        //进件单号
        root.put("orderNo", orderNo);
        try {
            log.info("日志编号:" + logNumber + "订单状态查询参数 -> {}", root);
            String request = hySignUtil.buildRequest(JSON.toJSONString(root));
            log.info("日志编号:" + logNumber + "订单状态查询参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "订单状态查询返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                if (null != hyResponse.getData()) {
                    HyGetOrderStatusResponse response = JSON.parseObject(hyResponse.getData().toString(), HyGetOrderStatusResponse.class);
                    hyResponse.setData(response);
                }
                log.info("日志编号:" + logNumber + "订单状态查询返回 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("订单状态查询接口异常->:{}", e.getMessage());
        }
        return null;
    }
 
    /**
     * 绑卡信息查询
     *
     * @param orderNo
     * @param log
     * @param logNumber
     * @return
     */
    public HyResponse<HyGetBankInfoResponse> getBankInfo(String orderNo, Logger log, String logNumber) {
        String url = "/getBankInfo";
        JSONObject root = new JSONObject();
        //进件单号
        root.put("orderNo", orderNo);
        try {
            log.info("日志编号:" + logNumber + "绑卡信息查询参数 -> {}", root);
            String request = hySignUtil.buildRequest(JSON.toJSONString(root));
            log.info("日志编号:" + logNumber + "绑卡信息查询参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "绑卡信息查询返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                if (null != hyResponse.getData()) {
                    HyGetBankInfoResponse response = JSON.parseObject(hyResponse.getData().toString(), HyGetBankInfoResponse.class);
                    hyResponse.setData(response);
                }
                log.info("日志编号:" + logNumber + "绑卡信息查询返回 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("绑卡信息查询接口异常->:{}", e.getMessage());
        }
        return null;
    }
 
    /**
     * 试算查询
     *
     * @param orderNo
     * @param log
     * @param logNumber
     * @return
     */
    public HyResponse<HyGetTrialInfoResponse> getTrialInfo(String orderNo, Logger log, String logNumber) {
        String url = "/getTrialInfo";
        JSONObject root = new JSONObject();
        //进件单号
        root.put("orderNo", orderNo);
        try {
            log.info("日志编号:" + logNumber + "试算查询参数 -> {}", root);
            String request = hySignUtil.buildRequest(JSON.toJSONString(root));
            log.info("日志编号:" + logNumber + "试算查询参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "试算查询返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                if (null != hyResponse.getData()) {
                    HyGetTrialInfoResponse response = JSON.parseObject(hyResponse.getData().toString(), HyGetTrialInfoResponse.class);
                    hyResponse.setData(response);
                }
                log.info("日志编号:" + logNumber + "试算查询返回 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("试算查询接口异常->:{}", e.getMessage());
        }
        return null;
    }
 
    /**
     * 确认借款
     *
     * @param dto
     * @param log
     * @param logNumber
     * @return
     */
    public HyResponse confirm(HyConfirmDto dto, Logger log, String logNumber) {
        String url = "/confirm";
        JSONObject root = new JSONObject();
        root.put("orderNo", dto.getOrderNo());
        root.put("applyAmount", dto.getApplyAmount());
        root.put("applyPeriodNum", dto.getApplyPeriodNum());
        root.put("applyPeriodNumUnit", dto.getApplyPeriodNumUnit());
        try {
            log.info("日志编号:" + logNumber + "确认借款参数 -> {}", root);
            String request = hySignUtil.buildRequest(JSON.toJSONString(root));
            log.info("日志编号:" + logNumber + "确认借款参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "确认借款返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                log.info("日志编号:" + logNumber + "确认借款返回 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("确认借款接口异常->:{}", e.getMessage());
        }
        return null;
    }
 
    /**
     * 签约
     *
     * @param dto
     * @param log
     * @param logNumber
     * @return
     */
    public HyResponse<HyGetSignUrlResponse> getSignUrl(HyGetSignUrlDto dto, Logger log, String logNumber) {
        String url = "/getSignUrl";
        JSONObject root = new JSONObject();
        root.put("orderNo", dto.getOrderNo());
        root.put("returnUrl", dto.getReturnUrl());
        try {
            log.info("日志编号:" + logNumber + "签约参数 -> {}", root);
            String request = hySignUtil.buildRequest(JSON.toJSONString(root));
            log.info("日志编号:" + logNumber + "签约参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "签约返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                if (null != hyResponse.getData()) {
                    HyGetSignUrlResponse response = JSON.parseObject(hyResponse.getData().toString(), HyGetSignUrlResponse.class);
                    hyResponse.setData(response);
                }
                log.info("日志编号:" + logNumber + "签约返回 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("签约接口异常->:{}", e.getMessage());
        }
        return null;
    }
 
    /**
     * 还款
     *
     * @param dto
     * @param log
     * @param logNumber
     * @return
     */
    public HyResponse<HyGetRepayUrlResponse> getRepayUrl(HyGetRepayUrlDto dto, Logger log, String logNumber) {
        String url = "/getRepayUrl";
        JSONObject root = new JSONObject();
        root.put("orderNo", dto.getOrderNo());
        root.put("returnUrl", dto.getReturnUrl());
        try {
            log.info("日志编号:" + logNumber + "还款参数 -> {}", root);
            String request = hySignUtil.buildRequest(JSON.toJSONString(root));
            log.info("日志编号:" + logNumber + "还款参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "还款返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                if (null != hyResponse.getData()) {
                    HyGetRepayUrlResponse response = JSON.parseObject(hyResponse.getData().toString(), HyGetRepayUrlResponse.class);
                    hyResponse.setData(response);
                }
                log.info("日志编号:" + logNumber + "还款返回 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("还款接口异常->:{}", e.getMessage());
        }
        return null;
    }
 
    /**
     * 还款计划查询
     *
     * @param orderNo
     * @param log
     * @param logNumber
     * @return
     */
    public HyResponse<List<HyGetRepayPlanResponse>> getRepayPlan(String orderNo, Logger log, String logNumber) {
        String url = "/getRepayPlan";
        JSONObject root = new JSONObject();
        root.put("orderNo", orderNo);
        try {
            log.info("日志编号:" + logNumber + "还款计划查询参数 -> {}", root);
            String request = hySignUtil.buildRequest(JSON.toJSONString(root));
            log.info("日志编号:" + logNumber + "还款计划查询参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "还款计划查询返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                if (null != hyResponse.getData()) {
                    List<HyGetRepayPlanResponse> planResponses = JSONArray.parseArray(hyResponse.getData().toString(), HyGetRepayPlanResponse.class);
                    hyResponse.setData(planResponses);
                }
                log.info("日志编号:" + logNumber + "还款计划查询返回 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("还款计划查询接口异常->:{}", e.getMessage());
        }
        return null;
    }
 
    /**
     * 协议
     *
     * @param dto
     * @param log
     * @param logNumber
     */
    public HyResponse<Map<String, String>> getContracts(HyGetContractsDto dto, Logger log, String logNumber) {
        String url = "/getContracts";
        JSONObject root = new JSONObject();
        root.put("contractTypeList", dto.getContractTypeList());
        root.put("orderNo", dto.getOrderNo());
        try {
            log.info("日志编号:" + logNumber + "协议参数 -> {}", root);
            String request = hySignUtil.buildRequest(JSON.toJSONString(root));
            log.info("日志编号:" + logNumber + "协议参数json -> {}", request);
            String hyResult = HttpClientUtil.getInstance().postJsonData(hySignUtil.getHyPath() + url, request);
            log.info("日志编号:" + logNumber + "协议查询返回 -> {}", hyResult);
            if (!TextUtils.isEmpty(hyResult)) {
                HyResponse hyResponse = JSON.parseObject(hyResult, HyResponse.class);
                if (null != hyResponse.getData()) {
                    Map<String, String> map = JSON.parseObject(hyResponse.getData().toString(), Map.class);
                    hyResponse.setData(map);
                }
                log.info("日志编号:" + logNumber + "协议查询返回 -> {}", hyResponse);
                return hyResponse;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("协议接口异常->:{}", e.getMessage());
        }
        return null;
    }
}