|
@@ -8,6 +8,7 @@ import com.caimei.components.RedisService;
|
|
|
import com.caimei.config.FastDfsClient;
|
|
|
import com.caimei.mapper.cmMapper.AuthMapper;
|
|
|
import com.caimei.mapper.cmMapper.AuthProductMapper;
|
|
|
+import com.caimei.mapper.cmMapper.ClubMapper;
|
|
|
import com.caimei.mapper.ldmMapper.LdmMapper;
|
|
|
import com.caimei.model.ResponseJson;
|
|
|
import com.caimei.model.po.*;
|
|
@@ -124,6 +125,9 @@ public class AuthServiceImpl implements AuthService {
|
|
|
@Resource
|
|
|
private RedisService redisService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private ClubMapper clubMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty,
|
|
|
String mobile, Integer status, Integer starFlag, Integer auditStatus,
|
|
@@ -1275,7 +1279,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
Date date=new Date();
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String releaseTime = sf.format(date).replace("T", "");
|
|
|
- authMapper.saveVideo(ross.getUserName(),ross.getCover(),ross.getOssUrl(),ross.getOssName(),ross.getTitle(),releaseTime,ross.getAuthId(),ross.getLinked());
|
|
|
+ authMapper.saveVideo(ross.getUserName(),ross.getCover(),ross.getOssUrl(),ross.getOssName(),ross.getTitle(),releaseTime,ross.getAuthId(),ross.getLinked(),ross.getAuthUserId());
|
|
|
return ResponseJson.success("保存成功",null);
|
|
|
}
|
|
|
|
|
@@ -1706,9 +1710,9 @@ public class AuthServiceImpl implements AuthService {
|
|
|
public ResponseJson downLoadChoseZip(String fileId,HttpServletResponse response){
|
|
|
if (fileId.contains(",")) {
|
|
|
String[] split = fileId.split(",");
|
|
|
- ArrayList<ChallengeRoundVo> fileTreeVos = new ArrayList<>();
|
|
|
+ ArrayList<RossChallengeVideo> fileTreeVos = new ArrayList<>();
|
|
|
for (String s : split) {
|
|
|
- ChallengeRoundVo file = authMapper.getChallengeRoundInfo(Integer.valueOf(s));
|
|
|
+ RossChallengeVideo file = authMapper.getChallengeVideoInfo(Integer.valueOf(s));
|
|
|
fileTreeVos.add(file);
|
|
|
}
|
|
|
//有package则在服务器固定路径new file.mkdir
|
|
@@ -1721,7 +1725,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
}
|
|
|
boolean mkdirs = new File(filePath).mkdirs();
|
|
|
Assert.isTrue(mkdirs, "文件夹创建失败");
|
|
|
- for (ChallengeRoundVo challengeRoundVo : fileTreeVos) {
|
|
|
+ for (RossChallengeVideo challengeRoundVo : fileTreeVos) {
|
|
|
//普通文件直接下载到临时文件夹uuid下
|
|
|
String fileName = "";
|
|
|
String ossurl = challengeRoundVo.getOssUrl();
|
|
@@ -1783,8 +1787,8 @@ public class AuthServiceImpl implements AuthService {
|
|
|
file.delete();
|
|
|
FileZipUtils.deleteFile(new File(zipPath));
|
|
|
}else {
|
|
|
- ArrayList<ChallengeRoundVo> fileTreeVos = new ArrayList<>();
|
|
|
- ChallengeRoundVo f = authMapper.getChallengeRoundInfo(Integer.valueOf(fileId));
|
|
|
+ ArrayList<RossChallengeVideo> fileTreeVos = new ArrayList<>();
|
|
|
+ RossChallengeVideo f = authMapper.getChallengeVideoInfo(Integer.valueOf(fileId));
|
|
|
fileTreeVos.add(f);
|
|
|
//有package则在服务器固定路径new file.mkdir
|
|
|
UUID uuid = UUID.randomUUID();
|
|
@@ -1796,7 +1800,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
}
|
|
|
boolean mkdirs = new File(filePath).mkdirs();
|
|
|
Assert.isTrue(mkdirs, "文件夹创建失败");
|
|
|
- for (ChallengeRoundVo challengeRoundVo : fileTreeVos) {
|
|
|
+ for (RossChallengeVideo challengeRoundVo : fileTreeVos) {
|
|
|
//普通文件直接下载到临时文件夹uuid下
|
|
|
String fileName = "";
|
|
|
String ossurl = challengeRoundVo.getOssUrl();
|
|
@@ -1937,7 +1941,14 @@ public class AuthServiceImpl implements AuthService {
|
|
|
* @return
|
|
|
*/
|
|
|
public ResponseJson<RossChallengeRoundVo> checkContestedInfo(String mobile){
|
|
|
- return ResponseJson.success(authMapper.getcontestedInfoByUserName(mobile));
|
|
|
+ RossChallengeRoundVo ross=new RossChallengeRoundVo();
|
|
|
+ RossChallengeRoundVo rossChallengeRoundVo = authMapper.getcontestedInfoByUserName(mobile);
|
|
|
+ if(null!=rossChallengeRoundVo&&null!=rossChallengeRoundVo.getContestStatus()){
|
|
|
+ ross.setContestStatus(rossChallengeRoundVo.getContestStatus());
|
|
|
+ }else{
|
|
|
+ ross.setContestStatus(0);
|
|
|
+ }
|
|
|
+ return ResponseJson.success(ross);
|
|
|
}
|
|
|
/**
|
|
|
* 获取已报名信息列表
|
|
@@ -1955,23 +1966,28 @@ public class AuthServiceImpl implements AuthService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseJson<List<RossChallengeVideo>> getVideoAll(String mobileOrAuthpart,Integer clubUserId){
|
|
|
- List<RossChallengeVideo> videoAll = authMapper.getVideoAll(mobileOrAuthpart);
|
|
|
+ public ResponseJson<PageInfo<RossChallengeVideo>> getVideoAll(String mobileOrAuthpart,Integer clubUserId,Integer authUserId,Integer pageNum,Integer pageSize){
|
|
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
|
+ List<RossChallengeVideo> videoAll = authMapper.getVideoAll(mobileOrAuthpart,authUserId);
|
|
|
+ PageInfo<RossChallengeVideo> pageData = new PageInfo<>(videoAll);
|
|
|
//获取该用户点赞过的视频
|
|
|
- if(null!=videoAll&& videoAll.size()>0){
|
|
|
- for(RossChallengeVideo video:videoAll){
|
|
|
- if (StringUtils.isNotEmpty(video.getClubUserIds())) {
|
|
|
- if (video.getClubUserIds().contains(clubUserId.toString())) {
|
|
|
- video.setDiggStatus(1);
|
|
|
- } else {
|
|
|
- video.setDiggStatus(0);
|
|
|
- }
|
|
|
- } else {
|
|
|
- video.setDiggStatus(0);
|
|
|
- }
|
|
|
- };
|
|
|
+ //如果clubUserId为空,用户不能点赞,直接返回所有视频
|
|
|
+ if(null!=clubUserId){
|
|
|
+ if(null!=videoAll&& videoAll.size()>0){
|
|
|
+ for(RossChallengeVideo video:videoAll){
|
|
|
+ if (StringUtils.isNotEmpty(video.getClubUserIds())) {
|
|
|
+ if (video.getClubUserIds().contains(clubUserId.toString())) {
|
|
|
+ video.setDiggStatus(1);
|
|
|
+ } else {
|
|
|
+ video.setDiggStatus(0);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ video.setDiggStatus(0);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|
|
|
- return ResponseJson.success(videoAll);
|
|
|
+ return ResponseJson.success(pageData);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1983,6 +1999,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
public ResponseJson<List<RossChallengeVideo>> getVideoByUsername(String mobile,Integer clubUserId){
|
|
|
List<RossChallengeVideo> videoByUsername = authMapper.getVideoByUsername(mobile);
|
|
|
//获取该用户点赞过的视频
|
|
|
+ if(null!=clubUserId){
|
|
|
if(null!=videoByUsername&& videoByUsername.size()>0){
|
|
|
for(RossChallengeVideo video:videoByUsername){
|
|
|
if (StringUtils.isNotEmpty(video.getClubUserIds())) {
|
|
@@ -1996,6 +2013,8 @@ public class AuthServiceImpl implements AuthService {
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
return ResponseJson.success(videoByUsername);
|
|
|
|
|
|
}
|
|
@@ -2055,8 +2074,12 @@ public class AuthServiceImpl implements AuthService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseJson<List<RossChallengeRoundVo>> getAuthInfo(String mobile){
|
|
|
- List<RossChallengeRoundVo> authInfo = authMapper.getAuthInfo(mobile);
|
|
|
+ public ResponseJson<PageInfo<RossChallengeRoundVo>> getAuthInfo(String mobile,Integer pageNum,Integer pageSize,Integer authUserId){
|
|
|
+ //获取活动时间内的机构列表信息
|
|
|
+ ChallengeActivityVo activityTime = authMapper.getActivityTime(authUserId);
|
|
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
|
+ List<RossChallengeRoundVo> authInfo = authMapper.getAuthInfo(mobile,authUserId,activityTime.getStartTime(),activityTime.getEndTime());
|
|
|
+ PageInfo<RossChallengeRoundVo> pageData = new PageInfo<>(authInfo);
|
|
|
if(null!=authInfo&&authInfo.size()>0){
|
|
|
for (RossChallengeRoundVo search:authInfo) {
|
|
|
if(null != search.getContestTime()){
|
|
@@ -2067,7 +2090,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return ResponseJson.success(authInfo);
|
|
|
+ return ResponseJson.success(pageData);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2100,20 +2123,25 @@ public class AuthServiceImpl implements AuthService {
|
|
|
|
|
|
public void smsSend(Integer authUserId){
|
|
|
//获取手机号码
|
|
|
- List<RossChallengeRoundVo> roundByAuthUserID = authMapper.getRoundByAuthUserID(authUserId);
|
|
|
+// List<RossChallengeRoundVo> roundByAuthUserID = authMapper.getRoundByAuthUserID(authUserId);
|
|
|
+ List<ClubUserVo> clubUserList = clubMapper.getClubUserList(authUserId, null, null, null);
|
|
|
//获取供应商名称
|
|
|
String authParty=authMapper.getAuthparty(authUserId);
|
|
|
+ if(authUserId==12){
|
|
|
+ authParty="西班牙ROSS";
|
|
|
+ }
|
|
|
//短信类型:1通知短信,2验证码短信,3营销短信
|
|
|
- Integer type=1;
|
|
|
- String conn="[" + authParty + "]认证通抖音视频挑战赛邀您参与获大奖,点击链接:https://zp.caimei365.com/12/ross/activity/challenge或去Ross认证通打开";
|
|
|
- if(null!=roundByAuthUserID&& roundByAuthUserID.size()>0){
|
|
|
- roundByAuthUserID.stream().forEach(round ->{
|
|
|
- if(StringUtils.isNotEmpty(round.getUserName())){
|
|
|
- Boolean aBoolean = SmsUtils.sendSms(type, round.getUserName(), conn);
|
|
|
+ Integer type=3;
|
|
|
+ //[s{20}]尊敬的会员,ROSS视频挑战赛报名通道已开启,点此【http://f6d.cn/Fgp6r】进入ROSS认证通,了解详情。
|
|
|
+ String conn="[" + authParty + "]尊敬的会员,ROSS视频挑战赛报名通道已开启,点此【http://f6d.cn/Fgp6r】进入ROSS认证通,了解详情";
|
|
|
+ if(null!=clubUserList&& clubUserList.size()>0){
|
|
|
+ clubUserList.stream().forEach(round ->{
|
|
|
+ if(StringUtils.isNotEmpty(round.getMobile())){
|
|
|
+ Boolean aBoolean = SmsUtils.sendSms(type, round.getMobile(), conn);
|
|
|
if(aBoolean){
|
|
|
- log.info("挑战赛短信发送成功"+round.getUserName());
|
|
|
+ log.info("挑战赛短信发送成功"+round.getMobile());
|
|
|
}else{
|
|
|
- log.info("挑战赛短信发送失败"+round.getUserName());
|
|
|
+ log.info("挑战赛短信发送失败"+round.getMobile());
|
|
|
}
|
|
|
}
|
|
|
});
|