| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(10000); |
| | | cityListQuery.setCityCode(byId.getCityCode()); |
| | | model.addAttribute("yysList", tOperatorService.list()); |
| | | Page<TCityManager> list2 = cityClient.list(cityListQuery); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2.getRecords()); |
| | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId,String lat,String lon,String pCode1,String cCode1,String provinceCode,String cityCode) { |
| | | public Object list(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId,String lat,String lon,String pCode1,String cCode1) { |
| | | try { |
| | | |
| | | |
| | | if(yyId==null){ |
| | | if(yyId==null || type==1){ |
| | | yyId=0; |
| | | } |
| | | |
| | |
| | | |
| | | storeService.save(tStore); |
| | | |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("space_id",""); |
| | | map.put("device_id",tStore.getIds()+""); |
| | | map.put("region_id",tStore.getId()+""); |
| | | // 添加门禁 |
| | | String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map); |
| | | |
| | | |
| | | |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | |
| | | storeConfigs.add(storeConfig); |
| | | } |
| | | storeConfigService.saveBatch(storeConfigs); |
| | | |
| | | |
| | | // 添加门店 |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("name",tStore.getName()); |
| | | map1.put("short_name",tStore.getName()); |
| | | map1.put("location",tStore.getCity()); |
| | | map1.put("address",tStore.getAddress()); |
| | | map1.put("telephone",tStore.getPhone()); |
| | | map1.put("linkman",userName); |
| | | map1.put("business_time","[{\"start_time\":\""+tStore.getStartTime()+"\",\"close_time\":\""+tStore.getEndTime()+"\"}]"); |
| | | map1.put("logo",tStore.getCoverDrawing()); |
| | | map1.put("remark",tStore.getIntroduce()); |
| | | map1.put("lat",tStore.getLat()); |
| | | map1.put("lng",tStore.getLon()); |
| | | map1.put("space_id",tStore.getId().toString()); |
| | | String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | 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",""); |
| | | // 添加门禁 |
| | | 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(); |
| | |
| | | tStore.setLon(lon); |
| | | tStore.setLat(lat); |
| | | storeService.updateById(tStore); |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("space_id",""); |
| | | map.put("device_id",tStore.getIds()); |
| | | map.put("region_id",tStore.getId()+""); |
| | | // 编辑门禁 |
| | | String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/editDevice/ids/82", map); |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | String spaceId = data.getString("space_id"); |
| | | String ids1 = byIdc.getIds(); |
| | | |
| | | |
| | | |
| | | HashMap<String, String> mapx = new HashMap<>(); |
| | | mapx.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | for (String s : ids1.split(",")) { |
| | | String post = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/deleteDevice/ids/" + s,mapx); |
| | | System.out.println(post); |
| | | } |
| | | |
| | | for (String s : ids.split(",")) { |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("space_id",tStore.getId()+""); |
| | | map1.put("device_id",s); |
| | | map1.put("region_id",""); |
| | | // 添加门禁 |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); |
| | | System.out.println(s1); |
| | | } |
| | | |
| | | |
| | | |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |