yanghb
2023-04-10 b2f678ad387ca24e05a11100ea4583f0f2f730f0
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
package com.stylefeng.guns.modular.system.controller.general;
 
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.SinataUtil;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import com.stylefeng.guns.core.log.LogObjectHolder;
import org.springframework.web.bind.annotation.RequestParam;
 
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
/**
 * 系统设置控制器
 *
 * @author fengshuonan
 * @Date 2020-06-09 13:43:44
 */
@Controller
@RequestMapping("/tSysReformist")
public class TSysReformistController extends BaseController {
 
    private String PREFIX = "/system/tSysReformist/";
 
    @Autowired
    private ITSysReformistService tSysReformistService;
 
    @Autowired
    private ITSysIntegralService tSysIntegralService;
 
    @Autowired
    private ITSysFaceDistinguishService tSysFaceDistinguishService;
 
    @Autowired
    private ITSysPushOrderService tSysPushOrderService;
 
    @Autowired
    private ITSysCancleOrderService tSysCancleOrderService;
 
    @Autowired
    private ITPhoneService tPhoneService;
 
    @Autowired
    private ITCompanyService companyService;
 
    @Autowired
    private ISpellOrderRuleService spellOrderRuleService;
 
    @Autowired
    private IShowModularService showModularService;
 
 
    /**
     * 跳转到系统设置首页
     */
    @RequestMapping("")
    public String index(Model model) {
        //改派设置
        TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper<TSysReformist>().eq("companyId", ShiroKit.getUser().getObjectId()));
        model.addAttribute("reformist",reformist);
        //积分设置
        TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper<TSysIntegral>().eq("companyId", ShiroKit.getUser().getObjectId()));
        model.addAttribute("integral",integral);
        //人脸识别
        TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", ShiroKit.getUser().getObjectId()));
        model.addAttribute("faceDistinguish",faceDistinguish);
 
        //快车推单(第一轮)
        TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 1));
        model.addAttribute("zcOne",zcOne);
        //快车推单(第二轮)
        TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 2));
        model.addAttribute("zcTwo",zcTwo);
        //快车推单(第三轮)
        TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 3));
        model.addAttribute("zcThree",zcThree);
 
        //出租车推单(第一轮)
        TSysPushOrder czcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 1));
        model.addAttribute("czcOne",czcOne);
        //出租车推单(第二轮)
        TSysPushOrder czcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 2));
        model.addAttribute("czcTwo",czcTwo);
        //出租车推单(第三轮)
        TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 3));
        model.addAttribute("czcThree",czcThree);
 
        //普通取消设置(快车)
        TSysCancleOrder ptCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 1));
        model.addAttribute("ptCancel1",ptCancel1);
        //普通取消设置(出租车)
        TSysCancleOrder ptCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 2));
        model.addAttribute("ptCancel2",ptCancel2);
        //普通取消设置(跨城出行)
        TSysCancleOrder ptCancel3 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 3));
        model.addAttribute("ptCancel3",ptCancel3);
 
        //预约取消设置(快车)
        TSysCancleOrder yyCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 1));
        model.addAttribute("yyCancel1",yyCancel1);
        //预约取消设置(出租车)
        TSysCancleOrder yyCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 2));
        model.addAttribute("yyCancel2",yyCancel2);
 
        //拼车设置
        SpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<SpellOrderRule>().eq("companyId", ShiroKit.getUser().getObjectId()));
        model.addAttribute("spellOrderRule", JSONObject.parseObject(spellOrderRule.getContent()));
 
        //报警电话
        TPhone phone1 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1));
        model.addAttribute("phone1",phone1);
        //客服电话
        TPhone phone2 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2));
        model.addAttribute("phone2",phone2);
        //客服电话
        TPhone phone3 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 3));
        model.addAttribute("phone3",phone3);
        //95128电召电话
        TPhone phone4 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 4));
        model.addAttribute("phone4",phone4);
        //招聘电话
        TPhone phone5 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 5));
        model.addAttribute("phone5",phone5);
        //节假日服务费
        BigDecimal holidayFee = companyService.selectById(ShiroKit.getUser().getObjectId()).getHolidayFee();
        model.addAttribute("holidayFee",holidayFee);
        //超时扣款
        TSysTimeoutMoney tSysTimeoutMoney = timeoutMoneyService.selectOne(null);
        model.addAttribute("tSysTimeoutMoney",tSysTimeoutMoney);
        //提现手续费
        TSysWithdrawalPoundage tSysWithdrawalPoundage = sysWithdrawalPoundageService.selectOne(null);
        model.addAttribute("tSysWithdrawalPoundage",tSysWithdrawalPoundage);
        //模块管理
        List<ShowModular> showModulars = showModularService.selectList(null);
        Map<String, Integer> map = new HashMap<>();
        for (ShowModular showModular : showModulars) {
            switch (showModular.getType()){
                case 1:
                    map.put("sjzp1", showModular.getUserShow());
                    map.put("sjzp2", showModular.getDriverShow());
                    break;
                case 2:
                    map.put("zuc1", showModular.getUserShow());
                    map.put("zuc2", showModular.getDriverShow());
                    break;
                case 3:
                    map.put("mc1", showModular.getUserShow());
                    map.put("mc2", showModular.getDriverShow());
                    break;
                case 4:
                    map.put("czgrcl1", showModular.getUserShow());
                    map.put("czgrcl2", showModular.getDriverShow());
                    break;
                case 5:
                    map.put("mac1", showModular.getUserShow());
                    map.put("mac2", showModular.getDriverShow());
                    break;
                case 6:
                    map.put("sjzx1", showModular.getUserShow());
                    map.put("sjzx2", showModular.getDriverShow());
                    break;
                case 7:
                    map.put("dck1", showModular.getUserShow());
                    map.put("dck2", showModular.getDriverShow());
                    break;
            }
        }
        model.addAttribute("showModulars", map);
        return PREFIX + "tSysReformist.html";
    }
 
    @Autowired
    private ITSysTimeoutMoneyService timeoutMoneyService;
 
    @Autowired
    private ITSysWithdrawalPoundageService sysWithdrawalPoundageService;
 
    /**
     * 删除系统设置
     */
    @RequestMapping(value = "/setUp")
    @ResponseBody
    public Object setUp(String type, BigDecimal one, Integer two, Integer three, Integer openValue,
                        Integer isSpecialCar,Integer isTaxiCar,
                        Double zc1,Integer zc2,Double zc3,
                        Double zc4,Integer zc5,Double zc6,
                        Double zc7,Integer zc8,Double zc9,
                        Double czc1,Integer czc2,Double czc3,
                        Double czc4,Integer czc5,Double czc6,
                        Double czc7,Integer czc8,Double czc9,
                        Integer ptCancel1,BigDecimal ptCancel2, Integer ptCancel3, BigDecimal ptCancel4, Integer ptCancel5, BigDecimal ptCancel6,
                        Integer yyCancel1, BigDecimal yyCancel2, Integer yyCancel3, BigDecimal yyCancel4,
                        Double pdpd1, Double pdpd2, Double pdpd3, Double pdpd4, Double pdpd5, Double pdpd6,
                        String phone1, String phone2, String phone3, String phone4, String phone5, BigDecimal holidayFee,
                        Double percentage, Integer timeOut, Double deductMoney,
                        Integer sjzp1, Integer sjzp2, Integer zuc1, Integer zuc2, Integer mc1, Integer mc2,
                        Integer czgrcl1, Integer czgrcl2, Integer mac1, Integer mac2, Integer sjzx1, Integer sjzx2,
                        Integer dck1, Integer dck2) {
        //改派设置
        if("reassigningSet".equals(type)){
            TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper<TSysReformist>().eq("companyId", ShiroKit.getUser().getObjectId()));
            if (SinataUtil.isNotEmpty(reformist)){
                reformist.setMoney(one);
                reformist.setIsSpecialCar(isSpecialCar);
                reformist.setIsTaxiCar(isTaxiCar);
                tSysReformistService.updateById(reformist);
            }else{
                reformist = new TSysReformist();
                reformist.setCompanyId(ShiroKit.getUser().getObjectId());
                reformist.setMoney(one);
                reformist.setIsSpecialCar(isSpecialCar);
                reformist.setIsTaxiCar(isTaxiCar);
                tSysReformistService.insert(reformist);
            }
        }
 
 
        //积分设置
        if("integralSet".equals(type)){
            TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper<TSysIntegral>().eq("companyId", ShiroKit.getUser().getObjectId()));
            if (SinataUtil.isNotEmpty(integral)){
                integral.setIntegral(two);
                tSysIntegralService.updateById(integral);
            }else{
                integral = new TSysIntegral();
                integral.setCompanyId(ShiroKit.getUser().getObjectId());
                integral.setIntegral(two);
                tSysIntegralService.insert(integral);
            }
        }
 
        //人脸识别
        if("faceRecognitionSettings".equals(type)){
            TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", ShiroKit.getUser().getObjectId()));
            if (SinataUtil.isNotEmpty(faceDistinguish)){
                faceDistinguish.setIsOpen(three);
                faceDistinguish.setMinuteNum(openValue);
                tSysFaceDistinguishService.updateById(faceDistinguish);
            }else{
                faceDistinguish = new TSysFaceDistinguish();
                faceDistinguish.setIsOpen(three);
                faceDistinguish.setMinuteNum(openValue);
                faceDistinguish.setCompanyId(ShiroKit.getUser().getObjectId());
                tSysFaceDistinguishService.insert(faceDistinguish);
            }
        }
 
        //推单设置
        if("pushOrderSettings".equals(type)){
            //快车推单(第一轮)
            TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 1));
            if (SinataUtil.isNotEmpty(zcOne)){
                zcOne.setPushDistance(zc1);
                zcOne.setPushTime(zc2);
                zcOne.setDriverProportion(zc3);
                tSysPushOrderService.updateById(zcOne);
            }else{
                zcOne = new TSysPushOrder();
                zcOne.setPushDistance(zc1);
                zcOne.setPushTime(zc2);
                zcOne.setDriverProportion(zc3);
                zcOne.setCompanyId(ShiroKit.getUser().getObjectId());
                zcOne.setPushType(1);
                zcOne.setType(1);
                tSysPushOrderService.insert(zcOne);
            }
            //快车推单(第二轮)
            TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 2));
            if (SinataUtil.isNotEmpty(zcTwo)){
                zcTwo.setPushDistance(zc4);
                zcTwo.setPushTime(zc5);
                zcTwo.setDriverProportion(zc6);
                tSysPushOrderService.updateById(zcTwo);
            }else{
                zcTwo = new TSysPushOrder();
                zcTwo.setPushDistance(zc4);
                zcTwo.setPushTime(zc5);
                zcTwo.setDriverProportion(zc6);
                zcTwo.setCompanyId(ShiroKit.getUser().getObjectId());
                zcTwo.setPushType(1);
                zcTwo.setType(2);
                tSysPushOrderService.insert(zcTwo);
            }
            //快车推单(第三轮)
            TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 3));
            if (SinataUtil.isNotEmpty(zcThree)){
                zcThree.setPushDistance(zc7);
                zcThree.setPushTime(zc8);
                zcThree.setDriverProportion(zc9);
                tSysPushOrderService.updateById(zcThree);
            }else{
                zcThree = new TSysPushOrder();
                zcThree.setPushDistance(zc7);
                zcThree.setPushTime(zc8);
                zcThree.setDriverProportion(zc9);
                zcThree.setCompanyId(ShiroKit.getUser().getObjectId());
                zcThree.setPushType(1);
                zcThree.setType(3);
                tSysPushOrderService.insert(zcThree);
            }
 
            //出租车推单(第一轮)
            TSysPushOrder czcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 1));
            if (SinataUtil.isNotEmpty(czcOne)){
                czcOne.setPushDistance(czc1);
                czcOne.setPushTime(czc2);
                czcOne.setDriverProportion(czc3);
                tSysPushOrderService.updateById(czcOne);
            }else{
                czcOne = new TSysPushOrder();
                czcOne.setPushDistance(czc1);
                czcOne.setPushTime(czc2);
                czcOne.setDriverProportion(czc3);
                czcOne.setCompanyId(ShiroKit.getUser().getObjectId());
                czcOne.setPushType(2);
                czcOne.setType(1);
                tSysPushOrderService.insert(czcOne);
            }
            //出租车推单(第二轮)
            TSysPushOrder czcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 2));
            if (SinataUtil.isNotEmpty(czcTwo)){
                czcTwo.setPushDistance(czc4);
                czcTwo.setPushTime(czc5);
                czcTwo.setDriverProportion(czc6);
                tSysPushOrderService.updateById(czcTwo);
            }else{
                czcTwo = new TSysPushOrder();
                czcTwo.setPushDistance(czc4);
                czcTwo.setPushTime(czc5);
                czcTwo.setDriverProportion(czc6);
                czcTwo.setCompanyId(ShiroKit.getUser().getObjectId());
                czcTwo.setPushType(2);
                czcTwo.setType(2);
                tSysPushOrderService.insert(czcTwo);
            }
            //出租车推单(第三轮)
            TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 3));
            if (SinataUtil.isNotEmpty(czcThree)){
                czcThree.setPushDistance(czc7);
                czcThree.setPushTime(czc8);
                czcThree.setDriverProportion(czc9);
                tSysPushOrderService.updateById(czcThree);
            }else{
                czcThree = new TSysPushOrder();
                czcThree.setPushDistance(czc7);
                czcThree.setPushTime(czc8);
                czcThree.setDriverProportion(czc9);
                czcThree.setCompanyId(ShiroKit.getUser().getObjectId());
                czcThree.setPushType(2);
                czcThree.setType(3);
                tSysPushOrderService.insert(czcThree);
            }
        }
 
        //取消设置
        if("cancelOrderSettings".equals(type)){
            //普通取消设置(快车)
            TSysCancleOrder ptCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 1));
            if (SinataUtil.isNotEmpty(ptCancelOne)){
                ptCancelOne.setMinuteNum(ptCancel1);
                ptCancelOne.setMoney(ptCancel2);
                tSysCancleOrderService.updateById(ptCancelOne);
            }else{
                ptCancelOne = new TSysCancleOrder();
                ptCancelOne.setMinuteNum(ptCancel1);
                ptCancelOne.setMoney(ptCancel2);
                ptCancelOne.setCompanyId(ShiroKit.getUser().getObjectId());
                ptCancelOne.setType(1);
                ptCancelOne.setOrderType(1);
                tSysCancleOrderService.insert(ptCancelOne);
            }
 
            //普通取消设置(出租车)
            TSysCancleOrder ptCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 2));
            if (SinataUtil.isNotEmpty(ptCancelTwo)){
                ptCancelTwo.setMinuteNum(ptCancel3);
                ptCancelTwo.setMoney(ptCancel4);
                tSysCancleOrderService.updateById(ptCancelTwo);
            }else{
                ptCancelTwo = new TSysCancleOrder();
                ptCancelTwo.setMinuteNum(ptCancel3);
                ptCancelTwo.setMoney(ptCancel4);
                ptCancelTwo.setCompanyId(ShiroKit.getUser().getObjectId());
                ptCancelTwo.setType(1);
                ptCancelTwo.setOrderType(2);
                tSysCancleOrderService.insert(ptCancelTwo);
            }
 
            //普通取消设置(跨城出行)
            TSysCancleOrder ptCancelThree = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 3));
            if (SinataUtil.isNotEmpty(ptCancelThree)){
                ptCancelThree.setMinuteNum(ptCancel5);
                ptCancelThree.setMoney(ptCancel6);
                tSysCancleOrderService.updateById(ptCancelThree);
            }else{
                ptCancelThree = new TSysCancleOrder();
                ptCancelThree.setMinuteNum(ptCancel5);
                ptCancelThree.setMoney(ptCancel6);
                ptCancelThree.setCompanyId(ShiroKit.getUser().getObjectId());
                ptCancelThree.setType(1);
                ptCancelThree.setOrderType(3);
                tSysCancleOrderService.insert(ptCancelThree);
            }
        }
 
        //预约取消设置
        if("cancelTheReservationOrderSetting".equals(type)){
            //预约取消设置(快车)
            TSysCancleOrder yyCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 1));
            if (SinataUtil.isNotEmpty(yyCancelOne)){
                yyCancelOne.setMinuteNum(yyCancel1);
                yyCancelOne.setMoney(yyCancel2);
                tSysCancleOrderService.updateById(yyCancelOne);
            }else{
                yyCancelOne = new TSysCancleOrder();
                yyCancelOne.setMinuteNum(yyCancel1);
                yyCancelOne.setMoney(yyCancel2);
                yyCancelOne.setCompanyId(ShiroKit.getUser().getObjectId());
                yyCancelOne.setType(2);
                yyCancelOne.setOrderType(1);
                tSysCancleOrderService.insert(yyCancelOne);
            }
            //预约取消设置(出租车)
            TSysCancleOrder yyCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 2));
            if (SinataUtil.isNotEmpty(yyCancelTwo)){
                yyCancelTwo.setMinuteNum(yyCancel3);
                yyCancelTwo.setMoney(yyCancel4);
                tSysCancleOrderService.updateById(yyCancelTwo);
            }else{
                yyCancelTwo = new TSysCancleOrder();
                yyCancelTwo.setMinuteNum(yyCancel3);
                yyCancelTwo.setMoney(yyCancel4);
                yyCancelTwo.setCompanyId(ShiroKit.getUser().getObjectId());
                yyCancelTwo.setType(2);
                yyCancelTwo.setOrderType(2);
                tSysCancleOrderService.insert(yyCancelTwo);
            }
        }
 
        //拼单派单
        if("spellOrderSetting".equals(type)){
            SpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<SpellOrderRule>().eq("companyId", ShiroKit.getUser().getObjectId()));
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("num1", pdpd1);
            jsonObject.put("num2", pdpd2);
            jsonObject.put("num3", pdpd3);
            jsonObject.put("num4", pdpd4);
            jsonObject.put("num5", pdpd5);
            jsonObject.put("num6", pdpd6);
            if(SinataUtil.isNotEmpty(spellOrderRule)){
                spellOrderRule.setContent(jsonObject.toJSONString());
                spellOrderRuleService.updateById(spellOrderRule);
            }else{
                spellOrderRule = new SpellOrderRule();
                spellOrderRule.setCompanyId(ShiroKit.getUser().getObjectId());
                spellOrderRule.setContent(jsonObject.toJSONString());
                spellOrderRuleService.insert(spellOrderRule);
            }
        }
 
        //电话设置
        if("phoneSettings".equals(type)){
            //报警电话
            TPhone phoneOne = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1));
            if (SinataUtil.isNotEmpty(phoneOne)){
                phoneOne.setPhone(phone1);
                tPhoneService.updateById(phoneOne);
            }else{
                phoneOne = new TPhone();
                phoneOne.setPhone(phone1);
                phoneOne.setCompanyId(ShiroKit.getUser().getObjectId());
                phoneOne.setType(1);
                if (ShiroKit.getUser().getRoleType() == 1){
                    phoneOne.setPlatform(1);
                }else{
                    phoneOne.setPlatform(2);
                }
                tPhoneService.insert(phoneOne);
            }
            //客服电话
            TPhone phoneTwo = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2));
            if (SinataUtil.isNotEmpty(phoneTwo)){
                phoneTwo.setPhone(phone2);
                tPhoneService.updateById(phoneTwo);
            }else{
                phoneTwo = new TPhone();
                phoneTwo.setPhone(phone2);
                phoneTwo.setCompanyId(ShiroKit.getUser().getObjectId());
                phoneTwo.setType(2);
                if (ShiroKit.getUser().getRoleType() == 1){
                    phoneTwo.setPlatform(1);
                }else{
                    phoneTwo.setPlatform(2);
                }
                tPhoneService.insert(phoneTwo);
            }
 
            //客服电话
            TPhone phone = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 3));
            if (SinataUtil.isNotEmpty(phone)){
                phone.setPhone(phone3);
                tPhoneService.updateById(phone);
            }else{
                phone = new TPhone();
                phone.setPhone(phone3);
                phone.setCompanyId(ShiroKit.getUser().getObjectId());
                phone.setType(3);
                if (ShiroKit.getUser().getRoleType() == 1){
                    phone.setPlatform(1);
                }else{
                    phone.setPlatform(2);
                }
                tPhoneService.insert(phone);
            }
 
            //招聘电话
            TPhone phoneFive = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 5));
            if (SinataUtil.isNotEmpty(phoneFive)){
                phoneFive.setPhone(phone5);
                tPhoneService.updateById(phoneFive);
            }else{
                phoneFive = new TPhone();
                phoneFive.setPhone(phone5);
                phoneFive.setCompanyId(ShiroKit.getUser().getObjectId());
                phoneFive.setType(5);
                if (ShiroKit.getUser().getRoleType() == 1){
                    phoneFive.setPlatform(1);
                }else{
                    phoneFive.setPlatform(2);
                }
                tPhoneService.insert(phoneFive);
            }
        }
 
        //95128
        if("95128TheOnCall".equals(type)){
            //95128电召电话
            TPhone phoneFour = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 4));
            if (SinataUtil.isNotEmpty(phoneFour)){
                phoneFour.setPhone(phone4);
                tPhoneService.updateById(phoneFour);
            }else{
                phoneFour = new TPhone();
                phoneFour.setPhone(phone4);
                phoneFour.setCompanyId(ShiroKit.getUser().getObjectId());
                phoneFour.setType(4);
                if (ShiroKit.getUser().getRoleType() == 1){
                    phoneFour.setPlatform(1);
                }else{
                    phoneFour.setPlatform(2);
                }
                tPhoneService.insert(phoneFour);
            }
        }
 
 
        ///  节假日服务费
        if("holidayServiceFeeSetting".equals(type)){
            Integer companyId = ShiroKit.getUser().getObjectId();
            TCompany company = companyService.selectById(companyId);
            company.setHolidayFee(holidayFee);
            companyService.updateById(company);
        }
 
 
        /// 超时扣款设置
        if("timeoutDeductionSettings".equals(type)){
            timeoutMoneyService.delete(new EntityWrapper<TSysTimeoutMoney>().ne("id",0));
            TSysTimeoutMoney tSysTimeoutMoney = new TSysTimeoutMoney();
            tSysTimeoutMoney.setDeductMoney(deductMoney);
            tSysTimeoutMoney.setTimeOut(timeOut);
            timeoutMoneyService.insert(tSysTimeoutMoney);
        }
 
 
        ///   提现手续费设置
        if("withdrawalFeeSetting".equals(type)){
            sysWithdrawalPoundageService.delete(new EntityWrapper<TSysWithdrawalPoundage>().ne("id",0));
            TSysWithdrawalPoundage tSysWithdrawalPoundage = new TSysWithdrawalPoundage();
            tSysWithdrawalPoundage.setPercentage(percentage);
            sysWithdrawalPoundageService.insert(tSysWithdrawalPoundage);
        }
 
        //模块设置
        if("moduleManagement".equals(type)){
            //司机招聘
            ShowModular showModular1 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 1));
            if(null == showModular1){
                showModular1 = new ShowModular();
                showModular1.setType(1);
                showModular1.setDriverShow(sjzp2);
                showModular1.setUserShow(sjzp1);
                showModularService.insert(showModular1);
            }else{
                showModular1.setDriverShow(sjzp2);
                showModular1.setUserShow(sjzp1);
                showModularService.updateById(showModular1);
            }
            //租车
            ShowModular showModular2 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 2));
            if(null == showModular2){
                showModular2 = new ShowModular();
                showModular2.setType(2);
                showModular2.setDriverShow(zuc2);
                showModular2.setUserShow(zuc1);
                showModularService.insert(showModular2);
            }else{
                showModular2.setDriverShow(zuc2);
                showModular2.setUserShow(zuc1);
                showModularService.updateById(showModular2);
            }
            //买车
            ShowModular showModular3 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 3));
            if(null == showModular3){
                showModular3 = new ShowModular();
                showModular3.setType(3);
                showModular3.setDriverShow(mc2);
                showModular3.setUserShow(mc1);
                showModularService.insert(showModular3);
            }else{
                showModular3.setDriverShow(mc2);
                showModular3.setUserShow(mc1);
                showModularService.updateById(showModular3);
            }
            //出租个人车辆
            ShowModular showModular4 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 4));
            if(null == showModular4){
                showModular4 = new ShowModular();
                showModular4.setType(4);
                showModular4.setDriverShow(czgrcl2);
                showModular4.setUserShow(czgrcl1);
                showModularService.insert(showModular4);
            }else{
                showModular4.setDriverShow(czgrcl2);
                showModular4.setUserShow(czgrcl1);
                showModularService.updateById(showModular4);
            }
            //卖车
            ShowModular showModular5 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 5));
            if(null == showModular5){
                showModular5 = new ShowModular();
                showModular5.setType(5);
                showModular5.setDriverShow(mac2);
                showModular5.setUserShow(mac1);
                showModularService.insert(showModular5);
            }else{
                showModular5.setDriverShow(mac2);
                showModular5.setUserShow(mac1);
                showModularService.updateById(showModular5);
            }
            //商家中心
            ShowModular showModular6 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 6));
            if(null == showModular6){
                showModular6 = new ShowModular();
                showModular6.setType(6);
                showModular6.setDriverShow(sjzx2);
                showModular6.setUserShow(sjzx1);
                showModularService.insert(showModular6);
            }else{
                showModular6.setDriverShow(sjzx2);
                showModular6.setUserShow(sjzx1);
                showModularService.updateById(showModular6);
            }
            //打车卡
            ShowModular showModular7 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 7));
            if(null == showModular7){
                showModular7 = new ShowModular();
                showModular7.setType(7);
                showModular7.setDriverShow(dck2);
                showModular7.setUserShow(dck1);
                showModularService.insert(showModular7);
            }else{
                showModular7.setDriverShow(dck2);
                showModular7.setUserShow(dck1);
                showModularService.updateById(showModular7);
            }
        }
        return SUCCESS_TIP;
    }
 
 
}