|
@@ -28,7 +28,6 @@ import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
@@ -39,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -56,104 +56,103 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
@Resource
|
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentPaymentOrderService studentPaymentOrderService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseScheduleService courseScheduleService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private TeacherDao teacherDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ClassGroupService classGroupDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ClassGroupStudentMapperService classGroupStudentMapperDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysMessageService sysMessageService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SendSeoMessageSource sendSeoMessageSource;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SubjectDao subjectDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysUserCashAccountDao sysUserCashAccountDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentDao studentDao;
|
|
|
-
|
|
|
@Lazy
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ContractService contractService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ImFeignService imFeignService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ImGroupMemberService imGroupMemberService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SubjectService subjectService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysTenantConfigService sysTenantConfigService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupDao musicGroupDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysUserCashAccountDetailService sysUserCashAccountDetailService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysUserCashAccountService sysUserCashAccountService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SubjectChangeDao subjectChangeDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private GoodsDao goodsDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private GoodsService goodsService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentCourseFeeDetailDao studentCourseFeeDetailDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseScheduleDao courseScheduleDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private OrganizationDao organizationDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentService studentService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ImGroupDao imGroupDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentInstrumentDao studentInstrumentDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupPaymentCalenderStudentDetailDao musicGroupPaymentCalenderStudentDetailDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CloudTeacherOrderService cloudTeacherOrderService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysCouponCodeService sysCouponCodeService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysUserCashAccountLogService sysUserCashAccountLogService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupPaymentCalenderActivityService musicGroupPaymentCalenderActivityService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupPaymentCalenderMemberService musicGroupPaymentCalenderMemberService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupPaymentCalenderRepairService musicGroupPaymentCalenderRepairService;
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ImUserFriendService imUserFriendService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysUserService sysUserService;
|
|
|
|
|
|
@Override
|
|
@@ -367,14 +366,14 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailDao.findUserApplyOrder(studentId, musicGroupId,
|
|
|
DealStatusEnum.SUCCESS);
|
|
|
|
|
|
- if (studentPaymentOrderDetailList != null && studentPaymentOrderDetailList.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(studentPaymentOrderDetailList)) {
|
|
|
|
|
|
Map<Long, StudentPaymentOrderDetail> maintenanceMap = studentPaymentOrderDetailList.stream()
|
|
|
.filter(t -> (t.getType() == MAINTENANCE))
|
|
|
- .collect(Collectors.toMap(t -> t.getStudentInstrumentId(), StudentPaymentOrderDetail -> StudentPaymentOrderDetail));
|
|
|
+ .collect(Collectors.toMap(StudentPaymentOrderDetail::getStudentInstrumentId, StudentPaymentOrderDetail -> StudentPaymentOrderDetail));
|
|
|
|
|
|
List<Long> instrumentIdList = new ArrayList<Long>(maintenanceMap.keySet());
|
|
|
- if (instrumentIdList != null && instrumentIdList.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(instrumentIdList)) {
|
|
|
List<StudentInstrument> studentInstrumentList = studentInstrumentDao.queryById(instrumentIdList);
|
|
|
|
|
|
for (StudentInstrument si : studentInstrumentList) {
|
|
@@ -418,14 +417,14 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
public List<Map<String, Object>> getNoClassStuBySubjectId(String musicGroupId, String actualSubjectId) {
|
|
|
List<StudentRegistration> students = studentRegistrationDao.getNoClassStuBySubjectId(musicGroupId, actualSubjectId);
|
|
|
List<Map<String, Object>> mapArrayList = new ArrayList<>();
|
|
|
- if (students != null && students.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(students)) {
|
|
|
String[] subjectIds = actualSubjectId.split(",");
|
|
|
- if (subjectIds != null && subjectIds.length > 0) {
|
|
|
+ if (subjectIds.length > 0) {
|
|
|
List<Map<Integer, String>> subjectNames = subjectDao.queryNameByIds(actualSubjectId);
|
|
|
Map<Integer, String> subjectNameMap = MapUtil.convertMybatisMap(subjectNames);
|
|
|
- for (int i = 0; i < subjectIds.length; i++) {
|
|
|
+ for (String id : subjectIds) {
|
|
|
Map<String, Object> resultMap = new HashMap<>(3);
|
|
|
- int subjectId = Integer.parseInt(subjectIds[i]);
|
|
|
+ int subjectId = Integer.parseInt(id);
|
|
|
List<StudentRegistration> collect = students.stream().filter(e -> e.getActualSubjectId().equals(subjectId)).collect(Collectors.toList());
|
|
|
resultMap.put("subjectId", subjectId);
|
|
|
resultMap.put("subjectName", subjectNameMap.get(subjectId));
|
|
@@ -469,7 +468,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
sysUser.setPhone(studentRegistration.getParentsPhone());
|
|
|
sysUser.setOrganId(studentRegistration.getOrganId());
|
|
|
|
|
|
- Boolean updateNameFlag = false;
|
|
|
+ boolean updateNameFlag = false;
|
|
|
|
|
|
if (StringUtils.isEmpty(sysUser.getUsername())) {
|
|
|
sysUser.setUsername(studentRegistration.getName());
|
|
@@ -566,13 +565,13 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetail4goodsGroup.setRemitFee(BigDecimal.ZERO);
|
|
|
OrderDetailTypeEnum type = null;
|
|
|
if (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
|
|
|
- type = OrderDetailTypeEnum.MUSICAL;//todo 乐器
|
|
|
+ type = OrderDetailTypeEnum.MUSICAL;// 乐器
|
|
|
goodsGroup.setPrice(goodsGroup.getPrice().subtract(remitFee));
|
|
|
studentPaymentOrderDetail4goodsGroup.setRemitFee(remitFee);
|
|
|
} else if (goodsGroup.getType().equals(GoodsType.ACCESSORIES)) {
|
|
|
- type = OrderDetailTypeEnum.ACCESSORIES;//todo 辅件
|
|
|
+ type = OrderDetailTypeEnum.ACCESSORIES;// 辅件
|
|
|
} else if (goodsGroup.getType().equals(GoodsType.OTHER)) {
|
|
|
- type = OrderDetailTypeEnum.TEACHING;//todo 教谱
|
|
|
+ type = OrderDetailTypeEnum.TEACHING;// 教谱
|
|
|
}
|
|
|
studentPaymentOrderDetail4goodsGroup.setType(type);
|
|
|
|
|
@@ -621,7 +620,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //新的课程形态 todo 合奏课 单技课
|
|
|
+ //新的课程形态 合奏课 单技课
|
|
|
if (CollectionUtils.isNotEmpty(newCourses)) {
|
|
|
BigDecimal courseRemitFee = goodsDto.getCourseRemitFee();
|
|
|
for (MusicGroupPaymentCalenderCourseSettings newCourse : newCourses) {
|
|
@@ -655,7 +654,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //乐保 todo 乐保
|
|
|
+ //乐保 乐保
|
|
|
if (registerPayDto.getBuyMaintenance()) {
|
|
|
if (StringUtils.isEmpty(maintenanceGoodsId)) {
|
|
|
throw new BizException("有乐器才能购买乐保,请核查");
|
|
@@ -672,7 +671,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetailList.add(maintenanceOrderDetail);
|
|
|
}
|
|
|
|
|
|
- //活动 todo VIP 或 网管课
|
|
|
+ //活动 VIP 或 网管课
|
|
|
List<MusicGroupPaymentCalenderActivity> calenderActivities = null;
|
|
|
List<Long> buyCalenderActivityId = registerPayDto.getBuyCalenderActivityId();
|
|
|
if (CollectionUtils.isNotEmpty(buyCalenderActivityId)) {
|
|
@@ -700,7 +699,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
|
|
|
- //云教练/云教练+ todo 团练宝
|
|
|
+ //云教练/云教练+ 团练宝
|
|
|
if (buyCloudTeacher || (Objects.nonNull(calender) && calender.getPayUserType() == MusicGroupPaymentCalender.PayUserType.SCHOOL)) {
|
|
|
List<MusicGroupPaymentCalenderMember> calenderMembers = new ArrayList<>();
|
|
|
if(buyCloudTeacher){
|
|
@@ -827,7 +826,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
){
|
|
|
Date date = new Date();
|
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
|
|
|
- //新的课程形态 todo 合奏课 单技课
|
|
|
+ //新的课程形态 合奏课 单技课
|
|
|
if (CollectionUtils.isNotEmpty(newCourses)) {
|
|
|
for (MusicGroupPaymentCalenderCourseSettings newCourse : newCourses) {
|
|
|
StudentPaymentOrderDetail studentPaymentOrderDetailCourse = new StudentPaymentOrderDetail();
|
|
@@ -841,7 +840,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //乐保 todo 乐保
|
|
|
+ //乐保 乐保
|
|
|
if (Objects.nonNull(calenderRepair)) {
|
|
|
StudentPaymentOrderDetail maintenanceOrderDetail = new StudentPaymentOrderDetail();
|
|
|
maintenanceOrderDetail.setType(MAINTENANCE);
|
|
@@ -854,7 +853,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetailList.add(maintenanceOrderDetail);
|
|
|
}
|
|
|
|
|
|
- //活动 todo VIP 或 网管课
|
|
|
+ //活动 VIP 或 网管课
|
|
|
if(CollectionUtils.isNotEmpty(calenderActivities)){
|
|
|
for (MusicGroupPaymentCalenderActivity calenderActivity : calenderActivities) {
|
|
|
StudentPaymentOrderDetail maintenanceOrderDetail = new StudentPaymentOrderDetail();
|
|
@@ -874,7 +873,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //云教练/云教练+ todo 团练宝
|
|
|
+ //云教练/云教练+ 团练宝
|
|
|
if(CollectionUtils.isNotEmpty(calenderMembers)){
|
|
|
for (MusicGroupPaymentCalenderMember calenderMember : calenderMembers) {
|
|
|
StudentPaymentOrderDetail cloudTeacherOrderDetail = new StudentPaymentOrderDetail();
|
|
@@ -901,13 +900,12 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
* 计算使用优惠券后的每个明细均摊的金额
|
|
|
*
|
|
|
* @param couponParam 优惠券的信息
|
|
|
- * @param orderDetailGroupList 订单信息
|
|
|
*/
|
|
|
private void calculateCoupon(Map<String, CouponPayTypeInfo> couponParam,List<StudentPaymentOrderDetail> paymentOrderDetails) {
|
|
|
List<StudentPaymentOrderDetail> singleTypeList = new ArrayList<>();
|
|
|
List<StudentPaymentOrderDetail> allTypeList = new ArrayList<>();
|
|
|
paymentOrderDetails.forEach(e->e.setCouponDetailTypeEnum(CouponDetailTypeEnum.valueOf(CouponDetailTypeEnum.of(e.getType().getCode()))));
|
|
|
- Map<CouponDetailTypeEnum, List<StudentPaymentOrderDetail>> orderDetailGroupList = paymentOrderDetails.stream().collect(Collectors.groupingBy(e -> e.getCouponDetailTypeEnum()));
|
|
|
+ Map<CouponDetailTypeEnum, List<StudentPaymentOrderDetail>> orderDetailGroupList = paymentOrderDetails.stream().collect(Collectors.groupingBy(StudentPaymentOrderDetail::getCouponDetailTypeEnum));
|
|
|
//先处理”非全类型券“的数据
|
|
|
orderDetailGroupList.forEach((e, list) -> {
|
|
|
//根据OrderDetailTypeEnum类型找到对应的券类型,默认全类型
|
|
@@ -1116,9 +1114,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
public void insertStudent(String studentIds, String oldMusicGroupId, String newMusicGroupId,
|
|
|
Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect,String batchNo) {
|
|
|
//获取欠费学员列表
|
|
|
- List<Integer> studentIdList = Arrays.asList(studentIds.split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
|
+ List<Integer> studentIdList = Arrays.stream(studentIds.split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
|
|
|
List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(newMusicGroupId, studentIdList,batchNo);
|
|
|
- if (noPaymentUserIds.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(noPaymentUserIds)) {
|
|
|
throw new BizException("操作失败:有欠费的学员不允许创建缴费");
|
|
|
}
|
|
|
SysUser sysUser1 = sysUserFeignService.queryUserInfo();
|
|
@@ -1128,14 +1126,14 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
BigDecimal amount = BigDecimal.ZERO;
|
|
|
for (StudentRegistration studentRegistration : studentRegistrations) {
|
|
|
List<MusicGroupPaymentCalenderStudentDetail> details = collect.get(studentRegistration.getUserId());
|
|
|
- BigDecimal masterTotalPrice = details.stream().map(e -> e.getCutAmount()).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ BigDecimal masterTotalPrice = details.stream().map(MusicGroupPaymentCalenderStudentDetail::getCutAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
if (masterTotalPrice.doubleValue() > studentRegistration.getSurplusCourseFee().doubleValue()) {
|
|
|
throw new BizException("用户信息发生变动,请重新提交");
|
|
|
}
|
|
|
if (oldMusicGroupId.equals(newMusicGroupId)) {
|
|
|
continue;
|
|
|
}
|
|
|
- courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(oldMusicGroupId), null, GroupType.MUSIC);
|
|
|
+ courseScheduleStudentPaymentService.updateCourseActualPrice(Collections.singletonList(oldMusicGroupId), null, GroupType.MUSIC);
|
|
|
//记录课程余额消费日志
|
|
|
if (studentRegistration.getSurplusCourseFee().doubleValue() > 0d && masterTotalPrice.doubleValue() > 0d) {
|
|
|
StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
|
|
@@ -1200,7 +1198,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentCourseFeeDetails.add(studentCourseFeeDetail);
|
|
|
}
|
|
|
}
|
|
|
- if (studentCourseFeeDetails.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(studentCourseFeeDetails)) {
|
|
|
studentCourseFeeDetailDao.batchInsert(studentCourseFeeDetails);
|
|
|
}
|
|
|
}
|
|
@@ -1227,7 +1225,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
// classGroupDao.updateClassStudentNum(classGroupId.longValue(), 1);
|
|
|
//3、学生加入新班级未开始课程
|
|
|
List<CourseSchedule> noStartCoursesByClassGroupId = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
|
|
|
- if (noStartCoursesByClassGroupId != null && noStartCoursesByClassGroupId.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(noStartCoursesByClassGroupId)) {
|
|
|
courseScheduleList.addAll(noStartCoursesByClassGroupId);
|
|
|
}
|
|
|
return courseScheduleList;
|
|
@@ -1253,8 +1251,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
String snapClassIds = studentAddDto.getSnapClassIds();
|
|
|
if (StringUtils.isNotEmpty(snapClassIds)) {
|
|
|
String[] split = snapClassIds.split(",");
|
|
|
- for (int i = 0; i < split.length; i++) {
|
|
|
- addStudent(Integer.parseInt(split[i]), userId, nowDate, courseScheduleList);
|
|
|
+ for (String s : split) {
|
|
|
+ addStudent(Integer.parseInt(s), userId, nowDate, courseScheduleList);
|
|
|
}
|
|
|
}
|
|
|
List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
|
|
@@ -1271,7 +1269,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
courseScheduleStudentPayments.add(courseScheduleStudentPayment);
|
|
|
}
|
|
|
|
|
|
- if (courseScheduleStudentPayments.size() == 0) {
|
|
|
+ if (CollectionUtils.isEmpty(courseScheduleStudentPayments)) {
|
|
|
return;
|
|
|
}
|
|
|
courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
|
|
@@ -1728,7 +1726,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
public BigDecimal updateUserSurplusCourseFee(Integer userId, String musicGroupId, BigDecimal amount, String memo, Integer operatorId) {
|
|
|
StudentRegistration studentRegistration = studentRegistrationDao.lockWithUserAndMusic(userId, musicGroupId);
|
|
|
if (Objects.isNull(studentRegistration)) {
|
|
|
- LOGGER.error("学员{}-{}可用排课余额更新失败:学员注册信息不存在", amount);
|
|
|
+ LOGGER.error("学员{}-{}可用排课余额更新失败:学员注册信息不存在", userId, musicGroupId);
|
|
|
return BigDecimal.ZERO;
|
|
|
}
|
|
|
|
|
@@ -1806,7 +1804,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
@Override
|
|
|
public List<StudentRegistration> getMusicGroupStuReBack(String musicGroupId) {
|
|
|
- courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(musicGroupId), null, GroupType.MUSIC);
|
|
|
+ courseScheduleStudentPaymentService.updateCourseActualPrice(Collections.singletonList(musicGroupId), null, GroupType.MUSIC);
|
|
|
return this.findMusicGroupStudent(musicGroupId, null);
|
|
|
}
|
|
|
|
|
@@ -1922,7 +1920,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
if(totalPayNum == 0){
|
|
|
pageInfo.setPayScale(new BigDecimal(0));
|
|
|
}else {
|
|
|
- pageInfo.setPayScale(new BigDecimal(firstPayNum).multiply(new BigDecimal(100)).divide(new BigDecimal(totalPayNum), 2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ pageInfo.setPayScale(new BigDecimal(firstPayNum).multiply(new BigDecimal(100)).divide(new BigDecimal(totalPayNum), 2, RoundingMode.HALF_UP));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2004,7 +2002,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
List<StudentPaymentOrder> updateList = new ArrayList<StudentPaymentOrder>();
|
|
|
|
|
|
- if (studentPaymentOrderList != null && studentPaymentOrderList.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(studentPaymentOrderList)) {
|
|
|
for (StudentPaymentOrder studentPaymentOrder : studentPaymentOrderList) {
|
|
|
if (StringUtils.equals("205", studentPaymentOrder.getPaymentAccountNo())) {
|
|
|
studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
|
|
@@ -2015,7 +2013,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (updateList.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(updateList)) {
|
|
|
studentPaymentOrderService.batchUpdate(updateList);
|
|
|
}
|
|
|
|
|
@@ -2051,7 +2049,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
List<StudentPaymentOrder> updateList = new ArrayList<StudentPaymentOrder>();
|
|
|
|
|
|
- if (studentPaymentOrderList != null && studentPaymentOrderList.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(studentPaymentOrderList)) {
|
|
|
for (StudentPaymentOrder studentPaymentOrder : studentPaymentOrderList) {
|
|
|
if (StringUtils.equals("205", studentPaymentOrder.getPaymentAccountNo())) {
|
|
|
studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
|
|
@@ -2062,7 +2060,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (updateList.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(updateList)) {
|
|
|
studentPaymentOrderService.batchUpdate(updateList);
|
|
|
}
|
|
|
|