cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java
@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import springfox.documentation.swagger2.mappers.ModelMapper; @@ -1085,14 +1086,20 @@ @PostMapping("/student/queryUserAge1") public HashMap<String, Object> queryUserAge1() { HashMap<String, Object> map = new HashMap<>(); List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1)); List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1) .isNotNull(TAppUser::getPhone) .isNotNull(TAppUser::getCity)); Set<String> strings2 = new HashSet<>(list.stream().filter(e -> e.getCity().equals("[]")).collect(Collectors.groupingBy(TAppUser::getProvince)).keySet()); List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList()); if (collect.size() == 0) { collect.add(-1); } Set<String> strings = list.stream().collect(Collectors.groupingBy(TAppUser::getCity)).keySet(); Set<String> strings = new HashSet<>(list.stream() .filter(e -> !e.getCity().equals("[]") && StringUtils.hasLength(e.getCity())) .collect(Collectors.groupingBy(TAppUser::getCity)) .keySet()); strings.addAll(strings2); ArrayList<String> strings1 = new ArrayList<>(); ArrayList<Integer> integers = new ArrayList<>(); @@ -1100,13 +1107,14 @@ int a = 0; strings1.add(string); for (TAppUser tAppUser : list) { if (tAppUser.getCity().equals(string)) { if (tAppUser.getCity()!=null&&tAppUser.getCity().equals(string)) { a++; }else if (tAppUser.getProvince()!=null&&tAppUser.getProvince().equals(string)){ a++; } } integers.add(a); } map.put("cityData", strings1); map.put("cityNum", integers); int age1 = 0; @@ -1159,14 +1167,21 @@ @PostMapping("/student/queryUserAgeYys") public HashMap<String, Object> queryUserAgeYys(@RequestBody List<Integer> ids) { HashMap<String, Object> map = new HashMap<>(); List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids)); List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids) .isNotNull(TAppUser::getPhone) .isNotNull(TAppUser::getCity)); Set<String> strings2 = new HashSet<>(list.stream().filter(e -> e.getCity().equals("[]")).collect(Collectors.groupingBy(TAppUser::getProvince)).keySet()); List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList()); if (collect.size() == 0) { collect.add(-1); } Set<String> strings = list.stream().collect(Collectors.groupingBy(TAppUser::getCity)).keySet(); Set<String> strings = new HashSet<>(list.stream() .filter(e -> !e.getCity().equals("[]") && StringUtils.hasLength(e.getCity())) .collect(Collectors.groupingBy(TAppUser::getCity)) .keySet()); strings.addAll(strings2); ArrayList<String> strings1 = new ArrayList<>(); ArrayList<Integer> integers = new ArrayList<>(); @@ -1174,7 +1189,9 @@ int a = 0; strings1.add(string); for (TAppUser tAppUser : list) { if (tAppUser.getCity().equals(string)) { if (tAppUser.getCity()!=null&&tAppUser.getCity().equals(string)) { a++; }else if (tAppUser.getProvince()!=null&&tAppUser.getProvince().equals(string)){ a++; } } @@ -1232,14 +1249,21 @@ @PostMapping("/student/queryUserAgeStore") public HashMap<String, Object> queryUserAgeStore(@RequestBody List<Integer> ids) { HashMap<String, Object> map = new HashMap<>(); List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids)); List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids) .isNotNull(TAppUser::getPhone) .isNotNull(TAppUser::getCity)); List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList()); if (collect.size() == 0) { collect.add(-1); } Set<String> strings2 = new HashSet<>(list.stream().filter(e -> e.getCity().equals("[]")).collect(Collectors.groupingBy(TAppUser::getProvince)).keySet()); Set<String> strings = list.stream().collect(Collectors.groupingBy(TAppUser::getCity)).keySet(); Set<String> strings = new HashSet<>(list.stream() .filter(e -> !e.getCity().equals("[]") && StringUtils.hasLength(e.getCity())) .collect(Collectors.groupingBy(TAppUser::getCity)) .keySet()); strings.addAll(strings2); ArrayList<String> strings1 = new ArrayList<>(); ArrayList<Integer> integers = new ArrayList<>(); @@ -1247,7 +1271,9 @@ int a = 0; strings1.add(string); for (TAppUser tAppUser : list) { if (tAppUser.getCity().equals(string)) { if (tAppUser.getCity()!=null&&tAppUser.getCity().equals(string)) { a++; }else if (tAppUser.getProvince()!=null&&tAppUser.getProvince().equals(string)){ a++; } } cloud-server-management/src/main/java/com/dsh/course/feignClient/account/AppUserClient.java
@@ -75,7 +75,7 @@ List<TAppUser> queryByNamePhone(QueryByNamePhone queryByNamePhone); @PostMapping("/base/appUser/queryById") TAppUser queryById(Integer appUserId); TAppUser queryById(@RequestBody Integer appUserId); @PostMapping("/student/webStudentList") List<TStudentDto> queryWebUser(@RequestBody StudentSearch search); cloud-server-management/src/main/java/com/dsh/course/feignClient/other/BallClient.java
@@ -22,6 +22,7 @@ // 数据统计 @PostMapping("/student/getData") @ResponseBody List<TGameRecord> getData(@RequestBody GameDataQuery query); // 根据门店ids 获取游戏记录 @PostMapping("/game/getGameByStoreIds") cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/GateDataController.java
@@ -132,34 +132,47 @@ @ResponseBody public Object totalNum(Integer storeId) { try { String apiUrl = "https://port.daowepark.com/v7/user_api/general/spaceDoorData?space_id="+storeId; URL url = new URL(apiUrl); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); // 发送请求并获取响应 int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; StringBuilder response = new StringBuilder(); while ((line = reader.readLine()) != null) { response.append(line); if (storeId!=null){ String apiUrl = "https://port.daowepark.com/v7/user_api/general/spaceDoorData?space_id="+storeId; URL url = new URL(apiUrl); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); // 发送请求并获取响应 int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { System.err.println("調用======"); BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; StringBuilder response = new StringBuilder(); while ((line = reader.readLine()) != null) { response.append(line); } reader.close(); // 处理响应数据 String data = response.toString(); // 使用Jackson库将JSON字符串转换为Java对象 ObjectMapper objectMapper = new ObjectMapper(); GateDataResponse res = objectMapper.readValue(data, GateDataResponse.class); // 访问Java对象中的数据 int code = res.getCode(); String message = res.getMessage(); // 场地总入场人数 int totalNum = res.getData().getTotal_num(); int temp = 0 ; List<GateDataResponse.Data.Region> regionNumList = res.getData().getRegion_num(); System.err.println("返回列表"+regionNumList); for (GateDataResponse.Data.Region regionNum : regionNumList) { String name = regionNum.getName(); int enterNum = regionNum.getEnter_num(); temp+=enterNum; System.out.println("Region: " + name + ", EnterNum: " + enterNum); } System.err.println("最終===="+temp); return temp; } else { System.out.println("请求失败: " + responseCode); } reader.close(); // 处理响应数据 String data = response.toString(); // 使用Jackson库将JSON字符串转换为Java对象 ObjectMapper objectMapper = new ObjectMapper(); GateDataResponse res = objectMapper.readValue(data, GateDataResponse.class); // 访问Java对象中的数据 int code = res.getCode(); String message = res.getMessage(); // 场地总入场人数 int totalNum = res.getData().getTotal_num(); return totalNum; } else { System.out.println("请求失败: " + responseCode); } } catch (IOException e) { e.printStackTrace(); cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopEvaluationController.java
@@ -82,7 +82,7 @@ model.addAttribute("list",list); String roleid = UserExt.getUser().getRoleid(); model.addAttribute("role",roleid); return PREFIX + "tShop_add.html"; return PREFIX + "TShop_add.html"; } @@ -110,11 +110,13 @@ User byId1 = userMapper.selectById(byId.getStoreStaffId()); model.addAttribute("city",byId1); model.addAttribute("type",1); return PREFIX + "tShop_edit.html"; return PREFIX + "TShop_edit.html"; } @RequestMapping("/tShop_info/{id}") public String tCityInfo(@PathVariable Integer id, Model model) { public String tCityInfo(@PathVariable("id") Integer id, Model model) { System.err.println("進入"); TEvaluationListVo vo = evaluationService.info(id); System.err.println("查詢vo"); model.addAttribute("item",vo); ArrayList<String> strings = new ArrayList<>(); String imgs = vo.getImgs(); @@ -124,14 +126,14 @@ model.addAttribute("imgs",strings); model.addAttribute("name1",vo.getPName()); model.addAttribute("name2",vo.getCName()); return PREFIX + "tShop_edit.html"; return PREFIX + "TShop_edit.html"; } @RequestMapping("/tShop_gift/{id}") public String tCityGift(@PathVariable Integer id, Model model) { TStore byId = storeService.getById(id); model.addAttribute("welfarePicture",byId.getWelfarePicture()); model.addAttribute("id",id); return PREFIX + "tShop_img.html"; return PREFIX + "TShop_img.html"; } @RequestMapping("/tShop_indexSet/{id}") public String tCityIndexSet(@PathVariable Integer id, Model model) { @@ -152,7 +154,7 @@ StoreConfig c8 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,8)); model.addAttribute("c8",c8); model.addAttribute("id",id); return PREFIX + "tShop_imgAll.html"; return PREFIX + "TShop_imgAll.html"; } cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/EvaluationServiceImpl.java
@@ -55,7 +55,9 @@ public TEvaluationListVo info(Integer id) { TEvaluationListVo info = this.baseMapper.info(id); Integer appUserId = info.getAppUserId(); System.err.println("查詢用戶"); TAppUser tAppUser = appUserClient.queryById(appUserId); System.err.println("========="+tAppUser); info.setName(tAppUser.getName()); info.setPhone(tAppUser.getPhone()); return info; cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/operatorIncome.html
@@ -1273,6 +1273,18 @@ var option; option = { tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: { type: 'category', data: data.cityData cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/platformIncome.html
@@ -1280,6 +1280,18 @@ var option; option = { tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: { type: 'category', data: data.cityData cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/storeIncome.html
@@ -654,6 +654,18 @@ var option; option = { tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: { type: 'category', data: data.cityData