|
@@ -12,6 +12,7 @@ import com.fs.activity.service.AccTeamService;
|
|
|
import com.fs.activity.mapper.AccTeamMapper;
|
|
import com.fs.activity.mapper.AccTeamMapper;
|
|
|
import com.fs.activity.utils.CodeGenerator;
|
|
import com.fs.activity.utils.CodeGenerator;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
|
|
+import com.fs.im.service.OpenIMService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -31,6 +32,9 @@ public class AccTeamServiceImpl extends ServiceImpl<AccTeamMapper, AccTeam>
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private AccTeamMemberMapper accTeamMemberMapper;
|
|
private AccTeamMemberMapper accTeamMemberMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private OpenIMService openIMService;
|
|
|
|
|
+
|
|
|
private final static Integer TEAM_MAX_MEMBER_COUNT = 26;
|
|
private final static Integer TEAM_MAX_MEMBER_COUNT = 26;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -83,6 +87,15 @@ public class AccTeamServiceImpl extends ServiceImpl<AccTeamMapper, AccTeam>
|
|
|
if(accTeamMemberMapper.insert(accTeamMember)<=0){
|
|
if(accTeamMemberMapper.insert(accTeamMember)<=0){
|
|
|
throw new RuntimeException("创建队员失败");
|
|
throw new RuntimeException("创建队员失败");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 异步发送im消息推送
|
|
|
|
|
+ String userId=String.valueOf(accTeam.getLeaderId());
|
|
|
|
|
+ StringBuilder textBuilder=new StringBuilder();
|
|
|
|
|
+ textBuilder.append("| 创建队伍成功 | 恭喜您加入【").append(accTeam.getTeamName()).append("】成功!队伍码:").append(accTeam.getTeamCode());
|
|
|
|
|
+ String text=textBuilder.toString();
|
|
|
|
|
+ String title="广场舞活动";
|
|
|
|
|
+ openIMService.sendSystemMsgAsync(userId,text,title);
|
|
|
|
|
+
|
|
|
return R.ok().put("data",accTeam);
|
|
return R.ok().put("data",accTeam);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -159,6 +172,15 @@ public class AccTeamServiceImpl extends ServiceImpl<AccTeamMapper, AccTeam>
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 异步发送im消息推送
|
|
|
|
|
+ String userId=String.valueOf(accTeam.getUserId());
|
|
|
|
|
+ StringBuilder textBuilder=new StringBuilder();
|
|
|
|
|
+ textBuilder.append("| 加入队伍成功 | 恭喜您加入【").append(team.getTeamName()).append("】成功!");
|
|
|
|
|
+ String text=textBuilder.toString();
|
|
|
|
|
+ String title="广场舞活动";
|
|
|
|
|
+ openIMService.sendSystemMsgAsync(userId,text,title);
|
|
|
|
|
+
|
|
|
return R.ok();
|
|
return R.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|