puzhibing
2024-06-14 3b9d9ec597651856ec407abbb6d27f40ae0bc859
客户修改需求 智慧球场修改不重新生成sutuID
1个文件已修改
56 ■■■■ 已修改文件
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java
@@ -231,27 +231,6 @@
        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 转换为字节数组
@@ -271,6 +250,29 @@
        );
        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
@@ -324,6 +326,8 @@
        }
        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+"");
@@ -424,6 +428,8 @@
            game.setBlueCode(s);
            game.setRedCode(s1);
        }
        }
        Integer gameId = ballClient.save(game);
        List<TGameConfig> gameConfigList = new ArrayList<>();
        //玩湃跨城赛
@@ -573,14 +579,6 @@
        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) {