|
@@ -1266,6 +1266,18 @@ public class AuthServiceImpl implements AuthService {
|
|
|
authMapper.saveVideoInfo(cr.getUserName(),cr.getCover(),cr.getOssUrl(),cr.getOssName(),cr.getTitle(),releaseTime,cr.getAuthId(),cr.getAuthUserId());
|
|
|
return ResponseJson.success("保存成功",null);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 1.7.7保存视频信息
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson saveVideo(RossChallengeVideo ross){
|
|
|
+ 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());
|
|
|
+ return ResponseJson.success("保存成功",null);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 根据authid获取authUserId
|
|
@@ -1552,8 +1564,18 @@ public class AuthServiceImpl implements AuthService {
|
|
|
}
|
|
|
if(challengeList.size()<0||!authUserIdList.contains(authUserId)){
|
|
|
authMapper.saveActivityInfo(startTime,endTime,status,authUserId);
|
|
|
+ //1.7.7ross挑战赛新加逻辑
|
|
|
+ //活动开启后给供应商下所有机构手机号码发送短信
|
|
|
+ if(status==1){
|
|
|
+ smsSend(authUserId);
|
|
|
+ }
|
|
|
}else {
|
|
|
authMapper.upActivityInfo(startTime,endTime,status,authUserId);
|
|
|
+ //1.7.7ross挑战赛新加逻辑
|
|
|
+ //活动开启后给供应商下所有机构手机号码发送短信
|
|
|
+ if(status==1){
|
|
|
+ smsSend(authUserId);
|
|
|
+ }
|
|
|
}
|
|
|
return ResponseJson.success();
|
|
|
}
|
|
@@ -1607,7 +1629,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
if(activityTime!=null){
|
|
|
//当按钮关闭时,状态皆为已结束,开始时根据时间判断
|
|
|
if(activityTime.getStatus()==0){
|
|
|
- activityTime.setActivityState(2);
|
|
|
+ activityTime.setActivityState(0);
|
|
|
}else{
|
|
|
if(activityTime.getStartTime().compareTo(releaseTime)>0){
|
|
|
activityTime.setActivityState(0);
|
|
@@ -1889,6 +1911,14 @@ public class AuthServiceImpl implements AuthService {
|
|
|
@Override
|
|
|
public ResponseJson saveRossInfo(RossChallengeRoundVo rossChallengeRoundVo){
|
|
|
authMapper.saveRossInfo(rossChallengeRoundVo);
|
|
|
+ //如果活动已经开始了,则用户报名成功后向用户发送短信
|
|
|
+ if(null!=rossChallengeRoundVo.getAuthUserId()){
|
|
|
+ ChallengeActivityVo activityTime = authMapper.getActivityTime(rossChallengeRoundVo.getAuthUserId());
|
|
|
+ //判断活动是否开启
|
|
|
+ if(null!=activityTime &&null!=rossChallengeRoundVo.getAuthUserId()&&null!=activityTime.getStatus()&&activityTime.getStatus()==1){
|
|
|
+ smsSend(rossChallengeRoundVo.getAuthUserId());
|
|
|
+ }
|
|
|
+ }
|
|
|
return ResponseJson.success();
|
|
|
}
|
|
|
|
|
@@ -1922,4 +1952,113 @@ public class AuthServiceImpl implements AuthService {
|
|
|
List<RossChallengeVideo> videoAll = authMapper.getVideoAll(mobileOrAuthpart);
|
|
|
return ResponseJson.success(videoAll);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据手机号码查询该机构视频列表
|
|
|
+ * @param mobile 登录账号
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson<List<RossChallengeVideo>> getVideoByUsername(String mobile){
|
|
|
+ List<RossChallengeVideo> videoByUsername = authMapper.getVideoByUsername(mobile);
|
|
|
+ return ResponseJson.success(videoByUsername);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 验证机构是否已经上传了3个视频
|
|
|
+ * @param mobile 登录账号
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson<List<RossChallengeVideo>> checkVideoByUsername(String mobile){
|
|
|
+ List<RossChallengeVideo> rossChallengeVideos = authMapper.checkVideoByUsername(mobile);
|
|
|
+ if(null!=rossChallengeVideos&&rossChallengeVideos.size()>=3){
|
|
|
+ return ResponseJson.success(-1,"抱歉,最多只能上传3个视频!!!",null);
|
|
|
+ }else{
|
|
|
+ return ResponseJson.success();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 点赞与取消点赞
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson upVideoDiggCount(Integer id,Integer diggFlag){
|
|
|
+ authMapper.upVideoDiggCount(id,diggFlag);
|
|
|
+ return ResponseJson.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询机构信息(后端)
|
|
|
+ * @param mobile
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson<List<RossChallengeRoundVo>> getAuthInfo(String mobile){
|
|
|
+ List<RossChallengeRoundVo> authInfo = authMapper.getAuthInfo(mobile);
|
|
|
+ if(null!=authInfo&&authInfo.size()>0){
|
|
|
+ for (RossChallengeRoundVo search:authInfo) {
|
|
|
+ if(null != search.getContestTime()){
|
|
|
+ SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date da=new Date(search.getContestTime().getTime());
|
|
|
+ String date = fmt.format(da);
|
|
|
+ search.setContestDate(date);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResponseJson.success(authInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据id删除机构信息
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson delAuthInfoById(Integer id){
|
|
|
+ //先删除机构对应的视频信息
|
|
|
+ RossChallengeRoundVo round = authMapper.getRoundById(id);
|
|
|
+ if(null!=round && StringUtils.isNotEmpty(round.getUserName())){
|
|
|
+ authMapper.delVideoInfoByUserName(round.getUserName());
|
|
|
+ }
|
|
|
+ //再删除机构信息
|
|
|
+ authMapper.delAuthInfoById(id);
|
|
|
+ return ResponseJson.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据id删除视频信息
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson delVideoInfoById(Integer id){
|
|
|
+ authMapper.delVideoInfoById(id);
|
|
|
+ return ResponseJson.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void smsSend(Integer authUserId){
|
|
|
+ //获取手机号码
|
|
|
+ List<RossChallengeRoundVo> roundByAuthUserID = authMapper.getRoundByAuthUserID(authUserId);
|
|
|
+ //获取供应商名称
|
|
|
+ String authParty=authMapper.getAuthparty(authUserId);
|
|
|
+ //短信类型: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);
|
|
|
+ if(aBoolean){
|
|
|
+ log.info("挑战赛短信发送成功"+round.getUserName());
|
|
|
+ }else{
|
|
|
+ log.info("挑战赛短信发送失败"+round.getUserName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|