| | |
| | | |
| | | import groovyjarjarpicocli.CommandLine; |
| | | import net.bytebuddy.asm.Advice; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.aspectj.weaver.ast.Var; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpRequest; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.resource.HttpResource; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.lang.reflect.Type; |
| | |
| | | site.setCityManagerId(cityManagerId); |
| | | site.setInsertTime(new Date()); |
| | | site.setState(1); |
| | | site.setOperatorId(UserExt.getUser().getObjectId()); |
| | | Integer integer1 = siteClient.addSite(site); |
| | | |
| | | // 添加场地 |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("name",site.getName()); |
| | | map.put("space_id",integer1.toString()); |
| | | String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | |
| | | map.put("area_id",store.getId().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); |
| | | if(StringUtils.hasLength( site.getIds())) { |
| | | for (String s1 : site.getIds().split(",")) { |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("space_id", integer1 + ""); |
| | | map1.put("device_id", s1); |
| | | map1.put("region_id", store.getId().toString() + ""); |
| | | String s2 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); |
| | | System.out.println("添加闸机:" + s2); |
| | | } |
| | | } |
| | | |
| | | |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑场地管理 |
| | | */ |
| | |
| | | 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); |
| | | if(StringUtils.hasLength(ids)) { |
| | | 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); |
| | | if(StringUtils.hasLength( site.getIds())) { |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | @RequestMapping("/add") |
| | | public String tCompetitionAdd(Model model) { |
| | | List<CityManager> province = cityManagerClient.listAll(); |
| | | System.out.println(province); |
| | | // 已有城市管理的省 |
| | | ArrayList<String> list1 = new ArrayList<>(); |
| | | // 已有城市管理的市 |
| | |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | List<Store> stores = new ArrayList<>(); |
| | | if (objectType ==2 ){ |
| | | stores= storeClient.getStoreByCityManagerId(objectId); |
| | | List<TStore> operatorId = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId)); |
| | | model.addAttribute("stores",operatorId); |
| | | }else if(objectType == 3){ |
| | | stores= storeClient.getStoreByStoreStaffId(objectId);; |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getId, objectId)); |
| | | model.addAttribute("stores",list); |
| | | }else { |
| | | model.addAttribute("stores",storeService.list(new QueryWrapper<TStore>().eq("operatorId", 0))); |
| | | } |
| | | List<TOperator> list = tOperatorService.list(); |
| | | model.addAttribute("yysList",list); |
| | |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("objectType",objectType); |
| | | model.addAttribute("objectId",objectId); |
| | | model.addAttribute("stores",stores); |
| | | return PREFIX + "tSite_add.html"; |
| | | |
| | | return PREFIX + "TSite_add.html"; |
| | | |
| | | } |
| | | |
| | | // /** |
| | |
| | | @ResponseBody |
| | | public Object getChangeOne(Integer oneId) { |
| | | try { |
| | | return storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId,oneId).eq(TStore::getState,1)); |
| | | return storeService.list(new QueryWrapper<TStore>() |
| | | .eq("operatorId",oneId) |
| | | .eq("state",1)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |