xuekang
2024-05-11 bac0878349a1db23e7b420ea164e22fb9db73a99
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
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
package com.nuvole.util.pay.allinPay.yunst;
 
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.allinpay.yunst.sdk.YunClient;
import com.allinpay.yunst.sdk.bean.YunConfig;
import com.allinpay.yunst.sdk.bean.YunRequest;
import com.allinpay.yunst.sdk.util.RSAUtil;
import com.nuvole.common.domain.dto.AppDTO;
import com.nuvole.util.IPUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
 
import java.util.Date;
import java.util.HashMap;
 
/**
 * 支付工具类(通联云商通)
 *
 * @Author: lc
 * @Date: 2019/10/12 11:49
 */
@Slf4j
public class YunStUtil {
 
    private Logger logger = LoggerFactory.getLogger(YunStUtil.class);
 
    //测试
    /*@Before
    public void initConfig() {
        final String serverUrl = "http://116.228.64.55:6900/service/soa";
        final String sysId = "1906061744156467038";
        final String pwd = "123456";
        final String alias = "1906061744156467038";
        final String path = "C:/Users/Administrator/Desktop/yunst/1906061744156467038/1906061744156467038.pfx";
        final String tlCertPath = "C:/Users/Administrator/Desktop/yunst/1906061744156467038/TLCert-test.cer";
        final String version = "2.0";
        final YunConfig config = new YunConfig(serverUrl, sysId, pwd, alias, version, path, tlCertPath);
        YunClient.configure(config);
    }
 
    @Test
    public void test() {
 
        String bizUserId = "lc201910171030";   //用户唯一标识 4806722d-3c3a-4137-bc6f-5982e2759dd5
        String acct = "oZN135B20y8KIUFMl4GaeRyuFyQ3";   //微信小程序openid
        String bizOrderNo = "123456789987654322";  //订单编号
 
        YunStResult yunStResult = new YunStResult();
 
        System.out.println("is Enter the test.............................创建会员");
        Long memberType = 3L;
        Long source = 2L;
        //创建会员
        yunStResult = createMember(bizUserId, memberType, source);
        if ("OK".equals(yunStResult.getStatus())) {
            log.info("is ok:-------------->");
            log.info(yunStResult.getSignedValue());
        } else {
            log.info("is error:-------------->");
            log.info(yunStResult.getErrorCode());
            log.info(yunStResult.getMessage());
        }
 
        System.out.println("is The end of the test.......................创建会员");
 
 
        System.out.println("is Enter the test.............................发送验证码");
        String phone = "17803846500";
        Long verificationCodeType = 9L;
        //创建会员
        yunStResult = sendVerificationCode(bizUserId, phone, verificationCodeType);
        if ("OK".equals(yunStResult.getStatus())) {
            log.info("is ok:-------------->");
            log.info(yunStResult.getSignedValue());
        } else {
            log.info("is error:-------------->");
            log.info(yunStResult.getErrorCode());
            log.info(yunStResult.getMessage());
        }
 
        System.out.println("is The end of the test.......................发送验证码");
 
 
        System.out.println("is Enter the test.............................绑定手机");
        String verificationCode = "544343";
        //创建会员
        yunStResult = bindPhone(bizUserId, phone, verificationCode);
        if ("OK".equals(yunStResult.getStatus())) {
            log.info("is ok:-------------->");
            log.info(yunStResult.getSignedValue());
        } else {
            log.info("is error:-------------->");
            log.info(yunStResult.getErrorCode());
            log.info(yunStResult.getMessage());
        }
 
        System.out.println("is The end of the test.......................绑定手机");
 
        System.out.println("is Enter the test.............................个人实名认证");
        //创建会员
        yunStResult = setRealName(bizUserId, "王莉", 1L, "410521199209010565");
        if ("OK".equals(yunStResult.getStatus())) {
            log.info("is ok:-------------->");
            log.info(yunStResult.getSignedValue());
        } else {
            log.info("is error:-------------->");
            log.info(yunStResult.getErrorCode());
            log.info(yunStResult.getMessage());
        }
 
        System.out.println("is The end of the test.......................个人实名认证");
 
        System.out.println("is Enter the test.............................绑定会员支付账户");
 
        //绑定会员支付账户
        String acctType = "weChatMiniProgram";
        YunStResult yunStResult1 = applyBindAcct(bizUserId, acctType, acct);
        if ("OK".equals(yunStResult1.getStatus())) {
            log.info("is ok:-------------->");
            log.info(yunStResult1.getSignedValue());
        } else {
            log.info("is error:-------------->");
            log.info(yunStResult1.getErrorCode());
            log.info(yunStResult1.getMessage());
        }
        System.out.println("is The end of the test.......................绑定会员支付账户");
 
 
        System.out.println("is Enter the test.............................个人实名认证");
 
        //绑定会员支付账户
        String name = "张三";
        Long identityType = 1L;
        String identityNo = "41000000000000000000";
 
        yunStResult = setRealName(bizUserId, name, identityType, identityNo);
        if ("OK".equals(yunStResult.getStatus())) {
            log.info("is ok:-------------->");
            log.info(yunStResult.getSignedValue());
        } else {
            log.info("is error:-------------->");
            log.info(yunStResult.getErrorCode());
            log.info(yunStResult.getMessage());
        }
        System.out.println("is The end of the test.......................个人实名认证");
 
 
        System.out.println("is Enter the test.............................请求绑定银行卡");
 
        //绑定会员支付账户
        String cardNo = "6228481111111111111";
        String phone = "17803846500";
 
        yunStResult = applyBindBankCard(bizUserId, cardNo, phone, name, identityType, identityNo);
        if ("OK".equals(yunStResult.getStatus())) {
            log.info("is ok:-------------->");
            log.info(yunStResult.getSignedValue());
        } else {
            log.info("is error:-------------->");
            log.info(yunStResult.getErrorCode());
            log.info(yunStResult.getMessage());
        }
        System.out.println("is The end of the test.......................请求绑定银行卡");
 
 
        System.out.println("is Enter the test.............................消费申请");
 
 
        //绑定会员支付账户
        String recieverId = "123456";
        Long validateType = 0L;  //交易验签方式【0.无验证 1.短信验证码 2.支付密码】
        String backUrl = "https://www.baudi.com";     //后台回调地址
        ConsumeApply consumeApply = new ConsumeApply() {{
            setPayerId(bizUserId);
            setRecieverId(recieverId);
            setBizOrderNo(bizOrderNo);
            setAmount(1L);
            setFee(0L);
            setValidateType(validateType);
            setBackUrl(backUrl);
            setSummary("商品交易");
        }};
        String vspCusid = "552651058145DRF";
        String subAppid = "00143623";
        Long amount = 1L;
        yunStResult = wechatMiniprogramPay(consumeApply, vspCusid, subAppid, amount, acct);
        if ("OK".equals(yunStResult.getStatus())) {
            log.info("is ok:-------------->");
            log.info(yunStResult.getSignedValue());
        } else {
            log.info("is error:-------------->");
            log.info(yunStResult.getErrorCode());
            log.info(yunStResult.getMessage());
        }
 
        System.out.println("is The end of the test.......................消费申请");
 
    }*/
 
    /**
     * 小程序支付
     */
   /* @Test
    public void wechatPay() {
        log.info("<-------------------------this is createMember operation 创建会员 ------------------------->");
        //创建会员
        String bizUserId = "tz20200401111";  //普通会员
        //String shBizUserId = "shanghu001";  //普通会员会员(收款方,已实名)
        Long memberType = 3L;
        Long source = 1L;
        YunStResult result;
        result = createMember(bizUserId, memberType, source);
        logger.info("createMember result: status={},message={},signedValue={}", new Object[]{result.getStatus(), result.getMessage(), result.getSignedValue()});
 
        log.info("<-------------------------this is applyBindAcct operation 会员绑定支付账户用户标识------------------------->");
        //会员绑定支付账户用户标识(支付账户绑定小程序openId)
        String bizUserId = "tz20200401111";  //普通会员
        String acctType = "weChatMiniProgram";
        String acct = "tm001001";
        result = applyBindAcct(bizUserId, acctType, acct);
        logger.info("applyBindAcct result: status={}", new Object[]{result.getStatus()});
 
        log.info("<-------------------------this is wechatMiniprogramPay operation 消费申请------------------------->");
        //消费申请
        String bizUserId = "tz20200401111";  //普通会员
        String recieverId = "shanghu001";
        Long validateType = 0L;  //交易验签方式【0.无验证 1.短信验证码 2.支付密
        String bizOrderNo = "201200401111212";
        String backUrl = "https:localhost:8080";     //后台回调地址
        String acct = "tm001001";
        ConsumeApply consumeApply = ConsumeApply.builder()
                .payerId(bizUserId)
                .recieverId(recieverId)
                .bizOrderNo(bizOrderNo)
                .amount(1L)
                .fee(0L)
                .validateType(validateType)
                .backUrl(backUrl)
                .summary("商品交易").build();
        String vspCusid = "552651058145DRF";
        String subAppid = "00143623";
        Long amount = 1L;
        result = wechatMiniprogramPay(consumeApply, vspCusid, subAppid, amount, acct);
        //todo 测试子商户号未提供 通联未反馈
        logger.info("consumeApply result: status={}, signedValue={}", new Object[]{result.getStatus(), result.getSignedValue()});
 
        log.info("<-------------------------this is callBack operation 订单结果通知------------------------->");
        //订单结果通知
    }*/
 
 
    /**
     * 收银宝快捷支付
     *
     */
    /*@Test
    public void quickPay() throws Exception {
        log.info("<-------------------------this is createMember operation 创建会员------------------------->");
        //创建会员
        String bizUserId = "tz20200401113";  //普通会员
        String shBizUserId = "shanghu001";  //普通会员会员(收款方,已实名)
        Long memberType = 3L;
        Long source = 1L;
        YunStResult result;
        result = createMember(bizUserId, memberType, source);
        logger.info("createMember result: status={},message={},signedValue={}", new Object[]{result.getStatus(), result.getMessage(), result.getSignedValue()});
 
        log.info("<-------------------------this is sendVerificationCode operation 发送验证码------------------------->");
        //发送验证码
        String bizUserId = "tz20200401111";  //普通会员
        String phone = "17803846500";
        Long verificationCodeType = 9L;
        result = sendVerificationCode(bizUserId, phone, verificationCodeType);
        logger.info("sendVerificationCode result: status={},message={},signedValue={}",new Object[]{result.getStatus(),result.getMessage(),result.getSignedValue()});
 
        log.info("<-------------------------this is bindPhone operation 绑定手机------------------------->");
        //绑定手机
        String bizUserId = "tz20200401111";  //普通会员
        String verificationCode = "544343";
        result = bindPhone(bizUserId, phone, verificationCode);
        logger.info("bindPhone result: status={}",new Object[]{result.getStatus()});
 
        log.info("<-------------------------this is certification operation 实名认证------------------------->");
        //实名认证
        String bizUserId = "tz20200401113";  //普通会员
        String name = "唐宗旭";
        Long identityType = 1L;
        String identityNo = "511521199408143656";
        result = setRealName(bizUserId, name, identityType, identityNo);
        logger.info("certification result: status={}",new Object[]{result.getStatus()});
 
        log.info("<-------------------------this is applyBindBankCard operation 申请绑定的银行卡------------------------->");
        //申请绑定的银行卡(需用真实姓名,手机,身份证,银行卡)
        String bizUserId = "tz20200401111";  //普通会员
        String cardNo = "6217853100025227554"; //4结尾卡号返回姓名不匹配
        String phone = "17723341354";
        String name = "唐宗旭";
        Long identityType = 1L;
        String identityNo = "511521199408143656";
        result = applyBindBankCard(bizUserId, cardNo, phone, name, identityType, identityNo);
        logger.info("applyBindBankCard result:  status={} , signedValue= {}", new Object[]{result.getStatus()});
 
        log.info("<-------------------------this is bindBankCard operation 确认绑定银行卡------------------------->");
        //确认绑定银行卡
        String bizUserId = "tz20200401111";  //普通会员
        String phone = "17803846500";
        String tranceNum = "123"; //流水号(请求绑定银行卡接口返回)
        String transDate = "2019-10-12"; //申请时间(请求绑定银行卡接口返回)
        String verificationCode = "123";
        //todo "errorCode":"9000","message":"确认超时或请求号错误,请重新调用绑卡申请接口" 通联未反馈
        result = bindBankCard(bizUserId,tranceNum,transDate,phone,verificationCode);
        logger.info("bindBankCard result: status={}", new Object[]{result.getStatus()});
 
        log.info("<-------------------------this is unbindBankCard operation 解除银行卡绑定------------------------->");
        //解除银行卡绑定(需要时调用)
        String bizUserId = "tz20200401111";  //普通会员
        String cardNo = "6230943800000203604";
        result = unbindBankCard(bizUserId,cardNo);
        logger.info("unbindBankCard result: status={},message={}",new Object[]{result.getStatus(),result.getMessage()});
 
        log.info("<-------------------------this is quickPayVsp operation 消费申请(短信验证)------------------------->");
        String recieverId = "shanghu001";
        Long validateType = 1L;  //交易验签方式【0.无验证 1.短信验证码 2.支付密
        String bizOrderNo = "201200401111212";
        Long amount = 1L;
        Long fee = 1L;
        String backUrl = "http://localhost:8080";
        ConsumeApply consumeApply = ConsumeApply.builder()
                .payerId("tz20200401111")
                .recieverId("shanghu001")
                .validateType(1L)
                .bizOrderNo("201200401111212")
                .amount(1L)
                .fee(1L)
                .backUrl("http://localhost:8080").build();
        result = quickPayVsp(consumeApply,cardNo);
        log.info("consumeApply result: status = {},message = {}",new Object[]{result.getStatus(),result.getMessage()});
 
        log.info("<-------------------------this is pay operation 确认支付(短信+后台验证)------------------------->");
 
        String bizUserId = "tz20200401111";  //普通会员
        String bizOrderNo = "201200401111212";
        String tradeNo = "123";
        String verificationCode = "123";
        result = pay(bizUserId,bizOrderNo,tradeNo,verificationCode);
        log.info("pay result: status={},signedValue={}",new Object[]{result.getStatus(),result.getSignedValue()});
 
        log.info("<-------------------------this is getOrderDetail 查询订单状态(确认支付返回处理中时调用)------------------------->");
        String bizOrderNo = "201200401111212";
        result = getOrderDetail(bizOrderNo);
        log.info("getOrderDetail result: status={},signedValue={}",new Object[]{result.getStatus(),result.getSignedValue()});
 
    }*/
 
    /**
     * 面扫面支付(B扫c)
     *
     */
    /*@Test
    public void bussToCustPay(){
        log.info("<-------------------------this is createMember operation 创建会员------------------------->");
        //创建会员
        String bizUserId = "tz20200401111";  //普通会员
        String shBizUserId = "shanghu001";  //普通会员会员(收款方,已实名)
        Long memberType = 3L;
        Long source = 1L;
        YunStResult result;
        result = createMember(bizUserId, memberType, source);
        logger.info("createMember result: status={},message={},signedValue={}", new Object[]{result.getStatus(), result.getMessage(), result.getSignedValue()});
 
        log.info("<-------------------------this is applyBindAcct operation 会员绑定支付账户用户标识(微信/支付宝/云闪付openId)------------------------->");
        //会员绑定支付账户用户标识(微信/支付宝/云闪付openId)
        String bizUserId = "tz20200401111";  //普通会员
        String acctType = "weChatMiniProgram";
        String acct = "tm001001";
        result = applyBindAcct(bizUserId, acctType, acct);
        logger.info("applyBindAcct result: status={}", new Object[]{result.getStatus(),result.getSignedValue()});
 
        log.info("<-------------------------this is quickPayVsp operation 消费申请(支付方式:收银宝刷卡支付(被扫)_集团——支持微信、支付宝、银联、手机QQ)------------------------->");
        String bizUserId = "tz20200401111";  //普通会员
        String shBizUserId = "shanghu001";  //普通会员会员(收款方,已实名)
        ConsumeApply consumeApply = ConsumeApply.builder()
                .payerId(bizUserId)
                .recieverId(shBizUserId)
                .bizOrderNo("123231231")
                .amount(1L)
                .fee(1L)
                .validateType(0L)
                .backUrl("localhost")
                .build();
        Long amount = 1L;
        String authcode = "124316162322111111"; //此处需用真实付款码
        String vspCusid = "zsh111111";
        result = doCodePay(consumeApply,vspCusid,amount,authcode);
 
        log.info("<-------------------------this is getOrderDetail 查询订单状态(确认支付返回处理中时调用)------------------------->");
        result = getOrderDetail("12312323");
        log.info("getOrderDetail result: status={},signedValue={}",new Object[]{result.getStatus(),result.getSignedValue()});
 
    }*/
 
    /**
     * 面对面付款c扫b
     */
   /* @Test
    public void custToBussPay(){
        log.info("<-------------------------this is createMember operation 创建会员------------------------->");
        //创建会员
        String bizUserId = "tz20200401111";  //普通会员
        String shBizUserId = "shanghu001";  //普通会员会员(收款方,已实名)
        Long memberType = 3L;
        Long source = 1L;
        YunStResult result;
        result = createMember(bizUserId, memberType, source);
        logger.info("createMember result: status={},message={},signedValue={}", new Object[]{result.getStatus(), result.getMessage(), result.getSignedValue()});
 
        log.info("<-------------------------this is applyBindAcct operation 会员绑定支付账户用户标识(微信/支付宝/云闪付openId)------------------------->");
        //会员绑定支付账户用户标识(微信/支付宝/云闪付openId)
        String bizUserId = "tz20200401111";  //普通会员
        String acctType = "weChatMiniProgram";
        String acct = "tm001001";
        result = applyBindAcct(bizUserId, acctType, acct);
        logger.info("applyBindAcct result: status={}", new Object[]{result.getStatus(),result.getSignedValue()});
 
        log.info("<-------------------------this is quickPayVsp operation 消费申请(支付方式:收银宝刷卡支付(正扫)_)------------------------->");
        String bizUserId = "tz20200401111";  //普通会员
        ConsumeApply consumeApply = ConsumeApply.builder()
                .payerId(bizUserId)
                .recieverId(shBizUserId)
                .bizOrderNo("1232312311")
                .amount(1L)
                .fee(1L)
                .validateType(0L)
                .backUrl("localhost")
                .build();
        Long amount = 1L;
        String vspCusid = "zsh111111";
        result = doScanPay(consumeApply,vspCusid,amount,"SCAN_WEIXIN"); //正式环后加_ORG
        log.info("quickPayVsp result: status={},signedValue={}",new Object[]{result.getStatus(),result.getSignedValue()});
 
        log.info("<-------------------------this is getOrderDetail 查询订单状态(入金类交易(使用银行账户资金进行支付),只有订单支付成功情况下才会通知)------------------------->");
        result = getOrderDetail("12312323");
        log.info("getOrderDetail result: status={},signedValue={}",new Object[]{result.getStatus(),result.getSignedValue()});
    }*/
 
    /**
     * 企业卖家会员
     */
    /*@Test
    public void createOrgMember(){
        log.info("<-------------------------this is createOrgMember operation 创建企业会员------------------------->");
        String bizUserId = "sh20200401111";  //企业会员
        Long memberType = 2L;
        Long source = 2L; //pc端
        YunStResult result;
        result = createMember(bizUserId, memberType, source);
        logger.info("createMember result: status={},message={},signedValue={}", new Object[]{result.getStatus(), result.getMessage(), result.getSignedValue()});
 
        log.info("<-------------------------this is createOrgMember operation 创建企业会员------------------------->");
        String bizUserId = "sh20200401111";  //企业会员
        String backUrl = "localhost"; //通知地址
        Boolean isAuth = true;
        MerchantApply merchantApply = MerchantApply.builder()
                .companyName("company")
                .authType(2L)
                .uniCredit("112")
                .legalName("张三")
                .identityType(1L)
                .legalIds("122212121")  //RSA加密
                .legalPhone("13360881231")
                .accountNo("13360881231") //RSA加密
                .parentBankName("工商银行")
                .bankName("中国工商银行股份有限公司北京樱桃园支行") //需是父级直连银行
                .unionBank("111111111111")//12位数字
                .build();
        result = setCompanyInfo(bizUserId,backUrl,isAuth,merchantApply);
 
        log.info("<-------------------------this is sendVerificationCode operation 发送验证码------------------------->");
        //发送验证码
        String bizUserId = "tz20200401111";  //企业会员
        String phone = "17803846500";
        Long verificationCodeType = 9L;
        result = sendVerificationCode(bizUserId, phone, verificationCodeType);
        logger.info("sendVerificationCode result: status={},message={},signedValue={}",new Object[]{result.getStatus(),result.getMessage(),result.getSignedValue()});
 
        log.info("<-------------------------this is bindPhone operation 绑定手机------------------------->");
        //绑定手机
        String bizUserId = "tz20200401111";  //企业通会员
        String verificationCode = "544343";
        result = bindPhone(bizUserId, phone, verificationCode);
        logger.info("bindPhone result: status={}",new Object[]{result.getStatus()});
 
        log.info("<-------------------------this is signContract operation 会员电子签约------------------------->");
 
        SignContractApply signContractApply = SignContractApply.builder()
                .bizUserId("tz20200401113")
                .jumpUrl("http://www.baidu.com")
                .backUrl("localhost")
                .source(2L)
                .build();
        String webParamUrl = "http://116.228.64.55:6900/yungateway/member/signContract.html?";
        String signUrl = signContract(signContractApply,webParamUrl); //以前台 H5 页面形式进行请求
        System.out.println("signUrl is " + signUrl);
    }*/
 
    /**
     * 个人卖家会员
     *
     */
    /*@Test
    public void createSellerMember(){
        log.info("<-------------------------this is createOrgMember operation 创建个人会员------------------------->");
        String bizUserId = "sh20200401111";  //企业会员
        Long memberType = 3L;
        Long source = 2L; //pc端
        YunStResult result;
        result = createMember(bizUserId, memberType, source);
        logger.info("createMember result: status={},message={},signedValue={}", new Object[]{result.getStatus(), result.getMessage(), result.getSignedValue()});
 
        log.info("<-------------------------this is sendVerificationCode operation 发送验证码------------------------->");
        //发送验证码
        String bizUserId = "tz20200401111";  //普通会员
        String phone = "17803846500";
        Long verificationCodeType = 9L;
        result = sendVerificationCode(bizUserId, phone, verificationCodeType);
        logger.info("sendVerificationCode result: status={},message={},signedValue={}",new Object[]{result.getStatus(),result.getMessage(),result.getSignedValue()});
 
        log.info("<-------------------------this is bindPhone operation 绑定手机------------------------->");
        //绑定手机
        String bizUserId = "tz20200401111";  //普通会员
        String verificationCode = "544343";
        result = bindPhone(bizUserId, phone, verificationCode);
        logger.info("bindPhone result: status={}",new Object[]{result.getStatus()});
 
        log.info("<-------------------------this is certification operation 实名认证------------------------->");
        //实名认证
        String bizUserId = "tz20200401113";  //普通会员
        String name = "唐宗旭";
        Long identityType = 1L;
        String identityNo = "511521199408143656";
        result = setRealName(bizUserId, name, identityType, identityNo);
        logger.info("certification result: status={}",new Object[]{result.getStatus()});
 
        log.info("<-------------------------this is applyBindBankCard operation 申请绑定的银行卡------------------------->");
        //申请绑定的银行卡(需用真实姓名,手机,身份证,银行卡)
        String bizUserId = "tz20200401111";  //普通会员
        String cardNo = "6217853100025227554"; //4结尾卡号返回姓名不匹配
        String phone = "17723341354";
        String name = "唐宗旭";
        Long identityType = 1L;
        String identityNo = "511521199408143656";
        result = applyBindBankCard(bizUserId, cardNo, phone, name, identityType, identityNo);
        logger.info("applyBindBankCard result:  status={} , signedValue= {}", new Object[]{result.getStatus()});
 
        log.info("<-------------------------this is bindBankCard operation 确认绑定银行卡------------------------->");
        //确认绑定银行卡
        String bizUserId = "tz20200401111";  //普通会员
        String phone = "17803846500";
        String tranceNum = "123"; //流水号(请求绑定银行卡接口返回)
        String transDate = "2019-10-12"; //申请时间(请求绑定银行卡接口返回)
        String verificationCode = "123";
        //todo "errorCode":"9000","message":"确认超时或请求号错误,请重新调用绑卡申请接口" 通联未反馈
        result = bindBankCard(bizUserId,tranceNum,transDate,phone,verificationCode);
        logger.info("bindBankCard result: status={}", new Object[]{result.getStatus()});
 
        log.info("<-------------------------this is queryBankCard operation 查询绑定银行卡------------------------->");
        String bizUserId = "tz20200401111";
        String cardNo = null; //为空则查询所有银行卡
        result = queryBankCard(bizUserId,cardNo);
 
 
        log.info("<-------------------------this is unbindBankCard operation 解除银行卡绑定------------------------->");
        //解除银行卡绑定(需要时调用)
        String bizUserId = "tz20200401111";  //普通会员
        String cardNo = "6230943800000203604";
        result = unbindBankCard(bizUserId,cardNo);
        logger.info("unbindBankCard result: status={},message={}",new Object[]{result.getStatus(),result.getMessage()});
 
        log.info("<-------------------------this is signContract operation 会员电子签约------------------------->");
 
        SignContractApply signContractApply = SignContractApply.builder()
                .bizUserId("tz20200401113")
                .jumpUrl("http://www.baidu.com")
                .backUrl("localhost")
                .source(2L)
                .build();
        String webParamUrl = "http://116.228.64.55:6900/yungateway/member/signContract.html?";
        String signUrl = signContract(signContractApply,webParamUrl); //以前台 H5 页面形式进行请求
        System.out.println("signUrl is " + signUrl);
    }*/
 
 
    /**
     * 会员电子签约
     *
     * @param signContractApply
     * @return
     *
     */
    public static String signContract(SignContractApply signContractApply, String webParamUrl) {
        final YunRequest request = new YunRequest("MemberService", "signContract");
        request.put("bizUserId", signContractApply.getBizUserId());
        request.put("jumpUrl", signContractApply.getJumpUrl());
        request.put("backUrl", signContractApply.getBackUrl());
        request.put("source", signContractApply.getSource());
        try {
            webParamUrl += YunClient.encodeOnce(request);
            return webParamUrl;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 创建会员
     *
     * @param bizUserId  用户标识(用户主键id)
     * @param memberType 会员类型 [2.企业会员 3.个人会员]
     * @param source     访问终端类型[1.mobile 2.pc]
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult createMember(String bizUserId, Long memberType, Long source) {
        final YunRequest request = new YunRequest("MemberService", "createMember");
        request.put("bizUserId", bizUserId);
        request.put("memberType", memberType);
        request.put("source", source);
        try {
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 会员绑定支付账户用户标识
     *
     * @param bizUserId 用户标识(用户主键id)
     * @param acctType  支付账户类型【weChatPublic:微信公众号 weChatMiniProgram:微信小程序 aliPayService:支付宝生活号】
     * @param acct      支付账户用户标识【微信公众号openid/微信小程序openid/支付宝生活号user_id 】
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult applyBindAcct(String bizUserId, String acctType, String acct) {
        final YunRequest request = new YunRequest("MemberService", "applyBindAcct");
        request.put("bizUserId", bizUserId);
        request.put("operationType", "set");
        request.put("acctType", acctType);
        request.put("acct", acct);
        try {
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
    /**
     * 发送短信验证码
     *
     * @param bizUserId            用户标识(用户主键id)
     * @param phone                手机号码
     * @param verificationCodeType 验证码类型[9-绑定手机 6-解绑手机]
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult sendVerificationCode(String bizUserId, String phone, Long verificationCodeType) {
        final YunRequest request = new YunRequest("MemberService", "sendVerificationCode");
        request.put("bizUserId", bizUserId);
        request.put("phone", phone);
        request.put("verificationCodeType", verificationCodeType);
        try {
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 绑定手机
     *
     * @param bizUserId        用户标识(用户主键id)
     * @param phone            手机号码
     * @param verificationCode 验证码
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult bindPhone(String bizUserId, String phone, String verificationCode) {
        final YunRequest request = new YunRequest("MemberService", "bindPhone");
        request.put("bizUserId", bizUserId);
        request.put("phone", phone);
        request.put("verificationCode", verificationCode);
        try {
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 个人实名认证
     *
     * @param bizUserId    用户标识(用户主键id)
     * @param name         姓名
     * @param identityType 证件类型【1.身份证 2.护照 3.军官证 4.回乡证 5.台胞证 6.警官证 7.士兵证 99.其他证件】
     * @param identityNo   证件号码
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult setRealName(String bizUserId, String name, Long identityType, String identityNo) {
        final YunRequest request = new YunRequest("MemberService", "setRealName");
        try {
            request.put("bizUserId", bizUserId);
            request.put("name", name);
            request.put("identityType", identityType);
            request.put("identityNo", RSAUtil.encrypt(identityNo));
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 请求绑定银行卡
     *
     * @param bizUserId    用户标识(用户主键id)
     * @param cardNo       银行卡号
     * @param phone        银行预留手机
     * @param name         姓名
     * @param identityType 证件类型【1.身份证 2.护照 3.军官证 4.回乡证 5.台胞证 6.警官证 7.士兵证 99.其他证件】
     * @param identityNo   证件号码
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult applyBindBankCard(String bizUserId, String cardNo, String phone, String name, Long identityType, String identityNo) {
        final YunRequest request = new YunRequest("MemberService", "applyBindBankCard");
        try {
            request.put("bizUserId", bizUserId);
            request.put("cardNo", RSAUtil.encrypt(cardNo));
            request.put("cardNo", YunClient.encrypt(cardNo));
            request.put("phone", phone);
            request.put("name", name);
            request.put("cardCheck", 7L); //默认7L快捷支付
            request.put("identityType", identityType);
            request.put("identityNo", RSAUtil.encrypt(identityNo));
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 确认绑定银行卡
     *
     * @param bizUserId        用户标识(用户主键id)
     * @param tranceNum        流水号
     * @param transDate        申请时间
     * @param phone            银行预留手机
     * @param verificationCode 手机验证码
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult bindBankCard(String bizUserId, String tranceNum, String transDate, String phone, String verificationCode) {
        final YunRequest request = new YunRequest("MemberService", "bindBankCard");
        try {
            request.put("bizUserId", bizUserId);
            request.put("tranceNum", tranceNum);
            request.put("transDate", transDate);
            request.put("phone", phone);
            request.put("verificationCode", verificationCode);
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
    public static YunStResult queryBankCard(String bizUserId, String cardNo){
        final YunRequest request = new YunRequest("MemberService","queryBankCard");
        try {
            if (StrUtil.isNotEmpty(cardNo)){
                RSAUtil.encrypt(cardNo);
            };
            request.put("bizUserId",bizUserId);
            request.put("cardNo",cardNo);
            return JSONUtil.toBean(YunClient.request(request),YunStResult.class);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
    /**
     * 解除绑定银行卡
     *
     * @param bizUserId 用户标识(用户主键id)
     * @param cardNo    银行卡号
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult unbindBankCard(String bizUserId, String cardNo) {
        final YunRequest request = new YunRequest("MemberService", "unbindBankCard");
        try {
            request.put("bizUserId", bizUserId);
            request.put("cardNo", RSAUtil.encrypt(cardNo));
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 设置企业会员信息(暂时不用)
     *
     * @param bizUserId:用户标识(用户主键id)
     * @param backUrl:企业会员审核结果通知url
     * @param isAuth:是否进行线上认证
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult setCompanyInfo(String bizUserId, String backUrl, Boolean isAuth, MerchantApply merchantApply) {
        final YunRequest request = new YunRequest("MemberService", "setCompanyInfo");
        try {
            merchantApply.setLegalIds(RSAUtil.encrypt(merchantApply.getLegalIds()));
            merchantApply.setAccountNo(RSAUtil.encrypt(merchantApply.getAccountNo()));
            request.put("companyBasicInfo", merchantApply);
            request.put("bizUserId", bizUserId);
            request.put("backUrl", backUrl);
            request.put("isAuth", isAuth);
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 消费申请(收银宝快捷支付)
     *
     * @param consumeApply:消费公共实体
     * @param bankCardNo:银行卡号
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult quickPayVsp(ConsumeApply consumeApply, String bankCardNo) throws Exception {
        final YunRequest request = new YunRequest("OrderService", "consumeApply");
 
        HashMap<String, Object> params = new HashMap<>();
        params.put("limitPay", "no_credit");
        params.put("bankCardNo", RSAUtil.encrypt(bankCardNo));
 
        // 组装支付方式
        HashMap<String, Object> payMethod = new HashMap<>();
        payMethod.put("QUICKPAY_VSP", params);
 
        request.put("payerId", consumeApply.getPayerId());
        request.put("recieverId", consumeApply.getRecieverId());
        request.put("bizOrderNo", consumeApply.getBizOrderNo());
        request.put("amount", consumeApply.getAmount());
        request.put("fee", consumeApply.getFee());
        request.put("validateType", consumeApply.getValidateType());
        request.put("backUrl", consumeApply.getBackUrl());
        request.put("orderExpireDatetime", consumeApply.getOrderExpireDatetime());
        request.put("payMethod", payMethod);
        request.put("industryCode", YunStParam.industryCode);
        request.put("industryName", YunStParam.industryName);
        request.put("source", YunStParam.source);
        request.put("summary", consumeApply.getSummary());
        request.put("extendInfo", consumeApply.getExtendInfo());
        request.put("splitRule", consumeApply.getSplitRule());
        try {
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 确认支付(后台+短信验证码确认)
     *
     * @param bizUserId        用户标识(用户主键id)
     * @param bizOrderNo       订单编号(支付订单)
     * @param tradeNo          交易编号
     * @param verificationCode 短信验证码
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult pay(String bizUserId, String bizOrderNo, String tradeNo, String verificationCode) {
        ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
//        HttpServletRequest req = requestAttributes.getRequest();
//        String ipAddress = IPUtil.getIpAddr(req); //正式环境传用户ip
        final YunRequest request = new YunRequest("OrderService", "pay");
        try {
            request.put("bizUserId", bizUserId);
            request.put("bizOrderNo", bizOrderNo);
            request.put("tradeNo", tradeNo);
            request.put("verificationCode", verificationCode);
            request.put("bizOrderNo", bizOrderNo);
            request.put("consumerIp", IPUtil.getLocalHostIp());  //ip地址
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 查询订单状态
     *
     * @param bizOrderNo 订单编号(支付订单)
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult getOrderDetail(String bizOrderNo) {
        final YunRequest request = new YunRequest("OrderService", "getOrderDetail");
        try {
            request.put("bizOrderNo", bizOrderNo);
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 消费申请(微信小程序)
     *
     * @param consumeApply:消费公共实体
     * @param vspCusid:收银宝子商户号
     * @param subAppid:微信小程序支付appid参数
     * @param amount:支付金额,单位:分
     * @param acct:微信JS支付openid——微信分配
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult wechatMiniprogramPay(ConsumeApply consumeApply, String vspCusid, String subAppid, Long amount, String acct) {
        final YunRequest request = new YunRequest("OrderService", "consumeApply");
 
        HashMap<String, Object> params = new HashMap<>();
        params.put("vspCusid", vspCusid);
        params.put("subAppid", subAppid);   //正式环境请必传
        params.put("limitPay", "no_credit");
        params.put("amount", amount);
        params.put("acct", acct);
 
        // 组装支付方式
        HashMap<String, Object> payMethod = new HashMap<>();
        //payMethod.put("WECHATPAY_MINIPROGRAM", params);  //测试
        payMethod.put("WECHATPAY_MINIPROGRAM_ORG", params); //正式集团版
 
        request.put("payerId", consumeApply.getPayerId());
        request.put("recieverId", consumeApply.getRecieverId());
        request.put("bizOrderNo", consumeApply.getBizOrderNo());
        request.put("amount", consumeApply.getAmount());
        request.put("fee", consumeApply.getFee());
        request.put("validateType", consumeApply.getValidateType());
        request.put("backUrl", consumeApply.getBackUrl());
        request.put("orderExpireDatetime", consumeApply.getOrderExpireDatetime());
        request.put("payMethod", payMethod);
        request.put("industryCode", YunStParam.industryCode);
        request.put("industryName", YunStParam.industryName);
        request.put("source", YunStParam.source);
        request.put("summary", consumeApply.getSummary());
        request.put("extendInfo", consumeApply.getExtendInfo());
        request.put("splitRule", consumeApply.getSplitRule());
        try {
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 消费申请(B扫C 用户被扫)
     *
     * @param consumeApply:消费公共实体
     * @param vspCusid:收银宝子商户号
     * @param amount:支付金额,单位:分
     * @param authcode:支付授权码(用户出示的二维码)
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult doCodePay(ConsumeApply consumeApply, String vspCusid, Long amount, String authcode) {
        final YunRequest request = new YunRequest("OrderService", "consumeApply");
 
        HashMap<String, Object> params = new HashMap<>();
        params.put("amount", amount);
        params.put("vspCusid", vspCusid);
        params.put("authcode", authcode);
        params.put("limitPay", "no_credit");
 
        // 组装支付方式
        HashMap<String, Object> payMethod = new HashMap<>();
        payMethod.put("CODEPAY_VSP", params);
        //payMethod.put("CODEPAY_VSP_ORG", params);  //正式集团版
 
        request.put("payerId", consumeApply.getPayerId());
        request.put("recieverId", consumeApply.getRecieverId());
        request.put("bizOrderNo", consumeApply.getBizOrderNo());
        request.put("amount", consumeApply.getAmount());
        request.put("fee", consumeApply.getFee());
        request.put("validateType", consumeApply.getValidateType());
        request.put("backUrl", consumeApply.getBackUrl());
        request.put("orderExpireDatetime", consumeApply.getOrderExpireDatetime());
        request.put("payMethod", payMethod);
        request.put("industryCode", YunStParam.industryCode);
        request.put("industryName", YunStParam.industryName);
        request.put("source", YunStParam.source);
        request.put("summary", consumeApply.getSummary());
        request.put("extendInfo", consumeApply.getExtendInfo());
        request.put("splitRule", consumeApply.getSplitRule());
        try {
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
    /**
     * 消费申请(C扫B 用户主扫)
     *
     * @param consumeApply:消费公共实体
     * @param vspCusid:收银宝子商户号
     * @param amount:支付金额,单位:分
     * @param acctType:支付账户类型【SCAN_WEIXIN_ORG:微信 SCAN_ALIPAY_ORG:支付宝 SCAN_UNIONPAY_ORG:银联云闪付】   测试环境不带_ORG
     * @Author: lc
     * @Date: 2019/10/14 16:12
     */
    public static YunStResult doScanPay(ConsumeApply consumeApply, String vspCusid, Long amount, String acctType) {
        final YunRequest request = new YunRequest("OrderService", "consumeApply");
 
        HashMap<String, Object> params = new HashMap<>();
        params.put("vspCusid", vspCusid);
        params.put("amount", amount);
        params.put("limitPay", "no_credit");
 
        // 组装支付方式
        HashMap<String, Object> payMethod = new HashMap<>();
        payMethod.put(acctType, params);
 
        request.put("payerId", consumeApply.getPayerId());
        request.put("recieverId", consumeApply.getRecieverId());
        request.put("bizOrderNo", consumeApply.getBizOrderNo());
        request.put("amount", consumeApply.getAmount());
        request.put("fee", consumeApply.getFee());
        request.put("validateType", consumeApply.getValidateType());
        request.put("backUrl", consumeApply.getBackUrl());
        request.put("orderExpireDatetime", consumeApply.getOrderExpireDatetime());
        request.put("payMethod", payMethod);
        request.put("industryCode", YunStParam.industryCode);
        request.put("industryName", YunStParam.industryName);
        request.put("source", YunStParam.source);
        request.put("summary", consumeApply.getSummary());
        request.put("extendInfo", consumeApply.getExtendInfo());
        request.put("splitRule", consumeApply.getSplitRule());
        try {
            return JSONUtil.toBean(YunClient.request(request), YunStResult.class);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}