|
@@ -18,8 +18,10 @@ import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
|
|
|
+import com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
|
|
|
+import com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo;
|
|
|
import com.zhongzheng.modules.grade.vo.UserPeriodStatusVo;
|
|
|
import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
|
import com.zhongzheng.modules.inform.service.IInformRemindService;
|
|
@@ -93,6 +95,9 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ClassGradeUserMapper classGradeUserMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
|
|
|
|
|
@@ -285,6 +290,22 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
objectLambdaUpdateWrapper.eq(ClassGradeUser::getId, classGradeUser.getId());
|
|
|
objectLambdaUpdateWrapper.set(ClassGradeUser::getPeriodStatus, 1);
|
|
|
objectLambdaUpdateWrapper.set(ClassGradeUser::getUpdateTime,DateUtils.getNowTime());
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getPeriodTime,DateUtils.getNowTime());
|
|
|
+ //判断结业
|
|
|
+ long nowTime = System.currentTimeMillis()/1000;
|
|
|
+ ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
|
|
|
+ queryBo.setGradeId(bo.getGradeId());
|
|
|
+ queryBo.setUserId(bo.getUserId());
|
|
|
+ ClassPeriodStudentVo classPeriodStudentVo = classGradeUserMapper.userPeriodStatus(queryBo);
|
|
|
+ if(Validator.isEmpty(classPeriodStudentVo.getClassStartTime())){
|
|
|
+ //没设置永久有效
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getFinishStatus,1);
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(classPeriodStudentVo.getClassEndTime())&&Validator.isNotEmpty(classPeriodStudentVo.getClassStartTime())){
|
|
|
+ if(nowTime<classPeriodStudentVo.getClassEndTime()&&nowTime>classPeriodStudentVo.getClassStartTime()){
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getFinishStatus,1);
|
|
|
+ }
|
|
|
+ }
|
|
|
iClassGradeUserService.update(null, objectLambdaUpdateWrapper);
|
|
|
ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
|
|
|
classGradeUserQueryBo.setUserId(bo.getUserId());
|