xuhy
2023-08-11 3c1223bf3eb6df077b48637a7c93a93246a1a8ae
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
package com.stylefeng.guns.modular.system.util.LiuZhouBank;
 
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fop.sdk.*;
import com.fop.sdk.domain.*;
import com.fop.sdk.request.*;
import com.fop.sdk.response.*;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.UUIDUtil;
 
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
 
/**
 * 银行签约工具类
 * @author pzb
 * @Date 2022/11/28 19:06
 */
 
public class ProtocolSignUtil {
 
 
    /**
     * 签约前获取短信验证码
     * @param IdNum         身份证号码
     * @param phone         银行预留电话
     * @param acctName      账户名称
     * @param acctNum       账户号
     * @return
     */
    public static ResultUtil<String> protocolSignSendSms(String IdNum, String phone, String acctName, String acctNum){
        try {
            String uri = "/api/conductor/cashier/protocolSignSendSms/1.0.0";
            FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
                    .IsBodyEncrypt(true)
                    .SererUrl(Config.PRODUCTION_URL + uri)
                    .EncryptType(EncryptType.SM4)
                    .SignType(SignType.SM2).build();
 
            /**
             * model,request,response类
             * 不同接口的model,request,response均不相同
             * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
             * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
             * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
             */
            ConductorCashierProtocolsignsendsmsModel_100 model = new ConductorCashierProtocolsignsendsmsModel_100();
            ConductorCashierProtocolsignsendsmsRequest_100  request = new ConductorCashierProtocolsignsendsmsRequest_100();
            ConductorCashierProtocolsignsendsmsResponse_100 response = null;
 
            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
            SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            String format = sdf1.format(new Date());
            String format1 = sdf2.format(new Date());
            model.setMchtNo(Config.MCHT_NO);
            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
            model.setTransDate(format);
            model.setTransTime(format1);
            model.setVersion("1.0");
            model.setSndDt(format + format1);
 
            model.setContractType("02");//01代扣,02代付
            model.setIdType("01");//01 居民身份证
            model.setIdNum(IdNum);//证件号码
            model.setMobilePhone(phone);//银行预留手机号
            model.setAcctName(acctName);//账户名称
            model.setAcctNum(acctNum);//账号
            model.setCardType("01");//01本行卡,02他行卡
            request.setBizModel(model);
            System.err.println("请求参数----》" + JSON.toJSONString(model));
            response = fopClient.execute(request);
            System.err.println("响应结果----》" + JSON.toJSONString(response));
            if("00000000".equals(response.getBizCode())){
                return ResultUtil.success();
            }else{
                System.err.println(response.getBizMsg());
                return ResultUtil.error(response.getBizMsg());
            }
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    /**
     * 银行卡签约
     * @param IdNum     身份证号码
     * @param phone     银行预留电话号码
     * @param acctName  账户名
     * @param acctNum   账号
     * @param code
     * @return
     */
    public static Map<String, String> protocolSign(String IdNum, String phone, String acctName, String acctNum, String code){
        Map<String, String> map = new HashMap<>();
        try {
            String uri = "/api/conductor/cashier/protocolSign/1.0.0";
            FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
                    .IsBodyEncrypt(true)
                    .SererUrl(Config.PRODUCTION_URL + uri)
                    .EncryptType(EncryptType.SM4)
                    .SignType(SignType.SM2).build();
 
            /**
             * model,request,response类
             * 不同接口的model,request,response均不相同
             * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
             * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
             * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
             */
            ConductorCashierProtocolsignModel_100 model = new ConductorCashierProtocolsignModel_100();
            ConductorCashierProtocolsignRequest_100 request = new ConductorCashierProtocolsignRequest_100();
            ConductorCashierProtocolsignResponse_100 response = null;
 
            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
            SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            String format = sdf1.format(new Date());
            String format1 = sdf2.format(new Date());
            model.setMchtNo(Config.MCHT_NO);
            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
            model.setTransDate(format);
            model.setTransTime(format1);
            model.setVersion("1.0");
            model.setSndDt(format + format1);
 
            model.setContractType("02");//协议类型01代扣,02代付
            model.setChannelType("11");//11收单商户
            model.setBusiType("01");//01商户后台接口调用
            model.setIdType("01");//01 居民身份证
            model.setIdNum(IdNum);//证件号码
            model.setMobilePhone(phone);//银行预留手机号码
            model.setAcctName(acctName);//户名
            model.setAcctNum(acctNum);//账户
            model.setCardType("01");//01本行卡,02他行卡
            model.setDynamicCode(code);//短信验证码
            request.setBizModel(model);
            System.err.println("请求参数----》" + JSON.toJSONString(model));
            response = fopClient.execute(request);
            System.err.println("响应结果----》" + JSON.toJSONString(response));
            if("00000000".equals(response.getBizCode())){
                map.put("code", "00");
                map.put("signNum", response.getSignNum());
                map.put("acctNumSuffix", response.getAcctNumSuffix());//银行卡号后4位
            }else{
                map.put("code", "01");
                map.put("msg", response.getBizMsg());
            }
        }catch (Exception e){
            e.printStackTrace();
            map.put("code", "01");
            map.put("msg", "接口异常");
        }
        return map;
    }
 
 
    /**
     * 协议签约查询
     * @param signNum   签约协议号
     * @param acctNum   银行账号
     * @return
     */
    public static Map<String, String> queryProtocolSign(String signNum, String acctNum){
        Map<String, String> map = new HashMap<>();
        try {
            String uri = "/api/conductor/cashier/queryProtocolSign/1.0.0";
            FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
                    .IsBodyEncrypt(true)
                    .SererUrl(Config.PRODUCTION_URL + uri)
                    .EncryptType(EncryptType.SM4)
                    .SignType(SignType.SM2).build();
 
            /**
             * model,request,response类
             * 不同接口的model,request,response均不相同
             * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
             * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
             * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
             */
            ConductorCashierQueryprotocolsignModel_100 model = new ConductorCashierQueryprotocolsignModel_100();
            ConductorCashierQueryprotocolsignRequest_100 request = new ConductorCashierQueryprotocolsignRequest_100();
            ConductorCashierQueryprotocolsignResponse_100 response = null;
 
            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
            SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            String format = sdf1.format(new Date());
            String format1 = sdf2.format(new Date());
            model.setMchtNo(Config.MCHT_NO);
            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
            model.setTransDate(format);
            model.setTransTime(format1);
            model.setVersion("1.0");
            model.setSndDt(format + format1);
 
            model.setSignNum(signNum);//签约协议号
            model.setAcctNum(acctNum);//账号
            model.setContractType("02");//协议类型01代扣,02代付
            request.setBizModel(model);
            System.err.println("请求参数----》" + JSON.toJSONString(model));
            response = fopClient.execute(request);
            System.err.println("响应结果----》" + JSON.toJSONString(response));
            String bizCode = response.getBizCode();
            if("00000000".equals(bizCode)){
                String signNum1 = response.getSignNum();
                String signStatus = response.getSignStatus();
                map.put("code", "00");
                map.put("SignNum", signNum1);//签约协议号
                map.put("SignStatus", signStatus);//签约状态 01-签约,02-解约,03客户黑名单,04-垫资超限冻结
            }else{
                map.put("code", "01");
                map.put("msg", response.getBizMsg());
            }
        }catch (Exception e){
            e.printStackTrace();
            map.put("code", "01");
            map.put("msg", "接口异常");
        }
        return map;
    }
 
 
 
 
    /**
     * 协议解约
     * @param signNum   签约协议号
     * @return
     */
    public static Map<String, String> protocolRescind(String signNum){
        Map<String, String> map = new HashMap<>();
        try {
            String uri = "/api/conductor/cashier/protocolRescind/1.0.0";
            FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
                    .IsBodyEncrypt(true)
                    .SererUrl(Config.PRODUCTION_URL + uri)
                    .EncryptType(EncryptType.SM4)
                    .SignType(SignType.SM2).build();
 
            /**
             * model,request,response类
             * 不同接口的model,request,response均不相同
             * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
             * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
             * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
             */
            ConductorCashierProtocolrescindModel_100 model = new ConductorCashierProtocolrescindModel_100();
            ConductorCashierProtocolrescindRequest_100 request = new ConductorCashierProtocolrescindRequest_100();
            ConductorCashierProtocolrescindResponse_100 response = null;
 
            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
            SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            String format = sdf1.format(new Date());
            String format1 = sdf2.format(new Date());
            model.setMchtNo(Config.MCHT_NO);
            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
            model.setTransDate(format);
            model.setTransTime(format1);
            model.setVersion("1.0");
            model.setSndDt(format + format1);
 
            model.setSignNum(signNum);//签约协议号
            model.setContractType("02");//协议类型01代扣,02代付
            model.setChannelType("11");//11收单商户
            request.setBizModel(model);
            System.err.println("请求参数----》" + JSON.toJSONString(model));
            response = fopClient.execute(request);
            System.err.println("响应结果----》" + JSON.toJSONString(response));
            String bizCode = response.getBizCode();
 
            if("00000000".equals(bizCode)){
                String signNum1 = response.getSignNum();
                String transSeq = response.getTransSeq();
                map.put("code", "00");
                map.put("SignNum", signNum1);//签约协议号
                map.put("TransSeq", transSeq);//流水号
            }else{
                map.put("code", "01");
                map.put("msg", response.getBizMsg());//流水号
            }
        }catch (Exception e){
            map.put("code", "01");
            map.put("msg", "接口异常");//流水号
        }
        return map;
    }
 
 
    /**
     * 协议支付
     * @param signNum       签约协议号
     * @param amount        支付金额
     * @param transDesc     交易描述
     * @return
     */
    public static String protocolPayTrans(String signNum, Double amount, String transDesc){
        String uri = "/api/conductor/cashier/protocolPayTrans/1.0.0";
        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
                .IsBodyEncrypt(true)
                .SererUrl(Config.PRODUCTION_URL + uri)
                .EncryptType(EncryptType.SM4)
                .SignType(SignType.SM2).build();
 
        /**
         * model,request,response类
         * 不同接口的model,request,response均不相同
         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
         */
        ConductorCashierProtocolpaytransModel_100 model = new ConductorCashierProtocolpaytransModel_100();
        ConductorCashierProtocolpaytransRequest_100 request = new ConductorCashierProtocolpaytransRequest_100();
        ConductorCashierProtocolpaytransResponse_100 response = null;
 
 
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
        SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String format = sdf1.format(new Date());
        String format1 = sdf2.format(new Date());
        model.setMchtNo(Config.MCHT_NO);
        try {
            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
        } catch (Exception e) {
            e.printStackTrace();
        }
        model.setTransDate(format);
        model.setTransTime(format1);
        model.setVersion("1.0");
        model.setSndDt(format + format1);
 
        model.setSignNum(signNum);//签约协议号
        model.setTransAmount(amount.toString());//支付金额
        model.setTransDesc(transDesc);//交易描述
        request.setBizModel(model);
        System.err.println("请求参数----》" + JSON.toJSONString(model));
        try {
            response = fopClient.execute(request);
        } catch (FopApiException e) {
            e.printStackTrace();
        }
        System.err.println("响应结果----》" + JSON.toJSONString(response));
        return  JSONObject.toJSONString(response);
    }
 
 
    /**
     * 协议代付
     * @param signNum
     * @param amount
     * @param transDesc
     * @return
     */
    public static Map<String, Object> protocolAgentPay(String signNum, Double amount, String transDesc){
        Map<String, Object> map = new HashMap<>();
        try {
            String uri = "/api/conductor/cashier/protocolAgentPay/1.0.0";
            FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
                    .IsBodyEncrypt(true)
                    .SererUrl(Config.PRODUCTION_URL + uri)
                    .EncryptType(EncryptType.SM4)
                    .SignType(SignType.SM2).build();
 
            /**
             * model,request,response类
             * 不同接口的model,request,response均不相同
             * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
             * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
             * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
             */
            ConductorCashierProtocolagentpayModel_100 model = new ConductorCashierProtocolagentpayModel_100();
            ConductorCashierProtocolagentpayRequest_100 request = new ConductorCashierProtocolagentpayRequest_100();
            ConductorCashierProtocolagentpayResponse_100 response = null;
 
 
            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
            SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            String format = sdf1.format(new Date());
            String format1 = sdf2.format(new Date());
            model.setMchtNo(Config.MCHT_NO);
            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
            model.setTransDate(format);
            model.setTransTime(format1);
            model.setVersion("1.0");
            model.setSndDt(format + format1);
 
            model.setSignNum(signNum);//签约协议号
            model.setTransAmount(amount.toString());//支付金额
            model.setTransDesc(transDesc);//交易描述
            request.setBizModel(model);
            System.err.println("请求参数----》" + JSON.toJSONString(model));
            response = fopClient.execute(request);
            System.err.println("响应结果----》" + JSON.toJSONString(response));
            String bizCode = response.getBizCode();
 
            if("00000000".equals(bizCode)){
                String transSeq = response.getTransSeq();
                map.put("code", "00");
                map.put("TransSeq", transSeq);
            }else{
                map.put("code", "01");
                map.put("msg", response.getBizMsg());
            }
        }catch (Exception e){
            e.printStackTrace();
            map.put("code", "01");
            map.put("msg", "接口异常");
        }
        return map;
    }
 
 
    /**
     * 统一交易退款
     * @param oriTransSeq       原商户上送交易流水号
     * @param oriTransDate      原交易日期
     * @param oriTansTime       原交易时间
     * @param oriTransAmount    原交易金额
     * @param refundAmount      退款金额
     * @return
     */
    public static String protocolPayRefund(String oriTransSeq, String oriTransDate, String oriTansTime, Double oriTransAmount, Double refundAmount){
        String uri = "/api/conductor/cashier/protocolPayRefund/1.0.0";
        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
                .IsBodyEncrypt(true)
                .SererUrl(Config.PRODUCTION_URL + uri)
                .EncryptType(EncryptType.SM4)
                .SignType(SignType.SM2).build();
 
        /**
         * model,request,response类
         * 不同接口的model,request,response均不相同
         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
         */
        ConductorCashierProtocolpayrefundModel_100 model = new ConductorCashierProtocolpayrefundModel_100();
        ConductorCashierProtocolpayrefundRequest_100 request = new ConductorCashierProtocolpayrefundRequest_100();
        ConductorCashierProtocolpayrefundResponse_100 response = null;
 
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
        SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String format = sdf1.format(new Date());
        String format1 = sdf2.format(new Date());
        model.setMchtNo(Config.MCHT_NO);
        try {
            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
        } catch (Exception e) {
            e.printStackTrace();
        }
        model.setTransDate(format);
        model.setTransTime(format1);
        model.setVersion("1.0");
        model.setSndDt(format + format1);
 
        model.setOriTransSeq(oriTransSeq);//原商户上送交易流水号
        model.setOriTransType("sign.pay");//sign.pay 协议支付,sign.deposit协议代付,sign.wx.jspay协议代付关联微信公众号支付,sign.ali.jspay协议代付关联支付宝服务窗支付,loan.pay欠款订单还款,card.prepay本行卡支付预下单,unified.pay客户被扫接口,ali.dynamic.code支付宝扫码支付,union.dynamic.code银联扫码支付,wx.jspay微信公众号支付,ali.jspay支付宝服务窗支付,mergePay.order聚合支付预下单
        model.setOriTransDate(oriTransDate);//原交易日期
        model.setOriTansTime(oriTansTime);//原交易时间
        model.setOriTransAmount(oriTransAmount.toString());//原交易金额
        model.setRefundAmount(refundAmount.toString());//退款金额
        request.setBizModel(model);
        System.err.println("请求参数----》" + JSON.toJSONString(model));
        try {
            response = fopClient.execute(request);
        } catch (FopApiException e) {
            e.printStackTrace();
        }
        System.err.println("响应结果----》" + JSON.toJSONString(response));
        return  JSONObject.toJSONString(response);
    }
 
 
    /**
     * 统一交易状态查询
     * @param oriTransSeq       原商户上送交易流水号
     * @param oriTransDate      原交易日期
     * @param oriTansTime       原交易时间
     * @param oriTransAmount    原交易金额
     * @return
     */
    public static String queryTransStatus(String oriTransSeq, String oriTransDate, String oriTansTime, Double oriTransAmount){
        String uri = "/api/conductor/cashier/protocolPayRefund/1.0.0";
        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
                .IsBodyEncrypt(true)
                .SererUrl(Config.PRODUCTION_URL + uri)
                .EncryptType(EncryptType.SM4)
                .SignType(SignType.SM2).build();
 
        /**
         * model,request,response类
         * 不同接口的model,request,response均不相同
         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
         */
        ConductorCashierQuerytransstatusModel_100 model = new ConductorCashierQuerytransstatusModel_100();
        ConductorCashierQuerytransstatusRequest_100 request = new ConductorCashierQuerytransstatusRequest_100();
        ConductorCashierQuerytransstatusResponse_100 response = null;
 
 
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
        SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String format = sdf1.format(new Date());
        String format1 = sdf2.format(new Date());
        model.setMchtNo(Config.MCHT_NO);
        try {
            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
        } catch (Exception e) {
            e.printStackTrace();
        }
        model.setTransDate(format);
        model.setTransTime(format1);
        model.setVersion("1.0");
        model.setSndDt(format + format1);
 
        model.setOriTransSeq(oriTransSeq);//原商户上送交易流水号
        model.setOriTransType("sign.pay");//sign.pay 协议支付,sign.deposit协议代付,sign.wx.jspay协议代付关联微信公众号支付,sign.ali.jspay协议代付关联支付宝服务窗支付,loan.pay欠款订单还款,card.prepay本行卡支付预下单,unified.pay客户被扫接口,ali.dynamic.code支付宝扫码支付,union.dynamic.code银联扫码支付,wx.jspay微信公众号支付,ali.jspay支付宝服务窗支付,mergePay.order聚合支付预下单
        model.setOriTransDate(oriTransDate);//原交易日期
        model.setOriTansTime(oriTansTime);//原交易时间
        model.setOriTransAmount(oriTransAmount.toString());//原交易金额
        request.setBizModel(model);
        System.err.println("请求参数----》" + JSON.toJSONString(model));
        try {
            response = fopClient.execute(request);
        } catch (FopApiException e) {
            e.printStackTrace();
        }
        System.err.println("响应结果----》" + JSON.toJSONString(response));
        return  JSONObject.toJSONString(response);
    }
 
 
}