|
@@ -2,20 +2,30 @@ package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.ReplacementInstrumentActivityDao;
|
|
|
import com.ym.mec.biz.dal.dao.ReplacementInstrumentCooperationDao;
|
|
|
+import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
+import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatDto;
|
|
|
+import com.ym.mec.biz.dal.entity.ReplacementInstrumentActivity;
|
|
|
import com.ym.mec.biz.dal.entity.ReplacementInstrumentCooperation;
|
|
|
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.dal.page.ReplacementInstrumentCooperationQueryInfo;
|
|
|
import com.ym.mec.biz.service.ReplacementInstrumentCooperationService;
|
|
|
+import com.ym.mec.biz.service.SysMessageService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
|
+import com.ym.mec.util.http.HttpUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
public class ReplacementInstrumentCooperationServiceImpl extends BaseServiceImpl<Integer, ReplacementInstrumentCooperation> implements ReplacementInstrumentCooperationService {
|
|
@@ -24,6 +34,10 @@ public class ReplacementInstrumentCooperationServiceImpl extends BaseServiceImpl
|
|
|
private ReplacementInstrumentCooperationDao replacementInstrumentCooperationDao;
|
|
|
@Autowired
|
|
|
private ReplacementInstrumentActivityDao replacementInstrumentActivityDao;
|
|
|
+ @Autowired
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
+ @Autowired
|
|
|
+ private SysConfigDao sysConfigDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, ReplacementInstrumentCooperation> getDAO() {
|
|
@@ -46,6 +60,25 @@ public class ReplacementInstrumentCooperationServiceImpl extends BaseServiceImpl
|
|
|
replacementInstrumentActivityDao.openPay(replacementInstrumentCooperation.getCooperationOrganId());
|
|
|
|
|
|
//发送推送链接
|
|
|
+ //家长您好!您订购的 {乐器品牌}品牌乐器已经开始接受预定,请点击{链接地址}完成付款,付款后15个工作日以内到货,如有疑问请咨询乐团管理老师。
|
|
|
+ List<ReplacementInstrumentActivityStatDto> pushUsers = replacementInstrumentActivityDao.getPushUsers(replacementInstrumentCooperation.getCooperationOrganId());
|
|
|
+
|
|
|
+ Map<Integer, String> userMap = new HashMap<>();
|
|
|
+ Map<Integer, String> userPhoneMap = new HashMap<>();
|
|
|
+
|
|
|
+ String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
|
+ String pushUrl = baseApiUrl + "/#/auditionActive/1?id=";
|
|
|
+ for (ReplacementInstrumentActivityStatDto pushUser : pushUsers) {
|
|
|
+ userMap.clear();
|
|
|
+ userPhoneMap.clear();
|
|
|
+ userMap.put(pushUser.getUserId(), pushUser.getUserId().toString());
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.REPLACEMENT_PAY_PUSH,
|
|
|
+ userMap, null, 0, "5?" + pushUrl + pushUser.getId(), "STUDENT", pushUser.getBrand(), "");
|
|
|
+
|
|
|
+ userPhoneMap.put(pushUser.getUserId(), pushUser.getMobileNo());
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.REPLACEMENT_PAY_PUSH,
|
|
|
+ userPhoneMap, null, 0, null, "STUDENT", pushUser.getBrand(), HttpUtil.getSortUrl(pushUrl + pushUser.getId()));
|
|
|
+ }
|
|
|
|
|
|
return replacementInstrumentCooperation;
|
|
|
}
|