From 3c8dc107047c0b5ee407fa36ca2ce06090f75929 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期六, 12 四月 2025 18:05:02 +0800
Subject: [PATCH] bug修改
---
cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java | 215 ++++++++++++++++++++++++++++++++++-------------------
1 files changed, 136 insertions(+), 79 deletions(-)
diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java
index 28f5302..86a9955 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java
@@ -5,19 +5,20 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.account.dto.*;
import com.dsh.account.entity.*;
+import com.dsh.account.feignclient.course.CoursePackageClient;
import com.dsh.account.feignclient.course.CoursePaymentClient;
import com.dsh.account.feignclient.course.model.TCoursePackagePayment;
import com.dsh.account.model.QueryDataFee;
import com.dsh.account.model.Student;
import com.dsh.account.model.StudentVo;
+import com.dsh.account.model.updateTimeDto;
import com.dsh.account.service.*;
import com.dsh.account.util.ResultUtil;
import com.dsh.account.util.TokenUtil;
import com.dsh.account.util.ToolUtil;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.swagger2.mappers.ModelMapper;
@@ -51,6 +52,21 @@
@Autowired
private RechargeRecordsService rechargeRecordsService;
+
+ @Resource
+ private CoursePackageClient coursePackageClient;
+
+ /**
+ * 查询惠民卡绑定学员列表信息
+ *
+ * @return
+ */
+ @RequestMapping("/base/student/getStudentByIds/{ids}")
+ public List<TStudent> getStudentByIds(@PathVariable("ids") String ids) {
+ List<TStudent> list = studentService.list(new LambdaQueryWrapper<TStudent>()
+ .in(TStudent::getId, Arrays.asList(ids.split(","))));
+ return list;
+ }
/**
* 添加学员
@@ -107,8 +123,8 @@
}
- @ResponseBody
@PostMapping("/student/queryStudentCom")
+
public List<Map<String, Object>> queryStudentCom(@RequestBody Integer id) {
List<Map<String, Object>> list = studentService.queryCom(id);
@@ -121,6 +137,21 @@
public void frozen(@RequestBody TStudent student) {
studentService.updateById(student);
+ }
+ @ResponseBody
+ @PostMapping("/student/getById")
+ public Date getById(@RequestBody Integer tStudentId) {
+ return studentService.getById(tStudentId).getValidity();
+
+ }
+ @ResponseBody
+ @PostMapping("/student/update1")
+ public void update(@RequestBody updateTimeDto updateTimeDto) {
+
+ TStudent student = new TStudent();
+ student.setId(updateTimeDto.getTStudentId());
+ student.setValidity(updateTimeDto.getDate());
+ studentService.updateById(student);
}
@@ -554,16 +585,9 @@
@ResponseBody
@PostMapping("/student/stuYys")
- public HashMap<String, Object> stuYys(@RequestBody Integer id) {
-
+ public HashMap<String, Object> stuYys(@RequestBody List<Integer> ids) {
HashMap<String, Object> map = new HashMap<>();
- // 所有的
- List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getAddUserId, id));
- List<Integer> collect1 = list.stream().map(TAppUser::getId).collect(Collectors.toList());
- if (collect1.size() == 0) {
- collect1.add(-1);
- }
- List<TStudent> students = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1));
+ List<TStudent> students = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids));
map.put("allUser", students.size());
ArrayList<Object> integers = new ArrayList<>();
@@ -618,13 +642,13 @@
String s8 = maxNow.minusDays(20).toString();
- int count = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s7, s8));
+ int count = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids).between(TStudent::getInsertTime, s7, s8));
- int count1 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s5, s6));
+ int count1 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids).between(TStudent::getInsertTime, s5, s6));
- int count2 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s3, s4));
+ int count2 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids).between(TStudent::getInsertTime, s3, s4));
- int count3 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s1, s2));
+ int count3 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids).between(TStudent::getInsertTime, s1, s2));
map.put("count", count);
map.put("count1", count1);
map.put("count2", count2);
@@ -636,7 +660,7 @@
for (int i = 6; i >= 0; i--) {
String s = minNow.minusDays(i).toString();
String s9 = maxNow.minusDays(i).toString();
- int count4 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s, s9));
+ int count4 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids).between(TStudent::getInsertTime, s, s9));
days.add(count4);
}
map.put("dayData", days);
@@ -654,18 +678,20 @@
}
+ @ResponseBody
+ @PostMapping("/student/updatePassWord")
+ public void updatePassWord(@RequestBody List<String> strings) throws Exception {
+ appUserService.updatePassword1(strings.get(0),strings.get(1),strings.get(2));
+
+ }
+
@ResponseBody
@PostMapping("/student/stuStores")
- public HashMap<String, Object> stuStores(@RequestBody Integer id) {
+ public HashMap<String, Object> stuStores(@RequestBody List<Integer> ids) {
HashMap<String, Object> map = new HashMap<>();
- // 所有的
- List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getAddUserId, id));
- List<Integer> collect1 = list.stream().map(TAppUser::getId).collect(Collectors.toList());
- if (collect1.size() == 0) {
- collect1.add(-1);
- }
- List<TStudent> students = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1));
+
+ List<TStudent> students = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids));
map.put("allUser", students.size());
ArrayList<Object> integers = new ArrayList<>();
@@ -720,13 +746,13 @@
String s8 = maxNow.minusDays(20).toString();
- int count = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s7, s8));
+ int count = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids).between(TStudent::getInsertTime, s7, s8));
- int count1 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s5, s6));
+ int count1 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids).between(TStudent::getInsertTime, s5, s6));
- int count2 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s3, s4));
+ int count2 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids).between(TStudent::getInsertTime, s3, s4));
- int count3 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s1, s2));
+ int count3 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids).between(TStudent::getInsertTime, s1, s2));
map.put("count", count);
map.put("count1", count1);
map.put("count2", count2);
@@ -738,7 +764,7 @@
for (int i = 6; i >= 0; i--) {
String s = minNow.minusDays(i).toString();
String s9 = maxNow.minusDays(i).toString();
- int count4 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s, s9));
+ int count4 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids).between(TStudent::getInsertTime, s, s9));
days.add(count4);
}
map.put("dayData", days);
@@ -763,12 +789,13 @@
@ResponseBody
@PostMapping("/student/userAndVipYys")
- public HashMap<String, Object> userAndVipYys(@RequestBody Integer id) {
+ public HashMap<String, Object> userAndVipYys(@RequestBody List<Integer> ids) {
HashMap<String, Object> map = new HashMap<>();
+
// 所有的
- List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id));
+ List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids));
map.put("allUser", list.size());
- List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1));
+ List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1));
map.put("allVip", list1.size());
@@ -829,17 +856,17 @@
String s8 = maxNow.minusDays(20).toString();
- int count = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).between(TAppUser::getInsertTime, s7, s8));
- int countVip = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s7, s8));
+ int count = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).in(TAppUser::getId, ids).between(TAppUser::getInsertTime, s7, s8));
+ int countVip = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).in(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s7, s8));
- int count1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).between(TAppUser::getInsertTime, s5, s6));
- int countVip1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s5, s6));
+ int count1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).in(TAppUser::getId, ids).between(TAppUser::getInsertTime, s5, s6));
+ int countVip1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).in(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s5, s6));
- int count2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).between(TAppUser::getInsertTime, s3, s4));
- int countVip2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s3, s4));
+ int count2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).in(TAppUser::getId, ids).between(TAppUser::getInsertTime, s3, s4));
+ int countVip2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).in(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s3, s4));
- int count3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).between(TAppUser::getInsertTime, s1, s2));
- int countVip3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s1, s2));
+ int count3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).in(TAppUser::getId, ids).between(TAppUser::getInsertTime, s1, s2));
+ int countVip3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).in(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s1, s2));
map.put("count", count);
map.put("count1", count1);
map.put("count2", count2);
@@ -856,8 +883,8 @@
for (int i = 6; i >= 0; i--) {
String s = minNow.minusDays(i).toString();
String s9 = maxNow.minusDays(i).toString();
- int count4 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).between(TAppUser::getInsertTime, s, s9));
- int countVip5 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s, s9));
+ int count4 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).in(TAppUser::getId, ids).between(TAppUser::getInsertTime, s, s9));
+ int countVip5 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).in(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s, s9));
days.add(count4);
daysVip.add(countVip5);
}
@@ -871,12 +898,12 @@
@ResponseBody
@PostMapping("/student/userAndVipStore")
- public HashMap<String, Object> userAndVipStore(@RequestBody Integer id) {
+ public HashMap<String, Object> userAndVipStore(@RequestBody List<Integer> ids) {
HashMap<String, Object> map = new HashMap<>();
// 所有的
- List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id));
+ List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids));
map.put("allUser", list.size());
- List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1));
+ List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1));
map.put("allVip", list1.size());
@@ -938,17 +965,17 @@
String s8 = maxNow.minusDays(20).toString();
- int count = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).between(TAppUser::getInsertTime, s7, s8));
- int countVip = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s7, s8));
+ int count = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getId, ids).between(TAppUser::getInsertTime, s7, s8));
+ int countVip = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s7, s8));
- int count1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).between(TAppUser::getInsertTime, s5, s6));
- int countVip1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s5, s6));
+ int count1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getId, ids).between(TAppUser::getInsertTime, s5, s6));
+ int countVip1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s5, s6));
- int count2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).between(TAppUser::getInsertTime, s3, s4));
- int countVip2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s3, s4));
+ int count2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getId, ids).between(TAppUser::getInsertTime, s3, s4));
+ int countVip2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s3, s4));
- int count3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).between(TAppUser::getInsertTime, s1, s2));
- int countVip3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s1, s2));
+ int count3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getId, ids).between(TAppUser::getInsertTime, s1, s2));
+ int countVip3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s1, s2));
map.put("count", count);
map.put("count1", count1);
map.put("count2", count2);
@@ -965,8 +992,8 @@
for (int i = 6; i >= 0; i--) {
String s = minNow.minusDays(i).toString();
String s9 = maxNow.minusDays(i).toString();
- int count4 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).between(TAppUser::getInsertTime, s, s9));
- int countVip5 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s, s9));
+ int count4 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getId, ids).between(TAppUser::getInsertTime, s, s9));
+ int countVip5 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1).between(TAppUser::getInsertTime, s, s9));
days.add(count4);
daysVip.add(countVip5);
}
@@ -1067,14 +1094,21 @@
@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)
+ .ne(TAppUser::getState,3)
+ .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<>();
@@ -1082,13 +1116,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;
@@ -1139,16 +1174,24 @@
}
@PostMapping("/student/queryUserAgeYys")
- public HashMap<String, Object> queryUserAgeYys(@RequestBody Integer id) {
+ public HashMap<String, Object> queryUserAgeYys(@RequestBody List<Integer> ids) {
HashMap<String, Object> map = new HashMap<>();
- List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id));
+ List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids)
+ .isNotNull(TAppUser::getPhone)
+ .ne(TAppUser::getState,3)
+ .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<>();
@@ -1156,7 +1199,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++;
}
}
@@ -1212,16 +1257,24 @@
}
@PostMapping("/student/queryUserAgeStore")
- public HashMap<String, Object> queryUserAgeStore(Integer id) {
+ public HashMap<String, Object> queryUserAgeStore(@RequestBody List<Integer> ids) {
HashMap<String, Object> map = new HashMap<>();
- List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id));
+ List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids)
+ .isNotNull(TAppUser::getPhone)
+ .ne(TAppUser::getState,3)
+ .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<>();
@@ -1229,7 +1282,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++;
}
}
@@ -1285,9 +1340,9 @@
}
@PostMapping("/student/queryUserAgeYys1")
- public HashMap<String, Object> queryUserAgeYys1(@RequestBody Integer id) {
+ public HashMap<String, Object> queryUserAgeYys1(@RequestBody List<Integer> ids) {
HashMap<String, Object> map = new HashMap<>();
- List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id));
+ List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids));
List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList());
if (collect.size() == 0) {
collect.add(-1);
@@ -1329,14 +1384,9 @@
}
@PostMapping("/student/queryUserAgeStore1")
- public HashMap<String, Object> queryUserAgeStore1(@RequestBody Integer id) {
+ public HashMap<String, Object> queryUserAgeStore1(@RequestBody List<Integer> ids) {
HashMap<String, Object> map = new HashMap<>();
- List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id));
- List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList());
- if (collect.size() == 0) {
- collect.add(-1);
- }
- List<TStudent> list1 = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect));
+ List<TStudent> list1 = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids));
int age1 = 0;
int age2 = 0;
int age3 = 0;
@@ -1368,7 +1418,14 @@
map.put("boy", boy);
map.put("girl", girl);
return map;
+ }
+
+ @ResponseBody
+ @PostMapping("/student/queryExpiredList")
+ public List<TStudent> queryExpiredList(){
+ List<TStudent> list = studentService.list(new QueryWrapper<TStudent>().eq("state", 1).last(" and DATE_FORMAT(now(), '%Y-%m-%d') > validity"));
+ return list;
}
}
--
Gitblit v1.7.1