|
@@ -28,6 +28,7 @@ import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
@@ -35,10 +36,8 @@ import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.math.RoundingMode;
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -54,105 +53,106 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(StudentRegistrationServiceImpl.class);
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(StudentRegistrationServiceImpl.class);
|
|
|
|
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private StudentPaymentOrderService studentPaymentOrderService;
|
|
private StudentPaymentOrderService studentPaymentOrderService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
|
|
private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
|
|
private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private CourseScheduleService courseScheduleService;
|
|
private CourseScheduleService courseScheduleService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private TeacherDao teacherDao;
|
|
private TeacherDao teacherDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private ClassGroupService classGroupDao;
|
|
private ClassGroupService classGroupDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
|
|
private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private ClassGroupStudentMapperService classGroupStudentMapperDao;
|
|
private ClassGroupStudentMapperService classGroupStudentMapperDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SysMessageService sysMessageService;
|
|
private SysMessageService sysMessageService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SendSeoMessageSource sendSeoMessageSource;
|
|
private SendSeoMessageSource sendSeoMessageSource;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
|
|
private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SubjectDao subjectDao;
|
|
private SubjectDao subjectDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SysUserCashAccountDao sysUserCashAccountDao;
|
|
private SysUserCashAccountDao sysUserCashAccountDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private StudentDao studentDao;
|
|
private StudentDao studentDao;
|
|
|
|
+
|
|
@Lazy
|
|
@Lazy
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private ContractService contractService;
|
|
private ContractService contractService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private ImFeignService imFeignService;
|
|
private ImFeignService imFeignService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private ImGroupMemberService imGroupMemberService;
|
|
private ImGroupMemberService imGroupMemberService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
|
|
private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
|
|
private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SubjectService subjectService;
|
|
private SubjectService subjectService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SysConfigDao sysConfigDao;
|
|
private SysConfigDao sysConfigDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SysTenantConfigService sysTenantConfigService;
|
|
private SysTenantConfigService sysTenantConfigService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupDao musicGroupDao;
|
|
private MusicGroupDao musicGroupDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SysUserCashAccountDetailService sysUserCashAccountDetailService;
|
|
private SysUserCashAccountDetailService sysUserCashAccountDetailService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SysUserCashAccountService sysUserCashAccountService;
|
|
private SysUserCashAccountService sysUserCashAccountService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SysUserFeignService sysUserFeignService;
|
|
private SysUserFeignService sysUserFeignService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
|
|
private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SubjectChangeDao subjectChangeDao;
|
|
private SubjectChangeDao subjectChangeDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private GoodsDao goodsDao;
|
|
private GoodsDao goodsDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private GoodsService goodsService;
|
|
private GoodsService goodsService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
|
|
private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
|
|
private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private StudentCourseFeeDetailDao studentCourseFeeDetailDao;
|
|
private StudentCourseFeeDetailDao studentCourseFeeDetailDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private CourseScheduleDao courseScheduleDao;
|
|
private CourseScheduleDao courseScheduleDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private OrganizationDao organizationDao;
|
|
private OrganizationDao organizationDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private StudentService studentService;
|
|
private StudentService studentService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private ImGroupDao imGroupDao;
|
|
private ImGroupDao imGroupDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private StudentInstrumentDao studentInstrumentDao;
|
|
private StudentInstrumentDao studentInstrumentDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupPaymentCalenderStudentDetailDao musicGroupPaymentCalenderStudentDetailDao;
|
|
private MusicGroupPaymentCalenderStudentDetailDao musicGroupPaymentCalenderStudentDetailDao;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private CloudTeacherOrderService cloudTeacherOrderService;
|
|
private CloudTeacherOrderService cloudTeacherOrderService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SysCouponCodeService sysCouponCodeService;
|
|
private SysCouponCodeService sysCouponCodeService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SysUserCashAccountLogService sysUserCashAccountLogService;
|
|
private SysUserCashAccountLogService sysUserCashAccountLogService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupPaymentCalenderActivityService musicGroupPaymentCalenderActivityService;
|
|
private MusicGroupPaymentCalenderActivityService musicGroupPaymentCalenderActivityService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupPaymentCalenderMemberService musicGroupPaymentCalenderMemberService;
|
|
private MusicGroupPaymentCalenderMemberService musicGroupPaymentCalenderMemberService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private MusicGroupPaymentCalenderRepairService musicGroupPaymentCalenderRepairService;
|
|
private MusicGroupPaymentCalenderRepairService musicGroupPaymentCalenderRepairService;
|
|
|
|
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private ImUserFriendService imUserFriendService;
|
|
private ImUserFriendService imUserFriendService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private SysUserService sysUserService;
|
|
private SysUserService sysUserService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -234,18 +234,18 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
if (studentRegistration == null) {
|
|
if (studentRegistration == null) {
|
|
throw new BizException("学员信息不存在");
|
|
throw new BizException("学员信息不存在");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
Student student = studentService.get(userId);
|
|
Student student = studentService.get(userId);
|
|
if(student == null){
|
|
if(student == null){
|
|
throw new BizException("用户[{}]信息获取失败", userId);
|
|
throw new BizException("用户[{}]信息获取失败", userId);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if(!StringUtils.equals(student.getSubjectIdList(), subId+"")){
|
|
if(!StringUtils.equals(student.getSubjectIdList(), subId+"")){
|
|
student.setSubjectIdList(subId + "");
|
|
student.setSubjectIdList(subId + "");
|
|
student.setUpdateTime(new Date());
|
|
student.setUpdateTime(new Date());
|
|
studentService.update(student);
|
|
studentService.update(student);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
//批量调剂(未缴费学员)
|
|
//批量调剂(未缴费学员)
|
|
int i = studentRegistrationDao.batchUpdateSubject(userId, subId, musicGroupId);
|
|
int i = studentRegistrationDao.batchUpdateSubject(userId, subId, musicGroupId);
|
|
if (i > 0) {
|
|
if (i > 0) {
|
|
@@ -366,14 +366,14 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailDao.findUserApplyOrder(studentId, musicGroupId,
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailDao.findUserApplyOrder(studentId, musicGroupId,
|
|
DealStatusEnum.SUCCESS);
|
|
DealStatusEnum.SUCCESS);
|
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(studentPaymentOrderDetailList)) {
|
|
|
|
|
|
+ if (studentPaymentOrderDetailList != null && studentPaymentOrderDetailList.size() > 0) {
|
|
|
|
|
|
Map<Long, StudentPaymentOrderDetail> maintenanceMap = studentPaymentOrderDetailList.stream()
|
|
Map<Long, StudentPaymentOrderDetail> maintenanceMap = studentPaymentOrderDetailList.stream()
|
|
.filter(t -> (t.getType() == MAINTENANCE))
|
|
.filter(t -> (t.getType() == MAINTENANCE))
|
|
- .collect(Collectors.toMap(StudentPaymentOrderDetail::getStudentInstrumentId, StudentPaymentOrderDetail -> StudentPaymentOrderDetail));
|
|
|
|
|
|
+ .collect(Collectors.toMap(t -> t.getStudentInstrumentId(), StudentPaymentOrderDetail -> StudentPaymentOrderDetail));
|
|
|
|
|
|
List<Long> instrumentIdList = new ArrayList<Long>(maintenanceMap.keySet());
|
|
List<Long> instrumentIdList = new ArrayList<Long>(maintenanceMap.keySet());
|
|
- if (CollectionUtils.isNotEmpty(instrumentIdList)) {
|
|
|
|
|
|
+ if (instrumentIdList != null && instrumentIdList.size() > 0) {
|
|
List<StudentInstrument> studentInstrumentList = studentInstrumentDao.queryById(instrumentIdList);
|
|
List<StudentInstrument> studentInstrumentList = studentInstrumentDao.queryById(instrumentIdList);
|
|
|
|
|
|
for (StudentInstrument si : studentInstrumentList) {
|
|
for (StudentInstrument si : studentInstrumentList) {
|
|
@@ -417,14 +417,14 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
public List<Map<String, Object>> getNoClassStuBySubjectId(String musicGroupId, String actualSubjectId) {
|
|
public List<Map<String, Object>> getNoClassStuBySubjectId(String musicGroupId, String actualSubjectId) {
|
|
List<StudentRegistration> students = studentRegistrationDao.getNoClassStuBySubjectId(musicGroupId, actualSubjectId);
|
|
List<StudentRegistration> students = studentRegistrationDao.getNoClassStuBySubjectId(musicGroupId, actualSubjectId);
|
|
List<Map<String, Object>> mapArrayList = new ArrayList<>();
|
|
List<Map<String, Object>> mapArrayList = new ArrayList<>();
|
|
- if (CollectionUtils.isNotEmpty(students)) {
|
|
|
|
|
|
+ if (students != null && students.size() > 0) {
|
|
String[] subjectIds = actualSubjectId.split(",");
|
|
String[] subjectIds = actualSubjectId.split(",");
|
|
- if (subjectIds.length > 0) {
|
|
|
|
|
|
+ if (subjectIds != null && subjectIds.length > 0) {
|
|
List<Map<Integer, String>> subjectNames = subjectDao.queryNameByIds(actualSubjectId);
|
|
List<Map<Integer, String>> subjectNames = subjectDao.queryNameByIds(actualSubjectId);
|
|
Map<Integer, String> subjectNameMap = MapUtil.convertMybatisMap(subjectNames);
|
|
Map<Integer, String> subjectNameMap = MapUtil.convertMybatisMap(subjectNames);
|
|
- for (String id : subjectIds) {
|
|
|
|
|
|
+ for (int i = 0; i < subjectIds.length; i++) {
|
|
Map<String, Object> resultMap = new HashMap<>(3);
|
|
Map<String, Object> resultMap = new HashMap<>(3);
|
|
- int subjectId = Integer.parseInt(id);
|
|
|
|
|
|
+ int subjectId = Integer.parseInt(subjectIds[i]);
|
|
List<StudentRegistration> collect = students.stream().filter(e -> e.getActualSubjectId().equals(subjectId)).collect(Collectors.toList());
|
|
List<StudentRegistration> collect = students.stream().filter(e -> e.getActualSubjectId().equals(subjectId)).collect(Collectors.toList());
|
|
resultMap.put("subjectId", subjectId);
|
|
resultMap.put("subjectId", subjectId);
|
|
resultMap.put("subjectName", subjectNameMap.get(subjectId));
|
|
resultMap.put("subjectName", subjectNameMap.get(subjectId));
|
|
@@ -468,7 +468,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
sysUser.setPhone(studentRegistration.getParentsPhone());
|
|
sysUser.setPhone(studentRegistration.getParentsPhone());
|
|
sysUser.setOrganId(studentRegistration.getOrganId());
|
|
sysUser.setOrganId(studentRegistration.getOrganId());
|
|
|
|
|
|
- boolean updateNameFlag = false;
|
|
|
|
|
|
+ Boolean updateNameFlag = false;
|
|
|
|
|
|
if (StringUtils.isEmpty(sysUser.getUsername())) {
|
|
if (StringUtils.isEmpty(sysUser.getUsername())) {
|
|
sysUser.setUsername(studentRegistration.getName());
|
|
sysUser.setUsername(studentRegistration.getName());
|
|
@@ -538,16 +538,16 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
MusicGroupApplyGoodsDto goodsDto,
|
|
MusicGroupApplyGoodsDto goodsDto,
|
|
RegisterPayDto registerPayDto,
|
|
RegisterPayDto registerPayDto,
|
|
CouponPayParam couponPayParam) throws Exception {
|
|
CouponPayParam couponPayParam) throws Exception {
|
|
-
|
|
|
|
|
|
+
|
|
MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
-
|
|
|
|
|
|
+
|
|
if(musicGroup == null){
|
|
if(musicGroup == null){
|
|
throw new BizException("乐团[{}]信息查询失败", studentRegistration.getMusicGroupId());
|
|
throw new BizException("乐团[{}]信息查询失败", studentRegistration.getMusicGroupId());
|
|
}
|
|
}
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(studentPaymentOrder.getCalenderId());
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(studentPaymentOrder.getCalenderId());
|
|
|
|
|
|
boolean isGiveAccessories = musicGroup.getIsGiveAccessories() != null && musicGroup.getIsGiveAccessories();
|
|
boolean isGiveAccessories = musicGroup.getIsGiveAccessories() != null && musicGroup.getIsGiveAccessories();
|
|
-
|
|
|
|
|
|
+
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
|
|
//乐器及打包辅件
|
|
//乐器及打包辅件
|
|
@@ -557,26 +557,26 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
BigDecimal remitFee = goodsDto.getRemitFee();
|
|
BigDecimal remitFee = goodsDto.getRemitFee();
|
|
Boolean buyCloudTeacher = CollectionUtils.isNotEmpty(registerPayDto.getBuyCalenderMemberId());
|
|
Boolean buyCloudTeacher = CollectionUtils.isNotEmpty(registerPayDto.getBuyCalenderMemberId());
|
|
if (CollectionUtils.isNotEmpty(goodsGroups)) {
|
|
if (CollectionUtils.isNotEmpty(goodsGroups)) {
|
|
-
|
|
|
|
|
|
+
|
|
BigDecimal organShareProfit = BigDecimal.ZERO;
|
|
BigDecimal organShareProfit = BigDecimal.ZERO;
|
|
-
|
|
|
|
|
|
+
|
|
for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
|
|
for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
|
|
StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
|
|
StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
|
|
studentPaymentOrderDetail4goodsGroup.setRemitFee(BigDecimal.ZERO);
|
|
studentPaymentOrderDetail4goodsGroup.setRemitFee(BigDecimal.ZERO);
|
|
OrderDetailTypeEnum type = null;
|
|
OrderDetailTypeEnum type = null;
|
|
if (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
|
|
if (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
|
|
- type = OrderDetailTypeEnum.MUSICAL;// 乐器
|
|
|
|
|
|
+ type = OrderDetailTypeEnum.MUSICAL;//todo 乐器
|
|
goodsGroup.setPrice(goodsGroup.getPrice().subtract(remitFee));
|
|
goodsGroup.setPrice(goodsGroup.getPrice().subtract(remitFee));
|
|
studentPaymentOrderDetail4goodsGroup.setRemitFee(remitFee);
|
|
studentPaymentOrderDetail4goodsGroup.setRemitFee(remitFee);
|
|
} else if (goodsGroup.getType().equals(GoodsType.ACCESSORIES)) {
|
|
} else if (goodsGroup.getType().equals(GoodsType.ACCESSORIES)) {
|
|
- type = OrderDetailTypeEnum.ACCESSORIES;// 辅件
|
|
|
|
|
|
+ type = OrderDetailTypeEnum.ACCESSORIES;//todo 辅件
|
|
} else if (goodsGroup.getType().equals(GoodsType.OTHER)) {
|
|
} else if (goodsGroup.getType().equals(GoodsType.OTHER)) {
|
|
- type = OrderDetailTypeEnum.TEACHING;// 教谱
|
|
|
|
|
|
+ type = OrderDetailTypeEnum.TEACHING;//todo 教谱
|
|
}
|
|
}
|
|
studentPaymentOrderDetail4goodsGroup.setType(type);
|
|
studentPaymentOrderDetail4goodsGroup.setType(type);
|
|
|
|
|
|
BigDecimal goodsPrice = new BigDecimal(0);
|
|
BigDecimal goodsPrice = new BigDecimal(0);
|
|
-
|
|
|
|
|
|
+
|
|
if (!(type == OrderDetailTypeEnum.ACCESSORIES && (isGiveAccessories && buyCloudTeacher))) {
|
|
if (!(type == OrderDetailTypeEnum.ACCESSORIES && (isGiveAccessories && buyCloudTeacher))) {
|
|
|
|
|
|
if (studentRegistration.getOrganId() == 55 && musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE && !buyCloudTeacher) {
|
|
if (studentRegistration.getOrganId() == 55 && musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE && !buyCloudTeacher) {
|
|
@@ -601,7 +601,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
if (OrderDetailTypeEnum.MUSICAL.equals(type)) {
|
|
if (OrderDetailTypeEnum.MUSICAL.equals(type)) {
|
|
maintenanceGoodsId = goodsGroup.getGoodsIdList();
|
|
maintenanceGoodsId = goodsGroup.getGoodsIdList();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if(goodsGroup.getOrganShareProfit() != null && goodsGroup.getKitGroupPurchaseType() == KitGroupPurchaseTypeEnum.GROUP){
|
|
if(goodsGroup.getOrganShareProfit() != null && goodsGroup.getKitGroupPurchaseType() == KitGroupPurchaseTypeEnum.GROUP){
|
|
organShareProfit = organShareProfit.add(goodsGroup.getOrganShareProfit());
|
|
organShareProfit = organShareProfit.add(goodsGroup.getOrganShareProfit());
|
|
}
|
|
}
|
|
@@ -620,7 +620,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //新的课程形态 合奏课 单技课
|
|
|
|
|
|
+ //新的课程形态 todo 合奏课 单技课
|
|
if (CollectionUtils.isNotEmpty(newCourses)) {
|
|
if (CollectionUtils.isNotEmpty(newCourses)) {
|
|
BigDecimal courseRemitFee = goodsDto.getCourseRemitFee();
|
|
BigDecimal courseRemitFee = goodsDto.getCourseRemitFee();
|
|
for (MusicGroupPaymentCalenderCourseSettings newCourse : newCourses) {
|
|
for (MusicGroupPaymentCalenderCourseSettings newCourse : newCourses) {
|
|
@@ -654,7 +654,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //乐保 乐保
|
|
|
|
|
|
+ //乐保 todo 乐保
|
|
if (registerPayDto.getBuyMaintenance()) {
|
|
if (registerPayDto.getBuyMaintenance()) {
|
|
if (StringUtils.isEmpty(maintenanceGoodsId)) {
|
|
if (StringUtils.isEmpty(maintenanceGoodsId)) {
|
|
throw new BizException("有乐器才能购买乐保,请核查");
|
|
throw new BizException("有乐器才能购买乐保,请核查");
|
|
@@ -671,7 +671,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
studentPaymentOrderDetailList.add(maintenanceOrderDetail);
|
|
studentPaymentOrderDetailList.add(maintenanceOrderDetail);
|
|
}
|
|
}
|
|
|
|
|
|
- //活动 VIP 或 网管课
|
|
|
|
|
|
+ //活动 todo VIP 或 网管课
|
|
List<MusicGroupPaymentCalenderActivity> calenderActivities = null;
|
|
List<MusicGroupPaymentCalenderActivity> calenderActivities = null;
|
|
List<Long> buyCalenderActivityId = registerPayDto.getBuyCalenderActivityId();
|
|
List<Long> buyCalenderActivityId = registerPayDto.getBuyCalenderActivityId();
|
|
if (CollectionUtils.isNotEmpty(buyCalenderActivityId)) {
|
|
if (CollectionUtils.isNotEmpty(buyCalenderActivityId)) {
|
|
@@ -699,7 +699,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- //云教练/云教练+ 团练宝
|
|
|
|
|
|
+ //云教练/云教练+ todo 团练宝
|
|
if (buyCloudTeacher || (Objects.nonNull(calender) && calender.getPayUserType() == MusicGroupPaymentCalender.PayUserType.SCHOOL)) {
|
|
if (buyCloudTeacher || (Objects.nonNull(calender) && calender.getPayUserType() == MusicGroupPaymentCalender.PayUserType.SCHOOL)) {
|
|
List<MusicGroupPaymentCalenderMember> calenderMembers = new ArrayList<>();
|
|
List<MusicGroupPaymentCalenderMember> calenderMembers = new ArrayList<>();
|
|
if(buyCloudTeacher){
|
|
if(buyCloudTeacher){
|
|
@@ -826,7 +826,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
){
|
|
){
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
|
|
- //新的课程形态 合奏课 单技课
|
|
|
|
|
|
+ //新的课程形态 todo 合奏课 单技课
|
|
if (CollectionUtils.isNotEmpty(newCourses)) {
|
|
if (CollectionUtils.isNotEmpty(newCourses)) {
|
|
for (MusicGroupPaymentCalenderCourseSettings newCourse : newCourses) {
|
|
for (MusicGroupPaymentCalenderCourseSettings newCourse : newCourses) {
|
|
StudentPaymentOrderDetail studentPaymentOrderDetailCourse = new StudentPaymentOrderDetail();
|
|
StudentPaymentOrderDetail studentPaymentOrderDetailCourse = new StudentPaymentOrderDetail();
|
|
@@ -840,7 +840,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //乐保 乐保
|
|
|
|
|
|
+ //乐保 todo 乐保
|
|
if (Objects.nonNull(calenderRepair)) {
|
|
if (Objects.nonNull(calenderRepair)) {
|
|
StudentPaymentOrderDetail maintenanceOrderDetail = new StudentPaymentOrderDetail();
|
|
StudentPaymentOrderDetail maintenanceOrderDetail = new StudentPaymentOrderDetail();
|
|
maintenanceOrderDetail.setType(MAINTENANCE);
|
|
maintenanceOrderDetail.setType(MAINTENANCE);
|
|
@@ -853,7 +853,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
studentPaymentOrderDetailList.add(maintenanceOrderDetail);
|
|
studentPaymentOrderDetailList.add(maintenanceOrderDetail);
|
|
}
|
|
}
|
|
|
|
|
|
- //活动 VIP 或 网管课
|
|
|
|
|
|
+ //活动 todo VIP 或 网管课
|
|
if(CollectionUtils.isNotEmpty(calenderActivities)){
|
|
if(CollectionUtils.isNotEmpty(calenderActivities)){
|
|
for (MusicGroupPaymentCalenderActivity calenderActivity : calenderActivities) {
|
|
for (MusicGroupPaymentCalenderActivity calenderActivity : calenderActivities) {
|
|
StudentPaymentOrderDetail maintenanceOrderDetail = new StudentPaymentOrderDetail();
|
|
StudentPaymentOrderDetail maintenanceOrderDetail = new StudentPaymentOrderDetail();
|
|
@@ -873,7 +873,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //云教练/云教练+ 团练宝
|
|
|
|
|
|
+ //云教练/云教练+ todo 团练宝
|
|
if(CollectionUtils.isNotEmpty(calenderMembers)){
|
|
if(CollectionUtils.isNotEmpty(calenderMembers)){
|
|
for (MusicGroupPaymentCalenderMember calenderMember : calenderMembers) {
|
|
for (MusicGroupPaymentCalenderMember calenderMember : calenderMembers) {
|
|
StudentPaymentOrderDetail cloudTeacherOrderDetail = new StudentPaymentOrderDetail();
|
|
StudentPaymentOrderDetail cloudTeacherOrderDetail = new StudentPaymentOrderDetail();
|
|
@@ -900,12 +900,13 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
* 计算使用优惠券后的每个明细均摊的金额
|
|
* 计算使用优惠券后的每个明细均摊的金额
|
|
*
|
|
*
|
|
* @param couponParam 优惠券的信息
|
|
* @param couponParam 优惠券的信息
|
|
|
|
+ * @param orderDetailGroupList 订单信息
|
|
*/
|
|
*/
|
|
private void calculateCoupon(Map<String, CouponPayTypeInfo> couponParam,List<StudentPaymentOrderDetail> paymentOrderDetails) {
|
|
private void calculateCoupon(Map<String, CouponPayTypeInfo> couponParam,List<StudentPaymentOrderDetail> paymentOrderDetails) {
|
|
List<StudentPaymentOrderDetail> singleTypeList = new ArrayList<>();
|
|
List<StudentPaymentOrderDetail> singleTypeList = new ArrayList<>();
|
|
List<StudentPaymentOrderDetail> allTypeList = new ArrayList<>();
|
|
List<StudentPaymentOrderDetail> allTypeList = new ArrayList<>();
|
|
paymentOrderDetails.forEach(e->e.setCouponDetailTypeEnum(CouponDetailTypeEnum.valueOf(CouponDetailTypeEnum.of(e.getType().getCode()))));
|
|
paymentOrderDetails.forEach(e->e.setCouponDetailTypeEnum(CouponDetailTypeEnum.valueOf(CouponDetailTypeEnum.of(e.getType().getCode()))));
|
|
- Map<CouponDetailTypeEnum, List<StudentPaymentOrderDetail>> orderDetailGroupList = paymentOrderDetails.stream().collect(Collectors.groupingBy(StudentPaymentOrderDetail::getCouponDetailTypeEnum));
|
|
|
|
|
|
+ Map<CouponDetailTypeEnum, List<StudentPaymentOrderDetail>> orderDetailGroupList = paymentOrderDetails.stream().collect(Collectors.groupingBy(e -> e.getCouponDetailTypeEnum()));
|
|
//先处理”非全类型券“的数据
|
|
//先处理”非全类型券“的数据
|
|
orderDetailGroupList.forEach((e, list) -> {
|
|
orderDetailGroupList.forEach((e, list) -> {
|
|
//根据OrderDetailTypeEnum类型找到对应的券类型,默认全类型
|
|
//根据OrderDetailTypeEnum类型找到对应的券类型,默认全类型
|
|
@@ -1114,9 +1115,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
public void insertStudent(String studentIds, String oldMusicGroupId, String newMusicGroupId,
|
|
public void insertStudent(String studentIds, String oldMusicGroupId, String newMusicGroupId,
|
|
Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect,String batchNo) {
|
|
Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect,String batchNo) {
|
|
//获取欠费学员列表
|
|
//获取欠费学员列表
|
|
- List<Integer> studentIdList = Arrays.stream(studentIds.split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> studentIdList = Arrays.asList(studentIds.split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(newMusicGroupId, studentIdList,batchNo);
|
|
List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(newMusicGroupId, studentIdList,batchNo);
|
|
- if (CollectionUtils.isNotEmpty(noPaymentUserIds)) {
|
|
|
|
|
|
+ if (noPaymentUserIds.size() > 0) {
|
|
throw new BizException("操作失败:有欠费的学员不允许创建缴费");
|
|
throw new BizException("操作失败:有欠费的学员不允许创建缴费");
|
|
}
|
|
}
|
|
SysUser sysUser1 = sysUserFeignService.queryUserInfo();
|
|
SysUser sysUser1 = sysUserFeignService.queryUserInfo();
|
|
@@ -1126,14 +1127,14 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
BigDecimal amount = BigDecimal.ZERO;
|
|
BigDecimal amount = BigDecimal.ZERO;
|
|
for (StudentRegistration studentRegistration : studentRegistrations) {
|
|
for (StudentRegistration studentRegistration : studentRegistrations) {
|
|
List<MusicGroupPaymentCalenderStudentDetail> details = collect.get(studentRegistration.getUserId());
|
|
List<MusicGroupPaymentCalenderStudentDetail> details = collect.get(studentRegistration.getUserId());
|
|
- BigDecimal masterTotalPrice = details.stream().map(MusicGroupPaymentCalenderStudentDetail::getCutAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
+ BigDecimal masterTotalPrice = details.stream().map(e -> e.getCutAmount()).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
if (masterTotalPrice.doubleValue() > studentRegistration.getSurplusCourseFee().doubleValue()) {
|
|
if (masterTotalPrice.doubleValue() > studentRegistration.getSurplusCourseFee().doubleValue()) {
|
|
throw new BizException("用户信息发生变动,请重新提交");
|
|
throw new BizException("用户信息发生变动,请重新提交");
|
|
}
|
|
}
|
|
if (oldMusicGroupId.equals(newMusicGroupId)) {
|
|
if (oldMusicGroupId.equals(newMusicGroupId)) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- courseScheduleStudentPaymentService.updateCourseActualPrice(Collections.singletonList(oldMusicGroupId), null, GroupType.MUSIC);
|
|
|
|
|
|
+ courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(oldMusicGroupId), null, GroupType.MUSIC);
|
|
//记录课程余额消费日志
|
|
//记录课程余额消费日志
|
|
if (studentRegistration.getSurplusCourseFee().doubleValue() > 0d && masterTotalPrice.doubleValue() > 0d) {
|
|
if (studentRegistration.getSurplusCourseFee().doubleValue() > 0d && masterTotalPrice.doubleValue() > 0d) {
|
|
StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
|
|
StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
|
|
@@ -1198,7 +1199,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
studentCourseFeeDetails.add(studentCourseFeeDetail);
|
|
studentCourseFeeDetails.add(studentCourseFeeDetail);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (CollectionUtils.isNotEmpty(studentCourseFeeDetails)) {
|
|
|
|
|
|
+ if (studentCourseFeeDetails.size() > 0) {
|
|
studentCourseFeeDetailDao.batchInsert(studentCourseFeeDetails);
|
|
studentCourseFeeDetailDao.batchInsert(studentCourseFeeDetails);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1225,7 +1226,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
// classGroupDao.updateClassStudentNum(classGroupId.longValue(), 1);
|
|
// classGroupDao.updateClassStudentNum(classGroupId.longValue(), 1);
|
|
//3、学生加入新班级未开始课程
|
|
//3、学生加入新班级未开始课程
|
|
List<CourseSchedule> noStartCoursesByClassGroupId = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
|
|
List<CourseSchedule> noStartCoursesByClassGroupId = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
|
|
- if (CollectionUtils.isNotEmpty(noStartCoursesByClassGroupId)) {
|
|
|
|
|
|
+ if (noStartCoursesByClassGroupId != null && noStartCoursesByClassGroupId.size() > 0) {
|
|
courseScheduleList.addAll(noStartCoursesByClassGroupId);
|
|
courseScheduleList.addAll(noStartCoursesByClassGroupId);
|
|
}
|
|
}
|
|
return courseScheduleList;
|
|
return courseScheduleList;
|
|
@@ -1251,8 +1252,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
String snapClassIds = studentAddDto.getSnapClassIds();
|
|
String snapClassIds = studentAddDto.getSnapClassIds();
|
|
if (StringUtils.isNotEmpty(snapClassIds)) {
|
|
if (StringUtils.isNotEmpty(snapClassIds)) {
|
|
String[] split = snapClassIds.split(",");
|
|
String[] split = snapClassIds.split(",");
|
|
- for (String s : split) {
|
|
|
|
- addStudent(Integer.parseInt(s), userId, nowDate, courseScheduleList);
|
|
|
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
|
+ addStudent(Integer.parseInt(split[i]), userId, nowDate, courseScheduleList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
|
|
List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
|
|
@@ -1269,7 +1270,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
courseScheduleStudentPayments.add(courseScheduleStudentPayment);
|
|
courseScheduleStudentPayments.add(courseScheduleStudentPayment);
|
|
}
|
|
}
|
|
|
|
|
|
- if (CollectionUtils.isEmpty(courseScheduleStudentPayments)) {
|
|
|
|
|
|
+ if (courseScheduleStudentPayments.size() == 0) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
|
|
courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
|
|
@@ -1381,7 +1382,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
LOGGER.error("协议生成失败", e);
|
|
LOGGER.error("协议生成失败", e);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
if (studentPaymentOrder.getStatus().equals(DealStatusEnum.FAILED) || studentPaymentOrder.getStatus().equals(DealStatusEnum.CLOSE)) {
|
|
if (studentPaymentOrder.getStatus().equals(DealStatusEnum.FAILED) || studentPaymentOrder.getStatus().equals(DealStatusEnum.CLOSE)) {
|
|
@@ -1390,7 +1391,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
studentRegistrationDao.update(studentRegistration);
|
|
studentRegistrationDao.update(studentRegistration);
|
|
//减去缴费人数(器乐收费,0元时不减缴费人数)
|
|
//减去缴费人数(器乐收费,0元时不减缴费人数)
|
|
studentPaymentOrderService.cutSubjectPlan(studentPaymentOrder);
|
|
studentPaymentOrderService.cutSubjectPlan(studentPaymentOrder);
|
|
-
|
|
|
|
|
|
+
|
|
//增加商品库存
|
|
//增加商品库存
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailService.queryOrderDetail(studentPaymentOrder.getId());
|
|
List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailService.queryOrderDetail(studentPaymentOrder.getId());
|
|
String goodsIds = studentPaymentOrderDetailList.stream().map(StudentPaymentOrderDetail::getMinuendStockGoodsIdList)
|
|
String goodsIds = studentPaymentOrderDetailList.stream().map(StudentPaymentOrderDetail::getMinuendStockGoodsIdList)
|
|
@@ -1402,7 +1403,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
Goods goods = null;
|
|
Goods goods = null;
|
|
Map<Integer, Goods> batchUpdateGoodsMap = new HashMap<Integer, Goods>();
|
|
Map<Integer, Goods> batchUpdateGoodsMap = new HashMap<Integer, Goods>();
|
|
// Map<Long, GoodsProcurement> goodsProcurementMap = new HashMap<Long, GoodsProcurement>();
|
|
// Map<Long, GoodsProcurement> goodsProcurementMap = new HashMap<Long, GoodsProcurement>();
|
|
-
|
|
|
|
|
|
+
|
|
for(String goodsIdStr : goodsIds.split(",")){
|
|
for(String goodsIdStr : goodsIds.split(",")){
|
|
if(StringUtils.isBlank(goodsIdStr)){
|
|
if(StringUtils.isBlank(goodsIdStr)){
|
|
continue;
|
|
continue;
|
|
@@ -1414,9 +1415,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
// goods.setStockCount(new AtomicInteger(goods.getStockCount()).incrementAndGet());
|
|
// goods.setStockCount(new AtomicInteger(goods.getStockCount()).incrementAndGet());
|
|
goods.setSellCount(new AtomicInteger(goods.getSellCount()).decrementAndGet());
|
|
goods.setSellCount(new AtomicInteger(goods.getSellCount()).decrementAndGet());
|
|
goods.setUpdateTime(nowDate);
|
|
goods.setUpdateTime(nowDate);
|
|
-
|
|
|
|
|
|
+
|
|
batchUpdateGoodsMap.put(goods.getId(), goods);
|
|
batchUpdateGoodsMap.put(goods.getId(), goods);
|
|
-
|
|
|
|
|
|
+
|
|
// 进货清单
|
|
// 进货清单
|
|
/*goodsProcurement = goodsProcurementDao.getWithStockSurplusProcurement(goods.getId());
|
|
/*goodsProcurement = goodsProcurementDao.getWithStockSurplusProcurement(goods.getId());
|
|
if(goodsProcurement != null){
|
|
if(goodsProcurement != null){
|
|
@@ -1427,13 +1428,13 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
goodsProcurement.setUpdateTime(nowDate);
|
|
goodsProcurement.setUpdateTime(nowDate);
|
|
goodsProcurementMap.put(goodsProcurement.getId(), goodsProcurement);
|
|
goodsProcurementMap.put(goodsProcurement.getId(), goodsProcurement);
|
|
}*/
|
|
}*/
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/*if(goodsProcurementMap.size() > 0){
|
|
/*if(goodsProcurementMap.size() > 0){
|
|
goodsProcurementDao.batchUpdate(new ArrayList<GoodsProcurement>(goodsProcurementMap.values()));
|
|
goodsProcurementDao.batchUpdate(new ArrayList<GoodsProcurement>(goodsProcurementMap.values()));
|
|
}*/
|
|
}*/
|
|
-
|
|
|
|
|
|
+
|
|
if(!batchUpdateGoodsMap.isEmpty()){
|
|
if(!batchUpdateGoodsMap.isEmpty()){
|
|
goodsService.batchUpdate(new ArrayList<Goods>(batchUpdateGoodsMap.values()));
|
|
goodsService.batchUpdate(new ArrayList<Goods>(batchUpdateGoodsMap.values()));
|
|
}
|
|
}
|
|
@@ -1726,7 +1727,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
public BigDecimal updateUserSurplusCourseFee(Integer userId, String musicGroupId, BigDecimal amount, String memo, Integer operatorId) {
|
|
public BigDecimal updateUserSurplusCourseFee(Integer userId, String musicGroupId, BigDecimal amount, String memo, Integer operatorId) {
|
|
StudentRegistration studentRegistration = studentRegistrationDao.lockWithUserAndMusic(userId, musicGroupId);
|
|
StudentRegistration studentRegistration = studentRegistrationDao.lockWithUserAndMusic(userId, musicGroupId);
|
|
if (Objects.isNull(studentRegistration)) {
|
|
if (Objects.isNull(studentRegistration)) {
|
|
- LOGGER.error("学员{}-{}可用排课余额更新失败:学员注册信息不存在", userId, musicGroupId);
|
|
|
|
|
|
+ LOGGER.error("学员{}-{}可用排课余额更新失败:学员注册信息不存在", amount);
|
|
return BigDecimal.ZERO;
|
|
return BigDecimal.ZERO;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1804,7 +1805,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<StudentRegistration> getMusicGroupStuReBack(String musicGroupId) {
|
|
public List<StudentRegistration> getMusicGroupStuReBack(String musicGroupId) {
|
|
- courseScheduleStudentPaymentService.updateCourseActualPrice(Collections.singletonList(musicGroupId), null, GroupType.MUSIC);
|
|
|
|
|
|
+ courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(musicGroupId), null, GroupType.MUSIC);
|
|
return this.findMusicGroupStudent(musicGroupId, null);
|
|
return this.findMusicGroupStudent(musicGroupId, null);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1851,10 +1852,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
for (MusicGroupPaymentCalender regCalender : regCalenders) {
|
|
for (MusicGroupPaymentCalender regCalender : regCalenders) {
|
|
viewMap.put(regCalender.getMusicGroupId(), true);
|
|
viewMap.put(regCalender.getMusicGroupId(), true);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
//判断乐团是否开课
|
|
//判断乐团是否开课
|
|
List<MusicGroup> musicGroupList = musicGroupDao.getMusicGroupByIds(ids);
|
|
List<MusicGroup> musicGroupList = musicGroupDao.getMusicGroupByIds(ids);
|
|
-
|
|
|
|
|
|
+
|
|
for(MusicGroup mg : musicGroupList){
|
|
for(MusicGroup mg : musicGroupList){
|
|
if (viewMap.containsKey(mg.getId()) && mg.getFirstCourseStartTime() != null) {
|
|
if (viewMap.containsKey(mg.getId()) && mg.getFirstCourseStartTime() != null) {
|
|
viewMap.remove(mg.getId());
|
|
viewMap.remove(mg.getId());
|
|
@@ -1920,7 +1921,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
if(totalPayNum == 0){
|
|
if(totalPayNum == 0){
|
|
pageInfo.setPayScale(new BigDecimal(0));
|
|
pageInfo.setPayScale(new BigDecimal(0));
|
|
}else {
|
|
}else {
|
|
- pageInfo.setPayScale(new BigDecimal(firstPayNum).multiply(new BigDecimal(100)).divide(new BigDecimal(totalPayNum), 2, RoundingMode.HALF_UP));
|
|
|
|
|
|
+ pageInfo.setPayScale(new BigDecimal(firstPayNum).multiply(new BigDecimal(100)).divide(new BigDecimal(totalPayNum), 2, BigDecimal.ROUND_HALF_UP));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2002,7 +2003,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
List<StudentPaymentOrder> updateList = new ArrayList<StudentPaymentOrder>();
|
|
List<StudentPaymentOrder> updateList = new ArrayList<StudentPaymentOrder>();
|
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(studentPaymentOrderList)) {
|
|
|
|
|
|
+ if (studentPaymentOrderList != null && studentPaymentOrderList.size() > 0) {
|
|
for (StudentPaymentOrder studentPaymentOrder : studentPaymentOrderList) {
|
|
for (StudentPaymentOrder studentPaymentOrder : studentPaymentOrderList) {
|
|
if (StringUtils.equals("205", studentPaymentOrder.getPaymentAccountNo())) {
|
|
if (StringUtils.equals("205", studentPaymentOrder.getPaymentAccountNo())) {
|
|
studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
|
|
studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
|
|
@@ -2013,7 +2014,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(updateList)) {
|
|
|
|
|
|
+ if (updateList.size() > 0) {
|
|
studentPaymentOrderService.batchUpdate(updateList);
|
|
studentPaymentOrderService.batchUpdate(updateList);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2049,7 +2050,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
List<StudentPaymentOrder> updateList = new ArrayList<StudentPaymentOrder>();
|
|
List<StudentPaymentOrder> updateList = new ArrayList<StudentPaymentOrder>();
|
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(studentPaymentOrderList)) {
|
|
|
|
|
|
+ if (studentPaymentOrderList != null && studentPaymentOrderList.size() > 0) {
|
|
for (StudentPaymentOrder studentPaymentOrder : studentPaymentOrderList) {
|
|
for (StudentPaymentOrder studentPaymentOrder : studentPaymentOrderList) {
|
|
if (StringUtils.equals("205", studentPaymentOrder.getPaymentAccountNo())) {
|
|
if (StringUtils.equals("205", studentPaymentOrder.getPaymentAccountNo())) {
|
|
studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
|
|
studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
|
|
@@ -2060,7 +2061,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(updateList)) {
|
|
|
|
|
|
+ if (updateList.size() > 0) {
|
|
studentPaymentOrderService.batchUpdate(updateList);
|
|
studentPaymentOrderService.batchUpdate(updateList);
|
|
}
|
|
}
|
|
|
|
|