吴门医述我的课程放开心理学模块

This commit is contained in:
wuchunlei
2025-03-13 13:32:30 +08:00
parent 32af78fca4
commit 62b42a1e7e
4 changed files with 81 additions and 65 deletions

View File

@@ -62,72 +62,77 @@ public class UserVipController {
@RequestMapping("/getUserVipType")
public R getUserVipType() {
List<Map<String,Object>> resList = new ArrayList();
List<UserVip> l4 = userVipService.list(new LambdaQueryWrapper<UserVip>().eq(UserVip::getUserId,ShiroUtils.getUId()).eq(UserVip::getType,4).orderByDesc(UserVip::getEndTime));
List<UserVip> l9 = userVipService.list(new LambdaQueryWrapper<UserVip>().eq(UserVip::getUserId,ShiroUtils.getUId()).eq(UserVip::getType,9).orderByDesc(UserVip::getEndTime));
List<UserVip> l5 = userVipService.list(new LambdaQueryWrapper<UserVip>().eq(UserVip::getUserId,ShiroUtils.getUId()).eq(UserVip::getType,5).orderByDesc(UserVip::getEndTime));
List<UserVip> l6 = userVipService.list(new LambdaQueryWrapper<UserVip>().eq(UserVip::getUserId,ShiroUtils.getUId()).eq(UserVip::getType,6).orderByDesc(UserVip::getEndTime));
if (l4.size()>0&&l9.size()>0&&l5.size()>0&&l6.size()>0){
Date t4 = l4.get(0).getEndTime();
Date t9 = l9.get(0).getEndTime();
Date t5 = l5.get(0).getEndTime();
Date t6 = l6.get(0).getEndTime();
if (t4.getTime()==t9.getTime()&&t9.getTime()==t5.getTime()&&t5.getTime()==t6.getTime()){
Map map = new HashMap();
map.put("type",1);
map.put("endTime",t4);
resList.add(map);
//根部不同平台返回不同列表
HttpServletRequest request = HttpContextUtil.getHttpServletRequest();
String appType = request.getHeader("appType")==null?"":request.getHeader("appType");
if (!"psyche".equals(appType)){
List<UserVip> l4 = userVipService.list(new LambdaQueryWrapper<UserVip>().eq(UserVip::getUserId,ShiroUtils.getUId()).eq(UserVip::getType,4).orderByDesc(UserVip::getEndTime));
List<UserVip> l9 = userVipService.list(new LambdaQueryWrapper<UserVip>().eq(UserVip::getUserId,ShiroUtils.getUId()).eq(UserVip::getType,9).orderByDesc(UserVip::getEndTime));
List<UserVip> l5 = userVipService.list(new LambdaQueryWrapper<UserVip>().eq(UserVip::getUserId,ShiroUtils.getUId()).eq(UserVip::getType,5).orderByDesc(UserVip::getEndTime));
List<UserVip> l6 = userVipService.list(new LambdaQueryWrapper<UserVip>().eq(UserVip::getUserId,ShiroUtils.getUId()).eq(UserVip::getType,6).orderByDesc(UserVip::getEndTime));
if (l4.size()>0&&l9.size()>0&&l5.size()>0&&l6.size()>0){
Date t4 = l4.get(0).getEndTime();
Date t9 = l9.get(0).getEndTime();
Date t5 = l5.get(0).getEndTime();
Date t6 = l6.get(0).getEndTime();
if (t4.getTime()==t9.getTime()&&t9.getTime()==t5.getTime()&&t5.getTime()==t6.getTime()){
Map map = new HashMap();
map.put("type",1);
map.put("endTime",t4);
resList.add(map);
}else {
List<Map<String,Object>> tempList = new ArrayList();
Map map4 = new HashMap();
map4.put("type",4);
map4.put("endTime",t4);
tempList.add(map4);
Map map9 = new HashMap();
map9.put("type",9);
map9.put("endTime",t9);
tempList.add(map9);
Map map5 = new HashMap();
map5.put("type",5);
map5.put("endTime",t5);
tempList.add(map5);
Map map6 = new HashMap();
map6.put("type",6);
map6.put("endTime",t6);
tempList.add(map6);
tempList = tempList.stream().sorted((map1,map2)->{
return Long.compare(((Date)map1.get("endTime")).getTime(),((Date)map2.get("endTime")).getTime());
}).collect(Collectors.toList());
resList.addAll(tempList);
Map map1 = new HashMap();
map1.put("type",1);
map1.put("endTime",tempList.get(0).get("endTime"));
resList.add(map1);
}
}else {
List<Map<String,Object>> tempList = new ArrayList();
Map map4 = new HashMap();
map4.put("type",4);
map4.put("endTime",t4);
tempList.add(map4);
Map map9 = new HashMap();
map9.put("type",9);
map9.put("endTime",t9);
tempList.add(map9);
Map map5 = new HashMap();
map5.put("type",5);
map5.put("endTime",t5);
tempList.add(map5);
Map map6 = new HashMap();
map6.put("type",6);
map6.put("endTime",t6);
tempList.add(map6);
tempList = tempList.stream().sorted((map1,map2)->{
return Long.compare(((Date)map1.get("endTime")).getTime(),((Date)map2.get("endTime")).getTime());
}).collect(Collectors.toList());
resList.addAll(tempList);
Map map1 = new HashMap();
map1.put("type",1);
map1.put("endTime",tempList.get(0).get("endTime"));
resList.add(map1);
}
}else {
if (l4.size()>0){
Map map = new HashMap();
map.put("type",4);
map.put("endTime",l4.get(0).getEndTime());
resList.add(map);
}
if (l5.size()>0){
Map map = new HashMap();
map.put("type",5);
map.put("endTime",l5.get(0).getEndTime());
resList.add(map);
}
if (l9.size()>0){
Map map = new HashMap();
map.put("type",9);
map.put("endTime",l9.get(0).getEndTime());
resList.add(map);
}
if (l6.size()>0){
Map map = new HashMap();
map.put("type",6);
map.put("endTime",l6.get(0).getEndTime());
resList.add(map);
if (l4.size()>0){
Map map = new HashMap();
map.put("type",4);
map.put("endTime",l4.get(0).getEndTime());
resList.add(map);
}
if (l5.size()>0){
Map map = new HashMap();
map.put("type",5);
map.put("endTime",l5.get(0).getEndTime());
resList.add(map);
}
if (l9.size()>0){
Map map = new HashMap();
map.put("type",9);
map.put("endTime",l9.get(0).getEndTime());
resList.add(map);
}
if (l6.size()>0){
Map map = new HashMap();
map.put("type",6);
map.put("endTime",l6.get(0).getEndTime());
resList.add(map);
}
}
}
List<UserVip> l7 = userVipService.list(new LambdaQueryWrapper<UserVip>().eq(UserVip::getUserId,ShiroUtils.getUId()).eq(UserVip::getType,7).orderByDesc(UserVip::getEndTime));