| | |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | 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.communityWorldCup.Model.WorldCupStore; |
| | | import com.dsh.course.feignClient.communityWorldCup.WorldCupStoreClient; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.other.model.Site; |
| | | import com.dsh.course.mapper.UserMapper; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | private ITSiteService siteService; |
| | | @Autowired |
| | | private IUserService userService; |
| | | @Autowired |
| | | private WorldCupStoreClient worldCupStoreClient; |
| | | |
| | | |
| | | // 添加SUTU |
| | |
| | | StoreConfig c8 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,8)); |
| | | model.addAttribute("c8",c8); |
| | | model.addAttribute("id",id); |
| | | StoreConfig c9 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,9)); |
| | | if (c9==null){ |
| | | model.addAttribute("c9",new StoreConfig()); |
| | | List<WorldCupStore> worldCupStores = worldCupStoreClient.getWorldCupStoreListByStoreId(id); |
| | | if (CollectionUtils.isEmpty(worldCupStores)){ |
| | | model.addAttribute("worldCupStores",new ArrayList<>()); |
| | | }else{ |
| | | model.addAttribute("c9",c9); |
| | | model.addAttribute("worldCupStores",worldCupStores); |
| | | } |
| | | return PREFIX + "TShop_imgAll.html"; |
| | | } |
| | |
| | | } |
| | | @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,Integer px9, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8,String c9, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8,Integer r9) { |
| | | 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,String str) { |
| | | try { |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | StoreConfig collect1 = collect(id, px1, r1, c1, 1); |
| | |
| | | storeConfigs.add(collect6); |
| | | storeConfigs.add(collect7); |
| | | storeConfigs.add(collect8); |
| | | StoreConfig collect9 = collect(id, px9, r9, c9, 9); |
| | | storeConfigs.add(collect9); |
| | | storeConfigService.updateBatchById(storeConfigs); |
| | | |
| | | // 修改世界杯 |
| | | JSONArray jsonArray = JSONObject.parseArray(str); |
| | | List<WorldCupStore> worldCupStores = new ArrayList<>(); |
| | | for (Object o : jsonArray) { |
| | | String s = JSONObject.toJSONString(o); |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | Integer id1 = jsonObject.getInteger("id"); |
| | | String backgroundImage = jsonObject.getString("backgroundImage"); |
| | | Integer isOpen = jsonObject.getInteger("isOpen"); |
| | | Integer sort = jsonObject.getInteger("sort"); |
| | | WorldCupStore worldCupStore = new WorldCupStore(); |
| | | worldCupStore.setSort(sort); |
| | | worldCupStore.setId(id1); |
| | | worldCupStore.setBackgroundImage(backgroundImage); |
| | | worldCupStore.setIsOpen(isOpen); |
| | | worldCupStores.add(worldCupStore); |
| | | } |
| | | worldCupStoreClient.updateWorldCupStoreListById(worldCupStores); |
| | | |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |