| | |
| | | @ResponseBody |
| | | @PostMapping("/addWorldCup") |
| | | public ResultUtil addWorldCup(WorldCup worldCup, String stores){ |
| | | worldCup.setStatus(1); |
| | | if(worldCup.getStartTime().before(new Date())){ |
| | | worldCup.setStatus(2); |
| | | }else{ |
| | | worldCup.setStatus(1); |
| | | } |
| | | worldCup.setCreateTime(new Date()); |
| | | worldCup.setMatchNumber(0); |
| | | Integer integer = worldCupClient.addWorldCup(worldCup); |
| | |
| | | if(worldCup1.getStartTime().before(DateUtil.getDate())){ |
| | | return ResultUtil.error("赛事已开始,不能编辑"); |
| | | } |
| | | worldCupClient.editWorldCup(worldCup); |
| | | 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{ |
| | | worldCup.setStatus(1); |
| | | } |
| | | worldCupClient.editWorldCup(JSON.toJSONString(worldCup)); |
| | | worldCupStoreClient.delWorldCupStore(worldCup.getId()); |
| | | JSONArray jsonArray = JSON.parseArray(stores); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | |
| | | WorldCup worldCup = new WorldCup(); |
| | | worldCup.setId(id); |
| | | worldCup.setStatus(state); |
| | | worldCupClient.editWorldCup(worldCup); |
| | | worldCupClient.editWorldCup(JSON.toJSONString(worldCup)); |
| | | //开始处理已支付的退费 |
| | | worldCupClient.cancelWorldCupRefund(id); |
| | | return ResultUtil.success(); |