|
@@ -76,10 +76,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
private MusicGroupDao musicGroupDao;
|
|
|
@Autowired
|
|
|
private TeacherDao teacherDao;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private MusicGroupDeliveryRecordDao musicGroupDeliveryRecordDao;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private StudentService studentService;
|
|
|
@Autowired
|
|
@@ -504,7 +504,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
sysUser.setUpdateTime(now);
|
|
|
teacherDao.addSysUser(sysUser);
|
|
|
si.setUserId(sysUser.getId());
|
|
|
- }
|
|
|
+ }else {
|
|
|
+ si.setUserId(userDto.getUserId());
|
|
|
+ }
|
|
|
Integer userId = si.getUserId();
|
|
|
if(!existPhones.contains(si.getPhone())){
|
|
|
student = new Student(userId, subjectMap.get(si.getSubjectName()) + "");
|
|
@@ -516,7 +518,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
|
|
|
if(studentRegistration == null){
|
|
|
studentRegistration = new StudentRegistration();
|
|
|
- String studentGrade = studentService.getStudentGrade(organization.getGradeType(), student.getCurrentGradeNum());
|
|
|
+ String studentGrade = studentService.getStudentGrade(organization.getGradeType(), SixPlusGradeEnum.get(si.getGrade()).getCode());
|
|
|
studentRegistration.setCurrentGrade(studentGrade);
|
|
|
studentRegistration.setActualSubjectId(subjectMap.get(si.getSubjectName()));
|
|
|
studentRegistration.setIsAllowAdjust(YesOrNoEnum.YES);
|
|
@@ -524,7 +526,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentRegistration.setUserId(userId);
|
|
|
studentRegistration.setParentsPhone(si.getPhone());
|
|
|
studentRegistration.setName(si.getStudentName());
|
|
|
- studentRegistration.setGender(sysUser.getGender());
|
|
|
+ studentRegistration.setGender(si.getGender().equals("男") ? 1 : 0);
|
|
|
studentRegistration.setPaymentStatus(PaymentStatusEnum.YES);
|
|
|
studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
|
|
|
studentRegistration.setTemporaryCourseFee(BigDecimal.ZERO);
|
|
@@ -564,9 +566,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentPaymentOrder.setMerNos(si.getMerNos());
|
|
|
studentPaymentOrder.setTransNo(si.getTransNo());
|
|
|
studentPaymentOrder.setPayTime(si.getPayTime());
|
|
|
+ studentPaymentOrder.setRemitFee(BigDecimal.ZERO);
|
|
|
+ studentPaymentOrder.setCourseRemitFee(BigDecimal.ZERO);
|
|
|
studentPaymentOrderService.insert(studentPaymentOrder);
|
|
|
- studentRegistrationService.addOrder1(studentPaymentOrder,calender,courseSettings, calenderMember, calenderRepair, calenderActivities);
|
|
|
+ List<StudentPaymentOrderDetail> orderDetails = studentRegistrationService.addOrder1(studentPaymentOrder, calender, courseSettings, calenderMember, calenderRepair, calenderActivities);
|
|
|
studentPaymentRouteOrderService.addRouteOrder(orderNo, calender.getOrganId(), calender.getCurrentTotalAmount());
|
|
|
+ studentPaymentOrderDetailService.addOrderDetailTo1(studentPaymentOrder, musicGroup, studentRegistration,orderDetails);
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(insertList)) {
|
|
|
studentRegistrationService.batchInsert(insertList);
|
|
@@ -608,28 +613,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
calender.setUpdateTime(now);
|
|
|
musicGroupPaymentCalenderDao.update(calender);
|
|
|
-
|
|
|
- MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
|
|
|
- List<MusicGroupPaymentCalenderDetail> insertMusicGroupPaymentCalenderDetailList = new ArrayList<>();
|
|
|
- for (MusicGroupPaymentImportDto si : importDtos) {
|
|
|
- musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
|
|
|
- musicGroupPaymentCalenderDetail.setTenantId(calender.getTenantId());
|
|
|
- musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(calender.getId());
|
|
|
- musicGroupPaymentCalenderDetail.setUserId(si.getUserId());
|
|
|
- musicGroupPaymentCalenderDetail.setResponsibleUserId(calender.getOperator());
|
|
|
- musicGroupPaymentCalenderDetail.setPaymentStatus(PAID_COMPLETED);
|
|
|
- musicGroupPaymentCalenderDetail.setPayTime(now);
|
|
|
- musicGroupPaymentCalenderDetail.setPaymentOrderId(null);
|
|
|
- musicGroupPaymentCalenderDetail.setUseInCourse(0);
|
|
|
- musicGroupPaymentCalenderDetail.setOpen(1);
|
|
|
- musicGroupPaymentCalenderDetail.setUserStatus(null);
|
|
|
- musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(calender.getDeadlinePaymentDate());
|
|
|
- musicGroupPaymentCalenderDetail.setStartPaymentDate(calender.getStartPaymentDate());
|
|
|
- insertMusicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
|
|
|
- }
|
|
|
- if (insertMusicGroupPaymentCalenderDetailList.size() > 0) {
|
|
|
- musicGroupPaymentCalenderDetailDao.batchInsert(insertMusicGroupPaymentCalenderDetailList);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -836,7 +819,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
//记录操作日志
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "预报名完成(预报名 -> 报名缴费中)", sysUser.getId(), ""));
|
|
|
-
|
|
|
+
|
|
|
studentRegistrationDao.musicGroupOpenPay(musicGroupId, PaymentStatusEnum.OPEN);
|
|
|
MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
|
|
|
if (regCalender != null && regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
|
|
@@ -1150,6 +1133,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("缴费项目批次{}不存在",batchNo);
|
|
|
}
|
|
|
MusicGroupPaymentCalender calender = byBatchNo.get(0);
|
|
|
+ if(calender.getPayUserType() == SCHOOL){
|
|
|
+ throw new BizException("不支持学校缴费导入");
|
|
|
+ }
|
|
|
if(calender.getPaymentType() != MUSIC_RENEW && calender.getPaymentType() != ADD_COURSE && calender.getPaymentType() != MUSIC_APPLY){
|
|
|
throw new BizException("不支持类型 {} 的缴费项目导入",calender.getPaymentType().getDesc());
|
|
|
}
|
|
@@ -1169,6 +1155,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("学员{}已缴费,请勿重复录入",userDto.getUserId());
|
|
|
}
|
|
|
}
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
|
+ MusicGroupPaymentCalenderMember calenderMember = musicGroupPaymentCalenderMemberDao.findByCalenderId(calenderId);
|
|
|
+ MusicGroupPaymentCalenderRepair calenderRepair = musicGroupPaymentCalenderRepairDao.findByCalenderId(calenderId);
|
|
|
+ List<MusicGroupPaymentCalenderActivity> calenderActivities = musicGroupPaymentCalenderActivityDao.findByCalenderId(calenderId);
|
|
|
+ List<MusicGroupPaymentCalenderCourseSettings> courseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(calenderId);
|
|
|
for (MusicGroupPaymentImportDto userDto : userDtoList) {
|
|
|
String orderNo = idGeneratorService.generatorId("payment") + "";
|
|
|
StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
|
|
@@ -1193,13 +1184,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentPaymentOrder.setTransNo(userDto.getTransNo());
|
|
|
studentPaymentOrder.setPayTime(userDto.getPayTime());
|
|
|
studentPaymentOrderDao.insert(studentPaymentOrder);
|
|
|
- studentPaymentRouteOrderService.addRouteOrder(orderNo, calender.getOrganId(), calender.getCurrentTotalAmount());
|
|
|
- Integer userId = studentPaymentOrder.getUserId();
|
|
|
- String musicGroupId = studentPaymentOrder.getMusicGroupId();
|
|
|
- StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
+ StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(studentPaymentOrder.getUserId(), calender.getMusicGroupId());
|
|
|
//支付成功后处理课程、云教练、活动等数据
|
|
|
- studentPaymentOrderDetailService.addOrderDetailTo(studentPaymentOrder, musicGroup, studentRegistration);
|
|
|
+ List<StudentPaymentOrderDetail> orderDetails = studentRegistrationService.addOrder1(studentPaymentOrder, calender, courseSettings, calenderMember, calenderRepair, calenderActivities);
|
|
|
+ studentPaymentRouteOrderService.addRouteOrder(orderNo, calender.getOrganId(), calender.getCurrentTotalAmount());
|
|
|
+ studentPaymentOrderDetailService.addOrderDetailTo1(studentPaymentOrder, musicGroup, studentRegistration,orderDetails);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1328,10 +1317,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public HttpResponseResult pay(RegisterPayDto registerPayDto) throws Exception {
|
|
|
-
|
|
|
+
|
|
|
Integer userId = registerPayDto.getUserId();
|
|
|
String musicGroupId = registerPayDto.getMusicGroupId();
|
|
|
-
|
|
|
+
|
|
|
//判断用户是否已存在订单
|
|
|
List<StudentPaymentOrder> applyOrderList = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, DealStatusEnum.ING);
|
|
|
if (CollectionUtils.isNotEmpty(applyOrderList)) {
|
|
@@ -1353,7 +1342,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (musicGroup == null) {
|
|
|
throw new BizException("查询乐团信息失败");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
SubjectChange subjectChange = subjectChangeDao.getStudentLastChange(userId, musicGroupId);
|
|
|
if(subjectChange != null){
|
|
|
throw new BizException("您已做过声部更换操作,不能继续缴费");
|
|
@@ -1562,19 +1551,19 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("分部信息查询失败");
|
|
|
}
|
|
|
BigDecimal maxProfits = organ.getMaxMusicalInstrumentsProfits();
|
|
|
-
|
|
|
+
|
|
|
for (MusicGroupSubjectGoodsGroup musicGroupSubjectGoodsGroup : subFeeSettingDto.getMusicGroupSubjectGoodsGroups()) {
|
|
|
if (musicGroupSubjectGoodsGroup.getType().equals(GoodsType.INSTRUMENT) && (musicGroupSubjectGoodsGroup.getKitGroupPurchaseTypeJson() == null
|
|
|
|| musicGroupSubjectGoodsGroup.getKitGroupPurchaseTypeJson().isEmpty()
|
|
|
|| musicGroupSubjectGoodsGroup.getKitGroupPurchaseTypeJson().equals("{}"))) {
|
|
|
throw new BizException(musicGroupSubjectGoodsGroup.getName() + " 请选择提供方式");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//判断分润是否超过最大值
|
|
|
if(musicGroupSubjectGoodsGroup.getOrganShareProfit() != null && maxProfits.compareTo(musicGroupSubjectGoodsGroup.getOrganShareProfit()) < 0){
|
|
|
throw new BizException("超过了分润最大金额[{}],请重新设置分润金额", maxProfits.doubleValue());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (musicGroupSubjectGoodsGroup.getGroupRemissionCourseFee() == null) {
|
|
|
musicGroupSubjectGoodsGroup.setGroupRemissionCourseFee(0);
|
|
|
}
|
|
@@ -1685,12 +1674,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("用户信息获取失败");
|
|
|
}
|
|
|
Date date = new Date();
|
|
|
-
|
|
|
+
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
if (musicGroup == null) {
|
|
|
throw new BizException("乐团信息不存在");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT && musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT_FAILED) {
|
|
|
throw new BizException("当前乐团状态不支持此操作");
|
|
|
}
|
|
@@ -1704,23 +1693,23 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
musicGroup.setUpdateTime(date);
|
|
|
musicGroupDao.update(musicGroup);
|
|
|
-
|
|
|
+
|
|
|
List<PaymentCalenderStatusEnum> statusList = new ArrayList<MusicGroupPaymentCalender.PaymentCalenderStatusEnum>();
|
|
|
statusList.add(PaymentCalenderStatusEnum.DRAFT);
|
|
|
//修改乐团报名缴费项目状态
|
|
|
List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(musicGroupId, statusList, null);
|
|
|
-
|
|
|
+
|
|
|
if(musicGroupPaymentCalenderList == null || musicGroupPaymentCalenderList.size() == 0) {
|
|
|
throw new BizException("请先创建缴费项目");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
musicGroupPaymentCalenderList.forEach(t -> {
|
|
|
t.setStatus(PaymentCalenderStatusEnum.AUDITING);
|
|
|
t.setUpdateTime(date);
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenderList);
|
|
|
-
|
|
|
+
|
|
|
sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
|
|
|
null, null, MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, sysUser.getRealName(), musicGroup.getName());
|
|
|
}
|
|
@@ -1742,9 +1731,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT) {
|
|
|
throw new BizException("当前乐团状态不支持此操作");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Date date = new Date();
|
|
|
-
|
|
|
+
|
|
|
//记录操作日志
|
|
|
if (musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT){
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "乐团审核失败(审核中 -> 审核失败)", sysUser.getId(), memo));
|
|
@@ -1752,40 +1741,40 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
musicGroup.setMemo(memo);
|
|
|
musicGroup.setUpdateTime(date);
|
|
|
musicGroupDao.update(musicGroup);
|
|
|
-
|
|
|
+
|
|
|
List<PaymentCalenderStatusEnum> statusList = new ArrayList<MusicGroupPaymentCalender.PaymentCalenderStatusEnum>();
|
|
|
statusList.add(PaymentCalenderStatusEnum.AUDITING);
|
|
|
//修改乐团报名缴费项目状态
|
|
|
List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(musicGroupId, statusList, null);
|
|
|
-
|
|
|
+
|
|
|
musicGroupPaymentCalenderList.forEach(t -> {
|
|
|
t.setStatus(PaymentCalenderStatusEnum.DRAFT);
|
|
|
t.setUpdateTime(date);
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenderList);
|
|
|
-
|
|
|
+
|
|
|
}else if(musicGroup.getStatus() == MusicGroupStatusEnum.FEE_AUDIT){
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "乐团审核失败(费用审核中 -> 费用审核失败)", sysUser.getId(), memo));
|
|
|
List<PaymentCalenderStatusEnum> statusList = new ArrayList<MusicGroupPaymentCalender.PaymentCalenderStatusEnum>();
|
|
|
statusList.add(PaymentCalenderStatusEnum.AUDITING);
|
|
|
//修改乐团报名缴费项目状态
|
|
|
List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(musicGroupId, statusList, null);
|
|
|
-
|
|
|
+
|
|
|
musicGroupPaymentCalenderList.forEach(t -> {
|
|
|
t.setStatus(PaymentCalenderStatusEnum.REJECT);
|
|
|
t.setUpdateTime(date);
|
|
|
t.setMemo(memo);
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenderList);
|
|
|
-
|
|
|
+
|
|
|
//修改乐团状态
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT_FAILED);
|
|
|
musicGroup.setUpdateTime(date);
|
|
|
musicGroupDao.update(musicGroup);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1805,9 +1794,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT) {
|
|
|
throw new BizException("当前乐团状态不支持此操作");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Date date = new Date();
|
|
|
-
|
|
|
+
|
|
|
if(musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT){
|
|
|
//记录操作日志
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 费用审核中)", sysUser.getId(), ""));
|
|
@@ -1815,17 +1804,17 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}else if(musicGroup.getStatus() == MusicGroupStatusEnum.FEE_AUDIT){
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(费用审核中 -> 预报名)", sysUser.getId(), ""));
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.PRE_APPLY);
|
|
|
-
|
|
|
+
|
|
|
|
|
|
List<PaymentCalenderStatusEnum> statusList = new ArrayList<MusicGroupPaymentCalender.PaymentCalenderStatusEnum>();
|
|
|
statusList.add(PaymentCalenderStatusEnum.AUDITING);
|
|
|
//修改乐团报名缴费项目状态
|
|
|
List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(musicGroupId, statusList, null);
|
|
|
-
|
|
|
+
|
|
|
if(musicGroupPaymentCalenderList == null || musicGroupPaymentCalenderList.size() == 0){
|
|
|
throw new BizException("没有审核中的缴费项目");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
musicGroupPaymentCalenderList.forEach(t -> {
|
|
|
if (t.getPayUserType() == SCHOOL) {
|
|
|
if (t.getCurrentTotalAmount().compareTo(BigDecimal.ZERO) > 0) {
|
|
@@ -1842,7 +1831,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
t.setUpdateTime(date);
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenderList);
|
|
|
}
|
|
|
musicGroup.setUpdateTime(date);
|
|
@@ -2178,7 +2167,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderService.findByMusicGroupRegCalender(musicGroup.getId());
|
|
|
if (regCalender != null && regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
|
|
|
regCalender.setDeadlinePaymentDate(expireDate);
|
|
|
-
|
|
|
+
|
|
|
//regCalender.setStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum.OPEN);
|
|
|
regCalender.setUpdateTime(date);
|
|
|
musicGroupPaymentCalenderService.update(regCalender);
|
|
@@ -2413,7 +2402,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
Date date = new Date();
|
|
|
-
|
|
|
+
|
|
|
Boolean hasRole = employeePositionService.getDao().hasRole("一键退团",reqMusicGroupQuit.getOperatorId(),reqMusicGroupQuit.getTenantId());
|
|
|
|
|
|
//如果发起退团申请的是乐团主管
|
|
@@ -2423,7 +2412,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (!StringUtils.equals(musicGroupQuit.getCurrentApproveRole(), SysUserRoleEnum.EDUCATION.ordinal() + 1 + "")) {
|
|
|
throw new BizException("只有分部经理才能审核");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (status == ApprovalStatus.APPROVED) {
|
|
|
throw new BizException("只能分部经理操作退团");
|
|
|
}
|
|
@@ -3931,7 +3920,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("用户信息获取失败");
|
|
|
}
|
|
|
String musicGroupId = closeMusicGroupDto.getMusicGroupId();
|
|
|
-
|
|
|
+
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
if (musicGroup == null) {
|
|
|
throw new BizException("乐团找不到");
|
|
@@ -3990,7 +3979,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (registrations.size() > 0 && studentRegistrationService.quitAllStudent(musicGroup.getId(), "退团(乐团关闭)") <= 0) {
|
|
|
throw new BizException("处理学生退团失败,请重试");
|
|
|
}*/
|
|
|
-
|
|
|
+
|
|
|
//清除剩余未排课时长
|
|
|
musicGroupPaymentStudentCourseDetailService.clearRemainCourseMinutesByMusicGroupId(musicGroupId);
|
|
|
|
|
@@ -4068,7 +4057,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean confirmDelivery(Integer userId, MusicGroupDeliveryVo musicGroupDeliveryVo) {
|
|
|
-
|
|
|
+
|
|
|
String musicGroupId = musicGroupDeliveryVo.getMusicGroupId();
|
|
|
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
@@ -4077,24 +4066,24 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
Date date = new Date();
|
|
|
-
|
|
|
+
|
|
|
String deliveryBatchNo = idGeneratorService.generatorId("delivery") + "";
|
|
|
-
|
|
|
+
|
|
|
//更新订单的发货状态(包括声部更换)
|
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailDao.querySubjectChangeByMusicGroupId(musicGroupId);
|
|
|
if(studentPaymentOrderDetailList == null){
|
|
|
studentPaymentOrderDetailList = new ArrayList<StudentPaymentOrderDetail>();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList1 = studentPaymentOrderDetailDao.findApplyOrderSuccess(musicGroupId, DealStatusEnum.SUCCESS, 0);
|
|
|
if(studentPaymentOrderDetailList1 != null && studentPaymentOrderDetailList1.size() > 0){
|
|
|
studentPaymentOrderDetailList.addAll(studentPaymentOrderDetailList1);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(studentPaymentOrderDetailList == null || studentPaymentOrderDetailList.size() == 0){
|
|
|
throw new BizException("没有商品信息,不能发货");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
studentPaymentOrderDetailList.forEach(t -> {
|
|
|
t.setDeliveryBatchNo(deliveryBatchNo);
|
|
|
t.setUpdateTime(date);
|
|
@@ -4102,7 +4091,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if(studentPaymentOrderDetailList.size() > 0){
|
|
|
studentPaymentOrderDetailDao.batchUpdate(studentPaymentOrderDetailList);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
List<SubjectChange> subjectChangeList = subjectChangeDao.queryWaitDeliveryList(musicGroupId);
|
|
|
subjectChangeList.forEach(t -> {
|
|
|
t.setDeliveryBatchNo(deliveryBatchNo);
|
|
@@ -4119,7 +4108,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
List<Long> instrumentIdList = maintenanceList.stream().map(t -> t.getStudentInstrumentId()).collect(Collectors.toList());
|
|
|
|
|
|
List<StudentInstrument> studentInstrumentList = studentInstrumentDao.queryById(instrumentIdList);
|
|
|
-
|
|
|
+
|
|
|
MusicGroupPaymentCalenderRepair musicGroupPaymentCalenderRepair = musicGroupPaymentCalenderRepairDao.findByCalenderId(maintenanceList.get(0).getMusicGroupPaymentCalenderId());
|
|
|
|
|
|
List<StudentInstrument> updateList = new ArrayList<StudentInstrument>();
|
|
@@ -4153,7 +4142,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
dr.setMusicGroupShippingAddressId(musicGroupDeliveryVo.getAddressId());
|
|
|
dr.setOperatorUserId(userId);
|
|
|
dr.setUpdateTime(date);
|
|
|
-
|
|
|
+
|
|
|
musicGroupDeliveryRecordDao.insert(dr);
|
|
|
|
|
|
return true;
|