| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // // 添加sutu编号 |
| | | // HashMap<String, String> map3 = new HashMap<>(); |
| | | // // 添加sutu编号 |
| | | // // 添加门禁 红蓝方 |
| | | // TSite si = siteService.getById(site); |
| | | // TStore st = storeService.getById(store); |
| | | // map3.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); |
| | | // map3.put("space_id", si.getId() + ""); |
| | | // map3.put("name", ToolUtil.isEmpty(sutuName) ? "" : sutuName); |
| | | // map3.put("city_code", ""); |
| | | // String s3 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map3); |
| | | // System.out.println("---------------------------"+s3); |
| | | // JSONObject jsonObject = new JSONObject(s3); |
| | | // // 获取 data 字段的值 |
| | | // JSONObject dataObject = jsonObject.getJSONObject("data"); |
| | | // // 获取 sutu_id 字段的值 |
| | | // String sutuIdValue = dataObject.getString("sutu_id"); |
| | | // Integer sutuId = Integer.valueOf(sutuIdValue); |
| | | // game.setSutuId(sutuId); |
| | | // } |
| | | |
| | | public static MultipartFile convert(BufferedImage bufferedImage, String fileName) throws IOException { |
| | | // 将 BufferedImage 转换为字节数组 |
| | |
| | | ); |
| | | |
| | | return multipartFile; |
| | | } |
| | | public static void main(String[] args) throws Exception { |
| | | // 生成红蓝sutu二维码 |
| | | HashMap<String, String> blueCode = new HashMap<>(); |
| | | blueCode.put("scan_type", "1000"); |
| | | blueCode.put("sutu_id", ""+1041); |
| | | blueCode.put("space_id", 46 + ""); |
| | | HashMap<String, String> redCode = new HashMap<>(); |
| | | redCode.put("scan_type", "1000"); |
| | | redCode.put("sutu_id", 1040+""); |
| | | redCode.put("space_id", 46 + ""); |
| | | String blueS= "{\"scan_type\": 1000, \"space_id\": "+46+", \"sutu_id\": "+1041+"}"; |
| | | String redS= "{\"scan_type\": 1000, \"space_id\": "+46+", \"sutu_id\": "+1040+"}"; |
| | | MyQrCodeUtil.createCodeToFile(blueS); |
| | | MyQrCodeUtil.createCodeToFile(redS); |
| | | BufferedImage blueImage = QRCodeUtil.createImage(blueS); |
| | | BufferedImage redImage = QRCodeUtil.createImage(redS); |
| | | MultipartFile blueFile = convert(blueImage, new Date().getTime()+UUIDUtil.getRandomCode(3)+".PNG"); |
| | | MultipartFile redFile = convert(redImage, new Date().getTime()+UUIDUtil.getRandomCode(3)+".PNG"); |
| | | String s = OssUploadUtil.ossUpload("img/", blueFile); |
| | | String s1 = OssUploadUtil.ossUpload("img/", redFile); |
| | | System.err.println("蓝色"+ s); |
| | | System.err.println("蓝色"+s1); |
| | | } |
| | | @RequestMapping("/save") |
| | | @ResponseBody |
| | |
| | | } |
| | | System.out.println("============"+game); |
| | | |
| | | // 判断是新增还是修改 修改不会重新生成sutuId |
| | | if (game.getId()==null){ |
| | | HashMap<String, String> map5 = new HashMap<>(); |
| | | map5.put("space_id", store+""); |
| | | map5.put("area_id", site+""); |
| | |
| | | game.setBlueCode(s); |
| | | game.setRedCode(s1); |
| | | } |
| | | } |
| | | |
| | | Integer gameId = ballClient.save(game); |
| | | List<TGameConfig> gameConfigList = new ArrayList<>(); |
| | | //玩湃跨城赛 |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | HashMap<String, String> map3 = new HashMap<>(); |
| | | map3.put("space_id", "1001"); |
| | | map3.put("area_id", "4352"); |
| | | String s3 = HttpRequestUtil.getRequest("https://try.daowepark.com/v7/user_api/general/get_space_sutu", map3); |
| | | |
| | | System.err.println(s3); |
| | | } |
| | | @RequestMapping("/pre_add") |
| | | public String add(Model model) { |
| | | |