JiangChongBo 2 tahun lalu
induk
melakukan
59d3986434

+ 2 - 0
src/main/java/com/caimei/controller/wechat/WxAuthApi.java

@@ -474,6 +474,7 @@ public class WxAuthApi {
         String licenseOssName=jsonObject.getString("licenseOssName");
         Integer authId=jsonObject.getInteger("authId");
         Integer authuser=jsonObject.getInteger("authUserId");
+//        Integer clubUserId=jsonObject.getInteger("clubUserId");
         //判断该账号是否已经参赛
         List<RossChallengeRoundVo> infoByUserName = authService.getInfoByUserName(mobile);
         if(null !=infoByUserName&&infoByUserName.size()>0){
@@ -490,6 +491,7 @@ public class WxAuthApi {
         rossChallengeRoundVo.setAuthId(authId);
         rossChallengeRoundVo.setLicenseOssUrl(licenseOssUrl);
         rossChallengeRoundVo.setLicenseOssName(licenseOssName);
+//        rossChallengeRoundVo.setClubUserId(clubUserId);
         if(StringUtils.isEmpty(licenseOssUrl)&&StringUtils.isEmpty(licenseOssName)){
             rossChallengeRoundVo.setAuthenticationStatus(1);
         }else{

+ 2 - 0
src/main/java/com/caimei/mapper/cmMapper/AuthMapper.java

@@ -187,6 +187,8 @@ public interface AuthMapper {
 
     void saveRossInfo(RossChallengeRoundVo rossChallengeRoundVo);
 
+    Integer getClubUserId(@Param("mobile")String mobile);
+
     List<RossChallengeRoundVo> getInfoByUserName(@Param("userName")String userName);
 
     List<RossChallengeRoundVo> getcontestedInfo(Integer authUserId);

+ 3 - 0
src/main/java/com/caimei/mapper/cmMapper/ClubMapper.java

@@ -54,4 +54,7 @@ public interface ClubMapper {
 
     //根據id獲取用戶信息
     WxClubUserVo getUserInfoByToken(Integer clubUserId);
+
+    //根据id更新authid到V1.7.7版本信息ross挑战赛机构表
+    void upAuthByid(Integer clubUserId,Integer authId);
 }

+ 4 - 0
src/main/java/com/caimei/model/vo/RossChallengeRoundVo.java

@@ -44,6 +44,10 @@ public class RossChallengeRoundVo {
      * 是否资质认证(0:未认证;1:已认证)
      */
     private Integer authenticationStatus;
+    /**
+     * 用户id
+     */
+    private Integer clubUserId;
     /**
      * 参赛时间(用于前端展示)
      */

+ 6 - 0
src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java

@@ -5,6 +5,7 @@ import com.caimei.model.ResponseJson;
 import com.caimei.model.po.ClubUserPo;
 import com.caimei.model.vo.*;
 import com.caimei.service.auth.AuthClubService;
+import com.caimei.utils.CodeUtil;
 import com.caimei.utils.Md5Util;
 import com.caimei.utils.SmsUtils;
 import com.github.pagehelper.PageHelper;
@@ -193,6 +194,9 @@ public class AuthClubServiceImpl implements AuthClubService {
                 if(authUserId==12){
                     authParty="西班牙ROSS";
                 }
+                //生成短连接
+                String s = CodeUtil.generateAccount(8);
+                System.out.println();
                 //短信类型:1通知短信,2验证码短信,3营销短信
                 Integer type=3;
                 String conn="[" + authParty + "]尊敬的会员,ROSS视频挑战赛报名通道已开启,点此【http://f6d.cn/Fgp6r】进入ROSS认证通,了解详情";
@@ -257,6 +261,8 @@ public class AuthClubServiceImpl implements AuthClubService {
     @Override
     public ResponseJson saveBindAuth(Integer authId,String authParty,Integer authUserId,Integer clubUserId){
         clubMapper.saveBindAuth(authId,authParty,authUserId,clubUserId);
+        //1.7.7ross挑战赛新加逻辑:更新机构信息到挑战赛表
+        clubMapper.upAuthByid(clubUserId,authId);
         return ResponseJson.success("绑定机构成功");
     }
 }

+ 3 - 8
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -1914,15 +1914,10 @@ public class AuthServiceImpl implements AuthService {
      */
     @Override
     public ResponseJson saveRossInfo(RossChallengeRoundVo rossChallengeRoundVo){
+        //根据手机号获取clubuserid
+        Integer clubUserId = authMapper.getClubUserId(rossChallengeRoundVo.getUserName());
+        rossChallengeRoundVo.setClubUserId(clubUserId);
         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();
     }
 

+ 6 - 3
src/main/resources/mapper/AuthMapper.xml

@@ -826,9 +826,12 @@
         where id=#{videoId}
     </update>
     <insert id="saveRossInfo" parameterType="com.caimei.model.vo.RossChallengeRoundVo">
-        insert into cm_ross_challenge_round(authUserId,authId,userName,contestStatus,contestTime,licenseOssUrl,licenseOssName,authenticationStatus)
-        values(#{authUserId},#{authId},#{userName},#{contestStatus},#{contestTime},#{licenseOssUrl},#{licenseOssName},#{authenticationStatus})
+        insert into cm_ross_challenge_round(authUserId,authId,userName,contestStatus,contestTime,licenseOssUrl,licenseOssName,authenticationStatus,clubUserId)
+        values(#{authUserId},#{authId},#{userName},#{contestStatus},#{contestTime},#{licenseOssUrl},#{licenseOssName},#{authenticationStatus},#{clubUserId})
     </insert>
+    <select id="getClubUserId" resultType="java.lang.Integer">
+        select id from cm_brand_club_user where mobile=#{mobile}
+    </select>
     <select id="getInfoByUserName" resultType="com.caimei.model.vo.RossChallengeRoundVo">
         select * from cm_ross_challenge_round where userName=#{userName} and contestStatus=1
     </select>
@@ -879,7 +882,7 @@
         <if test="null!=mobile and mobile !=''">
             and  cr.userName like concat('%', #{mobile})
         </if>
-        order by contestTime
+        order by contestTime desc
     </select>
     <delete id="delAuthInfoById">
         delete from cm_ross_challenge_round where id=#{id}

+ 5 - 0
src/main/resources/mapper/ClubMapper.xml

@@ -195,4 +195,9 @@
                  left join cm_brand_auth_user au on a.authUserId = au.authUserId
         where  cu.delFlag = 0 and cu.id = #{clubUserId}
     </select>
+    <update id="upAuthByid">
+        update cm_ross_challenge_round
+        set authId = #{authId}
+        where clubUserId = #{clubUserId}
+    </update>
 </mapper>