Просмотр исходного кода

活动开启短信通知bugfix

JiangChongBo 2 лет назад
Родитель
Сommit
39a6992cb5

+ 10 - 9
src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java

@@ -12,6 +12,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -41,6 +42,8 @@ public class AuthClubServiceImpl implements AuthClubService {
 
     @Resource
     private DoctorMapper doctorMapper;
+    @Value("${caimei.zpapi}")
+    private String zpServer;
 
     @Override
     public ResponseJson<PageInfo<ClubVo>> getClubList(Integer authUserId, String authParty, Integer pageNum, Integer pageSize) {
@@ -187,7 +190,7 @@ public class AuthClubServiceImpl implements AuthClubService {
         //如果活动已经开始了,则用户报名成功后向用户发送短信
         if(null!=authUserId){
             ChallengeActivityVo activityTime = authMapper.getActivityTime(authUserId);
-            String shortLink = getShortLink(8, 3, "activity/challenge");
+            String shortLink =getShortLink(8, 3, zpServer+"/12/ross/activity/challenge");
             //判断活动是否开启
             if(null!=activityTime &&null!=authUserId&&null!=activityTime.getStatus()&&activityTime.getStatus()==1){
                 //获取供应商名称
@@ -196,18 +199,16 @@ public class AuthClubServiceImpl implements AuthClubService {
                     authParty="西班牙ROSS";
                 }
                 //生成短连接
-                String s = CodeUtil.generateAccount(8);
-                System.out.println();
                 //短信类型:1通知短信,2验证码短信,3营销短信
                 Integer type=3;
-                String conn="[" + authParty + "]尊敬的会员,ROSS视频挑战赛报名通道已开启,点此进入https://zp.caimei365.com/12/ross/"+shortLink+"ROSS认证通,了解详情。";
+                String conn="[" + authParty + "]尊敬的会员,ROSS视频挑战赛报名通道已开启,点此进入www.caimei365.com/t/"+shortLink+" ROSS认证通,了解详情。【采美网提供技术支持】";
                 if(StringUtils.isNotEmpty(mobile)){
                     Boolean aBoolean = SmsUtils.sendSms(type, mobile, conn);
-                    if(aBoolean){
-                        log.info("挑战赛短信发送成功"+mobile);
-                    }else{
-                        log.info("挑战赛短信发送失败"+mobile);
-                    }
+//                    if(aBoolean){
+//                        log.info("挑战赛短信发送成功"+mobile);
+//                    }else{
+//                        log.info("挑战赛短信发送失败"+mobile);
+//                    }
                 }
             }
         }

+ 19 - 16
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -13,10 +13,7 @@ import com.caimei.mapper.ldmMapper.LdmMapper;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.po.*;
 import com.caimei.model.vo.*;
-import com.caimei.service.auth.AuthProductService;
-import com.caimei.service.auth.AuthService;
-import com.caimei.service.auth.ShopService;
-import com.caimei.service.auth.UploadService;
+import com.caimei.service.auth.*;
 import com.caimei.utils.*;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -128,6 +125,10 @@ public class AuthServiceImpl implements AuthService {
     @Resource
     private ClubMapper clubMapper;
 
+    @Resource
+    private AuthClubService authClubService;
+
+
     @Override
     public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty,
                                                       String mobile, Integer status, Integer starFlag, Integer auditStatus,
@@ -1578,16 +1579,16 @@ public class AuthServiceImpl implements AuthService {
             authMapper.saveActivityInfo(startTime,endTime,status,authUserId);
             //1.7.7ross挑战赛新加逻辑
             //活动开启后给供应商下所有机构手机号码发送短信
-//            if(status==1){
-//               smsSend(authUserId);
-//            }
+            if(status==1){
+               smsSend(authUserId);
+            }
         }else {
             authMapper.upActivityInfo(startTime,endTime,status,authUserId);
             //1.7.7ross挑战赛新加逻辑
             //活动开启后给供应商下所有机构手机号码发送短信
-//            if(status==1){
-//                smsSend(authUserId);
-//            }
+            if(status==1){
+                smsSend(authUserId);
+            }
         }
         return ResponseJson.success();
     }
@@ -2156,19 +2157,21 @@ public class AuthServiceImpl implements AuthService {
         if(authUserId==12){
             authParty="西班牙ROSS";
         }
+        //生成短链接
+        String shortLink = authClubService.getShortLink(8, 3, zpServer+"/12/ross/activity/challenge");
         //短信类型:1通知短信,2验证码短信,3营销短信
         Integer type=3;
         //[s{20}]尊敬的会员,ROSS视频挑战赛报名通道已开启,点此【http://f6d.cn/Fgp6r】进入ROSS认证通,了解详情。
-        String conn="[" + authParty + "]尊敬的会员,ROSS视频挑战赛报名通道已开启,点此https://zp.caimei365.com/12/ross/activity/challenge进入ROSS认证通,了解详情。";
+        String conn="[" + authParty + "]尊敬的会员,ROSS视频挑战赛报名通道已开启,点此进入www.caimei365.com/t/"+shortLink+" 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.getMobile());
-                    }else{
-                        log.info("挑战赛短信发送失败"+round.getMobile());
-                    }
+//                    if(aBoolean){
+//                        log.info("挑战赛短信发送成功"+round.getMobile());
+//                    }else{
+//                        log.info("挑战赛短信发送失败"+round.getMobile());
+//                    }
                 }
             });
         }

+ 1 - 0
src/main/java/com/caimei/utils/SmsUtils.java

@@ -61,6 +61,7 @@ public class SmsUtils {
                         if (code != 0) {
                             log.info("短信发送失败,手机号>>>>" + mobile);
                         } else {
+                            log.info("挑战赛短信发送成功"+mobile);
                             return true;
                         }
                     }