| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.dsh.competition.entity.Competition; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.common.annotion.Permission; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.client.competition.CompetitionClient; |
| | | import com.dsh.guns.modular.system.client.competition.model.ListQuery; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.warpper.RoleWarpper; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 菜单控制器 |
| | |
| | | |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | |
| | | |
| | | /** |
| | |
| | | * 跳转到菜单详情列表页面 |
| | | */ |
| | | @RequestMapping(value = "/tCompetition_edit/{id}") |
| | | public String menuEdit(@PathVariable Integer id, Model model) { |
| | | return PREFIX + "menu_edit.html"; |
| | | public String tCompetitionEdit(@PathVariable Integer id, Model model) { |
| | | Competition competition = competitionClient.queryById(id); |
| | | model.addAttribute("item",competition); |
| | | return PREFIX + "tCompetition_edit.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String provinceCode,String cityCode,String shopName,String eventName,String time,Integer state,Integer registerCondition) { |
| | | List<Integer> ids = new ArrayList<>(); |
| | | // 获取门店id |
| | | if(ToolUtil.isNotEmpty(shopName)){ |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().like(TStore::getName, shopName)); |
| | | ids = list.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | }else { |
| | | ids = storeService.list().stream().map(TStore::getId).collect(Collectors.toList()); |
| | | } |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | ListQuery listQuery = new ListQuery(); |
| | | // List<Competition> competitions = competitionClient.list(); |
| | | return super.warpObject(null); |
| | | } |
| | | |
| | | |