44323
2023-09-23 753145b81710f934c28b29a1feb376ce79d4a965
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
package com.dsh.guns.modular.system.controller.code;
 
import cn.hutool.crypto.SecureUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsh.course.feignClient.account.CityClient;
import com.dsh.course.feignClient.account.model.CityListQuery;
import com.dsh.course.feignClient.account.model.TCityManager;
import com.dsh.course.feignClient.competition.CompetitionClient;
import com.dsh.course.mapper.UserMapper;
import com.dsh.guns.config.UserExt;
import com.dsh.guns.core.base.controller.BaseController;
import com.dsh.guns.core.base.tips.SuccessTip;
import com.dsh.guns.core.common.constant.factory.PageFactory;
import com.dsh.guns.core.util.ToolUtil;
import com.dsh.guns.modular.system.model.*;
import com.dsh.guns.modular.system.service.*;
import com.dsh.guns.modular.system.util.GaoDeMapUtil;
import io.swagger.models.auth.In;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
 
/**
 * 车辆管理控制器
 *
 * @author fengshuonan
 * @Date 2020-06-05 17:25:12
 */
@Controller
@RequestMapping("/tShop")
public class TShopController extends BaseController {
 
    private String PREFIX = "/system/tShop/";
 
    @Autowired
    private CompetitionClient competitionClient;
 
    @Autowired
    private CityClient cityClient;
 
    @Autowired
    private IStoreService storeService;
    @Autowired
    private ICityService cityService;
 
    @Resource
    private UserMapper userMapper;
 
    @Resource
    private StoreConfigService storeConfigService;
 
    @Autowired
    private TStoreOtherConfigTrueService tStoreOtherConfigTrueService;
 
    @Autowired
    private TStoreOtherConfigService storeOtherConfigService;
 
    @Autowired
    private TTurnService tTurnService;
 
    @Autowired
    private TStoreOtherService storeOtherService;
 
 
 
 
    /**
     * 跳转到车辆管理首页
     */
    @RequestMapping("")
    public String index(Model model) {
        List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
        model.addAttribute("list",list);
        String roleid = UserExt.getUser().getRoleid();
        model.addAttribute("role",roleid);
        return PREFIX + "TShop.html";
    }
 
    /**
     * 跳转到添加车辆管理
     */
    @RequestMapping("/tShop_add")
    public String tCompetitionAdd(Model model) {
        List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
        model.addAttribute("list",list);
        String roleid = UserExt.getUser().getRoleid();
        model.addAttribute("role",roleid);
        return PREFIX + "tShop_add.html";
    }
    @RequestMapping("/tShop_add_one")
    public String tCompetitionAddOne(Integer id,Model model) {
        List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
        model.addAttribute("list",list);
        String roleid = UserExt.getUser().getRoleid();
        model.addAttribute("id",id);
 
        return PREFIX + "tShop_add_one.html";
    }
    @RequestMapping("/tShop_add_two")
    public String tCompetitionAddTwo(Model model) {
        List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
        model.addAttribute("list",list);
        String roleid = UserExt.getUser().getRoleid();
        return PREFIX + "tShop_add_two.html";
    }
 
 
    /**
     * 跳转到修改车辆管理
     */
    @RequestMapping("/tShop_update/{id}")
    public String tCityUpdate(@PathVariable Integer id, Model model) {
        TStore byId = storeService.getById(id);
        model.addAttribute("item",byId);
        List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
        model.addAttribute("list",list);
        TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode()));
        List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId()));
        CityListQuery cityListQuery = new CityListQuery();
        cityListQuery.setOffset(1);
        cityListQuery.setLimit(10000);
        cityListQuery.setCityCode(byId.getCityCode());
        Page<TCityManager> list2 = cityClient.list(cityListQuery);
        model.addAttribute("list1",list1);
        model.addAttribute("list2",list2.getRecords());
        String roleid = UserExt.getUser().getRoleid();
        model.addAttribute("role",roleid);
        model.addAttribute("time",byId.getStartTime()+" - "+byId.getEndTime());
        User byId1 = userMapper.selectById(byId.getStoreStaffId());
        model.addAttribute("city",byId1);
        model.addAttribute("type",1);
        return PREFIX + "tShop_edit.html";
    }
 
 
 
 
    @RequestMapping("/tShop_update_one/{id}")
    public String tCityUpdateOne(@PathVariable Integer id, Model model) {
        TStoreOtherConfig byId = storeOtherConfigService.getById(id);
        TTurn one = tTurnService.getOne(new LambdaQueryWrapper<TTurn>().eq(TTurn::getName, byId.getName()));
        // page list
        List<TTurn> list = tTurnService.list(new LambdaQueryWrapper<TTurn>().eq(TTurn::getPid, one.getId()));
        // type list
        List<TTurn> list1 = tTurnService.list(new LambdaQueryWrapper<TTurn>().eq(TTurn::getPid, byId.getPageId()));
        model.addAttribute("item",byId);
        model.addAttribute("list",list);
        model.addAttribute("list1",list1);
 
        return PREFIX + "tShop_edit_two.html";
    }
 
 
 
    @RequestMapping("/tShop_info/{id}")
    public String tCityInfo(@PathVariable Integer id, Model model) {
        TStore byId = storeService.getById(id);
        model.addAttribute("item",byId);
        List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
        model.addAttribute("list",list);
        TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode()));
        List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId()));
        CityListQuery cityListQuery = new CityListQuery();
        cityListQuery.setOffset(1);
        cityListQuery.setLimit(10000);
        cityListQuery.setCityCode(byId.getCityCode());
        Page<TCityManager> list2 = cityClient.list(cityListQuery);
        model.addAttribute("list1",list1);
        model.addAttribute("list2",list2.getRecords());
        String roleid = UserExt.getUser().getRoleid();
        model.addAttribute("role",roleid);
        model.addAttribute("time",byId.getStartTime()+" - "+byId.getEndTime());
        User byId1 = userMapper.selectById(byId.getStoreStaffId());
        model.addAttribute("city",byId1);
        model.addAttribute("type",0);
        return PREFIX + "tShop_edit.html";
    }
    @RequestMapping("/tShop_gift/{id}")
    public String tCityGift(@PathVariable Integer id, Model model) {
        TStore byId = storeService.getById(id);
        model.addAttribute("welfarePicture",byId.getWelfarePicture());
        model.addAttribute("id",id);
        return PREFIX + "tShop_img.html";
    }
    @RequestMapping("/tShop_indexSet/{id}")
    public String tCityIndexSet(@PathVariable Integer id, Model model) {
        StoreConfig c1 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,1));
        model.addAttribute("c1",c1);
        StoreConfig c2 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,2));
        model.addAttribute("c2",c2);
        StoreConfig c3 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,3));
        model.addAttribute("c3",c3);
        StoreConfig c4 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,4));
        model.addAttribute("c4",c4);
        StoreConfig c5 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,5));
        model.addAttribute("c5",c5);
        StoreConfig c6 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,6));
        model.addAttribute("c6",c6);
        StoreConfig c7 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,7));
        model.addAttribute("c7",c7);
        StoreConfig c8 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,8));
        model.addAttribute("c8",c8);
        model.addAttribute("id",id);
        return PREFIX + "tShop_imgAll.html";
    }
 
 
    @RequestMapping(value = "/list")
    @ResponseBody
    public Object list(String provinceCode, String cityCode , String name, String phone,String shopName) {
        Page<TStoreListVo> page = new PageFactory<TStoreListVo>().defaultPage();
        List<TStoreListVo> list =  storeService.listAll(page,provinceCode,cityCode,name,phone,shopName);
        page.setRecords(list);
        return  super.packForBT(page);
    }
    @RequestMapping(value = "/listOne")
    @ResponseBody
    public Object listOne(Integer id) {
        Page<Map<String,Object>> page = new PageFactory<Map<String,Object>>().defaultPage();
        List<Map<String,Object>> list =  storeService.listOne(page,id);
        page.setRecords(list);
        return  super.packForBT(page);
    }
    @RequestMapping(value = "/listTwo")
    @ResponseBody
    public Object listTwo() {
        Page<Map<String,Object>> page = new PageFactory<Map<String,Object>>().defaultPage();
        List<Map<String,Object>> list =  storeService.listTwo(page);
        page.setRecords(list);
        return  super.packForBT(page);
    }
 
    @RequestMapping(value = "/add")
    @ResponseBody
    public Object list(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId,String lat,String lon) {
        try {
            if(ToolUtil.isNotEmpty(tStore.getProvinceCode())) {
                TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getProvinceCode()));
                tStore.setProvince(one.getName());
                TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode()));
                tStore.setCity(one1.getName());
            }
            tStore.setStartTime(time.split(" - ")[0]);
            tStore.setEndTime(time.split(" - ")[1]);
            tStore.setIds(ids);
            tStore.setType(type);
            tStore.setOperatorId(yyId);
            tStore.setState(1);
            User user = new User();
            List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone));
            if(users.size()>0){
                return "5001";
            }
            user.setAccount(userPhone);
            user.setName(userName);
            user.setRoleid("2");
            user.setPhone(userPhone);
            user.setPassword(SecureUtil.md5("a123456"));
            userMapper.insert(user);
            tStore.setStoreStaffId(user.getId());
                tStore.setLon(lon);
                tStore.setLat(lat);
 
            storeService.save(tStore);
 
            ArrayList<StoreConfig> storeConfigs = new ArrayList<>();
            for (int i = 1; i < 9; i++) {
                StoreConfig storeConfig = new StoreConfig();
                storeConfig.setIsOpen(1);
                storeConfig.setSort(i);
                storeConfig.setType(i);
                storeConfig.setStoreId(tStore.getId());
                storeConfigs.add(storeConfig);
            }
            storeConfigService.saveBatch(storeConfigs);
            return new SuccessTip<>();
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
 
    @RequestMapping(value = "/update")
    @ResponseBody
    public Object update(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId) {
        try {
            TStore byId = storeService.getById(tStore.getId());
 
            if(ToolUtil.isNotEmpty(tStore.getProvinceCode())) {
                TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getProvinceCode()));
                tStore.setProvince(one.getName());
                TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode()));
                tStore.setCity(one1.getName());
            }
            tStore.setStartTime(time.split(" - ")[0]);
            tStore.setEndTime(time.split(" - ")[1]);
            tStore.setIds(ids);
            tStore.setType(type);
            tStore.setOperatorId(yyId);
            if(ToolUtil.isEmpty(tStore.getCoverDrawing())){
                tStore.setCoverDrawing(byId.getCoverDrawing());
            }
            User user = userMapper.selectById(byId.getStoreStaffId());
            List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone).ne(User::getId,tStore.getStoreStaffId()));
            if(users.size()>0){
                return "5001";
            }
            user.setAccount(userPhone);
            user.setName(userName);
            user.setPhone(userPhone);
            userMapper.updateById(user);
            storeService.updateById(tStore);
            return new SuccessTip<>();
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
    @RequestMapping(value = "/onChange")
    @ResponseBody
    public Object onChange(Integer oneId) {
        try {
            TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, oneId));
            return cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId()));
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
    @RequestMapping(value = "/saveImgAll")
    @ResponseBody
    public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8,
                             String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8,
                             Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8) {
        try {
            ArrayList<StoreConfig> storeConfigs = new ArrayList<>();
            StoreConfig collect1 = collect(id, px1, r1, c1, 1);
            StoreConfig collect2 = collect(id, px2, r2, c2, 2);
            StoreConfig collect3 = collect(id, px3, r3, c3, 3);
            StoreConfig collect4 = collect(id, px4, r4, c4, 4);
            StoreConfig collect5 = collect(id, px5, r5, c5, 5);
            StoreConfig collect6 = collect(id, px6, r6, c6, 6);
            StoreConfig collect7 = collect(id, px7, r7, c7, 7);
            StoreConfig collect8 = collect(id, px8, r8, c8, 8);
            storeConfigs.add(collect1);
            storeConfigs.add(collect2);
            storeConfigs.add(collect3);
            storeConfigs.add(collect4);
            storeConfigs.add(collect5);
            storeConfigs.add(collect6);
            storeConfigs.add(collect7);
            storeConfigs.add(collect8);
            storeConfigService.updateBatchById(storeConfigs);
            return new SuccessTip<>();
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
 
    private StoreConfig collect(Integer id,Integer sort,Integer isOpen,String img,int type){
        StoreConfig one = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType, type));
        one.setSort(sort);
        one.setIsOpen(isOpen);
        if(ToolUtil.isNotEmpty(img)){
            one.setBackgroundImage(img);
        }
        return one;
    }
    @RequestMapping(value = "/oneChangeNext")
    @ResponseBody
    public Object oneChangeNext(String oneId) {
 
        try {
            CityListQuery cityListQuery = new CityListQuery();
            cityListQuery.setCityCode(oneId);
            cityListQuery.setOffset(1);
            cityListQuery.setLimit(100000);
            Page<TCityManager> list = cityClient.list(cityListQuery);
            List<TCityManager> records = list.getRecords();
            for (TCityManager record : records) {
                record.setName(record.getName()+"-"+record.getPhone());
            }
            return records;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
 
 
    @RequestMapping(value = "/cancel")
    public Object cancel(Integer id) {
        try {
            competitionClient.cancel(id);
            return SUCCESS_TIP;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
    @ResponseBody
    @RequestMapping(value = "/deleteOne")
    public Object delete1(Integer id) {
        try {
            storeService.delete1(id);
            return SUCCESS_TIP;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
 
    @RequestMapping(value = "/saveImg")
    @ResponseBody
    public Object saveImg(Integer id,String img) {
        try {
            TStore byId = storeService.getById(id);
            byId.setWelfarePicture(img);
            storeService.updateById(byId);
            return SUCCESS_TIP;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
 
    @RequestMapping(value = "/freeze")
    @ResponseBody
    public Object freeze(Integer id) {
        try {
            TStore byId = storeService.getById(id);
            byId.setState(2);
            storeService.updateById(byId);
            return SUCCESS_TIP;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
    @RequestMapping(value = "/unfreeze")
    @ResponseBody
    public Object unfreeze(Integer id) {
        try {
            TStore byId = storeService.getById(id);
            byId.setState(1);
            storeService.updateById(byId);
            return SUCCESS_TIP;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
 
    @RequestMapping(value = "/pwd")
    @ResponseBody
    public Object pwd(Integer id) {
        try {
            TStore byId = storeService.getById(id);
            User user = userMapper.selectById(byId.getStoreStaffId());
            user.setPassword(SecureUtil.md5("a123456"));
            userMapper.updateById(user);
            return SUCCESS_TIP;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
    @RequestMapping(value = "/typeChange")
    @ResponseBody
    public Object typeChange(String name) {
        try {
            List<Map<String,Object>> list = storeService.typeChange(name);
            return list;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
    @RequestMapping(value = "/typeChangeOne")
    @ResponseBody
    public Object typeChangeOne(Integer id) {
        try {
            List<Map<String,Object>> list = storeService.typeChangeOne(id);
            return list;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
 
    /**
     * ajax.set("url",url);
     *     ajax.set("name",name);
     *     ajax.set("page",page);
     *     ajax.set("type",type);
     *     ajax.set("turnId",turnId);
     *     ajax.set("sort",sort);
     * @param id
     * @return
     */
    @RequestMapping(value = "/addConfigOne")
    @ResponseBody
    public Object addConfigOne(String url,String name,Integer page,Integer type,String  turnId,Integer sort) {
        try {
             storeService.addConfigOne(url,name,page,type,turnId,sort);
            return SUCCESS_TIP;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
    @RequestMapping(value = "/addConfig")
    @ResponseBody
    public Object addConfig(String name,Integer id) {
        try {
            List<TStoreOtherConfig> list = storeOtherConfigService.list();
            if(list.size()>0){
                TStoreOther tStoreOther = new TStoreOther();
                tStoreOther.setName(name);
                tStoreOther.setStoreId(id);
                storeOtherService.save(tStoreOther);
 
                // 找出temp表数据
 
                ArrayList<TStoreOtherConfigTrue> tStoreOtherConfigTrues = new ArrayList<>();
                for (TStoreOtherConfig tStoreOtherConfig : list) {
                    TStoreOtherConfigTrue tStoreOtherConfigTrue = new TStoreOtherConfigTrue();
                    BeanUtils.copyProperties(tStoreOtherConfig,tStoreOtherConfigTrue);
                    tStoreOtherConfigTrue.setPid(tStoreOther.getId());
                    tStoreOtherConfigTrues.add(tStoreOtherConfigTrue);
                }
                tStoreOtherConfigTrueService.saveBatch(tStoreOtherConfigTrues);
                storeOtherConfigService.remove(new LambdaQueryWrapper<TStoreOtherConfig>().gt(TStoreOtherConfig::getId,0));
            }
 
 
        return SUCCESS_TIP;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
    @RequestMapping(value = "/updateConfigOne")
    @ResponseBody
    public Object addConfigOne(String url,String name,Integer page,Integer type,String  turnId,Integer sort,Integer id) {
        try {
            TStoreOtherConfig byId = storeOtherConfigService.getById(id);
            if(ToolUtil.isNotEmpty(url)){
                byId.setUrl(url);
            }
            byId.setName(name);
            TTurn byId1 = tTurnService.getById(page);
            TTurn byId2 = tTurnService.getById(type);
            byId.setPage(byId1.getName());
            byId.setType(byId2.getName());
            byId.setTurnId(turnId);
            byId.setSort(sort);
            byId.setPageId(page);
            byId.setTypeId(type);
            storeOtherConfigService.updateById(byId);
            return SUCCESS_TIP;
        }catch (Exception e){
            e.printStackTrace();
            return ERROR;
        }
    }
 
 
 
 
}