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

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));

View File

@@ -12,6 +12,7 @@ public interface UserVipService extends IService<UserVip> {
boolean noVip();
boolean noMedicalVip();
boolean isMedicalVip();
boolean isChineseWesternVip();
boolean isAcupunctureVip();
boolean istumorVip();
boolean isSociologyVip();

View File

@@ -60,6 +60,11 @@ public class UserVipServiceImpl extends ServiceImpl<UserVipDao, UserVip> impleme
return isVip(4);
}
@Override
public boolean isChineseWesternVip() {
return isVip(9);
}
@Override
public boolean isAcupunctureVip() {
return isVip(5);

View File

@@ -163,7 +163,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
public Page<CourseEntity> getUserCourseBuy(Map<String, Object> param) {
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
wrapper.leftJoin(CourseToMedicine.class,CourseToMedicine::getCourseId,CourseEntity::getId);
if (userVipService.noMedicalVip()){
if (userVipService.isSociologyVip()){
wrapper.leftJoin(CourseCatalogueEntity.class,CourseCatalogueEntity::getCourseId,CourseEntity::getId);
wrapper.leftJoin(UserCourseBuyEntity.class,UserCourseBuyEntity::getCatalogueId,CourseCatalogueEntity::getId);
wrapper.eq(UserCourseBuyEntity::getUserId,ShiroUtils.getUId());
@@ -171,6 +171,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
List list = new ArrayList<>();//通过顶级标签获取最下层标签
if (userVipService.isMedicalVip()){
userVipService.bottomLabel(1,list);
}
if (userVipService.isChineseWesternVip()){
userVipService.bottomLabel(74,list);
}
if (userVipService.isAcupunctureVip()){
@@ -179,6 +181,9 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
if (userVipService.istumorVip()){
userVipService.bottomLabel(5,list);
}
if (userVipService.isPsycheVip()){
userVipService.bottomLabel(4,list);
}
wrapper.in(CourseToMedicine::getMedicalId,list);
}
if (StringUtils.isNotEmpty(param.get("medicalId").toString())){