|
@@ -13,6 +13,9 @@ import com.yonge.cooleshow.biz.dal.dto.ActivityPlanPayDto;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.req.OrderReq;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.ActivityPlanSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.*;
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.SourceTypeEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.service.*;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.ActivityMusicVo;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.ActivityPlanVo;
|
|
@@ -23,6 +26,8 @@ import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
import com.yonge.cooleshow.common.enums.ActivityTypeEnum;
|
|
|
import com.yonge.cooleshow.common.enums.RegistrationMethodEnum;
|
|
|
import com.yonge.toolset.base.exception.BizException;
|
|
|
+import com.yonge.toolset.base.util.StringUtil;
|
|
|
+import com.yonge.toolset.thirdparty.message.MessageSenderPluginContext;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.slf4j.Logger;
|
|
@@ -35,7 +40,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.*;
|
|
|
import java.util.Date;
|
|
|
+
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
|
|
@@ -61,7 +68,10 @@ public class ActivityPlanServiceImpl extends ServiceImpl<ActivityPlanDao, Activi
|
|
|
@Autowired
|
|
|
private ActivityEvaluationRecordService activityEvaluationRecordService;
|
|
|
|
|
|
- @Override
|
|
|
+ @Autowired
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
+
|
|
|
+ @Override
|
|
|
public ActivityPlanVo detail(Long id) {
|
|
|
ActivityPlanVo detail = baseMapper.detail(id);
|
|
|
if (null != detail) {
|
|
@@ -188,12 +198,14 @@ public class ActivityPlanServiceImpl extends ServiceImpl<ActivityPlanDao, Activi
|
|
|
@Override
|
|
|
public HttpResponseResult<OrderCreateRes> orderCreate(OrderReq.OrderReqInfo orderReqInfo) {
|
|
|
|
|
|
+ log.info("活动购买 参数 --> {}",orderReqInfo);
|
|
|
+
|
|
|
+ // 检查用户
|
|
|
getSysUser(orderReqInfo.getUserId());
|
|
|
ActivityPlanPayDto activityPlanPayDto = JSON.parseObject(
|
|
|
JSON.toJSONString(orderReqInfo.getBizContent()), ActivityPlanPayDto.class);
|
|
|
|
|
|
- // 检查活动购买
|
|
|
-
|
|
|
+ // 检查活动购买是否已购买
|
|
|
checkActivityPay(activityPlanPayDto.getActivityId());
|
|
|
|
|
|
|
|
@@ -292,9 +304,25 @@ public class ActivityPlanServiceImpl extends ServiceImpl<ActivityPlanDao, Activi
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 参与活动消息
|
|
|
+ */
|
|
|
private void sendMessage(String activityName, Long userId) {
|
|
|
+ try {
|
|
|
+ // 发送消息
|
|
|
+ SysUser user = sysUserFeignService.queryUserById(userId);
|
|
|
+
|
|
|
+ Map<Long, String> receivers = new HashMap<>();
|
|
|
+ receivers.put(userId, user.getPhone());
|
|
|
+
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.ACTIVITY_JOIN_MESSAGE, receivers, null,
|
|
|
+ 0, null, ClientEnum.STUDENT.getCode(), user.getUsername(), activityName);
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("活动参与发送消息失败--> {}",e.fillInStackTrace());
|
|
|
+ }
|
|
|
|
|
|
- // TODO 发送消息
|
|
|
|
|
|
}
|
|
|
|