|
@@ -20,7 +20,6 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
-import com.ym.mec.biz.service.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -99,6 +98,23 @@ import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
|
|
|
import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
|
|
|
+import com.ym.mec.biz.service.ClassGroupService;
|
|
|
+import com.ym.mec.biz.service.ClassGroupStudentMapperService;
|
|
|
+import com.ym.mec.biz.service.ContractService;
|
|
|
+import com.ym.mec.biz.service.CourseScheduleService;
|
|
|
+import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
|
|
|
+import com.ym.mec.biz.service.ImGroupMemberService;
|
|
|
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
|
|
|
+import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
|
|
|
+import com.ym.mec.biz.service.SellOrderService;
|
|
|
+import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
|
|
|
+import com.ym.mec.biz.service.StudentPaymentOrderService;
|
|
|
+import com.ym.mec.biz.service.StudentRegistrationService;
|
|
|
+import com.ym.mec.biz.service.SubjectService;
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
|
+import com.ym.mec.biz.service.SysMessageService;
|
|
|
+import com.ym.mec.biz.service.SysUserCashAccountDetailService;
|
|
|
+import com.ym.mec.biz.service.SysUserCashAccountService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.entity.ImResult;
|
|
|
import com.ym.mec.common.entity.ImUserModel;
|
|
@@ -186,8 +202,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
private StudentCourseFeeDetailDao studentCourseFeeDetailDao;
|
|
|
@Autowired
|
|
|
private CourseScheduleDao courseScheduleDao;
|
|
|
- @Autowired
|
|
|
- private ImUserFriendService imUserFriendService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, StudentRegistration> getDAO() {
|
|
@@ -648,6 +662,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
if (studentRegistration == null) {
|
|
|
throw new BizException("参数校验失败");
|
|
|
}
|
|
|
+ /*if(studentAddDto.getSignClassId() == null && studentAddDto.getMixClassId() == null){
|
|
|
+ throw new BizException("参数校验失败: 单技班或合奏班必填一项");
|
|
|
+ }*/
|
|
|
Date date = new Date();
|
|
|
String musicGroupId = studentRegistration.getMusicGroupId();
|
|
|
|
|
@@ -677,6 +694,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentDao.insert(new Student(userId, studentRegistration.getSubjectId().toString()));
|
|
|
//添加用户现金账户
|
|
|
sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
|
|
|
+ //添加用户电子签章账户
|
|
|
+// contractService.register(userId, sysUser.getRealName(), sysUser.getIdCardNo(), sysUser.getPhone());
|
|
|
ImResult register = imFeignService.register(new ImUserModel(userId.toString(), sysUser.getUsername(), null));
|
|
|
sysUser.setImToken(register.getToken());
|
|
|
teacherDao.updateUser(sysUser);
|
|
@@ -737,7 +756,44 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
|
|
|
null, studentAddDto.getTemporaryCourseFee(), null);
|
|
|
|
|
|
+ /*if (musicGroup.getFeeType() != null && musicGroup.getFeeType() != MusicGroupPaymentCalender.FeeType.OFFLINE && musicGroupStudentFee.getTemporaryCourseFee().doubleValue() * 100 == 0) {
|
|
|
+ musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
|
|
|
+ }*/
|
|
|
musicGroupStudentFeeDao.insert(musicGroupStudentFee);
|
|
|
+
|
|
|
+ StudentPaymentOrder waitPayOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, studentRegistration.getMusicGroupId(), DealStatusEnum.WAIT_PAY);
|
|
|
+
|
|
|
+ if (waitPayOrder != null) {
|
|
|
+ waitPayOrder.setStatus(DealStatusEnum.CLOSE);
|
|
|
+ studentPaymentOrderService.update(waitPayOrder);
|
|
|
+ }
|
|
|
+ //生成订单
|
|
|
+ StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
|
|
|
+ studentPaymentOrder.setUserId(userId);
|
|
|
+ studentPaymentOrder.setGroupType(GroupType.MUSIC);
|
|
|
+ studentPaymentOrder.setType(OrderTypeEnum.APPLY);
|
|
|
+ studentPaymentOrder.setStatus(DealStatusEnum.WAIT_PAY);
|
|
|
+ studentPaymentOrder.setMusicGroupId(musicGroupId);
|
|
|
+ studentPaymentOrder.setClassGroupId(studentAddDto.getSignClassId());
|
|
|
+ studentPaymentOrder.setOrganId(musicGroup.getOrganId());
|
|
|
+ studentPaymentOrder.setRoutingOrganId(musicGroup.getOrganId());
|
|
|
+
|
|
|
+ //生成订单明细
|
|
|
+ List<StudentPaymentOrderDetail> studentPaymentOrderDetails = studentAddDto.getStudentPaymentOrderDetails();
|
|
|
+ if (studentPaymentOrderDetails == null) {
|
|
|
+ studentPaymentOrderDetails = new ArrayList<>();
|
|
|
+ }
|
|
|
+ //汇总金额
|
|
|
+
|
|
|
+ BigDecimal reduce = studentPaymentOrderDetails.stream().map(StudentPaymentOrderDetail::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ if (reduce.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
+ studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
|
|
|
+ studentPaymentOrder.setActualAmount(reduce);
|
|
|
+ studentPaymentOrder.setPayTime(date);
|
|
|
+ }
|
|
|
+ studentPaymentOrder.setExpectAmount(reduce);
|
|
|
+ studentPaymentOrderService.insert(studentPaymentOrder);
|
|
|
+
|
|
|
//当前学员是否以前存在过当前乐团
|
|
|
if (phoneAndMusicGroupId != null) {
|
|
|
studentRegistration.setId(phoneAndMusicGroupId.getId());
|
|
@@ -746,6 +802,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentRegistrationDao.insertBasic(studentRegistration);
|
|
|
}
|
|
|
studentRegistrationDao.updateCurrentClass(studentRegistration);
|
|
|
+
|
|
|
return userId;
|
|
|
}
|
|
|
}
|