培训班
This commit is contained in:
@@ -5,11 +5,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.modules.common.dao.TrainingClassDao;
|
||||
import com.peanut.modules.common.dao.UserVipDao;
|
||||
import com.peanut.modules.common.entity.MyUserEntity;
|
||||
import com.peanut.modules.common.entity.TrainingClass;
|
||||
import com.peanut.modules.common.entity.UserContribution;
|
||||
import com.peanut.modules.common.entity.UserVip;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import com.peanut.modules.common.service.TrainingClassService;
|
||||
import com.peanut.modules.common.service.TrainingToUserService;
|
||||
import com.peanut.modules.common.service.UserContributionService;
|
||||
import com.peanut.modules.common.service.UserVipService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -29,6 +27,8 @@ public class TrainingClassServiceImpl extends ServiceImpl<TrainingClassDao, Trai
|
||||
private UserVipService userVipService;
|
||||
@Autowired
|
||||
private UserContributionService userContributionService;
|
||||
@Autowired
|
||||
private TrainingToUserService trainingToUserService;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> getFinalPriceByUser(int classId,int userId) {
|
||||
@@ -43,7 +43,20 @@ public class TrainingClassServiceImpl extends ServiceImpl<TrainingClassDao, Trai
|
||||
.eq(UserVip::getUserId,userId).eq(UserVip::getType,vipType).eq(UserVip::getState,0));
|
||||
if (count>0){
|
||||
fee = trainingClass.getVipFee();
|
||||
identity = "vip";
|
||||
if ("4".equals(vipType)){
|
||||
identity = "中医学vip";
|
||||
}else if ("5".equals(vipType)) {
|
||||
identity = "针灸学vip";
|
||||
}else if ("6".equals(vipType)) {
|
||||
identity = "肿瘤学vip";
|
||||
}else if ("7".equals(vipType)) {
|
||||
identity = "国学vip";
|
||||
}else if ("8".equals(vipType)) {
|
||||
identity = "心理学vip";
|
||||
}else if ("9".equals(vipType)) {
|
||||
identity = "中西汇通vip";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,12 +66,12 @@ public class TrainingClassServiceImpl extends ServiceImpl<TrainingClassDao, Trai
|
||||
if ("1".equals(svipType)&&userVipService.is4569SVip(userId)){
|
||||
if (fee.compareTo(trainingClass.getSvipFee())>0){
|
||||
fee = trainingClass.getSvipFee();
|
||||
identity = "svip";
|
||||
identity = "医学svip";
|
||||
}
|
||||
}else if ("2".equals(svipType)&&userVipService.is78SVip(userId)){
|
||||
if (fee.compareTo(trainingClass.getSvipFee())>0){
|
||||
fee = trainingClass.getSvipFee();
|
||||
identity = "svip";
|
||||
identity = "国学心理学svip";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,4 +111,14 @@ public class TrainingClassServiceImpl extends ServiceImpl<TrainingClassDao, Trai
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTrainingClassForUser(BuyOrder buyOrder) {
|
||||
TrainingToUser trainingToUser = new TrainingToUser();
|
||||
trainingToUser.setTrainingId(buyOrder.getTrainingClassId());
|
||||
trainingToUser.setUserId(buyOrder.getUserId());
|
||||
trainingToUser.setOrderSn(buyOrder.getOrderSn());
|
||||
trainingToUser.setIdentity(buyOrder.getTrainingClassIdentity());
|
||||
trainingToUserService.save(trainingToUser);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user