puzhibing
2023-06-13 7860e5cb6db60aeb82c640651998f8294635df5b
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
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
package com.dsh.guns.modular.system.controller.general;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsh.course.feignClient.account.model.CompanyQuerySuperiorIdAndTypeAndFlgAndNameReq;
import com.dsh.course.feignClient.account.model.CompanyQueryTypeAndFlgAndNameReq;
import com.dsh.course.feignClient.account.model.CompanyQueryTypeAndFlgReq;
import com.dsh.course.feignClient.activity.CompanyClient;
import com.dsh.course.feignClient.activity.DriverClient;
import com.dsh.course.feignClient.activity.model.CompanyInfoRes;
import com.dsh.course.feignClient.activity.model.CompanyQueryReq;
import com.dsh.course.feignClient.activity.model.TDriverReq;
import com.dsh.course.mapper.CarInsuranceMapper;
import com.dsh.guns.config.UserExt;
import com.dsh.guns.core.base.controller.BaseController;
import com.dsh.guns.core.base.tips.ErrorTip;
import com.dsh.guns.core.common.constant.factory.PageFactory;
import com.dsh.guns.core.log.LogObjectHolder;
import com.dsh.guns.core.util.SinataUtil;
import com.dsh.guns.modular.system.model.*;
import com.dsh.guns.modular.system.service.*;
import com.dsh.guns.modular.system.util.DateUtil;
import com.dsh.guns.modular.system.util.ExcelExportUtil;
import com.dsh.guns.modular.system.util.ResultUtil;
import org.apache.commons.lang.time.DateUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import com.dsh.guns.core.util.WoUtil;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
 
/**
 * 车辆管理控制器
 *
 * @author fengshuonan
 * @Date 2020-06-05 17:25:12
 */
@Controller
@RequestMapping("/tCar")
public class TCarController extends BaseController {
 
    private String PREFIX = "/system/tCar/";
 
    @Autowired
    private ITCarService tCarService;
 
//    @Autowired
//    private ITCompanyService tCompanyService;
 
    @Autowired
    private ITCarServiceService tCarServiceService;
 
//    @Autowired
//    private ITDriverLineService tDriverLineService;
 
    @Autowired
    private ITCarBrandService tCarBrandService;
 
    @Autowired
    private ITCarModelService tCarModelService;
 
    @Autowired
    private ITCarServiceService itCarServiceService;
 
    @Autowired
    private ITServerCarmodelService itServerCarmodelService;
 
//    @Autowired
//    private PushMinistryOfTransportUtil pushMinistryOfTransportUtil;
 
    @Resource
    private CarInsuranceMapper carInsuranceMapper;
 
    @Autowired
    private CompanyClient companyClient;
    @Autowired
    private DriverClient driverClient;
 
 
    /**
     * 跳转到车辆管理首页
     */
    @RequestMapping("")
    public String index(Model model) {
        model.addAttribute("language",UserExt.getLanguage());
        return PREFIX + "tCar.html";
    }
 
    /**
     * 跳转到添加车辆管理
     */
    @RequestMapping("/tCar_add")
    public String tCarAdd(Model model) {
        List<CompanyInfoRes> companyList = companyClient.queryByTypeCompany(2);
        model.addAttribute("companyList",companyList);
        User user = UserExt.getUser();
        Integer roleType = user.getRoleType();
        model.addAttribute("roleType",roleType);
        if (2 == roleType){
//            List<TCompany> franchiseeList = companyClient.queryByTypeCompany(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",11));
            List<CompanyInfoRes> companyInfoRes = companyClient.queryByListCompany(new CompanyQueryReq(3, user.getObjectId()));
            model.addAttribute("franchiseeList",companyInfoRes);
        }else{
            model.addAttribute("franchiseeList",null);
        }
        //查询当前用户所属分公司/加盟商
 
        model.addAttribute("objectName",companyClient.queryById(UserExt.getUser().getObjectId()).getName());
 
        //车辆品牌 car brand
        List<TCarBrand> brandList = tCarBrandService.list(new QueryWrapper<TCarBrand>().eq("state", 1));
        model.addAttribute("brandList",brandList);
        //车辆类型
        /*List<TCarModel> modelList = tCarModelService.selectList(new EntityWrapper<TCarModel>().eq("state", 1));
        model.addAttribute("modelList",modelList);*/
 
        List<TServerCarmodel> zcModelList = itServerCarmodelService.list(new QueryWrapper<TServerCarmodel>().eq("type", 1).eq("state", 1));
        model.addAttribute("zcModelList",zcModelList);
        List<TServerCarmodel> kcModelList = itServerCarmodelService.list(new QueryWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1));
        model.addAttribute("kcModelList",kcModelList);
        model.addAttribute("language",UserExt.getLanguage());
        return PREFIX + "tCar_add.html";
    }
 
    /**
     * 查询车辆类型
     * @param carBrandId
     * @return
     */
    @RequestMapping(value = "/brandChange")
    @ResponseBody
    public Object brandChange(@RequestParam Integer carBrandId) {
        List<TCarModel> list = new ArrayList<>();
        if (SinataUtil.isNotEmpty(carBrandId)){
            list = tCarModelService.list(new QueryWrapper<TCarModel>().eq("state",1).eq("brandId", carBrandId));
        }
        return list;
    }
 
    /**
     * 跳转到修改车辆管理
     */
    @RequestMapping("/tCar_update/{tCarId}")
    public String tCarUpdate(@PathVariable Integer tCarId, Model model) {
        TCar tCar = tCarService.getById(tCarId);
        model.addAttribute("item",tCar);
        LogObjectHolder.me().set(tCar);
        User user = UserExt.getUser();
        Integer roleType = user.getRoleType();
        model.addAttribute("roleType",roleType);
        model.addAttribute("objectName",companyClient.queryById(user.getObjectId()).getName());
 
        if (1 == roleType){
//            List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2));
            List<CompanyInfoRes> companyInfoRes = companyClient.queryByTypeCompany(2);
            model.addAttribute("companyList",companyInfoRes);
//            List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",tCar.getCompanyId()));
            List<CompanyInfoRes> companyInfoRes1 = companyClient.queryByListCompany(new CompanyQueryReq(3, tCar.getCompanyId()));
            model.addAttribute("franchiseeList",companyInfoRes1);
        }else if (2 == roleType){
//            List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",11));
            List<CompanyInfoRes> companyInfoRes1 = companyClient.queryByListCompany(new CompanyQueryReq(3, user.getObjectId()));
            model.addAttribute("franchiseeList",companyInfoRes1);
        }
 
        //查询平台ID
//        TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1));
        CompanyInfoRes company = companyClient.queryByTypeCompany(1).get(0);
        //判断是平台司机还是加盟司机
        if ((SinataUtil.isEmpty(tCar.getCompanyId()) || tCar.getCompanyId() == 0 || tCar.getCompanyId() == company.getId()) && (SinataUtil.isEmpty(tCar.getFranchiseeId()) || tCar.getFranchiseeId() == 0)){
            model.addAttribute("companyType",1);
        }else{
            model.addAttribute("companyType",2);
        }
 
        //获取经营业务
        List<TCarService> serviceList = tCarServiceService.list(new QueryWrapper<TCarService>().eq("carId", tCar.getId()));
        Integer one = 1;
        Integer two = 1;
        Integer three = 1;
        Integer four = 1;
        Integer five = 1;
        Integer six = 1;
        Integer zcModel = 0;
        Integer kcModel = 0;
        for (TCarService obj : serviceList){
            if (obj.getType() == 1){
                one = 2;
                zcModel = obj.getServerCarModelId();
            }
            if (obj.getType() == 2){
                two = 2;
            }
            if (obj.getType() == 3){
                three = 2;
                kcModel = obj.getServerCarModelId();
            }
            if (obj.getType() == 4){
                four = 2;
            }
            if (obj.getType() == 5){
                five = 2;
            }
            if (obj.getType() == 6){
                six = 2;
            }
        }
        model.addAttribute("one",one);
        model.addAttribute("two",two);
        model.addAttribute("three",three);
        model.addAttribute("four",four);
        model.addAttribute("five",five);
        model.addAttribute("six",six);
        model.addAttribute("zcModel",zcModel);
        model.addAttribute("kcModel",kcModel);
 
        List<TServerCarmodel> zcModelList = itServerCarmodelService.list(new QueryWrapper<TServerCarmodel>().eq("type", 1).eq("state", 1));
        model.addAttribute("zcModelList",zcModelList);
        List<TServerCarmodel> kcModelList = itServerCarmodelService.list(new QueryWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1));
        model.addAttribute("kcModelList",kcModelList);
 
        //车辆品牌 car brand
        List<TCarBrand> brandList = tCarBrandService.list(new QueryWrapper<TCarBrand>().eq("state", 1));
        model.addAttribute("brandList",brandList);
        //车辆类型
        List<TCarModel> modelList = tCarModelService.list(new QueryWrapper<TCarModel>().eq("brandId",tCar.getCarBrandId()).eq("state", 1));
        model.addAttribute("modelList",modelList);
        model.addAttribute("language",UserExt.getLanguage());
        return PREFIX + "tCar_edit.html";
    }
 
 
    /**
     * 跳转到保险列表页
     * @param carId
     * @param model
     * @return
     */
    @RequestMapping("/carInsurance")
    public String carInsurance(Integer carId, Model model){
        model.addAttribute("carId", carId);
        return PREFIX + "carInsurance.html";
    }
 
    /**
     * 跳转到添加页面
     * @param carId
     * @param model
     * @return
     */
    @RequestMapping("/showAddCarInsurance")
    public String showAddCarInsurance(Integer carId, Model model){
        model.addAttribute("carId", carId);
        model.addAttribute("id", "");
        return PREFIX + "carInsuranceInfo.html";
    }
 
    /**
     * 跳转到编辑页
     * @param id
     * @param carId
     * @param model
     * @return
     */
    @RequestMapping("/showEditCarInsurance")
    public String showEditCarInsurance(Integer id, Integer carId, Model model){
        model.addAttribute("carId", carId);
        model.addAttribute("id", id);
        return PREFIX + "carInsuranceInfo.html";
    }
 
    /**
     * 添加保险数据
     * @param carInsurance
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/saveCarInsurance", method = RequestMethod.POST)
    public ResultUtil saveCarInsurance(CarInsurance carInsurance){
        if(carInsurance.getId() == null){
            carInsuranceMapper.insert(carInsurance);
//            new Thread(new Runnable() {
//                @Override
//                public void run() {
//                    if(pushMinistryOfTransport){//上传数据
//                        pushMinistryOfTransportUtil.baseInfoVehicleInsurance(carInsurance.getId(), 1);
//                    }
//                }
//            }).start();
        }else{
            carInsuranceMapper.updateById(carInsurance);
//            new Thread(new Runnable() {
//                @Override
//                public void run() {
//                    if(pushMinistryOfTransport){//上传数据
//                        pushMinistryOfTransportUtil.baseInfoVehicleInsurance(carInsurance.getId(), 2);
//                    }
//                }
//            }).start();
        }
 
        return ResultUtil.success();
    }
 
    /**
     * 获取保险详情
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/queryCarInsurance", method = RequestMethod.POST)
    public ResultUtil queryCarInsurance(Integer id){
        CarInsurance carInsurance = carInsuranceMapper.selectById(id);
        return ResultUtil.success(carInsurance);
    }
 
 
    /**
     * 获取保险列表
     * @param carId
     * @param offset
     * @param limit
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/queryInsuranceList", method = RequestMethod.POST)
    public Object queryInsuranceList(Integer carId, Integer offset,Integer limit){
        try {
            Map<String, Object> map = new HashMap<>();
            List<Map<String, Object>> list = carInsuranceMapper.queryInsuranceList(carId, offset, limit);
            int i = carInsuranceMapper.queryInsuranceListCount(carId);
            map.put("rows", list);
            map.put("total", i);
            return map;
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
    /**
     * 删除保险
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/delCarInsurance", method = RequestMethod.POST)
    public ResultUtil delCarInsurance(Integer id){
        carInsuranceMapper.deleteById(id);
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                if(pushMinistryOfTransport){//上传数据
//                    pushMinistryOfTransportUtil.baseInfoVehicleInsurance(id, 3);
//                }
//            }
//        }).start();
        return ResultUtil.success();
    }
 
 
    /**
     * 获取车辆管理列表
     */
    @RequestMapping(value = "/list")
    @ResponseBody
    public Object list(String createTime,
                       String id,
                       String brandName,
                       String modelName,
                       String carColor,
                       String serverStr,
                       String carLicensePlate,
                       String driverName,
                       String companyName,
                       String franchiseeName) {
        String beginTime = null;
        String endTime = null;
        if (SinataUtil.isNotEmpty(createTime)){
            String[] timeArray = createTime.split(" - ");
            beginTime = timeArray[0];
            endTime = timeArray[1];
        }
        Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
        page.setRecords(tCarService.getCarList(page,UserExt.getUser().getRoleType(),UserExt.getUser().getObjectId(),beginTime,endTime,id,brandName,modelName,carColor,serverStr,carLicensePlate,driverName,companyName,franchiseeName));
        return super.packForBT(page);
    }
 
    /**
     * 新增车辆管理
     */
    @RequestMapping(value = "/add")
    @ResponseBody
    public Object add( TCar tCar, String serverBox,Integer roleType,Integer companyType,Integer oneId,Integer twoId,Integer franchiseeId,String zcModel,String kcModel) {
        TCar tCar1 = tCarService.getBaseMapper().selectOne(new QueryWrapper<TCar>().eq("carLicensePlate", tCar.getCarLicensePlate()).eq("state", 1));
        if(null != tCar1){
            return ResultUtil.error(UserExt.getLanguage() == 1 ? "车牌号重复" : UserExt.getLanguage() == 2 ? "Duplicate license plate" : "Kode kendaraan diulangi.");
        }
 
        if (1 == roleType){  //平台 platfrom
            if (2 == companyType.intValue()){
                if (SinataUtil.isNotEmpty(oneId)){
                    tCar.setCompanyId(oneId);
                }
                if (SinataUtil.isNotEmpty(twoId)){
                    tCar.setFranchiseeId(twoId);
                }
            }else if (1 == companyType.intValue()){
//                TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1));
                CompanyInfoRes company = companyClient.queryByTypeCompany(1).get(0);
                tCar.setCompanyId(company.getId());
                tCar.setFranchiseeId(0);
            }
            tCar.setAddType(2);
            tCar.setIsPlatCar(1);
        }else if (2 == roleType){  //分公司 sub company
            if (SinataUtil.isNotEmpty(UserExt.getUser().getObjectId())){
                tCar.setCompanyId(UserExt.getUser().getObjectId());
            }
            if (SinataUtil.isNotEmpty(franchiseeId)){
                tCar.setFranchiseeId(franchiseeId);
            }
            tCar.setIsPlatCar(2);
            tCar.setAddType(3);
            tCar.setAddObjectId(UserExt.getUser().getObjectId());
        }else if (3 == roleType){  //加盟商 Franchisee.
            CompanyInfoRes tCompany = companyClient.queryById(UserExt.getUser().getObjectId());
            if (SinataUtil.isNotEmpty(tCompany)){
                tCar.setCompanyId(tCompany.getSuperiorId());
            }
            if (SinataUtil.isNotEmpty(UserExt.getUser().getObjectId())){
                tCar.setFranchiseeId(UserExt.getUser().getObjectId());
            }
            tCar.setIsPlatCar(2);
            tCar.setAddType(4);
            tCar.setAddObjectId(UserExt.getUser().getObjectId());
        }
        tCar.setInsertTime(new Date());
        tCar.setState(1);
        tCarService.save(tCar);
 
        //添加经营业务 Add business operations.
        String[] serverArray = serverBox.split(",");
        for (int i=0;i<serverArray.length;i++){
            TCarService service = new TCarService();
            service.setCarId(tCar.getId());
            service.setType(Integer.valueOf(serverArray[i]));
            if (1 == service.getType()){
                service.setServerCarModelId(Integer.valueOf(zcModel));
            }else if (3 == service.getType()){
                service.setServerCarModelId(Integer.valueOf(kcModel));
            }
            tCarServiceService.save(service);
        }
 
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                if(pushMinistryOfTransport){//上传数据
//                    pushMinistryOfTransportUtil.baseInfoCompanyStat();
//                    pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId());
//                }
//            }
//        }).start();
        return ResultUtil.success();
    }
 
    /**
     * 删除车辆管理
     */
    @RequestMapping(value = "/delete")
    @ResponseBody
    public Object delete(@RequestParam Integer tCarId) {
        TCar tCar = tCarService.getById(tCarId);
        tCar.setState(2);
        tCarService.updateById(tCar);
 
        //清除相对应的司机关联车辆ID Remove the corresponding driver-associated vehicle ID.
        List<TDriverReq> list = driverClient.queryDriverListByCarId(tCarId);
        for (TDriverReq obj : list){
            obj.setCarId(null);
            driverClient.updateById(obj);
        }
 
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                if(pushMinistryOfTransport){//上传数据
//                    pushMinistryOfTransportUtil.baseInfoCompanyStat();
//                    pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId());
//                }
//            }
//        }).start();
        return SUCCESS_TIP;
    }
 
    /**
     * 修改车辆管理
     */
    @RequestMapping(value = "/update")
    @ResponseBody
    public Object update(TCar tCar,@RequestParam String serverBox,Integer roleType,Integer companyType,Integer oneId,Integer twoId,Integer franchiseeId,String zcModel,String kcModel) {
        TCar tCar1 = tCarService.getBaseMapper().selectOne(new QueryWrapper<TCar>().eq("carLicensePlate", tCar.getCarLicensePlate()).eq("state", 1));
        if(null != tCar1 && tCar1.getId().compareTo(tCar.getId()) != 0){
            return ResultUtil.error(UserExt.getLanguage() == 1 ? "车牌号重复" : UserExt.getLanguage() == 2 ? "Duplicate license plate" : "Kode kendaraan diulangi.");
        }
        if (1 == roleType){  //平台 platfrom
            if (2 == companyType.intValue()){
                if (SinataUtil.isNotEmpty(oneId)){
                    tCar.setCompanyId(oneId);
                }
                if (SinataUtil.isNotEmpty(twoId)){
                    tCar.setFranchiseeId(twoId);
                }
            }else if (1 == companyType.intValue()){
//                TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1));
                CompanyInfoRes company = companyClient.queryByTypeCompany(1).get(0);
                tCar.setCompanyId(company.getId());
                tCar.setFranchiseeId(0);
            }
        }else if (2 == roleType){  //分公司 sub company
            if (SinataUtil.isNotEmpty(UserExt.getUser().getObjectId())){
                tCar.setCompanyId(UserExt.getUser().getObjectId());
            }
            if (SinataUtil.isNotEmpty(franchiseeId)){
                tCar.setFranchiseeId(franchiseeId);
            }
        }else if (3 == roleType){  //加盟商 Franchisee
            CompanyInfoRes tCompany = companyClient.queryById(UserExt.getUser().getObjectId());
            if (SinataUtil.isNotEmpty(tCompany)){
                tCar.setCompanyId(tCompany.getSuperiorId());
            }
            if (SinataUtil.isNotEmpty(UserExt.getUser().getObjectId())){
                tCar.setFranchiseeId(UserExt.getUser().getObjectId());
            }
        }
 
        //删除业务 Delete business
        tCarServiceService.remove(new QueryWrapper<TCarService>().eq("carId",tCar.getId()));
 
        //添加经营业务 add business
        String[] serverArray = serverBox.split(",");
        for (int i=0;i<serverArray.length;i++){
            TCarService service = new TCarService();
            service.setCarId(tCar.getId());
            service.setType(Integer.valueOf(serverArray[i]));
            if (1 == service.getType()){
                service.setServerCarModelId(Integer.valueOf(zcModel));
            }else if (3 == service.getType()){
                service.setServerCarModelId(Integer.valueOf(kcModel));
            }
            tCarServiceService.save(service);
        }
 
        tCarService.updateById(tCar);
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                if(pushMinistryOfTransport){
//                    pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId());
//                }
//            }
//        }).start();
        return ResultUtil.success();
    }
 
    /**
     * 车辆管理详情
     */
    @RequestMapping(value = "/detail/{tCarId}")
    @ResponseBody
    public Object detail(@PathVariable("tCarId") Integer tCarId) {
        return tCarService.getById(tCarId);
    }
 
    /**
     * 下载模板
     * @param request
     * @param response
     */
    @RequestMapping(value = "/uploadCarModel")
    public void uploadCarModel(HttpServletRequest request, HttpServletResponse response) {
        // 表格数据【封装】 Table datas
        List<List<String>> dataList = new ArrayList<List<String>>();
        Integer language = UserExt.getLanguage();
        if(language==1){
            // 首行【封装】 first line 
            List<String> shellList = new ArrayList<String>();
            shellList.add("所属机构[平台车辆/加盟车辆]");
            shellList.add("所属分公司[提示:加盟车辆选填]");
            shellList.add("所属加盟商[提示:加盟车辆选填]");
            shellList.add("服务模式:摩托车车[是/否]");
            shellList.add("服务模式:同城快送[是/否]");
            shellList.add("车辆品牌");
            shellList.add("车辆类型");
            shellList.add("车辆颜色[1(黑色)/2(银色)/3(白色)/4(红色)/5(黄色)/6(橙色)/7(蓝色)]");
            shellList.add("车牌号");
            shellList.add("行驶证编号");
            shellList.add("年检到期时间[例如 2020-02-02]");
            shellList.add("商业保险到期时间[例如 2020-02-02]");
            dataList.add(shellList);
 
            try {
                // 调用工具类进行导出 Invoke the utility class to carry out data export.
                ExcelExportUtil.easySheet("平台导入车辆模板"+DateUtil.format(new Date(), "YYYYMMddHHmmss"), "平台导入车辆模板", dataList, request, response);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }else if(language==2){
            // 首行【封装】 first line 
            List<String> shellList = new ArrayList<String>();
            shellList.add("Affiliated Organization [Platform Vehicle/Franchised Vehicle]");
            shellList.add("Affiliated branch [Tip: Select for franchised vehicle]");
            shellList.add("Franchisee [Tip: Select Franchised vehicle]");
            shellList.add("Service mode: Motorcycle [Yes/No]");
            shellList.add("Service mode: intra-city express [Yes/No]");
            shellList.add("Vehicle brand");
            shellList.add("Vehicle type");
            shellList.add("Vehicle color [1(Black)/2(Silver)/3(white)/4(red)/5(yellow)/6(orange)/7(Blue)]");
            shellList.add("License plate number");
            shellList.add("License number");
            shellList.add("Annual inspection expiration time [e.g. 2020-02-02]");
            shellList.add("Commercial Insurance Expiration Time [e.g. 2020-02-02]");
            dataList.add(shellList);
 
            try {
                // 调用工具类进行导出 Invoke the utility class to carry out data export.
                ExcelExportUtil.easySheet("Platform import vehicle template"+DateUtil.format(new Date(), "YYYYMMddHHmmss"), "Platform import vehicle template", dataList, request, response);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }else {
            // 首行【封装】 first line
            List<String> shellList = new ArrayList<String>();
            shellList.add("Organisasi Berkait [Platform Vehicle/Franchised Vehicle]");
            shellList.add("Branch terkait [Tip: Pilih untuk kendaraan terkait]");
            shellList.add("Franchisee [Tip: Pilih kendaraan Franchised]");
            shellList.add("Mod layanan: Motosikal [Ya/Tidak]");
            shellList.add("Modus layanan: ekspres intra-kota [Ya/Tidak]");
            shellList.add("Tanda kendaraan");
            shellList.add("Jenis kendaraan");
            shellList.add("Warna kendaraan [1(Hitam)/2(Perak)/3(putih)/4(merah)/5(kuning)/6(oranye)/7(Biru)]");
            shellList.add("Nomor plat lisensi");
            shellList.add("Nomor lisensi");
            shellList.add("Waktu penggantian inspeksi tahunan [contohnya 2020-02-02]");
            shellList.add("Waktu Expiration Insurance Commercial [contohnya 2020-02-02]");
            dataList.add(shellList);
 
            try {
                // 调用工具类进行导出 Invoke the utility class to carry out data export.
                ExcelExportUtil.easySheet("templat kendaraan import platform"+DateUtil.format(new Date(), "YYYYMMddHHmmss"), "templat kendaraan import platform", dataList, request, response);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
 
 
    }
 
 
    /**
     * 导入操作
     * @param request
     * @return
     */
    @RequestMapping(value="/exportCar",method = RequestMethod.POST)
    @ResponseBody
    public Object exportCar(HttpServletRequest request){
        Integer language = UserExt.getLanguage();
        if(language==1) {
            MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
            MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile");
            try {
                //定时五秒后执行 Execute after five seconds on schedule.
            /*Map<String,Object> maps=new HashMap<>();
            Workbook book = WoUtil.ImportFile(file);
            maps.put("book",book);
            QuartzManager.addJob(AddContract.class, (AddContract.name+new Date().getTime()).toUpperCase(), TimeJobType.ADMIN,DateUtil.getDate_strYMdHms(new Date().getTime() + 1*1000) , maps);*/
 
                Workbook book = WoUtil.ImportFile(file);
                Sheet sh = book.getSheetAt(0);   //获取到第一个表 get first table
                for (int i = 1; i <= sh.getLastRowNum(); i++) {
                    Row row = sh.getRow(i);
 
                    Cell cell0 = row.getCell(0);  //所属机构[平台车辆/加盟车辆] Affiliated Organization [Platform Vehicles/Franchise Vehicles]
                    String zero = null;
                    if (SinataUtil.isNotEmpty(cell0)) {
                        zero = String.valueOf(cell0.getStringCellValue()).trim();
                    }
 
                    Cell cell1 = row.getCell(1);  //所属分公司[提示:加盟车辆选填] Affiliated branch company [Note: Franchise vehicles are optional].
                    String one = null;
 
                    if (SinataUtil.isNotEmpty(cell1)) {
                        cell1.setCellType(Cell.CELL_TYPE_STRING);
                        one = String.valueOf(cell1.getStringCellValue()).trim();
                    }
 
                    Cell cell2 = row.getCell(2);  //所属加盟商[提示:加盟车辆选填] Affiliated Franchise [Note: Franchise vehicles are optional].
                    String two = null;
                    if (SinataUtil.isNotEmpty(cell2)) {
                        two = String.valueOf(cell2.getStringCellValue()).trim();
                    }
 
                    Cell cell3 = row.getCell(3);  //服务模式:专车[是/否] Business mode: dedicated vehicle [yes/no]
                    String three = null;
                    if (SinataUtil.isNotEmpty(cell3)) {
                        three = String.valueOf(cell3.getStringCellValue()).trim();
                    }
 
                    Cell cell4 = row.getCell(4);  //服务模式:出租车[是/否] Business mode: taxi [yes/no]
                    String four = null;
                    if (SinataUtil.isNotEmpty(cell4)) {
                        four = String.valueOf(cell4.getStringCellValue()).trim();
                    }
 
                    Cell cell5 = row.getCell(5);  //服务模式:跨城出行[是/否] Business mode: cross-city  [yes/no]
                    String five = null;
                    if (SinataUtil.isNotEmpty(cell5)) {
                        five = String.valueOf(cell5.getStringCellValue()).trim();
                    }
 
                    Cell cell6 = row.getCell(6);  //服务模式:小件跨城物流[是/否] Business mode: small-scale logistics [yes/no]
                    String six = null;
                    if (SinataUtil.isNotEmpty(cell6)) {
                        six = String.valueOf(cell6.getStringCellValue()).trim();
                    }
 
                    Cell cell7 = row.getCell(7);  //服务模式:小件跨城物流[是/否]  Business mode: small-scale logistics [yes/no]
                    String seven = null;
                    if (SinataUtil.isNotEmpty(cell7)) {
                        seven = String.valueOf(cell7.getStringCellValue()).trim();
                    }
 
                    Cell cell8 = row.getCell(8);  //服务模式:包车[是/否]  Service mode: Chartered service [Yes/No]
                    cell8.setCellType(Cell.CELL_TYPE_STRING);
                    String eight = null;
                    if (SinataUtil.isNotEmpty(cell8)) {
                        eight = String.valueOf(cell8.getStringCellValue()).trim();
                    }
 
                    Cell cell9 = row.getCell(9);  //车辆品牌 car brand
                    cell9.setCellType(Cell.CELL_TYPE_STRING);
                    String nine = null;
                    if (SinataUtil.isNotEmpty(cell9)) {
                        nine = String.valueOf(cell9.getStringCellValue()).trim();
                    }
 
                    Cell cell10 = row.getCell(10);  //车辆类型 car type
                    cell10.setCellType(Cell.CELL_TYPE_STRING);
 
                    String ten = null;
                    if (SinataUtil.isNotEmpty(cell10)) {
                        ten = String.valueOf(cell10.getStringCellValue()).trim();
                    }
 
                    Cell cell11 = row.getCell(11);  //车辆颜色[黑色/银色/白色/红色/黄色/橙色/蓝色] Vehicle color options include black, silver, white, red, yellow, orange, and blue.
                    cell11.setCellType(Cell.CELL_TYPE_STRING);
                    String eleven = null;
                    if (SinataUtil.isNotEmpty(cell11)) {
                        eleven = String.valueOf(cell11.getStringCellValue()).trim();
                    }
 
 
                    if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four)
                            || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(seven)
                            || SinataUtil.isEmpty(eight) || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten)
                            || SinataUtil.isEmpty(eleven)) {
                        return new ErrorTip(500, "单元格不能为空");
                    } else {
                        //判断所属机构 Determine the affiliated organization.
                        if (!zero.equals("平台车辆") && !zero.equals("加盟车辆")) {
                            return new ErrorTip(500, "所属机构内容不正确");
                        }
                        //判断服务模式【专车】 Assessing the Service Mode "Private Car
                        if (!three.equals("是") && !three.equals("否")) {
                            return new ErrorTip(500, "服务模式【摩托车】内容不正确");
                        }
                        //判断服务模式【出租车】Assessing the Service Mode "taxi Car
                        if (!four.equals("是") && !four.equals("否")) {
                            return new ErrorTip(500, "服务模式【同城快送】内容不正确");
                        }
                        //判断车辆颜色Assessing the car colors
                        if (!seven.equals("1") && !seven.equals("2") && !seven.equals("3") && !seven.equals("4") && !seven.equals("5") && !seven.equals("6") && !seven.equals("7")) {
                            return new ErrorTip(500, "车辆颜色内容不正确");
                        }
                        //判断年检到期时间格式是否正确 Verify if the format of the expiration date for inspection is correct.
                        try {
                            if (!isValidDate(ten)) {
                                ten = importByExcelForDate(ten);
                            }
                        } catch (Exception e) {
                            return new ErrorTip(500, "年检到期时间格式不正确");
                        }
                        //判断商业保险到期时间格式是否正确 Check whether the expiration date format of the commercial insurance is correct.
                        try {
                            if (!isValidDate(eleven)) {
                                eleven = importByExcelForDate(eleven);
                            }
                        } catch (Exception e) {
                            return new ErrorTip(500, "商业保险到期时间格式不正确");
                        }
 
                        //查找平台公司 Search for platform companies
//                    TCompany platCompany = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1).notIn("flag", "3").last(" limit 1"));
                        CompanyInfoRes platCompany = companyClient.queryByTypeAndFlg(new CompanyQueryTypeAndFlgReq(1, 3));
                        Integer companyId = platCompany.getId();
                        Integer franchiseeId = 0;
                        if ("加盟车辆".equals(zero)) {
                            //判断所属分公司是否存在 Check if the subsidiary company exists
                            if (SinataUtil.isNotEmpty(one)) {
//                            TCompany company = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("name", one).eq("type", 2).notIn("flag", "3").last(" limit 1"));
                                CompanyInfoRes company = companyClient.queryByTypeAndFlgAndName(new CompanyQueryTypeAndFlgAndNameReq(2, 3, one));
                                if (SinataUtil.isNotEmpty(company)) {
                                    companyId = company.getId();
                                    //判断加盟商是否存在 Assessing the existence of a franchisee
                                    if (SinataUtil.isNotEmpty(two)) {
//                                    TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId",company.getId()).eq("name", two).eq("type", 3).notIn("flag", "3").last(" limit 1"));
                                        CompanyInfoRes franchisee = companyClient.queryBySuperiorIdAndTypeAndFlgAndName(new CompanyQuerySuperiorIdAndTypeAndFlgAndNameReq(3, 3, two, company.getId()));
                                        if (SinataUtil.isNotEmpty(franchisee)) {
                                            franchiseeId = franchisee.getId();
                                        }
                                    }
                                }
                            }
                        }
 
                        Integer carBrandId = null;
                        Integer carModelId = null;
                        //查找品牌 search brand
                        if (SinataUtil.isNotEmpty(five)) {
                            TCarBrand carBrand = tCarBrandService.getOne(new QueryWrapper<TCarBrand>().eq("name", five).eq("state", 1).last(" limit 1"));
                            if (SinataUtil.isNotEmpty(carBrand)) {
                                carBrandId = carBrand.getId();
                                if (SinataUtil.isNotEmpty(six)) {
                                    //查找类型 search type
                                    TCarModel carModel = tCarModelService.getOne(new QueryWrapper<TCarModel>().eq("brandId", carBrand.getId()).eq("name", six).eq("state", 1).last(" limit 1"));
                                    if (SinataUtil.isNotEmpty(carModel)) {
                                        carModelId = carModel.getId();
                                    }
                                }
                            }
                        }
 
                        //添加车辆对象 add vechcle obj
                        TCar car = new TCar();
                        if ("平台车辆".equals(zero)) {
                            car.setIsPlatCar(1);
                        } else if ("加盟车辆".equals(zero)) {
                            car.setIsPlatCar(2);
                        }
                        car.setCompanyId(companyId);
                        car.setFranchiseeId(franchiseeId);
                        car.setCarColor(seven);
                        car.setCarBrandId(carBrandId);
                        car.setCarModelId(carModelId);
                        car.setCarLicensePlate(eight);
                        car.setDrivingLicenseNumber(nine);
                        car.setAnnualInspectionTime(DateUtil.parseDate(ten));
                        car.setCommercialInsuranceTime(DateUtil.parseDate(eleven));
                        car.setInsertTime(new Date());
                        car.setState(1);
                        if (UserExt.getUser().getRoleType() == 1) {
                            car.setAddType(2);
                        } else if (UserExt.getUser().getRoleType() == 2) {
                            car.setAddType(3);
                            car.setAddObjectId(UserExt.getUser().getObjectId());
                        } else if (UserExt.getUser().getRoleType() == 3) {
                            car.setAddType(4);
                            car.setAddObjectId(UserExt.getUser().getObjectId());
                        }
                        tCarService.save(car);
 
                        //添加专车服务模式 add special car service
                        if ("是".equals(three)) {
                            TCarService service = new TCarService();
                            service.setCarId(car.getId());
                            service.setType(1);
                            tCarServiceService.save(service);
                        }
                        //添加小件同城物流服务模式 add small-scale local-city service model
                        if ("是".equals(four)) {
                            TCarService service = new TCarService();
                            service.setCarId(car.getId());
                            service.setType(4);
                            tCarServiceService.save(service);
                        }
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            return SUCCESS_TIP;
        }else if(language==2){
            MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
            MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile");
            try {
                //定时五秒后执行 execute after 5s on schedule
            /*Map<String,Object> maps=new HashMap<>();
            Workbook book = WoUtil.ImportFile(file);
            maps.put("book",book);
            QuartzManager.addJob(AddContract.class, (AddContract.name+new Date().getTime()).toUpperCase(), TimeJobType.ADMIN,DateUtil.getDate_strYMdHms(new Date().getTime() + 1*1000) , maps);*/
 
                Workbook book = WoUtil.ImportFile(file);
                Sheet sh = book.getSheetAt(0);   //获取到第一个表 get first table
                for (int i = 1; i <= sh.getLastRowNum(); i++) {
                    Row row = sh.getRow(i);
 
                    Cell cell0 = row.getCell(0);  //所属机构[平台车辆/加盟车辆] Affiliated Organization [Platform Vehicles/Franchise Vehicles]
                    String zero = null;
                    if (SinataUtil.isNotEmpty(cell0)) {
                        zero = String.valueOf(cell0.getStringCellValue()).trim();
                    }
 
                    Cell cell1 = row.getCell(1);  //所属分公司[提示:加盟车辆选填] Affiliated branch company [Note: Franchise vehicles are optional].
                    String one = null;
                    if (SinataUtil.isNotEmpty(cell1)) {
                        cell1.setCellType(Cell.CELL_TYPE_STRING);
                        one = String.valueOf(cell1.getStringCellValue()).trim();
                    }
 
                    Cell cell2 = row.getCell(2);  //所属加盟商[提示:加盟车辆选填]Affiliated Franchise [Note: Franchise vehicles are optional].
                    String two = null;
                    if (SinataUtil.isNotEmpty(cell2)) {
                        two = String.valueOf(cell2.getStringCellValue()).trim();
                    }
 
                    Cell cell3 = row.getCell(3);  //服务模式:专车[是/否]Business mode: dedicated vehicle [yes/no]
                    String three = null;
                    if (SinataUtil.isNotEmpty(cell3)) {
                        three = String.valueOf(cell3.getStringCellValue()).trim();
                    }
 
                    Cell cell4 = row.getCell(4);  //服务模式:出租车[是/否]Business mode: taxi [yes/no]
                    String four = null;
                    if (SinataUtil.isNotEmpty(cell4)) {
                        four = String.valueOf(cell4.getStringCellValue()).trim();
                    }
 
                    Cell cell5 = row.getCell(5);  //服务模式:跨城出行[是/否]Business mode: cross-city  [yes/no]
                    String five = null;
                    if (SinataUtil.isNotEmpty(cell5)) {
                        five = String.valueOf(cell5.getStringCellValue()).trim();
                    }
 
                    Cell cell6 = row.getCell(6);  //服务模式:小件跨城物流[是/否]Business mode: small-scale logistics [yes/no]
                    String six = null;
                    if (SinataUtil.isNotEmpty(cell6)) {
                        six = String.valueOf(cell6.getStringCellValue()).trim();
                    }
 
                    Cell cell7 = row.getCell(7);  //服务模式:小件跨城物流[是/否]Business mode: small-scale logistics [yes/no]
                    String seven = null;
                    if (SinataUtil.isNotEmpty(cell7)) {
                        seven = String.valueOf(cell7.getStringCellValue()).trim();
                    }
 
                    Cell cell8 = row.getCell(8);  //服务模式:包车[是/否]Service mode: Chartered service [Yes/No]
                    cell8.setCellType(Cell.CELL_TYPE_STRING);
                    String eight = null;
                    if (SinataUtil.isNotEmpty(cell8)) {
                        eight = String.valueOf(cell8.getStringCellValue()).trim();
                    }
 
                    Cell cell9 = row.getCell(9);  //车辆品牌car brand
                    cell9.setCellType(Cell.CELL_TYPE_STRING);
                    String nine = null;
                    if (SinataUtil.isNotEmpty(cell9)) {
                        nine = String.valueOf(cell9.getStringCellValue()).trim();
                    }
 
                    Cell cell10 = row.getCell(10);  //车辆类型 car type
                    cell10.setCellType(Cell.CELL_TYPE_STRING);
 
                    String ten = null;
                    if (SinataUtil.isNotEmpty(cell10)) {
                        ten = String.valueOf(cell10.getStringCellValue()).trim();
                    }
 
                    Cell cell11 = row.getCell(11);  //车辆颜色[黑色/银色/白色/红色/黄色/橙色/蓝色]Vehicle color options include black, silver, white, red, yellow, orange, and blue.
                    cell11.setCellType(Cell.CELL_TYPE_STRING);
                    String eleven = null;
                    if (SinataUtil.isNotEmpty(cell11)) {
                        eleven = String.valueOf(cell11.getStringCellValue()).trim();
                    }
 
 
                    if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four)
                            || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(seven)
                            || SinataUtil.isEmpty(eight) || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten)
                            || SinataUtil.isEmpty(eleven)) {
                        return new ErrorTip(500, "Cells cannot be empty");
                    } else {
                        //判断所属机构 Determine the affiliated organization.
                        if (!zero.equals("Platform vehicle") && !zero.equals("Franchised vehicle")) {
                            return new ErrorTip(500, "The organization content is incorrect");
                        }
                        //判断服务模式【专车】Assessing the Service Mode "Private Car
                        if (!three.equals("yes") && !three.equals("no")) {
                            return new ErrorTip(500, "Service mode [motorcycle] content is incorrect");
                        }
                        //判断服务模式【出租车】Assessing the Service Mode "taxi
                        if (!four.equals("yes") && !four.equals("no")) {
                            return new ErrorTip(500, "Service mode [Intra-city Express] content is incorrect");
                        }
                        //判断车辆颜色 Assessing the color
                        if (!seven.equals("1") && !seven.equals("2") && !seven.equals("3") && !seven.equals("4") && !seven.equals("5") && !seven.equals("6") && !seven.equals("7")) {
                            return new ErrorTip(500, "The vehicle color content is incorrect");
                        }
                        //判断年检到期时间格式是否正确 Verify if the format of the expiration date for inspection is correct.
                        try {
                            if (!isValidDate(ten)) {
                                ten = importByExcelForDate(ten);
                            }
                        } catch (Exception e) {
                            return new ErrorTip(500, "The format of the annual inspection expiration time is incorrect");
                        }
                        //判断商业保险到期时间格式是否正确 Check whether the expiration date format of the commercial insurance is correct.
                        try {
                            if (!isValidDate(eleven)) {
                                eleven = importByExcelForDate(eleven);
                            }
                        } catch (Exception e) {
                            return new ErrorTip(500, "The format of commercial insurance expiration time is incorrect");
                        }
 
                        //查找平台公司 Search for platform companies
//                    TCompany platCompany = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1).notIn("flag", "3").last(" limit 1"));
                        CompanyInfoRes platCompany = companyClient.queryByTypeAndFlg(new CompanyQueryTypeAndFlgReq(1, 3));
                        Integer companyId = platCompany.getId();
                        Integer franchiseeId = 0;
                        if ("Franchised vehicle".equals(zero)) {
                            //判断所属分公司是否存在 Checking if the subsidiary company exists.
                            if (SinataUtil.isNotEmpty(one)) {
//                            TCompany company = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("name", one).eq("type", 2).notIn("flag", "3").last(" limit 1"));
                                CompanyInfoRes company = companyClient.queryByTypeAndFlgAndName(new CompanyQueryTypeAndFlgAndNameReq(2, 3, one));
                                if (SinataUtil.isNotEmpty(company)) {
                                    companyId = company.getId();
                                    //判断加盟商是否存在 Assessing the existence of a franchisee
                                    if (SinataUtil.isNotEmpty(two)) {
//                                    TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId",company.getId()).eq("name", two).eq("type", 3).notIn("flag", "3").last(" limit 1"));
                                        CompanyInfoRes franchisee = companyClient.queryBySuperiorIdAndTypeAndFlgAndName(new CompanyQuerySuperiorIdAndTypeAndFlgAndNameReq(3, 3, two, company.getId()));
                                        if (SinataUtil.isNotEmpty(franchisee)) {
                                            franchiseeId = franchisee.getId();
                                        }
                                    }
                                }
                            }
                        }
 
                        Integer carBrandId = null;
                        Integer carModelId = null;
                        //查找品牌 search brand
                        if (SinataUtil.isNotEmpty(five)) {
                            TCarBrand carBrand = tCarBrandService.getOne(new QueryWrapper<TCarBrand>().eq("name", five).eq("state", 1).last(" limit 1"));
                            if (SinataUtil.isNotEmpty(carBrand)) {
                                carBrandId = carBrand.getId();
                                if (SinataUtil.isNotEmpty(six)) {
                                    //查找类型 search type
                                    TCarModel carModel = tCarModelService.getOne(new QueryWrapper<TCarModel>().eq("brandId", carBrand.getId()).eq("name", six).eq("state", 1).last(" limit 1"));
                                    if (SinataUtil.isNotEmpty(carModel)) {
                                        carModelId = carModel.getId();
                                    }
                                }
                            }
                        }
 
                        //添加车辆对象 add vechcle obj
                        TCar car = new TCar();
                        if ("Platform vehicle".equals(zero)) {
                            car.setIsPlatCar(1);
                        } else if ("Franchised vehicle".equals(zero)) {
                            car.setIsPlatCar(2);
                        }
                        car.setCompanyId(companyId);
                        car.setFranchiseeId(franchiseeId);
                        car.setCarColor(seven);
                        car.setCarBrandId(carBrandId);
                        car.setCarModelId(carModelId);
                        car.setCarLicensePlate(eight);
                        car.setDrivingLicenseNumber(nine);
                        car.setAnnualInspectionTime(DateUtil.parseDate(ten));
                        car.setCommercialInsuranceTime(DateUtil.parseDate(eleven));
                        car.setInsertTime(new Date());
                        car.setState(1);
                        if (UserExt.getUser().getRoleType() == 1) {
                            car.setAddType(2);
                        } else if (UserExt.getUser().getRoleType() == 2) {
                            car.setAddType(3);
                            car.setAddObjectId(UserExt.getUser().getObjectId());
                        } else if (UserExt.getUser().getRoleType() == 3) {
                            car.setAddType(4);
                            car.setAddObjectId(UserExt.getUser().getObjectId());
                        }
                        tCarService.save(car);
 
                        //添加专车服务模式
                        if ("yes".equals(three)) {
                            TCarService service = new TCarService();
                            service.setCarId(car.getId());
                            service.setType(1);
                            tCarServiceService.save(service);
                        }
                        //添加小件同城物流服务模式
                        if ("yes".equals(four)) {
                            TCarService service = new TCarService();
                            service.setCarId(car.getId());
                            service.setType(4);
                            tCarServiceService.save(service);
                        }
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            return SUCCESS_TIP;
        }else {
            MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
            MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile");
            try {
                //定时五秒后执行
            /*Map<String,Object> maps=new HashMap<>();
            Workbook book = WoUtil.ImportFile(file);
            maps.put("book",book);
            QuartzManager.addJob(AddContract.class, (AddContract.name+new Date().getTime()).toUpperCase(), TimeJobType.ADMIN,DateUtil.getDate_strYMdHms(new Date().getTime() + 1*1000) , maps);*/
 
                Workbook book = WoUtil.ImportFile(file);
                Sheet sh = book.getSheetAt(0);   //获取到第一个表 get first table
                for (int i = 1; i <= sh.getLastRowNum(); i++) {
                    Row row = sh.getRow(i);
 
                    Cell cell0 = row.getCell(0);  //所属机构[平台车辆/加盟车辆] Affiliated Organization [Platform Vehicles/Franchise Vehicles]
                    String zero = null;
                    if (SinataUtil.isNotEmpty(cell0)) {
                        zero = String.valueOf(cell0.getStringCellValue()).trim();
                    }
 
                    Cell cell1 = row.getCell(1);  //所属分公司[提示:加盟车辆选填]Affiliated Organization [Platform Vehicles/Franchise Vehicles]
                    String one = null;
                    if (SinataUtil.isNotEmpty(cell1)) {
                        cell1.setCellType(Cell.CELL_TYPE_STRING);
                        one = String.valueOf(cell1.getStringCellValue()).trim();
                    }
 
                    Cell cell2 = row.getCell(2);  //所属加盟商[提示:加盟车辆选填]Affiliated Franchise [Platform Vehicles/Franchise Vehicles]
                    String two = null;
                    if (SinataUtil.isNotEmpty(cell2)) {
                        two = String.valueOf(cell2.getStringCellValue()).trim();
                    }
 
                    Cell cell3 = row.getCell(3);  //服务模式:专车[是/否]Business mode: dedicated vehicle [yes/no]
                    String three = null;
                    if (SinataUtil.isNotEmpty(cell3)) {
                        three = String.valueOf(cell3.getStringCellValue()).trim();
                    }
 
                    Cell cell4 = row.getCell(4);  //服务模式:出租车[是/否] Business mode: taxi [yes/no]
                    String four = null;
                    if (SinataUtil.isNotEmpty(cell4)) {
                        four = String.valueOf(cell4.getStringCellValue()).trim();
                    }
 
                    Cell cell5 = row.getCell(5);  //服务模式:跨城出行[是/否] Business mode: cross-city  [yes/no]
                    String five = null;
                    if (SinataUtil.isNotEmpty(cell5)) {
                        five = String.valueOf(cell5.getStringCellValue()).trim();
                    }
 
                    Cell cell6 = row.getCell(6);  //服务模式:小件跨城物流[是/否]Business mode: small-scale logistics [yes/no]
                    String six = null;
                    if (SinataUtil.isNotEmpty(cell6)) {
                        six = String.valueOf(cell6.getStringCellValue()).trim();
                    }
 
                    Cell cell7 = row.getCell(7);  //服务模式:小件跨城物流[是/否]Business mode: small-scale logistics [yes/no]
                    String seven = null;
                    if (SinataUtil.isNotEmpty(cell7)) {
                        seven = String.valueOf(cell7.getStringCellValue()).trim();
                    }
 
                    Cell cell8 = row.getCell(8);  //服务模式:包车[是/否]Service mode: Chartered service [Yes/No]
                    cell8.setCellType(Cell.CELL_TYPE_STRING);
                    String eight = null;
                    if (SinataUtil.isNotEmpty(cell8)) {
                        eight = String.valueOf(cell8.getStringCellValue()).trim();
                    }
 
                    Cell cell9 = row.getCell(9);  //车辆品牌 car brand
                    cell9.setCellType(Cell.CELL_TYPE_STRING);
                    String nine = null;
                    if (SinataUtil.isNotEmpty(cell9)) {
                        nine = String.valueOf(cell9.getStringCellValue()).trim();
                    }
 
                    Cell cell10 = row.getCell(10);  //车辆类型
                    cell10.setCellType(Cell.CELL_TYPE_STRING);
 
                    String ten = null;
                    if (SinataUtil.isNotEmpty(cell10)) {
                        ten = String.valueOf(cell10.getStringCellValue()).trim();
                    }
 
                    Cell cell11 = row.getCell(11);  //车辆颜色[黑色/银色/白色/红色/黄色/橙色/蓝色]Vehicle color options include black, silver, white, red, yellow, orange, and blue.
                    cell11.setCellType(Cell.CELL_TYPE_STRING);
                    String eleven = null;
                    if (SinataUtil.isNotEmpty(cell11)) {
                        eleven = String.valueOf(cell11.getStringCellValue()).trim();
                    }
 
 
                    if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four)
                            || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(seven)
                            || SinataUtil.isEmpty(eight) || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten)
                            || SinataUtil.isEmpty(eleven)) {
                        return new ErrorTip(500, "Sel tidak dapat kosong");
                    } else {
                        //判断所属机构
                        if (!zero.equals("Mobil platform") && !zero.equals("Kendaraan yang dibersihkan")) {
                            return new ErrorTip(500, "isi organisasi tidak benar");
                        }
                        //判断服务模式【专车】
                        if (!three.equals("ya") && !three.equals("Tidak")) {
                            return new ErrorTip(500, "Konten mode layanan [motor] tidak benar");
                        }
                        //判断服务模式【出租车】
                        if (!four.equals("ya") && !four.equals("Tidak")) {
                            return new ErrorTip(500, "Konten mode layanan [Intra-city Express] tidak benar");
                        }
                        //判断车辆颜色
                        if (!seven.equals("1") && !seven.equals("2") && !seven.equals("3") && !seven.equals("4") && !seven.equals("5") && !seven.equals("6") && !seven.equals("7")) {
                            return new ErrorTip(500, "Konten warna kendaraan tidak benar");
                        }
                        //判断年检到期时间格式是否正确
                        try {
                            if (!isValidDate(ten)) {
                                ten = importByExcelForDate(ten);
                            }
                        } catch (Exception e) {
                            return new ErrorTip(500, "Format waktu penggantian inspeksi tahunan tidak benar");
                        }
                        //判断商业保险到期时间格式是否正确
                        try {
                            if (!isValidDate(eleven)) {
                                eleven = importByExcelForDate(eleven);
                            }
                        } catch (Exception e) {
                            return new ErrorTip(500, "Format waktunya kehabisan asuransi komersial tidak benar");
                        }
 
                        //查找平台公司 Search for platform companies
//                    TCompany platCompany = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1).notIn("flag", "3").last(" limit 1"));
                        CompanyInfoRes platCompany = companyClient.queryByTypeAndFlg(new CompanyQueryTypeAndFlgReq(1, 3));
                        Integer companyId = platCompany.getId();
                        Integer franchiseeId = 0;
                        if ("Kendaraan yang dibersihkan".equals(zero)) {
                            //判断所属分公司是否存在 Checking if the subsidiary company exists.
                            if (SinataUtil.isNotEmpty(one)) {
//                            TCompany company = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("name", one).eq("type", 2).notIn("flag", "3").last(" limit 1"));
                                CompanyInfoRes company = companyClient.queryByTypeAndFlgAndName(new CompanyQueryTypeAndFlgAndNameReq(2, 3, one));
                                if (SinataUtil.isNotEmpty(company)) {
                                    companyId = company.getId();
                                    //判断加盟商是否存在 Assessing the existence of a franchisee
                                    if (SinataUtil.isNotEmpty(two)) {
//                                    TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId",company.getId()).eq("name", two).eq("type", 3).notIn("flag", "3").last(" limit 1"));
                                        CompanyInfoRes franchisee = companyClient.queryBySuperiorIdAndTypeAndFlgAndName(new CompanyQuerySuperiorIdAndTypeAndFlgAndNameReq(3, 3, two, company.getId()));
                                        if (SinataUtil.isNotEmpty(franchisee)) {
                                            franchiseeId = franchisee.getId();
                                        }
                                    }
                                }
                            }
                        }
 
                        Integer carBrandId = null;
                        Integer carModelId = null;
                        //查找品牌 search brand
                        if (SinataUtil.isNotEmpty(five)) {
                            TCarBrand carBrand = tCarBrandService.getOne(new QueryWrapper<TCarBrand>().eq("name", five).eq("state", 1).last(" limit 1"));
                            if (SinataUtil.isNotEmpty(carBrand)) {
                                carBrandId = carBrand.getId();
                                if (SinataUtil.isNotEmpty(six)) {
                                    //查找类型 search type
                                    TCarModel carModel = tCarModelService.getOne(new QueryWrapper<TCarModel>().eq("brandId", carBrand.getId()).eq("name", six).eq("state", 1).last(" limit 1"));
                                    if (SinataUtil.isNotEmpty(carModel)) {
                                        carModelId = carModel.getId();
                                    }
                                }
                            }
                        }
 
                        //添加车辆对象 add vechcle obj
                        TCar car = new TCar();
                        if ("Mobil platform".equals(zero)) {
                            car.setIsPlatCar(1);
                        } else if ("Kendaraan yang dibersihkan".equals(zero)) {
                            car.setIsPlatCar(2);
                        }
                        car.setCompanyId(companyId);
                        car.setFranchiseeId(franchiseeId);
                        car.setCarColor(seven);
                        car.setCarBrandId(carBrandId);
                        car.setCarModelId(carModelId);
                        car.setCarLicensePlate(eight);
                        car.setDrivingLicenseNumber(nine);
                        car.setAnnualInspectionTime(DateUtil.parseDate(ten));
                        car.setCommercialInsuranceTime(DateUtil.parseDate(eleven));
                        car.setInsertTime(new Date());
                        car.setState(1);
                        if (UserExt.getUser().getRoleType() == 1) {
                            car.setAddType(2);
                        } else if (UserExt.getUser().getRoleType() == 2) {
                            car.setAddType(3);
                            car.setAddObjectId(UserExt.getUser().getObjectId());
                        } else if (UserExt.getUser().getRoleType() == 3) {
                            car.setAddType(4);
                            car.setAddObjectId(UserExt.getUser().getObjectId());
                        }
                        tCarService.save(car);
 
                        //添加专车服务模式
                        if ("ya".equals(three)) {
                            TCarService service = new TCarService();
                            service.setCarId(car.getId());
                            service.setType(1);
                            tCarServiceService.save(service);
                        }
                        //添加小件同城物流服务模式
                        if ("ya".equals(four)) {
                            TCarService service = new TCarService();
                            service.setCarId(car.getId());
                            service.setType(4);
                            tCarServiceService.save(service);
                        }
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            return SUCCESS_TIP;
        }
    }
 
    /**
     * 判断日期是否满足yyyy-MM-dd格式
     * @param str
     * @return
     */
    public static boolean isValidDate(String str) {
        boolean convertSuccess=true;
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        try {
            format.setLenient(false);
            format.parse(str);
        } catch (Exception e) {
            convertSuccess=false;
        }
        return convertSuccess;
    }
 
 
    /**
     * 转换日期
     * @return
     */
    public static String importByExcelForDate(String value) {//value就是它的天数
        String currentCellValue = "";
        if(value != null && !value.equals("")){
            Calendar calendar = new GregorianCalendar(1900,0,-1);
            Date d = calendar.getTime();
            Date dd = DateUtils.addDays(d,Integer.valueOf(value));
            DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
            currentCellValue = formater.format(dd);
        }
        return currentCellValue;
    }
 
    /**
     *  导出车辆信息
     */
    @RequestMapping(value = "/outCar")
    public void outCar(HttpServletRequest request, HttpServletResponse response) {
        List<Map<String,Object>> listMap = tCarService.getCarList(null,UserExt.getUser().getRoleType(),UserExt.getUser().getObjectId(),null,null,null,null,null,null,null,null,null,null,null);
 
        // 表格数据【封装】
        List<List<String>> dataList = new ArrayList<>();
 
        //第一行显示【封装】
        List<String> twoList = new ArrayList<String>();
        twoList.add("总计:");
        twoList.add(String.valueOf(listMap.size())+"条");
        dataList.add(twoList);
 
        // 列【封装】
        List<String> shellList = new ArrayList<String>();
        shellList.add("添加时间");
        shellList.add("车辆ID");
        shellList.add("所属机构");
        shellList.add("车辆品牌");
        shellList.add("车辆类型");
        shellList.add("颜色");
        shellList.add("服务模式");
        shellList.add("车牌号");
        shellList.add("行驶证号码");
        shellList.add("关联司机");
        shellList.add("年检到期时间");
        shellList.add("商业保险到期时间");
        shellList.add("车辆剩余电量");
        dataList.add(shellList);
 
        for (Map<String,Object> object : listMap){
            // 详细数据列【封装】 detail
            shellList = new ArrayList<String>();
            if(SinataUtil.isNotEmpty(object.get("insertTime"))){
                shellList.add(DateUtil.format(DateUtil.parse(object.get("insertTime").toString(),"YYYY-MM-dd HH:mm:ss.S"), "YYYY-MM-dd HH:mm:ss"));
            }else{
                shellList.add("-");
            }
            shellList.add(String.valueOf(object.get("id")));
 
            if(SinataUtil.isNotEmpty(object.get("companyName"))){
                shellList.add(object.get("companyName").toString());
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("brandName"))){
                shellList.add(object.get("brandName").toString());
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("modelName"))){
                shellList.add(object.get("modelName").toString());
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("carColor"))){
                shellList.add(object.get("carColor").toString());
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("serverStr"))){
                shellList.add(object.get("serverStr").toString());
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("carLicensePlate"))){
                shellList.add(object.get("carLicensePlate").toString());
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("drivingLicenseNumber"))){
                shellList.add(object.get("drivingLicenseNumber").toString());
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("driverName"))){
                shellList.add(object.get("driverName").toString());
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("annualInspectionTime"))){
                shellList.add(DateUtil.format(DateUtil.parse(object.get("annualInspectionTime").toString(),"YYYY-MM-dd HH:mm:ss.S"), "YYYY-MM-dd HH:mm:ss"));
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("commercialInsuranceTime"))){
                shellList.add(DateUtil.format(DateUtil.parse(object.get("commercialInsuranceTime").toString(),"YYYY-MM-dd HH:mm:ss.S"), "YYYY-MM-dd HH:mm:ss"));
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("power"))){
                shellList.add(object.get("power").toString());
            }else{
                shellList.add("-");
            }
            dataList.add(shellList);
        }
        try {
            // 调用工具类进行导出
            ExcelExportUtil.easySheet("车辆信息导出记录"+DateUtil.format(new Date(), "YYYYMMddHHmmss"), "车辆信息导出记录", dataList,request, response);
 
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
}