| | |
| | | private IUserService userService; |
| | | |
| | | |
| | | // 添加SUTU |
| | | @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) { |
| | | public Object addDevice(Integer id,String device) { |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("space_id",id.toString()); |
| | | map.put("device_id",device); |
| | | map.put("region_id",siteId+""); |
| | | map.put("name",device); |
| | | map.put("city_code",""); |
| | | // 添加门禁 |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map); |
| | | String s1 = HttpRequestUtil.postRequest |
| | | ("https://try.daowepark.com/v7/user_api/general/addSpaceSutu", map); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | @RequestMapping("/getCityYys") |
| | | @ResponseBody |
| | | public Object getCityYys(String province,Integer operatorId) { |
| | | |
| | | if (UserExt.getUser().getObjectType() == 2){ |
| | | operatorId = UserExt.getUser().getObjectId(); |
| | | } |
| | | // 通过选择的省 获取管理的市 |
| | | TOperatorCity byId = operatorCityService.getOne(new QueryWrapper<TOperatorCity>() |
| | | .eq("code",province).eq("operatorId",operatorId)); |
| | |
| | | }else{ |
| | | tStore.setOperatorId(yyId); |
| | | } |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | | tStore.setOperatorId(UserExt.getUser().getObjectId()); |
| | | } |
| | | storeService.save(tStore); |
| | | user.setObjectId(tStore.getId()); |
| | | userService.updateById(user); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | for (int i = 1; i < 9; i++) { |
| | | StoreConfig storeConfig = new StoreConfig(); |
| | |
| | | storeConfigs.add(storeConfig); |
| | | } |
| | | storeConfigService.saveBatch(storeConfigs); |
| | | // 添加场地 |
| | | TSite tSite = new TSite(); |
| | | tSite.setName(tStore.getName()); |
| | | tSite.setStoreId(tStore.getId()); |
| | | tSite.setSign(1); |
| | | siteService.save(tSite); |
| | | |
| | | |
| | | HashMap<String, String> mapSite = new HashMap<>(); |
| | | mapSite.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | mapSite.put("name",tStore.getName()); |
| | | mapSite.put("space_id",tStore.getId().toString()); |
| | | mapSite.put("area_id",tSite.getId().toString()); |
| | | HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpaceArea", mapSite); |
| | | // 添加门店 |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | |
| | | 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",tSite.getId().toString()); |
| | | // 添加门禁 |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map); |
| | | System.out.println(s1); |
| | | } |
| | | |
| | | |
| | | return new SuccessTip<>(); |
| | |
| | | byId.setUrl(url); |
| | | } |
| | | byId.setName(name); |
| | | TTurn byId1 = tTurnService.getById(page); |
| | | TTurn byId2 = tTurnService.getById(type); |
| | | byId.setPage(byId1.getName()); |
| | | byId.setType(byId2.getName()); |
| | | if(page!=null){ |
| | | TTurn byId1 = tTurnService.getById(page); |
| | | byId.setPage(byId1.getName()); |
| | | } |
| | | if(page!=null){ |
| | | TTurn byId2 = tTurnService.getById(type); |
| | | byId.setType(byId2.getName()); |
| | | } |
| | | byId.setTurnId(turnId); |
| | | byId.setSort(sort); |
| | | byId.setPageId(page); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/addConfigOne9") |
| | | @ResponseBody |
| | | public Object addConfigOne9(String url,String name,Integer page,Integer type,String turnId,Integer sort,Integer id) { |
| | | try { |
| | | TStoreOtherConfigTrue byId = new TStoreOtherConfigTrue(); |
| | | byId.setPid(id); |
| | | if(ToolUtil.isNotEmpty(url)){ |
| | | byId.setUrl(url); |
| | | } |
| | | byId.setName(name); |
| | | if(page!=null){ |
| | | TTurn byId1 = tTurnService.getById(page); |
| | | byId.setPage(byId1.getName()); |
| | | } |
| | | if(page!=null){ |
| | | TTurn byId2 = tTurnService.getById(type); |
| | | byId.setType(byId2.getName()); |
| | | } |
| | | byId.setTurnId(turnId); |
| | | byId.setSort(sort); |
| | | byId.setPageId(page); |
| | | byId.setTypeId(type); |
| | | byId.setState(1); |
| | | tStoreOtherConfigTrueService.save(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |