|
@@ -224,8 +224,9 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public boolean updateOperatingTempTag() {
|
|
|
- List<StudentCourseTimesDto> studentCourseTimesDtoList = courseScheduleStudentPaymentDao.queryStudentNotStartCourseTimesOfOnline();
|
|
|
+ /*List<StudentCourseTimesDto> studentCourseTimesDtoList = courseScheduleStudentPaymentDao.queryStudentNotStartCourseTimesOfOnline();
|
|
|
Map<Integer, StudentCourseTimesDto> map = studentCourseTimesDtoList.stream().collect(Collectors.toMap(StudentCourseTimesDto::getUserId, s -> s));
|
|
|
//查询服务指标为0的用户
|
|
|
List<Student> unlabeledStudentList = studentDao.queryByOperatingTempTag(0);
|
|
@@ -254,23 +255,17 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
s.setOperatingTag(0);
|
|
|
updateStudentList.add(s);
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- if (updateStudentList.size() > 0) {
|
|
|
- studentDao.batchUpdate(updateStudentList);
|
|
|
- String month = DateUtil.format(new Date(), DateUtil.ISO_YEAR_MONTH_FORMAT);
|
|
|
- List<Integer> operatingUserIds0 = updateStudentList.stream().filter(e -> e.getOperatingTag().equals(0)).map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
- if(!CollectionUtils.isEmpty(operatingUserIds0)){
|
|
|
- studentOperatingVisitDao.deleteByUserId(operatingUserIds0,month);
|
|
|
- }
|
|
|
- List<Integer> operatingUserIds = updateStudentList.stream().filter(e -> e.getOperatingTag().equals(1)).map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
+ }*/
|
|
|
+ String month = DateUtil.format(new Date(), DateUtil.ISO_YEAR_MONTH_FORMAT);
|
|
|
+ studentOperatingVisitDao.deleteByUserId(month);
|
|
|
+ List<Student> updateStudentList = studentDao.queryByOperatingTempTag(1);
|
|
|
+ if (!CollectionUtils.isEmpty(updateStudentList)) {
|
|
|
+ List<Integer> operatingUserIds = updateStudentList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
+ List<Integer> userIds = studentOperatingVisitDao.queryUserIds(month);
|
|
|
+ operatingUserIds.removeAll(userIds);
|
|
|
if(!CollectionUtils.isEmpty(operatingUserIds)){
|
|
|
- List<Integer> userIds = studentOperatingVisitDao.queryUserIds(month);
|
|
|
- operatingUserIds.removeAll(userIds);
|
|
|
- if(!CollectionUtils.isEmpty(operatingUserIds)){
|
|
|
- //需要新增的用户
|
|
|
- studentOperatingVisitDao.batchAdd(operatingUserIds,month);
|
|
|
- }
|
|
|
+ //需要新增的用户
|
|
|
+ studentOperatingVisitDao.batchAdd(operatingUserIds,month);
|
|
|
}
|
|
|
}
|
|
|
return true;
|