Helius
2021-06-16 5728be2af515b2200e782aa201ca5d4d67d9ea47
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
package com.ibeetl.admin.console.api;
 
import com.alibaba.fastjson.JSON;
import com.ibeetl.admin.console.model.*;
import com.ibeetl.admin.console.service.*;
import com.ibeetl.admin.console.util.DateUtil;
import com.ibeetl.admin.console.util.PreventManyCommit;
import com.ibeetl.admin.console.web.query.SettingMoneyQuery;
import com.ibeetl.admin.core.annotation.Function;
import com.ibeetl.admin.core.entity.CoreSetMoney;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.entity.XzxUserVehicleInfo;
import com.ibeetl.admin.core.entity.XzxUserVehicleRel;
import com.ibeetl.admin.core.service.CorePlatformService;
import com.ibeetl.admin.core.util.ConvertUtil;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.ibeetl.admin.core.web.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.beetl.sql.core.engine.PageQuery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
 
/**
 * 运营管理
 */
@RestController
@Api(value = "运营管理接口类")
public class OperateManageApi {
    private static final String MODEL = "/admin/front/opera";
    private final Logger log = LoggerFactory.getLogger(this.getClass());
    @Autowired
    OperateManageApiService operateManageApiService;
    @Autowired
    XzxUserVehicleInfoService xzxUserVehicleInfoService;
    @Autowired
    XzxUserVehicleRelService xzxUserVehicleRelService;
    @Autowired
    XzxOrderClockInInfoService xzxOrderClockInInfoService;
    @Autowired
    XzxOrderBatchInfoService xzxOrderBatchInfoService;
    @Autowired
    SettingConsoleService settingConsoleService;
    @Autowired
    MoneyConsoleService moneyConsoleService;
    @Autowired
    CuserConsoleService cuserConsoleService;
    @Autowired
    CorePlatformService platformService;
    @Autowired
    XzxCityPartnerService cityService;
 
    @Value("${file.upload.path}")
    String filePath;
    @Value("${file.address}")
    String fileAddress;
    /**
     * 查询
     * @param item
     * @return
     */
    @PostMapping(MODEL + "/queryOperaIteml.do")
    @ResponseBody
    @ApiOperation(value="运营管理-物品管理(详情可直接取一条数据)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "pageNum", value = "页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "limitNum", value = "每页条数", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "title", value = "大类名称", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "parentId", value = "大类类别Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "cityId", value = "城市Id", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> queryOperaIteml(@RequestBody ItemModel item){
        Map<String, Object> map = operateManageApiService.querOperaIteml(item);
        updateItemForRedis();
        return JsonResult.success(map);
    }
    /**
     * 查询
     * @param item
     * @return
     */
    @PostMapping(MODEL + "/queryPackageOperaIteml.do")
    @ResponseBody
    @ApiOperation(value="运营管理-打包站分类管理", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "pageNum", value = "页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "limitNum", value = "每页条数", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "title", value = "大类名称", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "parentId", value = "大类类别Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "packageId", value = "打包站Id", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> queryPackageOperaIteml(@RequestBody ItemModel item){
        Map<String, Object> map = operateManageApiService.queryPackageOperaIteml(item);
        updateItemForRedis1();
        return JsonResult.success(map);
    }
 
    @PostMapping(MODEL + "/queryCityByPartnerId.do")
    @ResponseBody
    @ApiOperation(value="运营管理-根据用户Id查询所有城市", notes="test: 仅0有正确返回")
    public JsonResult<Map<String, Object>> queryCityByPartnerId(){
        List<Map<String, Object>> list = operateManageApiService.queryCityByPartnerId();
        Map<String, Object>  map = new HashMap<>();
        map.put("code",0);
        map.put("data",list);
        map.put("msg","成功");
        return JsonResult.success(map);
    }
    /**
     * 更新redis里面的缓存
     */
    void updateItemForRedis(){
        operateManageApiService.updateItemForRedis();
    }
    void updateItemForRedis1(){
        operateManageApiService.updateItemForRedis1();
    }
    /**
     * 查询
     * @param item
     * @return
     */
    @PostMapping(MODEL + "/addOperateParent.json")
    @ResponseBody
    @ApiOperation(value="运营管理-添加物品(添加分类)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "title", value = "类别名称", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "itemUnit", value = "单位", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "price", value = "回收价格", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "putStoragePrice", value = "入库价格", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "picture", value = "图片", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "secondPrice", value = "500公斤以上价格", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "parentId", value = "所属类别(如果是添加分类为空)", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "sort", value = "排序", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "areaTownList", value = "区域集合", required = true, dataType = "List<List<String>>"),
            @ApiImplicitParam(paramType="query", name = "townIdList", value = "区域Id列表", required = true, dataType = "List<String>")
 
    })
    public JsonResult<Map<String, Object>> addOperateParent(@RequestBody ItemModel item){
        Map<String, Object> map = operateManageApiService.addOperateParent(item);
        return JsonResult.success(map);
    }
 
    /**
     * 查询
     * @param item
     * @return
     */
    @PostMapping(MODEL + "/addPackageOperateParent.json")
    @ResponseBody
    @ApiOperation(value="运营管理-添加打包站物品(添加分类)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "title", value = "类别名称", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "itemUnit", value = "单位", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "price", value = "回收价格", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "putStoragePrice", value = "入库价格", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "picture", value = "图片", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "secondPrice", value = "500公斤以上价格", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "parentId", value = "所属类别(如果是添加分类为空)", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "sort", value = "排序", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "packageId", value = "打包站Id", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> addPackageOperateParent(@RequestBody ItemModel item){
        Map<String, Object> map = operateManageApiService.addOperateParent1(item);
        return JsonResult.success(map);
    }
    /**
     * 删除
     * @param item
     * @return
     */
    @PostMapping(MODEL + "/delOperateItem.json")
    @PreventManyCommit(time = 10)
    @ResponseBody
    @ApiOperation(value="运营管理-删除物品(删除分类)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "id", value = "物品(父类)Id", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> delOperateItem(@RequestBody ItemModel item){
        Map<String, Object> map = operateManageApiService.delOperateItem(item);
        return JsonResult.success(map);
    }
 
    @PostMapping(MODEL + "/updateOperateItem.json")
    @ResponseBody
    @PreventManyCommit(time = 10)
    @ApiOperation(value="运营管理-更新物品(更新分类)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "id", value = "物品(父类)Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "cityId", value = "城市ID", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> updateOperateItem(@RequestBody ItemModel item){
        Map<String, Object> map = operateManageApiService.updateOperateItem(item);
        if(null!=map){
            return JsonResult.success(map);
        }else{
            return JsonResult.failMessage("该物品存在待入库和入库中的订单,不能修改物品属性!");
        }
    }
    @PostMapping(MODEL + "/delPackageOperateItem.json")
    @PreventManyCommit(time = 10)
    @ResponseBody
    @ApiOperation(value="运营管理-删除打包站物品(删除分类)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "id", value = "物品(父类)Id", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> delPackageOperateItem(@RequestBody ItemModel item){
        Map<String, Object> map = operateManageApiService.delPackageOperateItem(item);
        return JsonResult.success(map);
    }
    @PostMapping(MODEL + "/updatePackageOperateItem.json")
    @ResponseBody
    @PreventManyCommit(time = 10)
    @ApiOperation(value="运营管理-更新打包站物品(更新分类)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "id", value = "物品(父类)Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "packageId", value = "城市ID", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> updatePackageOperateItem(@RequestBody ItemModel item){
        Map<String, Object> map = operateManageApiService.updateOperateItem1(item);
        return JsonResult.success(map);
    }
 
    @PostMapping(MODEL + "/queryOperateItemList.json")
    @ResponseBody
    @PreventManyCommit(time = 10)
    @ApiOperation(value="运营管理-类别列表(更新分类)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "pageNum", value = "页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "limitNum", value = "每页条数", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "id", value = "父类Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "cityId", value = "原有城市Id改为存放区域Id,与前端App沟通", required = true, dataType = "String")
 
    })
    public JsonResult<Map<String, Object>> queryOperateItemList(@RequestBody ItemModel item){
 
        Map<String, Object> map = operateManageApiService.queryOperateItemList(item);
        return JsonResult.success(map);
    }
 
    @PostMapping(MODEL + "/queryPackageItemList.json")
    @ResponseBody
    @PreventManyCommit(time = 10)
    @ApiOperation(value="运营管理-打包站类别列表(更新分类)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "pageNum", value = "页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "limitNum", value = "每页条数", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "id", value = "父类Id", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> queryPackageItemList(@RequestBody ItemModel item){
        Map<String, Object> map = operateManageApiService.queryOperateItemList1(item);
        return JsonResult.success(map);
    }
 
    /**
     * 查询仓库列表
     * @param sysStorageApiModel
     * @return
     */
    @PostMapping(MODEL + "/querySysStorageList.do")
    @ResponseBody
    @ApiOperation(value="运营管理-仓库管理", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "page", value = "页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "limit", value = "每页条数", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "area", value = "区域Id", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> querySysStorageList(@RequestBody SysStorageApiModel sysStorageApiModel){
        Map<String, Object> map = operateManageApiService.querySysStorageList(sysStorageApiModel);
        return JsonResult.success(map);
 
    }
    /**
     * 查询仓库列表
     * @param sysStorageApiModel
     * @return
     */
    @PostMapping(MODEL + "/addSysStorageApi.json")
    @ResponseBody
    @ApiOperation(value="运营管理-新增仓库", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "storageName", value = "名称", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "storageArea", value = "面积", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "detailAddress", value = "详细地址", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "area", value = "区域Id", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> addSysStorageApi(@RequestBody SysStorageApiModel sysStorageApiModel){
        int num = operateManageApiService.addSysStorageApi(sysStorageApiModel);
        Map<String,Object> map = new HashMap<>();
        map.put("code",0);
        map.put("num",num);
        return JsonResult.success(map);
    }
 
    @PostMapping(MODEL + "/updateSysStorageApi.json")
    @ResponseBody
    @ApiOperation(value="运营管理-修改仓库", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "storageName", value = "名称", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "storageArea", value = "面积", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "detailAddress", value = "详细地址", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "id", value = "仓库Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "area", value = "区域Id", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> updateSysStorageApi(@RequestBody SysStorageApiModel sysStorageApiModel){
        int num = operateManageApiService.updateSysStorageApi(sysStorageApiModel);
        Map<String,Object> map = new HashMap<>();
        map.put("code",0);
        map.put("num",num);
        return JsonResult.success(map);
    }
 
    @PostMapping(MODEL + "/delSysStorageApi.json")
    @ResponseBody
    @ApiOperation(value="运营管理-删除仓库", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "id", value = "仓库Id", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> delSysStorageApi(@RequestBody SysStorageApiModel sysStorageApiModel){
        int num = operateManageApiService.delSysStorageApi(sysStorageApiModel);
        Map<String,Object> map = new HashMap<>();
        map.put("code",0);
        map.put("num",num);
        return JsonResult.success(map);
    }
 
 
    /**
     * 查询
     * @param bannerModel
     * @return
     */
    @PostMapping(MODEL + "/queryBannerApiList.do")
    @ResponseBody
    @ApiOperation(value="运营管理-banner管理", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "cityId", value = "区域Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "page", value = "页码", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "limit", value = "每页条数", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> queryBannerApiList(@RequestBody BannerModel bannerModel){
        List<String> partnerIds = cityService.queryPartnerByCurrent();
        if(null!=partnerIds&&partnerIds.size()>0){
            CoreUser user = platformService.getCurrentUser();
            bannerModel.setPartnerId(user.getId()+"");
        }
        Map<String, Object> map =  operateManageApiService.queryBannerApiList(bannerModel);
        return JsonResult.success(map);
 
    }
 
    /**
     * 添加
     * @param bannerModel
     * @return
     */
    @PostMapping(MODEL + "/insertBannerApi.json")
    @ResponseBody
    @ApiOperation(value="运营管理-banner添加", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "picName", value = "图片名称", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "picPath", value = "图片路径", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "picUrl", value = "图片链接", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "sort", value = "排序", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "townIdList", value = "区域Id列表", required = true, dataType = "List<String>")
 
    })
    public JsonResult insertBannerApi(@RequestBody BannerModel bannerModel){
        List<String> partnerIds = cityService.queryPartnerByCurrent();
        if(null!=partnerIds&&partnerIds.size()>0){
            CoreUser user = platformService.getCurrentUser();
            bannerModel.setPartnerId(user.getId()+"");
 
        }
        if(null!=bannerModel.getTownIdList()&&bannerModel.getTownIdList().size()>0){
            List<String> townIdList = bannerModel.getTownIdList();
            for (String townId:townIdList) {
                bannerModel.setCityId(townId);
                operateManageApiService.insertBannerApi(bannerModel);
            }
        }else{
            operateManageApiService.insertBannerApi(bannerModel);
        }
 
        return JsonResult.success("添加成功!");
 
    }
 
    /**
     * 更新
     * @param bannerModel
     * @return
     */
    @PostMapping(MODEL + "/updateBannerApi.json")
    @ResponseBody
    @ApiOperation(value="运营管理-banner更新", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "id", value = "banner的Id", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "picName", value = "图片名称", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "picPath", value = "图片路径", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "picUrl", value = "图片链接", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "sort", value = "排序", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> updateBannerApi(@RequestBody BannerModel bannerModel){
        Map<String,Object> map = new HashMap<>();
        map.put("code",0);
        map.put("num",operateManageApiService.updateBannerApi(bannerModel));
        return JsonResult.success(map);
    }
 
    /**
     * 删除
     * @param bannerModel
     * @return
     */
    @PostMapping(MODEL + "/delBannerApi.json")
    @ResponseBody
    @ApiOperation(value="运营管理-banner删除", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "id", value = "banner的Id", required = true, dataType = "int")
    })
    public JsonResult<Map<String, Object>> delBannerApi(@RequestBody BannerModel bannerModel){
        Map<String,Object> map = new HashMap<>();
        map.put("code",0);
        map.put("num",operateManageApiService.delBannerApi(String.valueOf(bannerModel.getId())));
        return JsonResult.success(map);
    }
 
    @PostMapping(MODEL + "/uploadAvatarApi.json")
    @ResponseBody
    @ApiOperation(value="运营管理-图片上传", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "file", value = "图片文件", required = true, dataType = "MultipartFile")
    })
    public JsonResult<Map<String, Object>> uploadAvatarApi(@PathVariable @RequestBody MultipartFile file){
        System.out.println("========图片上传接口开始执行===========");
        log.info("========图片上传接口开始执行===========");
        Map map=new HashMap();
 
        if(file.isEmpty()){
            return null;
        }
        //文件名
        String fileName = file.getOriginalFilename();
        //后缀名
        String suffixName = fileName.substring(fileName.lastIndexOf("."));
        //图片名
        //String path = "/resource/static/img"; //文件存储位置  我放在了我的项目下
        fileName=UUID.randomUUID()+suffixName;
        File dest = new File(filePath+fileName);
        //File dest = new File(path+"\\"+fileName);
        if (!dest.getParentFile().exists()) {
            dest.getParentFile().mkdirs();
        }
        try {
            file.transferTo(dest);
            String url=fileAddress+fileName;
            //String url=address+"\\"+fileName;
            map.put("path",url);
 
            System.out.println("========图片上传接口执行完毕===========");
            log.info("========图片上传接口执行完毕===========");
 
            return JsonResult.success(map);
        } catch (IOException e) {
            map.put("code",-1);
            map.put("path","");
            map.put("msg","图片不能超过1M");
            return JsonResult.success(map);
            //e.printStackTrace();
        }
    }
 
 
    @RequestMapping(MODEL + "/moneySetting.do")
    @ResponseBody
    @ApiOperation(value="运营管理-金额设置(查询)", notes="test: 仅0有正确返回")
    public JsonResult<List<Map<String,Object>>> moneySetting(@RequestBody SettingMoneyQuery condtion){
        PageQuery<CoreSetMoney> page = condtion.getPageQuery();
        operateManageApiService.moneySetting(page);
        List<Map<String,Object>> list = new ArrayList<>();
        List<CoreSetMoney> setMoneyList = page.getList();
        for (CoreSetMoney setmoney:setMoneyList) {
            list.add(setmoney.getTails());
        }
        return JsonResult.success(list);
    }
 
    @PostMapping(MODEL + "/updateMoneySetting.json")
    @ResponseBody
    @PreventManyCommit(time = 10)
    @ApiOperation(value="运营管理-金额设置(保存)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "startTime", value = "开始时间", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "endTime", value = "结束时间", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "timeInterval", value = "时间间隔", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "agentPrice", value = "代丢价格", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "overdrawPrice", value = "透支额度", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "rechargePrice", value = "充值金额", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "orderTotal", value = "订单数量", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "orderTimeout", value = "订单超时时间", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "warehousingPrice", value = "入库员透支额度", required = true, dataType = "String")
 
    })
    public JsonResult<String> updateMoneySetting(@RequestBody CoreSetMoney coreSetMoney){
        operateManageApiService.updateMoneySetting(coreSetMoney);
        return JsonResult.success("保存成功");
    }
 
    @PostMapping(MODEL + "/vehicleList.do")
    @ResponseBody
    @ApiOperation(value="运营管理-车辆管理", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "vehicleNo", value = "车辆编号", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "page", value = "页码", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "limit", value = "每页条数", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> vehicleList(@RequestBody VehicleModel model)
    {
        Map<String, Object> map =  xzxUserVehicleInfoService.queryByVehicleInfoList(model.getVehicleNo(),model.getPage(),model.getLimit());
        return JsonResult.success(map);
    }
 
 
    @PostMapping(MODEL + "/checkUserNameByPhone.json")
    @ResponseBody
    @ApiOperation(value="运营管理-车辆管理添加(校验回收员)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "mobilePhone", value = "车辆编号", required = true, dataType = "String")
    })
    public JsonResult<Map<String, Object>> checkUserNameByPhone(@RequestBody UserModel model)
    {
        Map<String,Object> map = new HashMap<>();
        String userType = "2";
        UserModel userModel = operateManageApiService.checkUserNameByPhone(model.getMobilePhone(), userType);
        if(null!=userModel){
            map.put("code",0);
            map.put("msg","查询成功");
            map.put("userId",userModel.getUserId());
            map.put("mobilePhone",userModel.getMobilePhone());
            map.put("name",userModel.getName());
            map.put("nickName",DateUtil.getNickName(userModel.getNickName()));
            //map.put("nickName",userModel.getNickName());
        }else{
            map.put("code",-1);
            map.put("msg","没有该手机号的回收员");
        }
 
        return JsonResult.success(map);
    }
 
 
    @PostMapping(MODEL + "/queryAllOtherUserApiByName.json")
    @ResponseBody
    @ApiOperation(value="运营管理-车辆管理添加(回收员列表)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "userId", value = "用户Id", required = true, dataType = "String")
    })
    public JsonResult<List<Map<String, Object>>>  queryAllOtherUserByName(@RequestBody UserModel model) {
        List<Map<String, Object>> otherUser = cuserConsoleService.queryCuserListByName(model.getUserId());
        return JsonResult.success(otherUser);
 
    }
 
 
    @PostMapping(MODEL + "/vehicleInfoadd.json")
    @ResponseBody
    @ApiOperation(value="运营管理-车辆管理添加", notes="test: 仅0有正确返回")
    public JsonResult vehicleInfoadd(@RequestBody VehicleModel model)
    {
 
        String userId=model.getUserId();
        String storageId=model.getStorageId();
        if(null!=storageId){
            model.setStorageId(storageId);
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        model.setCreateTime(sdf.format(new Date()));
        model.setDelFlag(0);
        XzxUserVehicleInfo xzxUserVehicleInfo =getInfo(model);
        xzxUserVehicleInfoService.save(xzxUserVehicleInfo);
        System.out.println("==========="+xzxUserVehicleInfo.getId());
        if(null!=xzxUserVehicleInfo.getId()){
            XzxUserVehicleRel rel = new XzxUserVehicleRel();
            rel.setDelFlag(0);
            rel.setVehicleId(xzxUserVehicleInfo.getId());
            rel.setUserId(userId);
            xzxUserVehicleRelService.save(rel);
        }
        return new JsonResult().success();
    }
 
    private XzxUserVehicleInfo getInfo (VehicleModel model){
        XzxUserVehicleInfo info = new XzxUserVehicleInfo();
        info.setCreateTime(model.getCreateTime());
        info.setDelFlag(model.getDelFlag());
        info.setStorageId(Integer.parseInt(model.getStorageId()));
        info.setLoadWeight(model.getLoadWeight());
        info.setType(model.getType());
        info.setVehicleNo(model.getVehicleNo());
        info.setWeight(model.getWeight());
        info.setColor(model.getColor());
        return info;
    }
    @PostMapping(MODEL + "/editVehicleIn.json")
    @ResponseBody
    @ApiOperation(value="运营管理-车辆管理编辑", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "id", value = "车辆管理Id", required = true, dataType = "Long"),
            @ApiImplicitParam(paramType="query", name = "relId", value = "车辆管理和用户关联ID", required = true, dataType = "Long"),
            @ApiImplicitParam(paramType="query", name = "userId", value = "用户Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "weight", value = "重量", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "vehicleNo", value = "车辆编号", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "storageId", value = "仓库Id", required = true, dataType = "String")
 
    })
    public JsonResult<String> editVehicleIn(@RequestBody VehicleModel model) {
        String userId = model.getUserId();
        String relId = model.getRelId();
        XzxUserVehicleInfo oldInfo = xzxUserVehicleInfoService.queryById(model.getId());
        oldInfo.setWeight(model.getWeight());
        oldInfo.setVehicleNo(model.getVehicleNo());
        if(model.getStorageId()!=null){
            oldInfo.setStorageId(Integer.parseInt(model.getStorageId()));
 
        }else{
            return JsonResult.failMessage("保存失败,仓库Id为空!");
        }
        boolean success = xzxUserVehicleInfoService.update(oldInfo);
        if (success) {
            XzxUserVehicleRel rel = xzxUserVehicleRelService.queryById(Long.parseLong(relId));
            rel.setDelFlag(0);
            rel.setUserId(userId);
            xzxUserVehicleRelService.update(rel);
            return new JsonResult().success();
        } else {
            return JsonResult.failMessage("保存失败");
        }
    }
 
 
    @PostMapping(MODEL + "/querySysStorageApi.json")
    @ResponseBody
    @ApiOperation(value="运营管理-仓库列表", notes="test: 仅0有正确返回")
    public JsonResult<List<Map<String, Object>>> querySysStorageApi(){
        List<Map<String, Object>> result = settingConsoleService.queryAllStorage();
        return JsonResult.success(result);
    }
 
    @PostMapping(MODEL + "/delete.json")
    @ResponseBody
    @ApiOperation(value="运营管理-车辆管理删除", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "ids", value = "车辆Id,多个id用逗号分割", required = true, dataType = "String")
    })
    public JsonResult delete(@RequestBody VehicleModel model) {
        String ids = model.getIds();
        if (ids.endsWith(",")) {
            ids = StringUtils.substringBeforeLast(ids, ",");
        }
        List<Long> idList = ConvertUtil.str2longs(ids);
        xzxUserVehicleInfoService.batchDelXzxUserVehicleInfo(idList);
        return new JsonResult().success();
    }
 
 
    @PostMapping(MODEL + "/batchInfoApiList.do")
    @ResponseBody
    @ApiOperation(value="运营管理-打卡管理", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "回收员名称", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "weightError", value = "误差", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "startTime", value = "开始时间", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "endTime", value = "结束时间", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "page", value = "页码", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "limit", value = "每页条数", required = true, dataType = "String")
 
    })
    public JsonResult<Map<String, Object>> batchInfoApiList(@RequestBody BatchInfoModel infoModel)
    {
        Map<String, Object> map= xzxOrderClockInInfoService.queryByConditionList(infoModel.getName(),infoModel.getWeightError(), infoModel.getStartTime(),infoModel.getEndTime(),infoModel.getPage(),infoModel.getLimit());
 
        return JsonResult.success(map);
 
    }
 
    @PostMapping(MODEL + "/batchDetaillist.json")
    @ResponseBody
    @ApiOperation(value="运营管理-打卡管理(详情)", notes="test: 仅0有正确返回")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "vehicleId", value = "关联车辆Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "userId", value = "用户Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "type", value = "类型(0:全部,1:空车,2:载重)", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "weightError", value = "误差", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "startTime", value = "开始时间", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "endTime", value = "结束时间", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "page", value = "页码", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "limit", value = "每页条数", required = true, dataType = "String")
 
    })
    public JsonResult<Map<String, Object>> batchDetaillist(@RequestBody BatchInfoModel infoModel)
    {
        String vehicleId=infoModel.getVehicleId();
        String userId =infoModel.getUserId();
        String weightError=infoModel.getWeightError();
        String startTime=infoModel.getStartTime();
        String endTime=infoModel.getEndTime();
        String page=infoModel.getPage();
        String limit=infoModel.getLimit();
        String type=infoModel.getType();
        Map<String,Object> map = new HashMap<>();
        if(null!=type&&!"".equals(type)){
            if("0".equals(type)){
                map =  xzxOrderBatchInfoService.queryBatchInfoDetailList(weightError,startTime,endTime,userId,vehicleId,page,limit);
            }else if("1".equals(type)){
                map= xzxOrderBatchInfoService.queryClockDetailList(weightError,startTime,endTime,userId,vehicleId,page,limit);
            }else{
                map= xzxOrderBatchInfoService.queryBatchDetailList(weightError,startTime,endTime,userId,vehicleId,page,limit);
            }
        }else{
            map = xzxOrderBatchInfoService.queryBatchInfoDetailList(weightError,startTime,endTime,userId,vehicleId,page,limit);
        }
        return JsonResult.success(map);
 
    }
 
 
}