|
@@ -27,6 +27,7 @@ import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.dto.*;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
@@ -82,20 +83,6 @@ import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
|
|
|
import com.ym.mec.biz.dal.dao.SysUserCashAccountLogDao;
|
|
|
import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
|
|
|
import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
|
-import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
-import com.ym.mec.biz.dal.dto.CloseMusicGroupDto;
|
|
|
-import com.ym.mec.biz.dal.dto.CourseScheduleTeachersDto;
|
|
|
-import com.ym.mec.biz.dal.dto.HighClassGroupDto;
|
|
|
-import com.ym.mec.biz.dal.dto.MusicCardDto;
|
|
|
-import com.ym.mec.biz.dal.dto.MusicGroupApplyGoodsDto;
|
|
|
-import com.ym.mec.biz.dal.dto.MusicGroupBasicDto;
|
|
|
-import com.ym.mec.biz.dal.dto.RegisterPayDto;
|
|
|
-import com.ym.mec.biz.dal.dto.SporadicPayDto;
|
|
|
-import com.ym.mec.biz.dal.dto.StudentApplyInstrumentDto;
|
|
|
-import com.ym.mec.biz.dal.dto.StudentImportDto;
|
|
|
-import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
|
|
|
-import com.ym.mec.biz.dal.dto.SubjectRegisterDto;
|
|
|
-import com.ym.mec.biz.dal.dto.UpdateExpectedNumDto;
|
|
|
import com.ym.mec.biz.dal.entity.ApprovalStatus;
|
|
|
import com.ym.mec.biz.dal.entity.ChargeType;
|
|
|
import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
@@ -363,19 +350,19 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean importStudentToMusicGroup(String musicGroupId, Map<String, List<Map<String, Object>>> excelData) {
|
|
|
-
|
|
|
+
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
-
|
|
|
+
|
|
|
if(musicGroup == null){
|
|
|
throw new BizException("乐团[{}]信息查询失败", musicGroupId);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(musicGroup.getStatus() != MusicGroupStatusEnum.PAY){
|
|
|
throw new BizException("只有[缴费中]状态的乐团才能导入数据");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Integer tenantId = musicGroup.getTenantId();
|
|
|
-
|
|
|
+
|
|
|
List<StudentImportDto> studentBasicList = new ArrayList<StudentImportDto>();
|
|
|
List<Map<String, Object>> sheet = null;
|
|
|
StudentImportDto dto = null;
|
|
@@ -390,12 +377,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if(!CommonValidator.isUserName(dto.getName())){
|
|
|
throw new BizException("学生姓名[{}]填写错误", dto.getName());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(row.get("性别") == null || StringUtils.isBlank(row.get("性别").toString())){
|
|
|
throw new BizException("性别不能为空");
|
|
|
}
|
|
|
dto.setSex(row.get("性别").toString());
|
|
|
-
|
|
|
+
|
|
|
if(row.get("手机号码") == null || StringUtils.isBlank(row.get("手机号码").toString())){
|
|
|
throw new BizException("手机号码不能为空");
|
|
|
}
|
|
@@ -403,51 +390,51 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if(!CommonValidator.isMobileNo(dto.getMobileNo())){
|
|
|
throw new BizException("手机号码[{}]填写错误", dto.getMobileNo());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(row.get("学习声部") == null || StringUtils.isBlank(row.get("学习声部").toString())){
|
|
|
throw new BizException("学习声部不能为空");
|
|
|
}
|
|
|
dto.setSubjectName(row.get("学习声部").toString());
|
|
|
-
|
|
|
+
|
|
|
if(row.get("所在年级") == null || StringUtils.isBlank(row.get("所在年级").toString())){
|
|
|
throw new BizException("所在年级不能为空");
|
|
|
}
|
|
|
dto.setGradeName(row.get("所在年级").toString());
|
|
|
-
|
|
|
+
|
|
|
studentBasicList.add(dto);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Date nowDate = new Date();
|
|
|
-
|
|
|
+
|
|
|
//查询导入的声部是否正确
|
|
|
List<String> subjectNameList = studentBasicList.stream().distinct().map(t->t.getSubjectName()).collect(Collectors.toList());
|
|
|
-
|
|
|
+
|
|
|
List<MusicGroupSubjectPlan> musicGroupSubjectPlanList = musicGroupSubjectPlanDao.getMusicSubjectClassPlan(musicGroupId);
|
|
|
-
|
|
|
+
|
|
|
Map<String,Integer> subjectMap = musicGroupSubjectPlanList.stream().collect(Collectors.toMap(MusicGroupSubjectPlan :: getSubName, MusicGroupSubjectPlan :: getSubjectId));
|
|
|
-
|
|
|
+
|
|
|
List<String> allSubjectNameList = musicGroupSubjectPlanList.stream().map(t -> t.getSubName()).collect(Collectors.toList());
|
|
|
-
|
|
|
+
|
|
|
for(String subName : subjectNameList){
|
|
|
if(!allSubjectNameList.contains(subName)){
|
|
|
throw new BizException("当前乐团不支持[{}]声部", subName);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//查询课程费用是否是0
|
|
|
MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
|
|
|
if(musicGroupPaymentCalender == null){
|
|
|
throw new BizException("请先创建乐团报名缴费");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
|
|
|
double d = musicGroupPaymentCalenderCourseSettingsList.stream().mapToDouble(t -> t.getCourseCurrentPrice().doubleValue()).sum();
|
|
|
-
|
|
|
+
|
|
|
if(d > 0){
|
|
|
throw new BizException("缴费项目中的课程费用为[{}]元,不能导入", d);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//检查用户是否已入团或在其他机构已注册
|
|
|
for(StudentImportDto si : studentBasicList){
|
|
|
SysUser sysUser = studentRegistrationDao.getSysUserByPhone(si.getMobileNo());
|
|
@@ -455,7 +442,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("该手机号[{}]已注册", si.getMobileNo());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
SysUser sysUser = null;
|
|
|
Integer userId = null;
|
|
|
Student student = null;
|
|
@@ -474,15 +461,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
sysUser.setUpdateTime(nowDate);
|
|
|
teacherDao.addSysUser(sysUser);
|
|
|
userId = sysUser.getId();
|
|
|
-
|
|
|
+
|
|
|
si.setUserId(userId);
|
|
|
-
|
|
|
+
|
|
|
student = new Student(userId, subjectMap.get(si.getSubjectName()) + "");
|
|
|
student.setCurrentGradeNum(SixPlusGradeEnum.get(si.getGradeName()).getCode());
|
|
|
studentDao.insert(student);
|
|
|
// 添加用户现金账户
|
|
|
sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
|
|
|
-
|
|
|
+
|
|
|
studentRegistration = new StudentRegistration();
|
|
|
String studentGrade = studentService.getStudentGrade(organization.getGradeType(), student.getCurrentGradeNum());
|
|
|
studentRegistration.setCurrentGrade(studentGrade);
|
|
@@ -501,10 +488,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentRegistration.setMusicGroupId(musicGroupId);
|
|
|
studentRegistration.setCreateTime(nowDate);
|
|
|
studentRegistration.setUpdateTime(nowDate);
|
|
|
-
|
|
|
+
|
|
|
insertList.add(studentRegistration);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (insertList.size() > 0) {
|
|
|
studentRegistrationService.batchInsert(insertList);
|
|
|
|
|
@@ -596,9 +583,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
if (insertMusicGroupPaymentCalenderDetailList.size() > 0) {
|
|
|
musicGroupPaymentCalenderDetailDao.batchInsert(insertMusicGroupPaymentCalenderDetailList);
|
|
|
-
|
|
|
+
|
|
|
Map<Integer,Long> musicGroupPaymentCalenderDetailIdMap = insertMusicGroupPaymentCalenderDetailList.stream().collect(Collectors.toMap(MusicGroupPaymentCalenderDetail :: getUserId, MusicGroupPaymentCalenderDetail :: getId));
|
|
|
-
|
|
|
+
|
|
|
if (musicGroupPaymentStudentCourseDetails.size() > 0) {
|
|
|
for(MusicGroupPaymentStudentCourseDetail cd : musicGroupPaymentStudentCourseDetails){
|
|
|
cd.setMusicGroupPaymentCalenderDetailId(musicGroupPaymentCalenderDetailIdMap.get(cd.getUserId()));
|
|
@@ -607,7 +594,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -1096,16 +1083,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
private MusicGroupApplyGoodsDto getCalenderTotalAmount(RegisterPayDto registerPayDto, MusicGroupPaymentCalender calender) {
|
|
|
-
|
|
|
+
|
|
|
String musicGroupId = calender.getMusicGroupId();
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
-
|
|
|
+
|
|
|
if(musicGroup == null){
|
|
|
throw new BizException("乐团[{}]信息查询失败", musicGroupId);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
boolean isGiveAccessories = musicGroup.getIsGiveAccessories();
|
|
|
-
|
|
|
+
|
|
|
MusicGroupApplyGoodsDto goodsDto = new MusicGroupApplyGoodsDto();
|
|
|
//乐器及打包辅件价格
|
|
|
List<MusicGroupSubjectGoodsGroup> goodsGroups;
|
|
@@ -1116,7 +1103,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
|
|
|
Map<String, BigDecimal> groupType = JSONObject.parseObject(goodsGroup.getKitGroupPurchaseTypeJson(), new TypeReference<Map<String, BigDecimal>>() {
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
if(isGiveAccessories && registerPayDto.getBuyCloudTeacher()){
|
|
|
if (goodsGroup.getType().equals(GoodsType.ACCESSORIES)) {
|
|
|
continue;
|
|
@@ -1381,17 +1368,17 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
Integer userId = studentRegistration.getUserId();
|
|
|
|
|
|
List<StudentPaymentOrder> applyOrderList = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, studentRegistration.getMusicGroupId(), DealStatusEnum.ING);
|
|
|
-
|
|
|
+
|
|
|
StudentPaymentOrder applyOrder = null;
|
|
|
-
|
|
|
+
|
|
|
if(applyOrderList != null && applyOrderList.size() > 0){
|
|
|
applyOrder = applyOrderList.get(0);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (applyOrder == null) {
|
|
|
throw new BizException("没有支付中订单,请在我的订单中查看订单状态");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 查询订单状态
|
|
|
PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
|
|
|
if(payStatus != PayStatus.FAILED){
|
|
@@ -1406,7 +1393,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if(musicGroupRegCalender == null){
|
|
|
throw new BizException("缴费信息不存在");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//手动关闭订单
|
|
|
applyOrder.setStatus(DealStatusEnum.FAILED);
|
|
|
applyOrder.setMemo("用户手动关闭");
|
|
@@ -1453,14 +1440,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
remitFee = groupType.get(kitGroupPurchaseType) == null ? BigDecimal.ZERO : groupType.get(kitGroupPurchaseType);
|
|
|
}
|
|
|
goodsGroup.setGoodsList(goodsService.findGoodsByIds(goodsGroup.getGoodsIdList()));
|
|
|
-
|
|
|
+
|
|
|
if(goodsGroup.getType().equals(GoodsType.ACCESSORIES)){
|
|
|
if((registerPayDto.getBuyCloudTeacher() || registerPayDto.getBuyCloudTeacherPlus()) && musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
|
|
|
goodsGroup.setPrice(BigDecimal.ZERO);
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(musicGroup.getOrganId() == 55 && (registerPayDto.getNewCourse() == null || registerPayDto.getNewCourse().size() == 0) && !(registerPayDto.getBuyCloudTeacher() || registerPayDto.getBuyCloudTeacherPlus())){
|
|
|
//取商品零售价
|
|
|
if (StringUtils.isNotBlank(goodsGroup.getGoodsIdList())) {
|
|
@@ -1505,7 +1492,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
//云教练/云教练+
|
|
|
if (registerPayDto.getBuyCloudTeacher() || registerPayDto.getBuyCloudTeacherPlus()) {
|
|
|
-
|
|
|
+
|
|
|
BigDecimal cloudTeacherPrice = BigDecimal.ZERO;
|
|
|
if (musicGroupRegCalender.getMemberRankSettingId() != null) {
|
|
|
cloudTeacherPrice = musicGroupRegCalender.getMemberPaymentAmount();
|
|
@@ -1515,17 +1502,17 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
cloudTeacherPrice = musicGroup.getCloudTeacherType() == 0 ? cloudTeacher.getPrice() : cloudTeacher.getPlusPrice();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
orderAmount = orderAmount.add(cloudTeacherPrice);
|
|
|
studentRegistration.setHasCloudTeacher(0);
|
|
|
-
|
|
|
+
|
|
|
|
|
|
//创建订单
|
|
|
cloudTeacherOrder = new CloudTeacherOrder();
|
|
|
|
|
|
cloudTeacherOrder.setType(PeriodEnum.MONTH);//月
|
|
|
cloudTeacherOrder.setTime(musicGroupRegCalender.getMemberValidDate() == null ? 6 : musicGroupRegCalender.getMemberValidDate());
|
|
|
-
|
|
|
+
|
|
|
cloudTeacherOrder.setOrganId(musicGroup.getOrganId());
|
|
|
cloudTeacherOrder.setStudentId(studentRegistration.getUserId());
|
|
|
cloudTeacherOrder.setLevel(musicGroupRegCalender.getMemberRankSettingId() == null ? 1 : musicGroupRegCalender.getMemberRankSettingId());
|
|
@@ -1561,14 +1548,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("价格异常");
|
|
|
}
|
|
|
boolean canPay = studentPaymentOrder.getClassGroupId() != null && studentPaymentOrder.getClassGroupId().equals(206);
|
|
|
-
|
|
|
+
|
|
|
if(cloudTeacherOrder != null){
|
|
|
cloudTeacherOrder.setOrderId(studentPaymentOrder.getId());
|
|
|
cloudTeacherOrder.setCreateTime(date);
|
|
|
cloudTeacherOrder.setUpdateTime(date);
|
|
|
cloudTeacherOrderService.insert(cloudTeacherOrder);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
BigDecimal balance = BigDecimal.ZERO;
|
|
|
if (registerPayDto.getUseBalancePayment() && amount.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
SysUserCashAccount userCashAccount = sysUserCashAccountService.get(userId);
|
|
@@ -2312,7 +2299,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public boolean applyQuitMusicGroup(List<SysUserRoleEnum> currentOperatorRoleIds, MusicGroupQuit reqMusicGroupQuit, Integer operatorId) {
|
|
|
|
|
|
Integer userId = reqMusicGroupQuit.getUserId();
|
|
@@ -2348,6 +2335,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
musicGroupQuit.setUserComment(reqMusicGroupQuit.getUserComment());
|
|
|
musicGroupQuit.setApplyUserId(userId);
|
|
|
musicGroupQuit.setReason(reason);
|
|
|
+ musicGroupQuit.setReasonEnum(reqMusicGroupQuit.getReasonEnum());
|
|
|
|
|
|
MusicGroupReturnFeeDto returnFeeDto = reqMusicGroupQuit.getReturnFeeDto();
|
|
|
if (returnFeeDto != null) {
|
|
@@ -2454,7 +2442,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public boolean approveQuitMusicGroup(List<SysUserRoleEnum> currentOperatorRoleIds, MusicGroupQuit reqMusicGroupQuit) {
|
|
|
Long id = reqMusicGroupQuit.getId();
|
|
|
ApprovalStatus status = reqMusicGroupQuit.getStatus();
|
|
@@ -2521,8 +2509,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
musicGroupQuit.setStatus(status);
|
|
|
musicGroupQuit.setReason(reason);
|
|
|
musicGroupQuit.setQuitDate(date);
|
|
|
+ musicGroupQuit.setReasonEnum(reqMusicGroupQuit.getReasonEnum());
|
|
|
+ musicGroupQuit.setIsVisit(reqMusicGroupQuit.getIsVisit());
|
|
|
+ musicGroupQuit.setVisitTime(reqMusicGroupQuit.getVisitTime());
|
|
|
+ musicGroupQuit.setUserComment(reqMusicGroupQuit.getUserComment());
|
|
|
|
|
|
- if (visitDate != null) {
|
|
|
+
|
|
|
+/* if (visitDate != null) {
|
|
|
musicGroupQuit.setVisitTime(visitDate);
|
|
|
musicGroupQuit.setIsVisit(true);
|
|
|
} else {
|
|
@@ -2531,7 +2524,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
if (StringUtils.isBlank(musicGroupQuit.getUserComment())) {
|
|
|
musicGroupQuit.setUserComment(reqMusicGroupQuit.getUserComment());
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
BigDecimal returnTotalFee = BigDecimal.ZERO;
|
|
|
|
|
@@ -2761,11 +2754,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
- public boolean directQuitMusicGroup(String musicGroupId, Integer userId, String reason, boolean isRefundCourseFee, boolean isRefundInstrumentFee,
|
|
|
- boolean isRefundTeachingAssistantsFee, boolean isRefundMemberFee, BigDecimal maintenanceFee) {
|
|
|
-
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserById(userId);
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public boolean directQuitMusicGroup(MusicGroupQuitDto musicGroupQuitDto) {
|
|
|
+ Integer userId = musicGroupQuitDto.getUserId();
|
|
|
+ String musicGroupId = musicGroupQuitDto.getMusicGroupId();
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserById(userId);
|
|
|
if (sysUser == null) {
|
|
|
throw new BizException("获取用户信息失败");
|
|
|
}
|
|
@@ -2815,21 +2808,20 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
MusicGroupQuit musicGroupQuit = musicGroupQuitDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
|
|
|
if (musicGroupQuit != null && musicGroupQuit.getStatus() == PROCESSING) {
|
|
|
musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
|
|
|
- musicGroupQuit.setReason(reason);
|
|
|
+ musicGroupQuit.setReason(musicGroupQuitDto.getReason());
|
|
|
+ musicGroupQuit.setReasonEnum(musicGroupQuitDto.getReasonEnum());
|
|
|
musicGroupQuit.setQuitDate(date);
|
|
|
-
|
|
|
musicGroupQuitDao.update(musicGroupQuit);
|
|
|
} else {
|
|
|
-
|
|
|
musicGroupQuit = new MusicGroupQuit();
|
|
|
musicGroupQuit.setCreateTime(date);
|
|
|
musicGroupQuit.setJoinDate(studentRegistration.getCreateTime());
|
|
|
musicGroupQuit.setMusicGroupId(musicGroupId);
|
|
|
musicGroupQuit.setUserId(sysUser.getId());
|
|
|
musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
|
|
|
- musicGroupQuit.setReason(reason);
|
|
|
+ musicGroupQuit.setReason(musicGroupQuitDto.getReason());
|
|
|
+ musicGroupQuit.setReasonEnum(musicGroupQuitDto.getReasonEnum());
|
|
|
musicGroupQuit.setQuitDate(date);
|
|
|
-
|
|
|
musicGroupQuitDao.insert(musicGroupQuit);
|
|
|
}
|
|
|
|
|
@@ -2854,20 +2846,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentRegistration.setUpdateTime(date);
|
|
|
studentRegistrationDao.update(studentRegistration);
|
|
|
|
|
|
- //更新服务指标、运营指标
|
|
|
- /*int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
|
|
|
- if (remainCourseNum == 0) {
|
|
|
- Student student = studentDao.get(userId);
|
|
|
- if (student == null) {
|
|
|
- throw new BizException("学生信息查询失败");
|
|
|
- }
|
|
|
- student.setServiceTag(0);
|
|
|
- student.setOperatingTag(0);
|
|
|
- student.setOperatingTempTag(0);
|
|
|
- student.setUpdateTime(date);
|
|
|
- studentDao.update(student);
|
|
|
- }*/
|
|
|
-
|
|
|
//删除进行中加学生,且在审批中或拒绝的缴费
|
|
|
List<Long> paymentCalenderIdList = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId, musicGroupId);
|
|
|
if (paymentCalenderIdList != null && paymentCalenderIdList.size() > 0) {
|
|
@@ -2935,64 +2913,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
//统计变更学员数
|
|
|
groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
|
|
|
}
|
|
|
-/*
|
|
|
- if (isRefundMemberFee){
|
|
|
- if(musicGroup.getCourseViewType() != CourseViewTypeEnum.MEMBER_FEE){
|
|
|
- throw new BizException("非会员乐团不允许退云教练");
|
|
|
- }
|
|
|
- //删除乐团会员时长
|
|
|
- studentRegistrationDao.cleanMusicMember(userId,musicGroupId);
|
|
|
- //退云教练费用
|
|
|
- if (cloudTeacherAmount != null) {
|
|
|
- Date nowDate = new Date();
|
|
|
- List<CloudTeacherOrder> cloudTeacherOrders = cloudTeacherOrderService.getStudentCloudTeacherOrder(userId,musicGroupId);
|
|
|
- BigDecimal orderAmount = BigDecimal.ZERO;
|
|
|
- Student student = studentDao.get(userId);
|
|
|
- if(cloudTeacherOrders.size() > 0){
|
|
|
- Integer subMemberDay = 0;
|
|
|
- List<CloudTeacherOrder> quitCloudTeacherOrders = new ArrayList<>();
|
|
|
- for (CloudTeacherOrder cloudTeacherOrder : cloudTeacherOrders) {
|
|
|
- if (cloudTeacherOrder.getEndTime() == null || DateUtil.stringToDate(DateUtil.format(cloudTeacherOrder.getEndTime(),DateUtil.ISO_EXPANDED_DATE_FORMAT),DateUtil.ISO_EXPANDED_DATE_FORMAT).compareTo(
|
|
|
- DateUtil.stringToDate(DateUtil.format(nowDate,DateUtil.ISO_EXPANDED_DATE_FORMAT),DateUtil.ISO_EXPANDED_DATE_FORMAT)) >= 0) {
|
|
|
- quitCloudTeacherOrders.add(cloudTeacherOrder);
|
|
|
- orderAmount = orderAmount.add(cloudTeacherOrder.getAmount());
|
|
|
- subMemberDay = subMemberDay + DateUtil.daysBetween(cloudTeacherOrder.getStartTime(), cloudTeacherOrder.getEndTime());
|
|
|
- }
|
|
|
- }
|
|
|
- cloudTeacherOrderService.quitCloudTeacherOrders(quitCloudTeacherOrders, cloudTeacherAmount);
|
|
|
- Date memberEndTime = DateUtil.addDays(studentRegistration.getMembershipEndTime(), subMemberDay);
|
|
|
- if(memberEndTime.compareTo(nowDate) < 0){
|
|
|
- //清除学员云教练
|
|
|
- studentService.cleanMember(userId);
|
|
|
- //如果有试用会员,不清除
|
|
|
- if(student.getExperienceMemberRankSettingId() != null){
|
|
|
- student.setMemberRankSettingId(student.getExperienceMemberRankSettingId());
|
|
|
- student.setMembershipStartTime(student.getExperienceMembershipStartTime());
|
|
|
- student.setMembershipEndTime(student.getExperienceMembershipEndTime());
|
|
|
- studentDao.update(student);
|
|
|
- }
|
|
|
- }else {
|
|
|
- if(student.getExperienceMemberRankSettingId() != null){
|
|
|
- if(memberEndTime.compareTo(student.getExperienceMembershipEndTime()) > 0){
|
|
|
- student.setMembershipEndTime(memberEndTime);
|
|
|
- }else {
|
|
|
- student.setMembershipEndTime(student.getExperienceMembershipEndTime());
|
|
|
- }
|
|
|
- studentDao.update(student);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (cloudTeacherAmount.compareTo(orderAmount) > 0) {
|
|
|
- throw new BizException("云教练退费金额不能大于原始订单金额");
|
|
|
- }
|
|
|
- amount = amount.add(cloudTeacherAmount);
|
|
|
- }
|
|
|
- }else {
|
|
|
- //删除乐团会员时长
|
|
|
- studentRegistrationDao.cleanMusicMember(userId,musicGroupId);
|
|
|
- }*/
|
|
|
-
|
|
|
- if (isRefundCourseFee) {
|
|
|
+ if (musicGroupQuitDto.getIsRefundCourseFee()) {
|
|
|
// 退课程费用
|
|
|
amount = amount.add(surplusCourseFee);
|
|
|
}
|
|
@@ -3006,12 +2927,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.getWithIds(paymentOrderIdList);
|
|
|
|
|
|
SubjectChange studentLastChange = null;
|
|
|
- if (isRefundInstrumentFee || isRefundTeachingAssistantsFee) {
|
|
|
+ if (musicGroupQuitDto.getIsRefundInstrumentFee() || musicGroupQuitDto.getIsRefundTeachingAssistantsFee()) {
|
|
|
studentLastChange = subjectChangeDao.getStudentLastChange(userId, musicGroupId);
|
|
|
}
|
|
|
|
|
|
if (studentLastChange != null && minPaymentOrderId <= studentLastChange.getOriginalOrderId()) {
|
|
|
- if (isRefundInstrumentFee) {
|
|
|
+ if (musicGroupQuitDto.getIsRefundInstrumentFee()) {
|
|
|
amount = amount.add(studentLastChange.getChangeMusicalPrice());
|
|
|
|
|
|
StudentInstrument studentMaintenance = studentInstrumentDao.getByOrderId(studentLastChange.getOrderId().longValue());
|
|
@@ -3021,14 +2942,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isRefundTeachingAssistantsFee) {
|
|
|
+ if (musicGroupQuitDto.getIsRefundTeachingAssistantsFee()) {
|
|
|
amount = amount.add(studentLastChange.getChangeAccessoriesPrice());
|
|
|
}
|
|
|
} else {
|
|
|
for (StudentPaymentOrderDetail detail : orderDetailList) {
|
|
|
|
|
|
// 退乐器费用
|
|
|
- if (isRefundInstrumentFee && detail.getType() == MUSICAL) {
|
|
|
+ if (musicGroupQuitDto.getIsRefundInstrumentFee() && detail.getType() == MUSICAL) {
|
|
|
amount = amount.add(detail.getPrice()).subtract(detail.getRemitFee());
|
|
|
|
|
|
StudentInstrument studentMaintenance = studentInstrumentDao.getStudentMaintenance(userId, musicGroupId);
|
|
@@ -3039,7 +2960,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
// 退教辅费用
|
|
|
- if (isRefundTeachingAssistantsFee
|
|
|
+ if (musicGroupQuitDto.getIsRefundTeachingAssistantsFee()
|
|
|
&& (detail.getType() == ACCESSORIES || detail.getType() == TEACHING)) {
|
|
|
amount = amount.add(detail.getPrice()).subtract(detail.getRemitFee());
|
|
|
}
|
|
@@ -3049,15 +2970,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
//退乐保费用
|
|
|
- if (maintenanceFee != null) {
|
|
|
+ if (musicGroupQuitDto.getMaintenanceFee() != null) {
|
|
|
StudentInstrument studentMaintenance = studentInstrumentDao.getStudentMaintenance(userId, musicGroupId);
|
|
|
- if (maintenanceFee.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ if (musicGroupQuitDto.getMaintenanceFee().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
if (studentMaintenance == null) {
|
|
|
throw new BizException("学生没有有效期内的乐保,不能退乐保费用");
|
|
|
}
|
|
|
}
|
|
|
- amount = amount.add(maintenanceFee);
|
|
|
- if (maintenanceFee.compareTo(BigDecimal.ZERO) > 0 && studentMaintenance != null) {
|
|
|
+ amount = amount.add(musicGroupQuitDto.getMaintenanceFee());
|
|
|
+ if (musicGroupQuitDto.getMaintenanceFee().compareTo(BigDecimal.ZERO) > 0 && studentMaintenance != null) {
|
|
|
studentMaintenance.setStatus(0);
|
|
|
studentMaintenance.setStartTime(null);
|
|
|
studentMaintenance.setEndTime(null);
|
|
@@ -4199,7 +4120,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (sysUser == null) {
|
|
|
throw new BizException("请登录");
|
|
|
}
|
|
|
- Map<String, Object> resultMap = new HashMap<>(7);
|
|
|
+ Map<String, Object> resultMap = new HashMap<>(8);
|
|
|
String username = sysUser.getUsername();
|
|
|
resultMap.put("username", StringUtils.isEmpty(username) ? sysUser.getRealName() : username);
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
@@ -4211,8 +4132,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
resultMap.put("days", daysBetween);
|
|
|
MusicGroupQuit musicGroupQuit = musicGroupQuitDao.queryByUserIdAndMusicGroupId(sysUser.getId(), musicGroupId);
|
|
|
if (musicGroupQuit != null && musicGroupQuit.getStatus() == PROCESSING) {
|
|
|
- resultMap.put("memo", musicGroupQuit.getUserComment());
|
|
|
- resultMap.put("quitTime", musicGroupQuit.getCreateTime());
|
|
|
+ resultMap.put("reasonEnum",musicGroupQuit.getReasonEnum());
|
|
|
+ resultMap.put("memo", musicGroupQuit.getUserComment());
|
|
|
+ resultMap.put("quitTime", musicGroupQuit.getCreateTime());
|
|
|
}
|
|
|
if (musicGroup.getEducationalTeacherId() != null) {
|
|
|
SysUser user = sysUserFeignService.queryUserById(musicGroup.getEducationalTeacherId());
|