| | |
| | | private UserIntegralChangesClient userIntegralChangesClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 裁判获取世界杯列表数据 |
| | | * @return |
| | |
| | | return ResultUtil.error("赛事已取消"); |
| | | } |
| | | //1、通过扫码获取的sutuid查询t_game表中的红蓝方sutuid |
| | | // 智慧需要判断code |
| | | |
| | | String code = startWorldCup.getCode(); |
| | | JSONObject object = JSON.parseObject(code); |
| | | String sutu_id = object.getString("sutu_id"); |
| | | TGame tGame = gameClient.getTGameBySutuId(sutu_id); |
| | | if (worldCup.getType() == null || worldCup.getType() == 1) { |
| | | if(null == tGame){ |
| | | return ResultUtil.error("无效的游戏二维码"); |
| | | } |
| | | } |
| | | |
| | | String people = startWorldCup.getPeople(); |
| | | JSONArray jsonArray = JSON.parseArray(people); |
| | | if(jsonArray.size() != 6){ |
| | | return ResultUtil.error("参赛人数只能是6人"); |
| | | int red=0; |
| | | int blue=0; |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String type = jsonObject.get("type").toString(); |
| | | if("red".equals( type)){ |
| | | red++; |
| | | } |
| | | if("blue".equals( type)){ |
| | | blue++; |
| | | } |
| | | } |
| | | if(red==0){ |
| | | return ResultUtil.error("红方最少要1人参赛"); |
| | | } |
| | | if(red>5){ |
| | | return ResultUtil.error("红方最多5人参赛"); |
| | | } |
| | | if(blue==0){ |
| | | return ResultUtil.error("蓝方最少要1人参赛"); |
| | | } |
| | | if(blue>5){ |
| | | return ResultUtil.error("蓝方最多5人参赛"); |
| | | } |
| | | String timeStr = UUIDUtil.getTimeStr() + UUIDUtil.getNumberRandom(3); |
| | | List<Long> ids = new ArrayList<>(); |
| | |
| | | worldCup.setMatchNumber(worldCup.getMatchNumber() + 1); |
| | | this.updateById(worldCup); |
| | | |
| | | |
| | | //2、调起开启游戏的接口。 |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("gameType", 1); |
| | | jsonObject.put("ids", ids); |
| | | //2、调起开启游戏的接口。 |
| | | if (worldCup.getType() == null || worldCup.getType() == 1) { |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("space_id", tGame.getSiteId() + ""); |
| | |
| | | Integer code1 = jsonObject1.getInteger("code"); |
| | | String message = jsonObject1.getString("message"); |
| | | if (200 == code1) { |
| | | return ResultUtil.success(); |
| | | return ResultUtil.success(jsonObject.toJSONString()); |
| | | } else { |
| | | return ResultUtil.error(message); |
| | | } |
| | | }else { |
| | | return ResultUtil.success(jsonObject.toJSONString()); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 报名世界杯 |
| | | * @param paymentWorldCup |
| | |
| | | ,"/base/worldCup/wxPayWorldCupCallback1",worldCupPayment.getAmount().toString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |