| | |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.Competition; |
| | | import com.dsh.course.feignClient.competition.model.ListQuery; |
| | | import com.dsh.course.feignClient.course.CourseClient; |
| | | 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.SinataUtil; |
| | | import com.dsh.guns.core.support.HttpKit; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.util.DateUtil; |
| | | import com.dsh.guns.modular.system.util.ExcelExportUtil; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import com.dsh.guns.modular.system.warpper.RoleWarpper; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/TCompetition") |
| | | @RequestMapping("/tCompetition") |
| | | public class TCompetitionController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/TCompetition/"; |
| | | private String PREFIX = "/system/tCompetition/"; |
| | | |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | |
| | | */ |
| | | @RequestMapping("/tCompetition_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | return PREFIX + "tCompetition_add.html"; |
| | | return PREFIX + "TCompetition_add.html"; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String provinceCode,String cityCode,String shopName,String eventName,String time,Integer state,Integer registerCondition) { |
| | | public Object list(String provinceCode, String cityCode, String shopName, String eventName, String time, Integer state, Integer registerCondition) { |
| | | List<Integer> ids = new ArrayList<>(); |
| | | List<TStore> list = null; |
| | | // 获取门店id |
| | | if(ToolUtil.isNotEmpty(shopName)){ |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().like(TStore::getName, shopName)); |
| | | list = storeService.list(new LambdaQueryWrapper<TStore>().like(TStore::getName, shopName)); |
| | | ids = list.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | }else { |
| | | list = storeService.list(); |
| | | ids = storeService.list().stream().map(TStore::getId).collect(Collectors.toList()); |
| | | } |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | ListQuery listQuery = new ListQuery(provinceCode,cityCode,eventName,time,state,registerCondition,ids); |
| | | List<Competition> competitions = competitionClient.list(listQuery); |
| | | return super.warpObject(null); |
| | | Page<Competition> page = new PageFactory<Competition>().defaultPage(); |
| | | ListQuery listQuery = new ListQuery(page.getSize(),page.getCurrent(),provinceCode,cityCode,eventName,time,state,registerCondition,ids); |
| | | Page<Competition> competitions = competitionClient.list(listQuery); |
| | | for (Competition competition : competitions.getRecords()) { |
| | | for (TStore tStore : list) { |
| | | if(competition.getStoreId().equals(tStore.getId())){ |
| | | competition.setStoreName(tStore.getName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return super.packForBT(competitions); |
| | | } |
| | | |
| | | |