| | |
| | | import java.math.BigDecimal; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | } |
| | | model.addAttribute("nextNames",strings1); |
| | | |
| | | ArrayList<String> strings3 = new ArrayList<>(); |
| | | strings3.add("普通场地"); |
| | | strings3.add("智慧场地"); |
| | | model.addAttribute("typeNames",strings3); |
| | | |
| | | String halfNames = site.getHalfName(); |
| | | ArrayList<String> strings2 = new ArrayList<>(); |
| | |
| | | }else{ |
| | | stores = storeClient.getStore(site.getCity()); |
| | | } |
| | | |
| | | ArrayList<String> strings3 = new ArrayList<>(); |
| | | strings3.add("普通场地"); |
| | | strings3.add("智慧场地"); |
| | | model.addAttribute("typeNames",strings3); |
| | | |
| | | |
| | | String nextName = site.getNextName(); |
| | | ArrayList<String> strings1 = new ArrayList<>(); |
| | | for (String s : nextName.split(",")) { |
| | | strings1.add(s); |
| | | } |
| | | model.addAttribute("nextNames",strings1); |
| | | |
| | | |
| | | |
| | | String halfNames = site.getHalfName(); |
| | | ArrayList<String> strings2 = new ArrayList<>(); |
| | | String[] split = halfNames.split(","); |
| | | String halfName=null; |
| | | for (int i = 0; i < split.length; i++) { |
| | | if(i==0){ |
| | | halfName = split[0]; |
| | | }else { |
| | | strings2.add(split[i]); |
| | | } |
| | | } |
| | | model.addAttribute("halfNames",strings2); |
| | | model.addAttribute("halfName",halfName); |
| | | |
| | | List<CityManager> accounts = cityManagerClient.getAccount(site.getCity()); |
| | | model.addAttribute("list",site); |
| | | Date insuranceEndTime = site.getInsuranceEndTime(); |
| | |
| | | site.setCityManagerId(cityManagerId); |
| | | site.setInsertTime(new Date()); |
| | | site.setState(1); |
| | | siteClient.addSite(site); |
| | | Integer integer1 = siteClient.addSite(site); |
| | | |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("name",site.getName()); |
| | | map.put("short_name",site.getName()); |
| | | map.put("location",city); |
| | | map.put("address",store.getAddress()); |
| | | map.put("telephone",store.getPhone()); |
| | | map.put("linkman",""); |
| | | map.put("business_time","[{\"start_time\":\"00:00\",\"close_time\":\"23:59\"}]"); |
| | | map.put("logo",store.getCoverDrawing()); |
| | | map.put("remark",site.getIntroduce()); |
| | | map.put("lat",store.getLat()); |
| | | map.put("lng",store.getLon()); |
| | | HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map); |
| | | map.put("space_id",integer1.toString()); |
| | | String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | |
| | | // 添加门禁 |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | String spaceId = data.getString("space_id"); |
| | | Integer integer = Integer.valueOf(spaceId); |
| | | |
| | | for (String s1 : site.getIds().split(",")) { |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("space_id",site.getStoreId()+""); |
| | | map1.put("device_id",s1); |
| | | map1.put("region_id",integer1+""); |
| | | String s2 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); |
| | | System.out.println("添加闸机:"+s2); |
| | | } |
| | | |
| | | |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | |
| | | if(site.getInsuranceImg().equals("")){ |
| | | site.setInsuranceImg(null); |
| | | } |
| | | |
| | | TSite byId = siteService.getById(site.getId()); |
| | | |
| | | Store store = storeClient.getStoreById(site.getStoreId()); |
| | | |
| | | String province = store.getProvince(); |
| | |
| | | site.setInsertTime(new Date()); |
| | | site.setState(1); |
| | | siteClient.addSite(site); |
| | | |
| | | String ids = byId.getIds(); |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | for (String s : ids.split(",")) { |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/deleteDevice/ids/" + s,map); |
| | | System.out.println(s1); |
| | | } |
| | | |
| | | for (String s : site.getIds().split(",")) { |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("space_id",store.getId()+""); |
| | | map1.put("device_id",s); |
| | | map1.put("region_id",site.getId()+""); |
| | | // 添加门禁 |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); |
| | | System.out.println(s1); |
| | | } |
| | | |
| | | |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | /** |