puzhibing
2022-08-22 1421f8e9c308c4741cb396309035009393b5b036
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
package com.stylefeng.guns.modular.system.util;
 
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.modular.system.dao.CarInsuranceMapper;
import com.stylefeng.guns.modular.system.dao.DriverPunishMapper;
import com.stylefeng.guns.modular.system.dao.DriverTrainMapper;
import com.stylefeng.guns.modular.system.dao.OrderCancelMapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
import java.util.*;
import java.util.regex.Pattern;
 
/**
 * 上传安全平台数据
 */
@Component
public class PushMinistryOfTransportUtil {
 
    @Autowired
    private ITCarService carService;
 
    @Autowired
    private ITDriverService driverService;
 
    @Autowired
    private ITCompanyService companyService;
 
    @Autowired
    private ITSystemPriceService systemPriceService;
 
    @Autowired
    private ITCarModelService carModelService;
 
    @Autowired
    private ITCarBrandService carBrandService;
 
    @Autowired
    private ITCarServiceService carServiceService;
 
    @Autowired
    private ITVersionManagementService versionManagementService;
 
    @Autowired
    private ITOrderPrivateCarService orderPrivateCarService;
 
    @Autowired
    private ITComplaintService complaintService;
 
    @Resource
    private OrderCancelMapper orderCancelMapper;
 
    @Autowired
    private GDMapGeocodingUtil gdMapGeocodingUtil;
 
    @Resource
    private CarInsuranceMapper carInsuranceMapper;
 
    @Resource
    private DriverTrainMapper driverTrainMapper;
 
    @Resource
    private DriverPunishMapper driverPunishMapper;
 
 
    /**
     * 上传企业基础信息
     */
    public void baseInfoCompany(Integer id){
        TCompany tCompany = companyService.selectById(id);
        String fileName = System.currentTimeMillis() + ".jpg";
        //上传图片文件
        Map<String, String> file = new HashMap<>();
        file.put("path", "/tmp");
        file.put("fileName", fileName);
        file.put("url", tCompany.getLegalPhotoUrl());
        file.put("newFilePath", "/swapfiles");
        String result_ = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_ftp + "/uploadAndMoveFile", file);
        System.out.println("上传图片文件:" + result_);
 
        //上传数据
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("CompanyName", tCompany.getName());//公司名称
        jsonObject.put("Identifier", tCompany.getIdentifier());//统一社会信用代码
        jsonObject.put("Address", Integer.valueOf(tCompany.getAddressCode()));//注册地行政区划代码
        jsonObject.put("BusinessScope", tCompany.getBusinessScope());//经营范围
        jsonObject.put("ContactAddress", tCompany.getContactAddress());//通信地址
        jsonObject.put("EconomicType", tCompany.getEconomicType());//经营业户经济类型
        jsonObject.put("RegCapital", tCompany.getRegCapital());//注册资本
        jsonObject.put("LegalName", tCompany.getLegalName());//法人代表姓名
        jsonObject.put("LegalID", tCompany.getLegalId());//法人代表身份证号
        jsonObject.put("LegalPhone", tCompany.getLegalPhone());//法人代表电话
        jsonObject.put("LegalPhoto", fileName);//法人代表身份证扫描件文件编号(.jpg)
        jsonObject.put("State", 0);//状态(0:有效,1:失效)
        jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoCompany", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompany", map);
        System.out.println("上传企业基础信息:" + result);
    }
 
 
 
 
    /**
     * 上传网约车平台公司营运规模信息
     */
    public void baseInfoCompanyStat(){
        int state = carService.selectCount(new EntityWrapper<TCar>().eq("state", 1));
        int i = driverService.selectCount(new EntityWrapper<TDriver>().eq("authState", 2).ne("flag", 3));
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("VehicleNum", state);
        jsonObject.put("DriverNum", i);
        jsonObject.put("Flag", 1);
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoCompanyStat", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompanyStat", map);
        System.out.println("上传网约车平台公司营运规模信息:" + result);
 
    }
 
 
    /**
     * 上传网约车平台公司支付信息
     */
    public void baseInfoCompanyPay(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("PayName", "支付宝(中国)网络技术有限公司");//银行或者非银行支付机构名称
        jsonObject.put("PayId", "2000133000019");//非银行支付机构支付业务许可证编号
        jsonObject.put("PayType", "1");//支付业务类型
        jsonObject.put("PayScope", "全国");//业务覆盖范围
        jsonObject.put("PrepareBank", "中国工商银行");//备付金存管银行
        jsonObject.put("CountDate", 15);//结算周期
        jsonObject.put("State", 0);//状态(0:有效,1:失效)
        jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoCompanyPay", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompanyPay", map);
        System.out.println("上传网约车平台公司支付信息:" + result);
    }
 
 
    /**
     * 网约车平台公司服务机构
     */
    public void baseInfoCompanyService(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("Address", 450204);//行政区划代码
        jsonObject.put("ServiceName", "广西云森科技有限公司");//服务机构名称
        jsonObject.put("ServiceNo", "45020401");//服务机构代码
        jsonObject.put("DetailAddress", "柳州市柳邕路新翔小区二区6栋11号");//服务机构地址
        jsonObject.put("ResponsibleName", "翁克顺");//服务机构负责人姓名
        jsonObject.put("ResponsiblePhone", "13907728585");//负责人联系电话
        jsonObject.put("ManagerName", "吴志武");//服务机构管理人姓名
        jsonObject.put("ManagerPhone", "15907720083");//管理人联系电话
        jsonObject.put("ContactPhone", "0772-3633333");//服务机构紧急联系电话
        jsonObject.put("MailAddress", "柳州市城中区滨江西路15栋2号OK充电站");//行政文书送达邮寄地址
        jsonObject.put("CreateDate", "2015年09月18日");//服务机构设立日期
        jsonObject.put("State", 0);//状态(0:有效,1:失效)
        jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoCompanyService", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompanyService", map);
        System.out.println("网约车平台公司服务机构:" + result);
    }
 
 
    /**
     * 网约车平台公司经营许可
     * @param id
     */
    public void baseInfoCompanyPermit(Integer id){
        TCompany tCompany = companyService.selectById(id);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("Address", tCompany.getAddressCode());//许可地行政区划代码
        jsonObject.put("Certificate", tCompany.getLicenseNumber());//网络预约出租车经营许可证号
        jsonObject.put("OperationArea", "广西壮族自治区柳州市城区");//经营区域
        jsonObject.put("OwnerName", tCompany.getName());//公司名称
        jsonObject.put("Organization", tCompany.getLicensingAgency());//发证机构名称
        jsonObject.put("StartDate", tCompany.getLicenseStartTime());//有效期起YYYYMMDD
        jsonObject.put("StopDate", tCompany.getLicenseEndTime());//有效期止YYYYMMDD
        jsonObject.put("CertifyDate", tCompany.getLicenseTime());//初次发证日期YYYYMMDD
        jsonObject.put("State", 0);//状态(0:有效,1:失效)
        jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoCompanyPermit", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompanyPermit", map);
        System.out.println("网约车平台公司经营许可:" + result);
    }
 
 
 
    /**
     * 网约车平台公司运价信息
     */
    public void baseInfoCompanyFare(Integer id){
        TSystemPrice tSystemPrice = systemPriceService.selectById(id);
        String content = tSystemPrice.getContent();
        JSONObject price = JSON.parseObject(content);
 
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("Address", 450204);//运价适用地行政区划代码
        jsonObject.put("FareType", id);//运价类型编码(由网约车平台公司统一编码,应确保唯一性)
        jsonObject.put("FareTypeNote", tSystemPrice.getFareTypeNote());//运价类型说明
        jsonObject.put("FareValidOn", new Date());//运价有效期起YYYYMMDDhhmmss
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) +1);
        jsonObject.put("FareValidOff", calendar.getTime());//运价有效止YYYYMMDDhhmmss
        jsonObject.put("StartFare", Double.valueOf(price.get("num1").toString()));//起步价(元)
        jsonObject.put("StartMile", Double.valueOf(price.get("num2").toString()));//起步里程(km)
        jsonObject.put("UnitPricePerMile", Double.valueOf(price.get("num4").toString()));//计程单价(按公里/元)
        jsonObject.put("UnitPricePerMinute", Double.valueOf(price.get("num5").toString()));//计时单价(按分钟/元)
        jsonObject.put("UpPrice", Double.valueOf(price.get("num10").toString()));//单程加价单价(元)
        jsonObject.put("UpPriceStartMile", Double.valueOf(price.get("num8").toString()));//单程加价公里(km)
        String[] num23s = price.get("num23").toString().split(" - ");
        jsonObject.put("MorningPeakTimeOn", num23s[0]);//营运早高峰时间起(HHmm 24小时)
        jsonObject.put("MorningPeakTimeOff", num23s[1]);//营运早高峰时间止(HHmm 24小时)
        String[] num24s = price.get("num24").toString().split(" - ");
        jsonObject.put("EveningPeakTimeOn", num24s[0]);//营运晚高峰时间起(HHmm 24小时)
        jsonObject.put("EveningPeakTimeOff", num24s[1]);//营运晚高峰时间止(HHmm 24小时)
        jsonObject.put("OtherPeakTimeOn", "");//其他营运高峰时间起(HHmm 24小时)
        jsonObject.put("OtherPeakTineOff", "");//其他营运高峰时间止(HHmm 24小时)
        jsonObject.put("PeakUnitPrice", Double.valueOf(price.get("num28").toString()));//高峰时间单程加价单价(元)
        jsonObject.put("PeakPriceStartMile", Double.valueOf(price.get("num8").toString()));//高峰时间单程加价公里(km)
        jsonObject.put("LowSpeedPriceMinute", 0);//低速计时加价(按分钟 元)
        jsonObject.put("NightPricePerMile", Double.valueOf(price.get("num18").toString()));//夜间费(按公里 元)
        jsonObject.put("NightPricePerMinute", Double.valueOf(price.get("num19").toString()));//夜间费(按分钟 元)
        jsonObject.put("OtherPrice", 0);//其它加价金额(元)
 
        jsonObject.put("State", tSystemPrice.getState() != 1 ? 1 : 0);//状态(0:有效,1:失效)
        jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoCompanyFare", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoCompanyFare", map);
        System.out.println("网约车平台公司运价信息:" + result);
    }
 
 
    /**
     * 车辆基本信息
     * @param id
     */
    public void baseInfoVehicle(Integer id){
        TCar tCar = carService.selectById(id);
        TCarModel tCarModel = carModelService.selectById(tCar.getCarModelId());
        TCarBrand tCarBrand = carBrandService.selectById(tCar.getCarBrandId());
        TCarService tCarService = carServiceService.selectOne(new EntityWrapper<TCarService>().eq("carId", id).eq("type", 1));
        TSystemPrice tSystemPrice = systemPriceService.selectOne(new EntityWrapper<TSystemPrice>()
                .eq("type", 1)
                .eq("serverCarModelId", tCarService.getServerCarModelId())
                .eq("companyId", (tCar.getFranchiseeId() == null || tCar.getFranchiseeId() == 0) ? tCar.getCompanyId() : tCar.getFranchiseeId()).eq("state", 1));
 
        String fileName = System.currentTimeMillis() + ".jpg";
        //上传图片文件
        Map<String, String> file = new HashMap<>();
        file.put("path", "/tmp");
        file.put("fileName", fileName);
        file.put("url", tCar.getCarPhoto());
        file.put("newFilePath", "/swapfiles");
        String result_ = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_ftp + "/uploadAndMoveFile", file);
        System.out.println("上传图片文件:" + result_);
 
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("Address", 450204);//车辆所在城市行政区划代码
        jsonObject.put("VehicleNo", tCar.getCarLicensePlate());//车辆号牌
        jsonObject.put("PlateColor", tCar.getPlateColor());//车牌颜色
        jsonObject.put("Seats", tCarModel.getSeat());//核定载客位
        jsonObject.put("Brand", tCarBrand.getName());//车辆厂牌
        jsonObject.put("Model", tCarModel.getName());//车辆型号
        jsonObject.put("VehicleType", tCar.getVehicleType());//车辆类型(以机动车行驶证为准)
        jsonObject.put("OwnerName", tCar.getOwnerName());//车辆所有人(以机动车行驶证为准)
        jsonObject.put("VehicleColor", tCar.getCarColor());//车身颜色
        jsonObject.put("EngineId", tCar.getEngineId());//发动机号(以机动车行驶证为准)
        jsonObject.put("VIN", tCar.getVIN());//车辆VIN码(以机动车行驶证为准)
        jsonObject.put("CertifyDateA", tCar.getCertifyDateA());//车辆注册日期(以机动车行驶证为准)YYYY-MM-DD
        jsonObject.put("FuelType", tCar.getFuelType());//车辆燃料类型
        jsonObject.put("EngineDisplace", tCar.getEngineDisplace());//发送机排量(毫升)
        jsonObject.put("PhotoId", fileName);//车辆照片文件编号
        jsonObject.put("Certificate", tCar.getCertificate());//运输证字号
        jsonObject.put("TransAgency", tCar.getTransAgency());//车辆运输证发证机构
        jsonObject.put("TransArea", tCar.getTransArea());//车辆经营区域
        jsonObject.put("TransDateStart", tCar.getTransDateStart());//车辆运输证有效期起YYYYMMDD
        jsonObject.put("TransDateStop", tCar.getTransDateStop());//车辆运输证有效期止YYYYMMDD
        jsonObject.put("CertifyDateB", tCar.getCertifyDateB());//车辆初次登记日期YYYY-MM-DD
        jsonObject.put("FixState", tCar.getFixState());//车辆维修状态(0:未检修,1:已检修,2:未知)
        jsonObject.put("NextFixDate", tCar.getNextFixDate());//车辆下次年检时间YYYY-MM-DD
        jsonObject.put("CheckState", tCar.getCheckState());//车辆年度审验状态
        jsonObject.put("FeePrintId", tCar.getFeePrintId());//发票打印设备序列号
        jsonObject.put("GPSBrand", tCar.getGPSBrand());//卫星定位装置品牌
        jsonObject.put("GPSModel", tCar.getGPSModel());//卫星定位装置型号
        jsonObject.put("GPSIMEI", tCar.getGPSIMEI());//卫星定位装置IMEI号
        jsonObject.put("GPSInstallDate", tCar.getGPSInstallDate());//卫星定位设备安装日期YYYYMMDD
        jsonObject.put("RegisterDate", tCar.getRegisterDate());//报备日期(车辆信息向服务所在地出租车行政主管部门报备日期YYYYMMDD)
        jsonObject.put("CommercialType", Integer.valueOf(tCar.getCommercialType()));//服务类型(1:网络预约出租车,2:巡游出租汽车,3:私人小客车合乘)
        jsonObject.put("FareType", null == tSystemPrice ? "" : tSystemPrice.getId());//运价类型编码(与运价信息中一一对应)
        jsonObject.put("State", tCar.getState() == 1 ? 0 : 1);//状态(0:有效,1:失效)
        jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());//YYYYMMDDhhmmss
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoVehicle", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoVehicle", map);
        System.out.println("车辆基本信息:" + result);
    }
 
 
    /**
     * 车辆保险信息
     */
    public void baseInfoVehicleInsurance(Integer id, Integer flag){
        CarInsurance carInsurance = carInsuranceMapper.selectById(id);
        TCar tCar = carService.selectById(carInsurance.getCarId());
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("VehicleNo", tCar.getCarLicensePlate());//车辆号牌
        jsonObject.put("InsurCom", carInsurance.getInsurCom());//保险公司名称
        jsonObject.put("InsurNum", carInsurance.getInsurNum());//保险号
        jsonObject.put("InsurType", carInsurance.getInsurType());//保险类型
        jsonObject.put("InsurCount", carInsurance.getInsurCount());//保险金额(元)
        jsonObject.put("InsurEff", carInsurance.getInsurEff());//保险生效时间YYYYMMDD
        jsonObject.put("InsurExp", carInsurance.getInsurExp());//保险到期时间YYYYMMDD
        jsonObject.put("Flag", flag);//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoVehicleInsurance", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoVehicleInsurance", map);
        System.out.println("车辆保险信息:" + result);
    }
 
 
    /**
     * 驾驶员基本信息
     * @param driverId
     */
    public void baseInfoDriver(Integer driverId){
        TDriver tDriver = driverService.selectById(driverId);
 
        //上传图片文件
        String fileName = System.currentTimeMillis() + ".jpg";
        Map<String, String> file = new HashMap<>();
        file.put("path", "/tmp");
        file.put("fileName", fileName);
        file.put("url", tDriver.getHeadImgUrl());
        file.put("newFilePath", "/swapfiles");
        String result_ = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_ftp + "/uploadAndMoveFile", file);
        System.out.println("上传图片文件:" + result_);
 
        String fileName1 = System.currentTimeMillis() + ".jpg";
        Map<String, String> file1 = new HashMap<>();
        file1.put("path", "/tmp");
        file1.put("fileName", fileName1);
        file1.put("url", tDriver.getDriveCardImgUrl());
        file1.put("newFilePath", "/swapfiles");
        String result1_ = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_ftp + "/uploadAndMoveFile", file1);
        System.out.println("上传图片文件:" + result1_);
 
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("Address", 450204);//注册地行政区划代码
        jsonObject.put("DriverName", tDriver.getName());//机动车驾驶员姓名
        jsonObject.put("DriverPhone", tDriver.getPhone());//驾驶员手机号
        jsonObject.put("DriverGender", (tDriver.getSex() == 1 ? "男" : "女"));//驾驶员性别
        jsonObject.put("DriverBirthday", tDriver.getBirthday());//出生日期YYYYMMDD
        jsonObject.put("DriverNationality", tDriver.getDriverNationality());//国籍
        jsonObject.put("DriverNation", tDriver.getDriverNation());//驾驶员民族
        jsonObject.put("DriverMaritalStatus", (tDriver.getDriverMaritalStatus() == 1 ? "未婚" : tDriver.getDriverMaritalStatus() == 2 ? "已婚" : "离异"));//驾驶员婚姻状况(未婚,已婚,离异)
        jsonObject.put("DriverLanguageLevel", tDriver.getDriverLanguageLevel());//驾驶员外语能力
        jsonObject.put("DriverEducation", tDriver.getDriverEducation());//驾驶员学历
        jsonObject.put("DriverCensus", tDriver.getDriverCensus());//户口登记机关名称
        jsonObject.put("DriverAddress", tDriver.getDriverAddress());//户口住址或长住地址
        jsonObject.put("DriverContactAddress", tDriver.getDriverContactAddress());//驾驶员通信地址
        jsonObject.put("PhotoId", fileName);//驾驶员照片文件编号
        jsonObject.put("LicenseId", tDriver.getDriveCard());//机动车驾驶证号
        jsonObject.put("LicensePhotoId", fileName1);//机动车驾驶证扫描件文件编号
        jsonObject.put("DriverType", tDriver.getDriverType());//准驾车型
        jsonObject.put("GetDriverLicenseDate", tDriver.getGetDriverLicenseDate());//初次领取驾驶证日期YYYYMMDD
        jsonObject.put("DriverLicenseOn", tDriver.getDriverLicenseOn());//驾驶证有效期限起YYYYMMDD
        jsonObject.put("DriverLicenseOff", tDriver.getDriverLicenseOff());//驾驶证有效期限止YYYYMMDD
        jsonObject.put("TaxiDriver", tDriver.getTaxiDriver() == 0 ? 2 : 1);//是否巡游出租汽车驾驶员(1:是,2:否)
        jsonObject.put("CertificateNo", tDriver.getTaxiAptitudeCard());//网络预约出租汽车驾驶员资格证号
        jsonObject.put("NetworkCarIssueOrganization", tDriver.getNetworkCarlssueOrganization());//网络预约出租汽车驾驶员证发证机构
        jsonObject.put("NetworkCarIssueDate", tDriver.getNetworkCarlssueDate());//资格证发证日期YYYYMMDD
        jsonObject.put("GetNetworkCarProofDate", tDriver.getGetNetworkCarProofDate());//初次领取资格证日期YYYYMMDD
        jsonObject.put("NetworkCarProofOn", tDriver.getNetworkCarProofOn());//资格证有效起始日期YYYYMMDD
        jsonObject.put("NetworkCarProofOff", tDriver.getNetworkCarProofOff());//资格证有截止日期YYYYMMDD
        jsonObject.put("RegisterDate", tDriver.getRegisterDate());//报备日期(驾驶员信息向服务所在地出租车行政主管部门报备日期)
        jsonObject.put("FullTimeDriver", tDriver.getFullTimeDriver());//是否专职驾驶员(1:是,0:否)
        jsonObject.put("InDriverBlacklist", tDriver.getInDriverBlacklist());//是否在驾驶员黑名单内(1:是,0:否)
        jsonObject.put("CommercialType", tDriver.getCommercialType());//服务类型(1:网络预约出租汽车,2:巡游出租汽车,3:私人小客车合乘)
        jsonObject.put("ContractCompany", tDriver.getContractCompany());//驾驶员合同签署公司
        jsonObject.put("ContractOn", tDriver.getContractOn());//合同有效期起YYYYMMDD
        jsonObject.put("ContractOff", tDriver.getContractOff());//合同有效期止YYYYMMDD
        jsonObject.put("EmergencyContact", tDriver.getEmergencyContact());//紧急情况联系人
        jsonObject.put("EmergencyContactPhone", tDriver.getEmergencyContactPhone());//紧急情况联系人电话
        jsonObject.put("EmergencyContactAddress", tDriver.getEmergencyContactAddress());//紧急情况联系人通信地址
 
        jsonObject.put("State", tDriver.getAuthState() == 2 ? 0 : 1);//状态(0:有效,1:失效)
        jsonObject.put("Flag", tDriver.getFlag());//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoDriver", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoDriver", map);
        System.out.println("驾驶员基本信息:" + result);
    }
 
 
    /**
     * 网约车驾驶员培训信息
     * @param id
     * @param id
     */
    public void baseInfoDriverEducate(Integer id, Integer flag){
        DriverTrain driverTrain = driverTrainMapper.selectById(id);
        TDriver driver = driverService.selectById(driverTrain.getDriverId());
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("Address", 450204);//注册地行政区划代码
        jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证号
        jsonObject.put("CourseName", driverTrain.getCourseName());//驾驶员培训课程名称
        jsonObject.put("CourseDate", driverTrain.getCourseDate());//培训课程日期YYYYMMDD
        jsonObject.put("StartTime", driverTrain.getStartTime());//培训开始时间
        jsonObject.put("StopTime", driverTrain.getStopTime());//培训结束时间
        jsonObject.put("Duration", driverTrain.getDuration());//培训时长
        jsonObject.put("Flag", flag);//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoDriverEducate", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoDriverEducate", map);
        System.out.println("网约车驾驶员培训信息:" + result);
    }
 
 
    /**
     * 驾驶员移动终端信息
     * @param driverId
     */
    public void baseInfoDriverApp(Integer driverId){
        TDriver tDriver = driverService.selectById(driverId);
        TVersionManagement type = versionManagementService.selectOne(new EntityWrapper<TVersionManagement>().eq("type", 2).orderBy("insertTime desc limit 0, 1"));
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("Address", 450204);//注册地行政区划代码
        jsonObject.put("LicenseId", tDriver.getDriveCard());//机动车驾驶证号
        jsonObject.put("DriverPhone", tDriver.getPhone());//驾驶员手机号
        jsonObject.put("NetType", phoneExp(tDriver.getPhone()));//手机运营商(1:中国联通,2:中国移动,3:中国电信,4:其他)
        jsonObject.put("AppVersion", type.getVersion());//使用APP版本号
        jsonObject.put("MapType", 2);//使用地图类型(1:百度地图,2:高德地图,3:其他)
        jsonObject.put("State", 0);//状态(0:有效,1:失效)
        jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoDriverApp", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoDriverApp", map);
        System.out.println("驾驶员移动终端信息:" + result);
    }
 
 
    /**
     * 驾驶员统计信息
     * @param driverId
     */
    public void baseInfoDriverStat(Integer driverId){
        TDriver tDriver = driverService.selectById(driverId);
        Calendar s = Calendar.getInstance();
        s.setTime(new Date());
        s.set(s.get(Calendar.YEAR), s.get(Calendar.MONTH) - 1, 1, 0, 0, 0);
 
        Calendar e = Calendar.getInstance();
        e.setTime(new Date());
        e.set(e.get(Calendar.YEAR), e.get(Calendar.MONTH) - 1, e.getActualMaximum(Calendar.DAY_OF_MONTH), 23, 59, 59);
 
        int i = orderPrivateCarService.selectCount(
                new EntityWrapper<TOrderPrivateCar>()
                        .eq("driverId", driverId)
                        .in("state", Arrays.asList(6, 7, 8, 9))
                        .between("travelTime", s.getTime(), e.getTime())
        );
        int i1 = complaintService.selectCount(
                new EntityWrapper<TComplaint>()
                        .eq("driverId", driverId)
                        .between("insert_time", s.getTime(), e.getTime())
        );
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("Address", 450204);//注册地行政区划代码
        jsonObject.put("LicenseId", tDriver.getDriveCard());//机动车驾驶证号
        jsonObject.put("Cycle", s.getTime());//统计周期(统计周期按月,内容填写统计月份YYYYMM)
        jsonObject.put("OrderCount", i);//完成订单次数
        jsonObject.put("TrafficViolationCount", 0);//交通违章次数
        jsonObject.put("ComplainedCount", i1);//被投诉次数
        jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除)
        jsonObject.put("UpdateTime", new Date());
        Map<String, String> map = new HashMap<>();
        map.put("baseInfoDriverStat", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/baseInfoDriverStat", map);
        System.out.println("驾驶员统计信息:" + result);
    }
 
 
    /**
     * 订单撤销接口
     * @param orderId
     */
    public void orderCancel(Integer orderId){
        TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(orderId);
        TDriver driver = driverService.selectById(tOrderPrivateCar.getDriverId());
        OrderCancel query = orderCancelMapper.query(orderId, 1, null, null, 2);
        Map<String, String> geocode = null;
        try {
            geocode = gdMapGeocodingUtil.geocode(tOrderPrivateCar.getBoardingLon().toString(),
                    tOrderPrivateCar.getBoardingLat().toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("Address", Integer.valueOf(geocode.get("districtCode")));//上车地点行政区划代码
        jsonObject.put("OrderId", tOrderPrivateCar.getOrderNum());//订单编号
        jsonObject.put("OrderTime", tOrderPrivateCar.getOrderNum());//订单时间YYYYMMDDhhmmss
        jsonObject.put("CancelTime", query.getInsertTime());//订单撤销时间YYYYMMDDhhmmss
        jsonObject.put("Operator", "3");//撤销发起方(1:乘客,2:驾驶员,3:平台公司)
        jsonObject.put("CancelTypeCode", null != driver ? driver.getDriveCard() : "");//机动车驾驶证编号
        jsonObject.put("CancelReason", query.getReason());//撤销或违约原因
        Map<String, String> map = new HashMap<>();
        map.put("orderCancel", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/orderCancel", map);
        System.out.println("订单撤销接口:" + result);
    }
 
 
    /**
     * 乘客投诉信息
     * @param id
     */
    public void ratedPassengerComplaint(Integer id){
        TComplaint tComplaint = complaintService.selectById(id);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("OrderId", "");//订单号
        jsonObject.put("ComplaintTime", tComplaint.getInsertTime());//投诉时间YYYYMMDDhhmms
        jsonObject.put("Detail", tComplaint.getReason());//投诉内容
        jsonObject.put("Result", tComplaint.getHandleResult());//处理结果
        Map<String, String> map = new HashMap<>();
        map.put("ratedPassengerComplaint", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/ratedPassengerComplaint", map);
        System.out.println("乘客投诉信息:" + result);
    }
 
 
    /**
     * 驾驶员处罚信息
     * @param id
     */
    public void ratedDriverPunish(Integer id){
        DriverPunish driverPunish = driverPunishMapper.selectById(id);
        TDriver driver = driverService.selectById(driverPunish.getDriverId());
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证编号
        jsonObject.put("PunishTime", driverPunish.getPunishTime());//处罚时间YYYYMMDDhhmms
        jsonObject.put("PunishReason", driverPunish.getPunishReason());//处罚原因
        jsonObject.put("PunishReault", driverPunish.getPunishReault());//处罚结果
        Map<String, String> map = new HashMap<>();
        map.put("ratedDriverPunish", jsonObject.toJSONString());
        String result = HttpRequestUtil.postRequest(PushURL.ministry_of_transport_data + "/ratedDriverPunish", map);
        System.out.println("驾驶员处罚信息:" + result);
    }
 
 
 
 
 
 
    private int phoneExp(String phone){
        /**
         * 中国移动号码正则
         * 139、138、137、136、135、134、147、150、151、152、157、158、159、178、182、183、184、187、188、198、195
         * 虚拟运营商号段: 1703、1705、1706、165
         **/
         String MOBILE_PATTERN = "(^1(3[4-9]|47|5[0-27-9]|65|78|8[2-478]|98)\\d{8}$)|(^170[356]\\d{7}$)";
 
        /**
         * 中国电信号码正则
         * 133、149、153、173、177、180、181、189、199、191
         * 虚拟运营商号段: 162、1700、1701、1702
         **/
         String TELECOM_PATTERN = "(^1(33|49|53|62|7[37]|8[019]|9[19])\\d{8}$)|(^170[012]\\d{7}$)";
 
        /**
         * 中国联通号码正则
         * 130、131、132、155、156、185、186、145、175、176、166、140
         * 虚拟运营商号段: 171、1707、1708、1709、167
         **/
         String UNICOM_PATTERN = "(^1(3[0-2]|4[05]|5[56]|6[67]|7[156]|8[56])\\d{8}$)|(^170[7-9]\\d{7}$)";
        if(Pattern.matches(UNICOM_PATTERN, phone)){
           return 1;
        }
        if(Pattern.matches(MOBILE_PATTERN, phone)){
            return 2;
        }
        if(Pattern.matches(TELECOM_PATTERN, phone)){
            return 3;
        }
        return 4;
    }
}