Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/PlayPai into 2.0
| | |
| | | package com.dsh.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.account.entity.Referee; |
| | | import com.dsh.account.model.RefereeList; |
| | |
| | | public Referee getRefereeById(@RequestBody Integer id){ |
| | | return refereeService.getById(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据电话号码查询 |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | @PostMapping("/referee/getRefereeByPhone") |
| | | public Referee getRefereeByPhone(String phone){ |
| | | return refereeService.getOne(new QueryWrapper<Referee>() |
| | | .eq("phone", phone).ne("state", 3)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | LambdaQueryWrapper<UserPointsMerchandise> userPointsMerchandiseLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | userPointsMerchandiseLambdaQueryWrapper.eq(UserPointsMerchandise::getPointsMerchandiseId, pointMercharsPayedVo.getId()); |
| | | userPointsMerchandiseLambdaQueryWrapper.eq(UserPointsMerchandise::getPayStatus, 2).eq(UserPointsMerchandise::getState, 1); |
| | | if (ToolUtil.isNotEmpty(pointMercharsPayedVo.getStatus())) { |
| | | userPointsMerchandiseLambdaQueryWrapper.eq(UserPointsMerchandise::getStatus, pointMercharsPayedVo.getStatus()); |
| | | } |
| | |
| | | public Map<String, Object> userGameRecordList(@RequestBody UserGameRecordList userGameRecordList){ |
| | | return worldCupCompetitorService.userGameRecordList(userGameRecordList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取已报名人数 |
| | | * @param worldCupId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/worldCup/getRegisteredNumber") |
| | | public int getRegisteredNumber(@RequestBody Integer worldCupId){ |
| | | List<WorldCupPayment> list = worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("worldCupId", worldCupId) |
| | | .eq("payStatus", 2).eq("state", 1)); |
| | | List<Long> collect = list.stream().map(WorldCupPayment::getId).collect(Collectors.toList()); |
| | | if(collect.size() == 0){ |
| | | return 0; |
| | | } |
| | | return worldCupPaymentParticipantService.getCount(worldCupId, collect); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/referee/getRefereeById") |
| | | Referee getRefereeById(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 根据电话号码查询 |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | @PostMapping("/referee/getRefereeByPhone") |
| | | Referee getRefereeByPhone(String phone); |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/worldCup/userGameRecordList") |
| | | Map<String, Object> userGameRecordList(UserGameRecordList userGameRecordList); |
| | | |
| | | /** |
| | | * 获取已报名人数 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/worldCup/getRegisteredNumber") |
| | | int getRegisteredNumber(Integer worldCupId); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/addReferee") |
| | | public ResultUtil addReferee(Referee referee){ |
| | | Referee refereeByPhone = refereeClient.getRefereeByPhone(referee.getPhone()); |
| | | if(null != refereeByPhone){ |
| | | return ResultUtil.error("电话号码已使用"); |
| | | } |
| | | Region region = regionService.getOne(new QueryWrapper<Region>().eq("code", referee.getProvinceCode())); |
| | | referee.setProvince(region.getName()); |
| | | region = regionService.getOne(new QueryWrapper<Region>().eq("code", referee.getCityCode())); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/editReferee") |
| | | public ResultUtil editReferee(Referee referee){ |
| | | Referee refereeByPhone = refereeClient.getRefereeByPhone(referee.getPhone()); |
| | | if(null != refereeByPhone && !referee.getId().equals(refereeByPhone.getId())){ |
| | | return ResultUtil.error("电话号码已使用"); |
| | | } |
| | | Region region = regionService.getOne(new QueryWrapper<Region>().eq("code", referee.getProvinceCode())); |
| | | referee.setProvince(region.getName()); |
| | | region = regionService.getOne(new QueryWrapper<Region>().eq("code", referee.getCityCode())); |
| | |
| | | if(worldCup1.getStartTime().before(DateUtil.getDate())){ |
| | | return ResultUtil.error("赛事已开始,不能编辑"); |
| | | } |
| | | Integer maxPeople = worldCup1.getMaxPeople(); |
| | | int registeredNumber = worldCupClient.getRegisteredNumber(worldCup.getId()); |
| | | if(maxPeople.compareTo(registeredNumber) < 0){ |
| | | return ResultUtil.error("报名人数不能小于已报名人数"); |
| | | } |
| | | if(worldCup.getStartTime().before(new Date())){ |
| | | worldCup.setStatus(2); |
| | | }else{ |
| | |
| | | {title: '身份证号', field: 'idcard', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '二维码', field: '', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data, item) { |
| | | return '<a href="#" onclick="RegisteredPersonnel.openQRCode(' + item.id + ', ' + item.isStudent + ',\'' + item.name + '\')">二维码</a>' |
| | | return '<a href="#" onclick="RegisteredPersonnel.openQRCode(' + item.id + ', ' + item.isStudent + ',\'' + item.name + '\')">查看</a>' |
| | | } |
| | | }, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle', |