|
@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -38,21 +39,6 @@ import com.ym.mec.biz.dal.dto.StudentAddDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentFeeDetailDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentInfo;
|
|
|
-import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
|
|
|
-import com.ym.mec.biz.dal.entity.Goods;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentRegistration;
|
|
|
-import com.ym.mec.biz.dal.entity.Subject;
|
|
|
-import com.ym.mec.biz.dal.entity.SysUserCashAccount;
|
|
|
-import com.ym.mec.biz.dal.entity.SysUserCashAccountDetail;
|
|
|
import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
@@ -844,24 +830,27 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
sysUserCashAccountDetailService.insert(paymentDetail);
|
|
|
|
|
|
- //发送缴费成功通知(短信 + push)
|
|
|
- Map<Integer, String> map = new HashMap<>(1);
|
|
|
- map.put(studentPaymentOrder.getUserId(), studentRegistration.getParentsPhone());
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
|
|
|
- MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, map, null, 0, "1",
|
|
|
- studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
|
|
|
- //push
|
|
|
- Map<Integer, String> map1 = new HashMap<>(1);
|
|
|
- map1.put(studentPaymentOrder.getUserId(), studentPaymentOrder.getUserId().toString());
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
|
|
|
- MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, map1, null, 0, "1",
|
|
|
- studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
|
|
|
-
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
|
+ //三方乐团不发送缴费通知
|
|
|
+ if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
|
|
|
+ //发送缴费成功通知(短信 + push)
|
|
|
+ Map<Integer, String> map = new HashMap<>(1);
|
|
|
+ map.put(studentPaymentOrder.getUserId(), studentRegistration.getParentsPhone());
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
|
|
|
+ MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, map, null, 0, "1",
|
|
|
+ studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
|
|
|
+ //push
|
|
|
+ Map<Integer, String> map1 = new HashMap<>(1);
|
|
|
+ map1.put(studentPaymentOrder.getUserId(), studentPaymentOrder.getUserId().toString());
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
|
|
|
+ MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, map1, null, 0, "1",
|
|
|
+ studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
|
|
|
+ }
|
|
|
// //生成课程协议
|
|
|
try {
|
|
|
contractService.transferMusicGroupCoursesContract(studentRegistration.getUserId(), studentRegistration.getMusicGroupId());
|
|
|
// 商品协议(租赁时候有)
|
|
|
- if (musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
|
|
|
+ if (musicOneSubjectClassPlan.getKitGroupPurchaseType()!= null && musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
|
|
|
StudentPaymentOrderDetail applyOrderMusical = studentPaymentOrderDetailService.findApplyOrderMusical(studentPaymentOrder.getId());
|
|
|
if (applyOrderMusical != null && applyOrderMusical.getGoodsIdList() != null && !applyOrderMusical.getGoodsIdList().equals("")) {
|
|
|
contractService.transferGoodsContract(studentPaymentOrder.getUserId(), studentPaymentOrder.getMusicGroupId(),
|
|
@@ -886,15 +875,16 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
if(studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) >0 ){
|
|
|
sysUserCashAccountService.updateBalance(studentPaymentOrder.getUserId(), studentPaymentOrder.getBalancePaymentAmount(),PlatformCashAccountDetailTypeEnum.REFUNDS,"报名缴费失败");
|
|
|
}
|
|
|
-
|
|
|
- //发送缴费成功通知(短信 + push)
|
|
|
- String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + studentRegistration.getMusicGroupId();
|
|
|
-
|
|
|
- Map<Integer, String> map = new HashMap<>(1);
|
|
|
- map.put(studentPaymentOrder.getUserId(), studentRegistration.getParentsPhone());
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
|
|
|
- MessageTypeEnum.STUDENT_SMS_PAYMENT_FAILED, map, null, 0, "1",
|
|
|
- HttpUtil.getSortUrl(studentApplyUrl));
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
|
+ //三方乐团不发送缴费通知
|
|
|
+ if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
|
|
|
+ String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + studentRegistration.getMusicGroupId();
|
|
|
+ Map<Integer, String> map = new HashMap<>(1);
|
|
|
+ map.put(studentPaymentOrder.getUserId(), studentRegistration.getParentsPhone());
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
|
|
|
+ MessageTypeEnum.STUDENT_SMS_PAYMENT_FAILED, map, null, 0, "1",
|
|
|
+ HttpUtil.getSortUrl(studentApplyUrl));
|
|
|
+ }
|
|
|
// sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
|
|
|
// MessageTypeEnum.STUDENT_SMS_PAYMENT_FAILED,map,null,0,"1",
|
|
|
// studentApplyUrl);
|
|
@@ -958,15 +948,19 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
if(StringUtils.isNotEmpty(ids)){
|
|
|
//发送短信通知
|
|
|
List<Long> list = JSONObject.parseArray(JSONObject.toJSONString(Arrays.asList(ids.split(","))),Long.class);
|
|
|
- List<StudentRegistration> registrations = studentRegistrationDao.findStudentListByIdList(list);
|
|
|
MusicGroup musicGroup = musicGroupDao.findMusicGroup(list);
|
|
|
- String configValue = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL);
|
|
|
- HashMap<Integer,String> receivers = new HashMap<>(registrations.size());
|
|
|
- registrations.forEach(e->{
|
|
|
- receivers.put(e.getUserId(),e.getParentsPhone());
|
|
|
- });
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
|
|
|
- MessageTypeEnum.SMS_STUDENT_OPEN_PAYMENT,receivers,null,0,null,musicGroup.getName(),HttpUtil.getSortUrl(configValue + musicGroup.getId()));
|
|
|
+ //三方乐团不发送缴费通知
|
|
|
+ if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
|
|
|
+ List<StudentRegistration> registrations = studentRegistrationDao.findStudentListByIdList(list);
|
|
|
+ String configValue = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL);
|
|
|
+ HashMap<Integer,String> receivers = new HashMap<>(registrations.size());
|
|
|
+ registrations.forEach(e->{
|
|
|
+ receivers.put(e.getUserId(),e.getParentsPhone());
|
|
|
+ });
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
|
|
|
+ MessageTypeEnum.SMS_STUDENT_OPEN_PAYMENT,receivers,null,0,null,
|
|
|
+ musicGroup.getName(),HttpUtil.getSortUrl(configValue + musicGroup.getId()));
|
|
|
+ }
|
|
|
}
|
|
|
return studentRegistrationDao.batchOpenPay(ids, PaymentStatusEnum.OPEN);
|
|
|
}
|