|
@@ -21,6 +21,7 @@ import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
+import com.ym.mec.biz.dal.enums.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -83,24 +84,6 @@ import com.ym.mec.biz.dal.dto.SubjectRegisterDto;
|
|
|
import com.ym.mec.biz.dal.dto.UpdateExpectedNumDto;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
|
-import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.FivePlusGradeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.GoodsType;
|
|
|
-import com.ym.mec.biz.dal.enums.GradeTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
-import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.SixPlusGradeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
|
|
|
import com.ym.mec.biz.event.source.GroupEventSource;
|
|
|
import com.ym.mec.biz.service.ClassGroupService;
|
|
@@ -466,16 +449,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentPreRegistration.setUserId(user.getId());
|
|
|
|
|
|
Organization organization = organizationDao.get(musicGroup.getOrganId());
|
|
|
- if(organization.getGradeType().equals(GradeTypeEnum.SIX_PLUS)){
|
|
|
+ if (organization.getGradeType().equals(GradeTypeEnum.SIX_PLUS)) {
|
|
|
for (SixPlusGradeEnum value : SixPlusGradeEnum.values()) {
|
|
|
- if(value.getCode().equals(studentPreRegistration.getCurrentGradeNum())){
|
|
|
+ if (value.getCode().equals(studentPreRegistration.getCurrentGradeNum())) {
|
|
|
studentPreRegistration.setCurrentGrade(value.getDesc());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
for (FivePlusGradeEnum value : FivePlusGradeEnum.values()) {
|
|
|
- if(value.getCode().equals(studentPreRegistration.getCurrentGradeNum())){
|
|
|
+ if (value.getCode().equals(studentPreRegistration.getCurrentGradeNum())) {
|
|
|
studentPreRegistration.setCurrentGrade(value.getDesc());
|
|
|
break;
|
|
|
}
|
|
@@ -743,7 +726,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
}
|
|
|
//乐器保养
|
|
|
- if(registerPayDto.getBuyMaintenance()){
|
|
|
+ if (registerPayDto.getBuyMaintenance()) {
|
|
|
BigDecimal maintenancePrice = new BigDecimal(sysConfigDao.findConfigValue("maintenance_price"));
|
|
|
orderAmount = orderAmount.add(maintenancePrice);
|
|
|
}
|
|
@@ -759,7 +742,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
String channelType = "";
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, remitFee, courseRemitFee, newCourses,registerPayDto.getBuyMaintenance());
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance());
|
|
|
studentPaymentOrder.setVersion(0);
|
|
|
|
|
|
Date date = new Date();
|
|
@@ -894,7 +877,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(registerPayDto.getBuyMaintenance()){
|
|
|
+ if (registerPayDto.getBuyMaintenance()) {
|
|
|
BigDecimal maintenancePrice = new BigDecimal(sysConfigDao.findConfigValue("maintenance_price"));
|
|
|
orderAmount = orderAmount.add(maintenancePrice);
|
|
|
}
|
|
@@ -911,7 +894,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
String channelType = "";
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentRegistrationService.reAddOrder(userId, amount, orderNo, channelType, courseFee, goodsGroups, studentRegistration.getMusicGroupId(), ApplyOrder, remitFee, courseRemitFee, newCourses,registerPayDto.getBuyMaintenance());
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentRegistrationService.reAddOrder(userId, amount, orderNo, channelType, courseFee, goodsGroups, studentRegistration.getMusicGroupId(), ApplyOrder, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance());
|
|
|
studentPaymentOrder.setVersion(0);
|
|
|
Date date = new Date();
|
|
|
|
|
@@ -1817,15 +1800,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
BigDecimal amount = new BigDecimal(0);
|
|
|
|
|
|
- // 判断乐器是否是租赁
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
|
|
|
+ BigDecimal orderExpectAmount = studentPaymentOrder == null ? BigDecimal.ZERO : studentPaymentOrder.getExpectAmount();
|
|
|
+
|
|
|
+ // 缴费人数更新
|
|
|
MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, studentRegistration.getActualSubjectId());
|
|
|
- if (musicGroupSubjectPlan != null) {
|
|
|
+ if (musicGroupSubjectPlan != null && (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.COURSE_lIST) || orderExpectAmount.compareTo(BigDecimal.ZERO) > 0)) {
|
|
|
musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
|
|
|
musicGroupSubjectPlan.setUpdateTime(date);
|
|
|
musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
|
|
|
}
|
|
|
|
|
|
- if(MusicGroupStatusEnum.PROGRESS.equals(musicGroup.getStatus())){
|
|
|
+ if (MusicGroupStatusEnum.PROGRESS.equals(musicGroup.getStatus())) {
|
|
|
//统计变更学员数
|
|
|
groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
|
|
|
|
|
@@ -1839,8 +1825,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
amount = amount.add(surplusCourseFee);
|
|
|
}
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
|
|
|
-
|
|
|
if (studentPaymentOrder != null) {
|
|
|
List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
|
|
|
|
|
@@ -1921,27 +1905,27 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
Date date = new Date();
|
|
|
-
|
|
|
+
|
|
|
MusicGroupQuit musicGroupQuit = musicGroupQuitDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
|
|
|
- if (musicGroupQuit != null && musicGroupQuit.getStatus() == ApprovalStatus.PROCESSING) {
|
|
|
- musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
|
|
|
- musicGroupQuit.setReason(reason);
|
|
|
- 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.setQuitDate(date);
|
|
|
-
|
|
|
- musicGroupQuitDao.insert(musicGroupQuit);
|
|
|
- }
|
|
|
+ if (musicGroupQuit != null && musicGroupQuit.getStatus() == ApprovalStatus.PROCESSING) {
|
|
|
+ musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
|
|
|
+ musicGroupQuit.setReason(reason);
|
|
|
+ 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.setQuitDate(date);
|
|
|
+
|
|
|
+ musicGroupQuitDao.insert(musicGroupQuit);
|
|
|
+ }
|
|
|
|
|
|
List<Integer> classGroupIdList = classGroupStudentMapperDao.queryClassGroupIdList(musicGroupId, userId, GroupType.MUSIC);
|
|
|
for (Integer classGroupId : classGroupIdList) {
|
|
@@ -2007,15 +1991,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
BigDecimal amount = new BigDecimal(0);
|
|
|
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
|
|
|
+ BigDecimal orderExpectAmount = studentPaymentOrder == null ? BigDecimal.ZERO : studentPaymentOrder.getExpectAmount();
|
|
|
+
|
|
|
// 判断乐器是否是租赁
|
|
|
MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, studentRegistration.getActualSubjectId());
|
|
|
- if (musicGroupSubjectPlan != null) {
|
|
|
+ if (musicGroupSubjectPlan != null && (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.COURSE_lIST) || orderExpectAmount.compareTo(BigDecimal.ZERO) > 0)) {
|
|
|
musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
|
|
|
musicGroupSubjectPlan.setUpdateTime(date);
|
|
|
musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
|
|
|
}
|
|
|
|
|
|
- if(MusicGroupStatusEnum.PROGRESS.equals(musicGroup.getStatus())){
|
|
|
+ if (MusicGroupStatusEnum.PROGRESS.equals(musicGroup.getStatus())) {
|
|
|
//统计变更学员数
|
|
|
groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
|
|
|
}
|
|
@@ -2029,8 +2016,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
amount = amount.add(surplusCourseFee);
|
|
|
}
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
|
|
|
-
|
|
|
if (studentPaymentOrder != null) {
|
|
|
List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
|
|
|
|
|
@@ -2395,27 +2380,27 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
List<Integer> roles = employeeDao.queryUserRole(sysUser.getId());
|
|
|
PageInfo<MusicGroup> musicGroupPageInfo;
|
|
|
//待创建缴费项目提醒
|
|
|
- if("WAIT_CREATE_PAYMENT_CALENDER".equals(queryInfo.getSearchType())){
|
|
|
+ if ("WAIT_CREATE_PAYMENT_CALENDER".equals(queryInfo.getSearchType())) {
|
|
|
Integer educationUserId = null;
|
|
|
if (!sysUser.getIsSuperAdmin() && roles.size() == 1 && roles.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
|
|
|
educationUserId = sysUser.getId();
|
|
|
}
|
|
|
//获取关联的乐团列表
|
|
|
- List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,queryInfo.getOrganId());
|
|
|
+ List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId, queryInfo.getOrganId());
|
|
|
String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
|
|
|
Date date = new Date();
|
|
|
String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
|
|
|
- if(musicGroupIds.size() > 0){
|
|
|
- List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format,musicGroupIds);
|
|
|
- if(calenderIds.size() > 0){
|
|
|
+ if (musicGroupIds.size() > 0) {
|
|
|
+ List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format, musicGroupIds);
|
|
|
+ if (calenderIds.size() > 0) {
|
|
|
List<String> queryMusicGroupIds = musicGroupPaymentCalenderDao.queryMusicGroupIds(calenderIds);
|
|
|
- if(queryInfo.getMusicGroupIds() != null){
|
|
|
+ if (queryInfo.getMusicGroupIds() != null) {
|
|
|
queryMusicGroupIds.addAll(queryInfo.getMusicGroupIds());
|
|
|
}
|
|
|
queryInfo.setMusicGroupIds(queryMusicGroupIds);
|
|
|
}
|
|
|
}
|
|
|
- if(queryInfo.getMusicGroupIds() == null || queryInfo.getMusicGroupIds().size() == 0){
|
|
|
+ if (queryInfo.getMusicGroupIds() == null || queryInfo.getMusicGroupIds().size() == 0) {
|
|
|
return new PageInfo<MusicGroup>();
|
|
|
}
|
|
|
}
|
|
@@ -2462,7 +2447,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
Map<Integer, String> cooperationOrganNames = MapUtil.convertMybatisMap(cooperationOrganDao.queryNameByIds(StringUtils.join(musicGroupList.stream().map(MusicGroup::getCooperationOrganId).collect(Collectors.toSet()), ",")));
|
|
|
|
|
|
Set<Integer> organIds = musicGroupList.stream().map(e -> e.getOrganId()).collect(Collectors.toSet());
|
|
|
- Map<Integer,String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(StringUtils.join(organIds,",")));
|
|
|
+ Map<Integer, String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(StringUtils.join(organIds, ",")));
|
|
|
|
|
|
List<MusicGroupPurchaseList> musicGroupPurchaseListCount = musicGroupPurchaseListDao.getCount(musicGroupIds);
|
|
|
Map<String, Integer> purchaseListMap = musicGroupPurchaseListCount.stream().collect(Collectors.toMap(MusicGroupPurchaseList::getMusicGroupId, MusicGroupPurchaseList::getPurchaseNum));
|
|
@@ -2478,8 +2463,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
e.setPayNum(payNumMap.get(e.getId()) == null ? 0 : payNumMap.get(e.getId()));
|
|
|
e.setChargeTypeName(chargeTypeNameMap.get(e.getChargeTypeId()));
|
|
|
e.setHasVerifyMusicalList(purchaseListMap.get(e.getId()) != null);
|
|
|
- if(e.getStatus().equals(MusicGroupStatusEnum.PREPARE) || e.getStatus().equals(MusicGroupStatusEnum.PROGRESS)){
|
|
|
- if(viewRegButtonMap.containsKey(e.getId())){
|
|
|
+ if (e.getStatus().equals(MusicGroupStatusEnum.PREPARE) || e.getStatus().equals(MusicGroupStatusEnum.PROGRESS)) {
|
|
|
+ if (viewRegButtonMap.containsKey(e.getId())) {
|
|
|
e.setIsRemedy(true);
|
|
|
}
|
|
|
}
|
|
@@ -2751,7 +2736,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
Integer cooperationMusicGroupNum = musicGroupDao.getCooperationMusicGroupNum(musicGroup.getCooperationOrganId(), musicGroupId);
|
|
|
Integer paymentStudentNum = studentRegistrationDao.getPaymentStudentNum(musicGroupId);
|
|
|
|
|
|
- if((cooperationMusicGroupNum <= 0 && paymentStudentNum < 98) || (cooperationMusicGroupNum > 0 && paymentStudentNum < 58)){
|
|
|
+ if ((cooperationMusicGroupNum <= 0 && paymentStudentNum < 98) || (cooperationMusicGroupNum > 0 && paymentStudentNum < 58)) {
|
|
|
checkStudentVisit(musicGroupId);
|
|
|
}
|
|
|
|
|
@@ -2784,9 +2769,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
/**
|
|
|
* 校验回访
|
|
|
+ *
|
|
|
* @param musicGroupId
|
|
|
*/
|
|
|
- private void checkStudentVisit(String musicGroupId){
|
|
|
+ private void checkStudentVisit(String musicGroupId) {
|
|
|
boolean hasNoVisit = false;
|
|
|
StringBuilder tipsMsg = new StringBuilder();
|
|
|
List<StudentRegistration> noPaymentStudents = studentRegistrationDao.getNoPaymentStudent(musicGroupId);
|