|
@@ -264,17 +264,19 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (chargeInfo == null) {
|
|
|
throw new BizException("支付项不存在");
|
|
|
}
|
|
|
- BigDecimal amount = sporadicPayDto.getAmount();
|
|
|
- if (!(amount.compareTo(chargeInfo.getAmount()) == 0)) {
|
|
|
- throw new BizException("订单金额异常");
|
|
|
- }
|
|
|
+ BigDecimal amount = chargeInfo.getAmount();
|
|
|
if(chargeInfo.getDiscountAmount() != null && chargeInfo.getDiscountAmount().compareTo(BigDecimal.ZERO)>0){
|
|
|
amount = amount.subtract(chargeInfo.getDiscountAmount());
|
|
|
}
|
|
|
+ if (!(amount.compareTo(sporadicPayDto.getAmount()) == 0)) {
|
|
|
+ throw new BizException("订单金额异常");
|
|
|
+ }
|
|
|
|
|
|
OrderTypeEnum type = OrderTypeEnum.SPORADIC;
|
|
|
+ String receiver = null;
|
|
|
if(chargeInfo.getChargeType().equals("6")){
|
|
|
type = OrderTypeEnum.LUCK;
|
|
|
+ receiver = "PER";
|
|
|
}
|
|
|
|
|
|
Integer userId = sporadicPayDto.getUserId();
|
|
@@ -340,7 +342,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
chargeInfo.getTitle(),
|
|
|
userId,
|
|
|
classFee,
|
|
|
- chargeInfo.getOrganId()
|
|
|
+ chargeInfo.getOrganId(),
|
|
|
+ receiver
|
|
|
);
|
|
|
|
|
|
Map<String, BigDecimal> routingFee = (Map<String, BigDecimal>) payMap.get("routingFee");
|
|
@@ -514,14 +517,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ String orderSubject = "乐团报名";
|
|
|
+ if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType().equals(CooperationOrgan.OwnershipType.COOPERATION)){
|
|
|
+ orderSubject = "乐团相关费用";
|
|
|
+ }
|
|
|
String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
|
Map payMap = payService.getPayMap(
|
|
|
amount,
|
|
|
orderNo,
|
|
|
baseApiUrl + "/api-student/studentOrder/notify",
|
|
|
baseApiUrl + "/api-student/studentOrder/paymentResult?orderNo=" + orderNo,
|
|
|
- "乐团报名",
|
|
|
- "乐团报名",
|
|
|
+ orderSubject,
|
|
|
+ orderSubject,
|
|
|
userId,
|
|
|
classFee,
|
|
|
musicGroup.getOrganId()
|
|
@@ -704,15 +711,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ String orderSubject = "乐团报名";
|
|
|
+ if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType().equals(CooperationOrgan.OwnershipType.COOPERATION)){
|
|
|
+ orderSubject = "乐团相关费用";
|
|
|
+ }
|
|
|
String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
|
Map payMap = payService.getPayMap(
|
|
|
amount,
|
|
|
orderNo,
|
|
|
baseApiUrl + "/api-student/studentOrder/notify",
|
|
|
baseApiUrl + "/api-student/studentOrder/paymentResult?orderNo=" + orderNo,
|
|
|
- "乐团报名",
|
|
|
- "乐团报名",
|
|
|
+ orderSubject,
|
|
|
+ orderSubject,
|
|
|
userId,
|
|
|
classFee,
|
|
|
musicGroup.getOrganId()
|
|
@@ -909,15 +919,17 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
@Override
|
|
|
public void pushMessage(String musicGroupId) throws IOException {
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
- //3.0发送该消息
|
|
|
- if (new Integer(3).equals(musicGroup.getChargeTypeId())) {
|
|
|
- Map<Integer, String> studentMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(studentRegistrationDao.findIdMapByMusicGroupId(musicGroupId, 2))), HashMap.class);
|
|
|
- if (studentMap != null && studentMap.size() > 0) {
|
|
|
- String baseURL = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
|
- String url = baseURL + "/#/smallRegister?musicGroupId=" + musicGroupId;
|
|
|
- String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
|
|
|
- sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE,
|
|
|
- studentMap, null, 0, "5?" + url, musicGroup.getName(), HttpUtil.getSortUrl(url), serverPhone);
|
|
|
+ if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
|
|
|
+ //3.0发送该消息
|
|
|
+ if (new Integer(3).equals(musicGroup.getChargeTypeId())) {
|
|
|
+ Map<Integer, String> studentMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(studentRegistrationDao.findIdMapByMusicGroupId(musicGroupId, 2))), HashMap.class);
|
|
|
+ if (studentMap != null && studentMap.size() > 0) {
|
|
|
+ String baseURL = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
|
+ String url = baseURL + "/#/smallRegister?musicGroupId=" + musicGroupId;
|
|
|
+ String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
|
|
|
+ sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE,
|
|
|
+ studentMap, null, 0, "5?" + url, musicGroup.getName(), HttpUtil.getSortUrl(url), serverPhone);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1018,14 +1030,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
+ musicGroupId, "", PlatformCashAccountDetailTypeEnum.REFUNDS, null, DealStatusEnum.SUCCESS, "取消乐团");
|
|
|
}
|
|
|
//获取当前乐团所有已报名学员
|
|
|
- List<StudentRegistration> registrations = studentRegistrationDao.findClassGroupStu(musicGroupId, null);
|
|
|
- if (registrations != null && registrations.size() > 0) {
|
|
|
- Map<Integer, String> map = new HashMap<>(registrations.size());
|
|
|
- registrations.forEach(e -> {
|
|
|
- map.put(e.getUserId(), e.getUserId().toString());
|
|
|
- });
|
|
|
- sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_CLOSE,
|
|
|
- map, null, 0, "1", musicGroup.getName(), sysConfigDao.findConfigValue(SysConfigService.REFUND_PERIOD));
|
|
|
+ if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
|
|
|
+ List<StudentRegistration> registrations = studentRegistrationDao.findClassGroupStu(musicGroupId, null);
|
|
|
+ if (registrations != null && registrations.size() > 0) {
|
|
|
+ Map<Integer, String> map = new HashMap<>(registrations.size());
|
|
|
+ registrations.forEach(e -> {
|
|
|
+ map.put(e.getUserId(), e.getUserId().toString());
|
|
|
+ });
|
|
|
+ sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_CLOSE,
|
|
|
+ map, null, 0, "1", musicGroup.getName(), sysConfigDao.findConfigValue(SysConfigService.REFUND_PERIOD));
|
|
|
+ }
|
|
|
}
|
|
|
//记录建团日志
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "取消乐团", sysUser.getId(), ""));
|
|
@@ -1571,12 +1585,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
paymentDetail.setComAmount(studentPaymentOrder.getComAmount().negate());
|
|
|
paymentDetail.setPerAmount(studentPaymentOrder.getPerAmount().negate());
|
|
|
sysUserCashAccountDetailService.insert(paymentDetail);
|
|
|
-
|
|
|
- // 发送续费结果通知
|
|
|
- sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_SMS_MUSIC_GROUP_RENEW_SUCCESS, push, null, 0, "1",
|
|
|
- studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
|
|
|
- sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.STUDENT_SMS_MUSIC_GROUP_RENEW_SUCCESS, yimei, null, 0, "1",
|
|
|
- studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
+ if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
|
|
|
+ // 发送续费结果通知
|
|
|
+ sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_SMS_MUSIC_GROUP_RENEW_SUCCESS, push, null, 0, "1",
|
|
|
+ studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
|
|
|
+ sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.STUDENT_SMS_MUSIC_GROUP_RENEW_SUCCESS, yimei, null, 0, "1",
|
|
|
+ studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
|
|
|
+ }
|
|
|
return true;
|
|
|
} else {
|
|
|
if (studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().doubleValue() > 0) {
|
|
@@ -1584,13 +1600,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
"乐团续费失败");
|
|
|
}
|
|
|
}
|
|
|
- if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {
|
|
|
- String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
|
- String memo = baseUrl + "/#/renew?musicGroupId=" + musicGroupId;
|
|
|
- //4?http://mstudev.dayaedu.com/#/renew?musicGroupId=" +musicGroupId
|
|
|
- sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_RENEW_FAILED, push, null, 0, "4?" + memo,
|
|
|
- HttpUtil.getSortUrl(memo));
|
|
|
- return false;
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
+ if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
|
|
|
+ if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {
|
|
|
+ String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
|
+ String memo = baseUrl + "/#/renew?musicGroupId=" + musicGroupId;
|
|
|
+ //4?http://mstudev.dayaedu.com/#/renew?musicGroupId=" +musicGroupId
|
|
|
+ sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_RENEW_FAILED, push, null, 0, "4?" + memo,
|
|
|
+ HttpUtil.getSortUrl(memo));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
@@ -1913,24 +1932,25 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, event, sysUser.getId(), ""));
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.PREPARE);
|
|
|
musicGroupDao.update(musicGroup);
|
|
|
- //给家长发送乐团基础训练课短信
|
|
|
- //获取所有乐团学员列表
|
|
|
- List<StudentRegistration> students = studentRegistrationDao.queryStudentByMusicGroupId(musicGroupId);
|
|
|
- if (students != null && students.size() > 0) {
|
|
|
- // 获取所有家长电话
|
|
|
- Set<String> parentsPhones = students.stream().map(StudentRegistration::getParentsPhone).collect(Collectors.toSet());
|
|
|
- // 获取对应家长的用户编号
|
|
|
- Map<Integer, String> userIds = MapUtil.convertMybatisMap(studentRegistrationDao.findParentId(StringUtils.join(parentsPhones, ",")));
|
|
|
- userIds = JSONObject.parseObject(JSONObject.toJSONString(userIds), HashMap.class);
|
|
|
- if (userIds != null && userIds.size() > 0) {
|
|
|
- String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
|
|
|
- String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
|
|
|
- sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE, userIds, null, 0, "", musicGroup.getName(), studentApplyUrl, serverPhone);
|
|
|
+ if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
|
|
|
+ //给家长发送乐团基础训练课短信
|
|
|
+ //获取所有乐团学员列表
|
|
|
+ List<StudentRegistration> students = studentRegistrationDao.queryStudentByMusicGroupId(musicGroupId);
|
|
|
+ if (students != null && students.size() > 0) {
|
|
|
+ // 获取所有家长电话
|
|
|
+ Set<String> parentsPhones = students.stream().map(StudentRegistration::getParentsPhone).collect(Collectors.toSet());
|
|
|
+ // 获取对应家长的用户编号
|
|
|
+ Map<Integer, String> userIds = MapUtil.convertMybatisMap(studentRegistrationDao.findParentId(StringUtils.join(parentsPhones, ",")));
|
|
|
+ userIds = JSONObject.parseObject(JSONObject.toJSONString(userIds), HashMap.class);
|
|
|
+ if (userIds != null && userIds.size() > 0) {
|
|
|
+ String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
|
|
|
+ String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
|
|
|
+ sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE, userIds, null, 0, "", musicGroup.getName(), studentApplyUrl, serverPhone);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
Set<Integer> roleIds = new HashSet<>(1);
|
|
|
roleIds.add(SysUserRole.SECTION_MANAGER);
|
|
|
-
|
|
|
sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId() + ""), MessageTypeEnum.BACKSTAGE_MUSIC_GROUP_MARKING, "", musicGroup.getName());
|
|
|
}
|
|
|
}
|