|
@@ -14,6 +14,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;
|
|
@@ -24,6 +27,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;
|
|
@@ -40,10 +45,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.*;
|
|
|
import java.util.Date;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Optional;
|
|
|
|
|
|
|
|
|
@Service
|
|
@@ -67,6 +70,9 @@ public class ActivityPlanServiceImpl extends ServiceImpl<ActivityPlanDao, Activi
|
|
|
@Autowired
|
|
|
private ActivityEvaluationRecordService activityEvaluationRecordService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
+
|
|
|
@Override
|
|
|
public ActivityPlanVo detail(Long id) {
|
|
|
ActivityPlanVo detail = baseMapper.detail(id);
|
|
@@ -182,12 +188,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());
|
|
|
|
|
|
|
|
@@ -286,9 +294,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 发送消息
|
|
|
|
|
|
}
|
|
|
|