44323
2023-11-14 ddbb38c54db9c3670e5ff53f4bf713525de1099d
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java
@@ -86,6 +86,27 @@
    private IUserService userService;
    @RequestMapping("/tShop_addDevice/{id}")
    public String addDevice(@PathVariable("id") Integer id,Model model) {
        // 查询门店下的所有场地
        List<TSite> list = siteService.list(new QueryWrapper<TSite>().eq("storeId", id));
        // 门店id
        model.addAttribute("id",id);
        model.addAttribute("list",list);
        return PREFIX + "TShop_add_device.html";
    }
    @RequestMapping("/addDevice")
    public Object addDevice(Integer id,Integer siteId,String device) {
        HashMap<String, String> map = new HashMap<>();
        map.put("sign","0DB011836143EEE2C2E072967C9F4E4B");
        map.put("space_id",siteId+"");
        map.put("device_id",device);
        map.put("region_id",id.toString());
        // 添加门禁
        String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map);
        return SUCCESS_TIP;
    }
    /**
     * 跳转到车辆管理首页
     */
@@ -548,20 +569,6 @@
            System.out.println(result);
            for (String s : tStore.getIds().split(",")) {
                HashMap<String, String> map = new HashMap<>();
                map.put("sign","0DB011836143EEE2C2E072967C9F4E4B");
                map.put("space_id",tStore.getId()+"");
                map.put("device_id",s);
                map.put("region_id",tSite.getId().toString());
                // 添加门禁
                String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map);
                System.out.println(s1);
            }
            return new SuccessTip<>();
        }catch (Exception e){
            e.printStackTrace();
@@ -969,13 +976,14 @@
    }
    @RequestMapping(value = "/addConfig")
    @ResponseBody
    public Object addConfig(String name,Integer id) {
    public Object addConfig(String name,Integer id,Integer sort) {
        try {
            List<TStoreOtherConfig> list = storeOtherConfigService.list();
            if(list.size()>0){
                TStoreOther tStoreOther = new TStoreOther();
                tStoreOther.setName(name);
                tStoreOther.setStoreId(id);
                tStoreOther.setSort(sort);
                storeOtherService.save(tStoreOther);
                // 找出temp表数据
@@ -1000,12 +1008,11 @@
    }
    @RequestMapping(value = "/addConfig1")
    @ResponseBody
    public Object addConfig1(String name,Integer id) {
    public Object addConfig1(String name,Integer id,Integer sort) {
        try {
            TStoreOther byId = storeOtherService.getById(id);
            byId.setName(
                    name
            );
            byId.setName(name);
            byId.setSort(sort);
            storeOtherService.updateById(byId);