|
@@ -24,7 +24,6 @@ import com.ym.mec.im.ImFeignService;
|
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
-
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -127,7 +126,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public void createVipGroup(VipGroupApplyDto vipGroup) {
|
|
|
+ public String createVipGroup(VipGroupApplyDto vipGroup) {
|
|
|
|
|
|
if (Objects.isNull(vipGroup.getVipGroupApplyBaseInfo().getUserId())){
|
|
|
throw new BizException("请选择指导老师");
|
|
@@ -387,6 +386,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
// }else {
|
|
|
sysMessageService.batchSeoMessage(userIds,MessageTypeEnum.BACKSTAGE_TEACHER_APPLY_VIP, JSONObject.toJSONString(memo),teacher.getRealName());
|
|
|
// }
|
|
|
+ return vipGroupApplyBaseInfoDto.getAuditStatus().getCode();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -402,8 +402,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
Date groupCourseStartTime=courseScheduleDao.findGroupCourseStartTime(GroupType.VIP,vipGroupId.toString());
|
|
|
Date groupCourseEndTime=courseScheduleDao.findGroupCourseEndTime(GroupType.VIP,vipGroupId.toString());
|
|
|
|
|
|
- //获取活动信息
|
|
|
- if(Objects.nonNull(vipGroup.getVipGroupActivityId())){
|
|
|
+ //获取活动信息
|
|
|
+ if(Objects.nonNull(vipGroup.getVipGroupActivityId())){
|
|
|
VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId().intValue());
|
|
|
if(Objects.nonNull(vipGroupActivity)&&(Objects.nonNull(vipGroupActivity.getCoursesEndTime())||Objects.nonNull(vipGroupActivity.getCoursesStartTime()))){
|
|
|
if(groupCourseEndTime.after(vipGroupActivity.getCoursesEndTime())
|
|
@@ -421,7 +421,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -976,12 +976,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
public void updateVipGroupStudentNumAndStatus(Long vipGroupId , ClassGroup classGroup, Integer num, boolean updateVipStatus) {
|
|
|
-// VipGroup vipGroup = vipGroupDao.getLockVipGroup(vipGroupId);
|
|
|
-// if(Objects.isNull(vipGroup)){
|
|
|
-// throw new BizException("指定的vip课程不存在");
|
|
|
-// }
|
|
|
+ VipGroup vipGroup = vipGroupDao.get(vipGroupId);
|
|
|
+ if(Objects.isNull(vipGroup)){
|
|
|
+ throw new BizException("指定的vip课程不存在");
|
|
|
+ }
|
|
|
if(Objects.isNull(classGroup)){
|
|
|
throw new BizException("未找到关联班级");
|
|
|
}
|
|
@@ -1006,7 +1006,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
public void createVipGroupCourseScheInfo(Long vipGroupId,ClassGroup classGroup){
|
|
|
VipGroup vipGroupApplyBaseInfoDto = vipGroupDao.get(vipGroupId);
|
|
|
List<CourseSchedule> courseSchedules = JSON.parseArray(vipGroupApplyBaseInfoDto.getCourseSchedulesJson(),CourseSchedule.class);
|
|
@@ -1051,7 +1051,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
public Map buyVipGroup(VipGroupBuyParamsDto vipGroupBuyParams) {
|
|
|
SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
if(user == null){
|
|
@@ -1066,7 +1066,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("课程信息错误");
|
|
|
}
|
|
|
|
|
|
- VipGroup vipGroup = vipGroupDao.get(vipGroupBuyParams.getVipGroupId());
|
|
|
+ VipGroup vipGroup = vipGroupDao.get(vipGroupBuyParams.getVipGroupId());
|
|
|
|
|
|
if(vipGroup.getStatus()!=VipGroupStatusEnum.APPLYING){
|
|
|
throw new BizException("该课程已结束报名!");
|
|
@@ -1210,7 +1210,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
public void orderCallback(StudentPaymentOrder order) {
|
|
|
/*
|
|
|
根据回调信息调整订单状态及vip课程状态等相关信息
|
|
@@ -1219,7 +1219,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
Integer userId = order.getUserId();
|
|
|
boolean isOk=order.getStatus().equals(DealStatusEnum.SUCCESS);
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.get(order.getId());
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.get(order.getId());
|
|
|
if(studentPaymentOrder.getStatus().equals(DealStatusEnum.SUCCESS)){
|
|
|
return;
|
|
|
}
|
|
@@ -1250,6 +1250,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(userId);
|
|
|
|
|
|
VipGroup vipGroup = vipGroupDao.get(vipGroupId);
|
|
|
+
|
|
|
//插入缴费明细
|
|
|
//收入
|
|
|
SysUserCashAccountDetail sysUserIncomeCashAccountDetail = new SysUserCashAccountDetail();
|
|
@@ -1295,7 +1296,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if(classGroup.getExpectStudentNum().equals(classGroup.getStudentNum())){
|
|
|
vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
|
|
|
}
|
|
|
- update(vipGroup);
|
|
|
+ vipGroupDao.update(vipGroup);
|
|
|
|
|
|
try {
|
|
|
contractService.transferVipGroupCoursesContract(userId,vipGroupId);
|
|
@@ -2018,16 +2019,16 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
private void stopVipPush(Long vipGroupId,String vipGroupName){
|
|
|
String refundPeriod = sysConfigDao.findConfigValue(SysConfigService.REFUND_PERIOD);
|
|
|
- Map<Integer,String> map = MapUtil.convertMybatisMap(classGroupStudentMapperDao.queryStudentIdMap(vipGroupId));
|
|
|
- if(map != null && map.size() > 0){
|
|
|
+ Map<Integer,String> map1 = MapUtil.convertMybatisMap(classGroupStudentMapperDao.queryStudentIdMap(vipGroupId));
|
|
|
+ if(map1 != null && map1.size() > 0){
|
|
|
sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,MessageTypeEnum.PUSH_STUDENT_VIP_STOP,
|
|
|
- map,null,0,null,"STUDENT",vipGroupName,refundPeriod);
|
|
|
+ map1,null,0,null,"STUDENT",vipGroupName,refundPeriod);
|
|
|
}
|
|
|
// 老师推送消息
|
|
|
- map = MapUtil.convertMybatisMap(classGroupStudentMapperDao.queryTeacherIdMap(vipGroupId));
|
|
|
- if(map != null && map.size() > 0){
|
|
|
+ Map<Integer,String> map2 = MapUtil.convertMybatisMap(classGroupStudentMapperDao.queryTeacherIdMap(vipGroupId));
|
|
|
+ if(map2 != null && map2.size() > 0){
|
|
|
sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,MessageTypeEnum.PUSH_TEACHER_VIP_STOP,
|
|
|
- map,null,0,null,"TEACHER",vipGroupName);
|
|
|
+ map2,null,0,null,"TEACHER",vipGroupName);
|
|
|
}
|
|
|
}
|
|
|
|