|
@@ -19,7 +19,15 @@ import com.zhongzheng.common.utils.polyv.PolyvUtils;
|
|
|
import com.zhongzheng.modules.base.service.IProfileTpService;
|
|
|
import com.zhongzheng.modules.base.vo.ProfileTpVo;
|
|
|
import com.zhongzheng.modules.base.vo.UserProfileVo;
|
|
|
+import com.zhongzheng.modules.exam.bo.ExamApplyQueryBo;
|
|
|
+import com.zhongzheng.modules.exam.bo.ExamBeforeQueryBo;
|
|
|
+import com.zhongzheng.modules.exam.domain.ExamApply;
|
|
|
+import com.zhongzheng.modules.exam.domain.ExamBefore;
|
|
|
import com.zhongzheng.modules.exam.domain.ExamNumber;
|
|
|
+import com.zhongzheng.modules.exam.mapper.ExamApplyMapper;
|
|
|
+import com.zhongzheng.modules.exam.mapper.ExamBeforeMapper;
|
|
|
+import com.zhongzheng.modules.exam.vo.ExamApplyVo;
|
|
|
+import com.zhongzheng.modules.exam.vo.ExamBeforeVo;
|
|
|
import com.zhongzheng.modules.exam.vo.ExamUserApplyVo;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
@@ -150,6 +158,12 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Autowired
|
|
|
private UserPlanMapper userPlanMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ExamApplyMapper examApplyMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ExamBeforeMapper examBeforeMapper;
|
|
|
+
|
|
|
@Value("${aliyun.sms.OpenTheGoodsCode}")
|
|
|
private String OpenTheGoodsCode;
|
|
|
|
|
@@ -657,6 +671,61 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void UpExam(UserQueryBo bo) {
|
|
|
+ ExamApplyQueryBo examApplyQueryBo = new ExamApplyQueryBo();
|
|
|
+ examApplyQueryBo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
|
|
|
+ List<ExamApplyVo> examApplyVos = examApplyMapper.queryExam(examApplyQueryBo);
|
|
|
+ for (ExamApplyVo examApplyVo : examApplyVos) {
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
|
|
|
+ calendar.setTimeInMillis(System.currentTimeMillis());
|
|
|
+ if ((examApplyVo.getApplyEndTime()) < calendar.getTimeInMillis()/1000){
|
|
|
+ ExamApply update = new ExamApply();
|
|
|
+ update.setApplyId(examApplyVo.getApplyId());
|
|
|
+ update.setStatus(2);
|
|
|
+ update.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ examApplyMapper.updateById(update);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ExamBeforeQueryBo examBeforeQueryBo = new ExamBeforeQueryBo();
|
|
|
+ examBeforeQueryBo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
|
|
|
+ List<ExamBeforeVo> examBeforeVos = examBeforeMapper.queryBefore(examBeforeQueryBo);
|
|
|
+ for (ExamBeforeVo examBeforeVo : examBeforeVos) {
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
|
|
|
+ calendar.setTimeInMillis(System.currentTimeMillis());
|
|
|
+ if ((examBeforeVo.getBeforeEndTime()) < calendar.getTimeInMillis()/1000){
|
|
|
+ ExamBefore update = new ExamBefore();
|
|
|
+ update.setBeforeId(examBeforeVo.getBeforeId());
|
|
|
+ update.setStatus(2);
|
|
|
+ update.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ examBeforeMapper.updateById(update);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ UserPlanQueryBo userPlanQueryBo = new UserPlanQueryBo();
|
|
|
+ userPlanQueryBo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
|
|
|
+ List<UserPlanVo> userPlanVos = userPlanService.queryList(userPlanQueryBo);
|
|
|
+ for (UserPlanVo userPlanVo : userPlanVos) {
|
|
|
+ UserPlan userPlan = new UserPlan();
|
|
|
+ userPlan.setPlanId(userPlanVo.getPlanId());
|
|
|
+ userPlan.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
|
|
|
+ calendar.setTimeInMillis(System.currentTimeMillis());
|
|
|
+ if ((userPlanVo.getEndTime()) < calendar.getTimeInMillis()/1000 && userPlanVo.getStatus().equals(1)){
|
|
|
+ if (userPlanVo.getPitchNum().equals(userPlanVo.getStudyNum())){
|
|
|
+ userPlan.setStatus(2);
|
|
|
+ }else {
|
|
|
+ userPlan.setStatus(3);
|
|
|
+ }
|
|
|
+ userPlanMapper.updateById(userPlan);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//获得可用学习天数
|
|
|
private static int getDutyDays(Date startDateStr, Date endDateStr,Long[] longs,Long studyDay) {
|
|
|
int result = 0;
|