|
@@ -21,6 +21,7 @@ import com.zhongzheng.modules.exam.service.IExamPaperService;
|
|
|
import com.zhongzheng.modules.goods.domain.GoodsAttached;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
+import com.zhongzheng.modules.grade.domain.ClassGrade;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriod;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodService;
|
|
@@ -172,6 +173,18 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
|
|
|
if(Validator.isEmpty(bo.getGradeId())||Validator.isEmpty(bo.getOrderGoodsId())){
|
|
|
throw new CustomException("OrderGoodsId参数缺失");
|
|
|
}
|
|
|
+ if(Validator.isNotEmpty(bo.getGradeId())){
|
|
|
+ ClassGrade grade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>()
|
|
|
+ .eq(ClassGrade::getGradeId, bo.getGradeId()));
|
|
|
+ if(Validator.isNotEmpty(grade)){
|
|
|
+ if(Validator.isNotEmpty(grade.getClassEndTime())&&DateUtils.getNowTime()>grade.getClassEndTime()){
|
|
|
+ throw new CustomException("班级已过期",601);
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(grade.getClassStartTime())&&DateUtils.getNowTime()<grade.getClassStartTime()){
|
|
|
+ throw new CustomException("班级未开始",601);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
UserBankRecord add = BeanUtil.toBean(bo, UserBankRecord.class);
|
|
|
validEntityBeforeSave(add);
|
|
|
add.setStatus(1);
|
|
@@ -209,6 +222,18 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
|
|
|
if(Validator.isEmpty(bo.getOrderGoodsId())){
|
|
|
throw new CustomException("OrderGoodsId缺失");
|
|
|
}
|
|
|
+ if(Validator.isNotEmpty(bo.getGradeId())){
|
|
|
+ ClassGrade grade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>()
|
|
|
+ .eq(ClassGrade::getGradeId, bo.getGradeId()));
|
|
|
+ if(Validator.isNotEmpty(grade)){
|
|
|
+ if(Validator.isNotEmpty(grade.getClassEndTime())&&DateUtils.getNowTime()>grade.getClassEndTime()){
|
|
|
+ throw new CustomException("班级已过期",601);
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(grade.getClassStartTime())&&DateUtils.getNowTime()<grade.getClassStartTime()){
|
|
|
+ throw new CustomException("班级未开始",601);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
UserBankRecord update = BeanUtil.toBean(bo, UserBankRecord.class);
|
|
|
validEntityBeforeSave(update);
|
|
|
update.setStatus(1);
|