|
@@ -1,15 +1,13 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.ActivityQueryDto;
|
|
|
import com.ym.mec.biz.dal.dto.ActivityStudentAdjustDto;
|
|
|
import com.ym.mec.biz.dal.dto.ActivityStudentDto;
|
|
|
import com.ym.mec.biz.dal.dto.ActivityUserMapperAddDto;
|
|
|
-import com.ym.mec.biz.dal.entity.ActivityUserMapper;
|
|
|
-import com.ym.mec.biz.dal.entity.Student;
|
|
|
-import com.ym.mec.biz.dal.entity.SysUserCashAccountLog;
|
|
|
-import com.ym.mec.biz.dal.entity.VipGroupActivity;
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.ReturnFeeEnum;
|
|
|
import com.ym.mec.biz.dal.page.ActivityStudentQueryInfo;
|
|
|
import com.ym.mec.biz.service.ActivityUserMapperService;
|
|
@@ -38,6 +36,8 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
|
|
|
@Autowired
|
|
|
private ActivityUserMapperDao activityUserMapperDao;
|
|
|
@Autowired
|
|
|
+ private ActivityUserMapperAdjustLogDao activityUserMapperAdjustLogDao;
|
|
|
+ @Autowired
|
|
|
private VipGroupActivityDao vipGroupActivityDao;
|
|
|
@Autowired
|
|
|
private StudentDao studentDao;
|
|
@@ -45,6 +45,8 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
|
|
|
private TeacherDao teacherDao;
|
|
|
@Autowired
|
|
|
private SysUserCashAccountLogDao sysUserCashAccountLogDao;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, ActivityUserMapper> getDAO() {
|
|
@@ -117,6 +119,10 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
|
|
|
if(activity.getActivityType() != 0){
|
|
|
throw new BizException("操作失败:只有课程活动支持此操作");
|
|
|
}
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ Integer operatorId = sysUser.getId();
|
|
|
+ String operatorName = sysUser.getRealName();
|
|
|
+
|
|
|
List<Integer> studentIds = activityStudentAdjustDtos.stream().map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
List<Student> studentTeacher = studentDao.findByStudentIds(studentIds);
|
|
|
Map<Integer, List<Student>> collect = studentTeacher.stream().collect(Collectors.groupingBy(Student::getUserId));
|
|
@@ -124,7 +130,19 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
|
|
|
Integer giveCourseNum = activity.getGiveCourseNum();
|
|
|
String giveCourseType = activity.getGiveCourseType();
|
|
|
List<ActivityUserMapper> activityUserMappers = new ArrayList<>();
|
|
|
+ List<ActivityUserMapperAdjustLog> activityUserMapperAdjustLogs = new ArrayList<>();
|
|
|
for (ActivityStudentAdjustDto adjustDto : activityStudentAdjustDtos) {
|
|
|
+ //添加操作记录
|
|
|
+ ActivityUserMapperAdjustLog activityUserMapperAdjustLog = new ActivityUserMapperAdjustLog();
|
|
|
+ activityUserMapperAdjustLog.setActivityId(activityId);
|
|
|
+ activityUserMapperAdjustLog.setOperatorId(operatorId);
|
|
|
+ activityUserMapperAdjustLog.setOperatorName(operatorName);
|
|
|
+ activityUserMapperAdjustLog.setCourseNum(adjustDto.getCourseNum());
|
|
|
+ activityUserMapperAdjustLog.setGiveCourseNum(adjustDto.getGiveCourseNum());
|
|
|
+ activityUserMapperAdjustLog.setMemo(memo);
|
|
|
+ activityUserMapperAdjustLog.setUserId(adjustDto.getUserId());
|
|
|
+ activityUserMapperAdjustLogs.add(activityUserMapperAdjustLog);
|
|
|
+
|
|
|
int activityUserMapperNum = adjustDto.getCourseNum();
|
|
|
if(giveCourseNum != null && giveCourseNum > 0){
|
|
|
if(adjustDto.getGiveCourseNum() > activityUserMapperNum){
|
|
@@ -165,6 +183,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
|
|
|
activityUserMappers.add(activityUserMapper);
|
|
|
}
|
|
|
}
|
|
|
+ activityUserMapperAdjustLogDao.batchInsert(activityUserMapperAdjustLogs);
|
|
|
activityUserMapperDao.batchInsert(activityUserMappers);
|
|
|
}
|
|
|
|
|
@@ -197,5 +216,17 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
|
|
|
sysUserCashAccountLog.setReturnFeeType(ReturnFeeEnum.CANCEL_ACTIVITY_COURSE);
|
|
|
sysUserCashAccountLog.setComment("取消活动排课");
|
|
|
sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
|
|
|
+
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ Integer operatorId = sysUser.getId();
|
|
|
+ String operatorName = sysUser.getRealName();
|
|
|
+ //添加操作记录
|
|
|
+ ActivityUserMapperAdjustLog activityUserMapperAdjustLog = new ActivityUserMapperAdjustLog();
|
|
|
+ activityUserMapperAdjustLog.setActivityId(activityUserMapper.getActivityId());
|
|
|
+ activityUserMapperAdjustLog.setOperatorId(operatorId);
|
|
|
+ activityUserMapperAdjustLog.setOperatorName(operatorName);
|
|
|
+ activityUserMapperAdjustLog.setMemo(memo);
|
|
|
+ activityUserMapperAdjustLog.setUserId(activityUserMapper.getUserId());
|
|
|
+ activityUserMapperAdjustLogDao.insert(activityUserMapperAdjustLog);
|
|
|
}
|
|
|
}
|