Prechádzať zdrojové kódy

预设二维码列表/机构关联

zhijiezhao 1 rok pred
rodič
commit
a6349310ae

+ 69 - 23
src/main/java/com/caimei/controller/admin/auth/AuthApi.java

@@ -6,6 +6,7 @@ import com.caimei.annotation.Idempotent;
 import com.caimei.annotation.WebHooks;
 import com.caimei.components.RedisService;
 import com.caimei.model.ResponseJson;
+import com.caimei.model.po.AuthQrcodePo;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.SysUser;
 import com.caimei.model.vo.*;
@@ -20,18 +21,6 @@ import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.http.Consts;
-import org.apache.http.HttpEntity;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.ContentType;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.util.EntityUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -39,7 +28,6 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.math.BigDecimal;
-import java.nio.charset.StandardCharsets;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -61,6 +49,56 @@ public class AuthApi {
     @Resource
     private RedisService redisService;
 
+    @ApiOperation("预设二维码列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
+            @ApiImplicitParam(name = "unionStatus", required = false, value = "激活状态 0未激活 1已激活"),
+            @ApiImplicitParam(name = "productTypeId", required = false, value = "设备类型Id"),
+            @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
+            @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
+    })
+    @GetMapping("/qrcode/list")
+    public ResponseJson<PageInfo<AuthQrcodePo>> getQrCodeList(Integer authUserId, Integer unionStatus, Integer productTypeId,
+                                                              @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+                                                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
+        return authService.getQrcodeList(authUserId, unionStatus, productTypeId, pageNum, pageSize);
+    }
+
+    @ApiOperation("二维码关联机构列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", required = true, value = "二维码Id"),
+            @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
+            @ApiImplicitParam(name = "productTypeId", required = true, value = "设备类型Id"),
+            @ApiImplicitParam(name = "authParty", required = false, value = "机构名称"),
+            @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
+            @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
+    })
+    @GetMapping("/concat/list")
+    public ResponseJson<PageInfo<AuthVo>> getConcatList(Integer id,Integer authUserId, Integer productTypeId, String authParty,
+                                                        @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+                                                        @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
+        return authService.getConcatList(id,authUserId, productTypeId, authParty, pageNum, pageSize);
+    }
+
+    @ApiOperation("批量生成二维码")
+    @ApiImplicitParam(name = "params", value = "authUserId:供应商Id;num:生成数量;productTypeId:设备类型id", required = true)
+    @PostMapping("/qrcode/made")
+    public ResponseJson getQrCodeList(@RequestBody Map<String, Integer> params) {
+        Integer authUserId = params.get("authUserId");
+        Integer num = params.get("num");
+        Integer productTypeId = params.get("productTypeId");
+        return authService.makeQrcode(authUserId, productTypeId, num);
+    }
+
+    @ApiOperation("预设二维码关联")
+    @ApiImplicitParam(name = "params", value = "authId:机构id;id:二维码id;", required = true)
+    @PostMapping("/qrcode/concat")
+    public ResponseJson concatQrcode(@RequestBody Map<String, Integer> params) {
+        Integer authId = params.get("authId");
+        Integer id = params.get("id");
+        return authService.concatQrcode(authId, id);
+    }
+
     /**
      * 授权列表
      */
@@ -534,10 +572,11 @@ public class AuthApi {
 
     /**
      * 清除抖音授权token缓存
+     *
      * @return
      */
     @GetMapping("/clean/douyin/redis")
-    public  ResponseJson cleanDYRedis(){
+    public ResponseJson cleanDYRedis() {
         redisService.remove("DYaccessToken");
         redisService.remove("DyrefreshToken");
         redisService.remove("DyopenId");
@@ -777,7 +816,7 @@ public class AuthApi {
      */
     @GetMapping("/get/published/video/list")
     public ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideoList(@CurrentUser SysUser sysUser, Integer status, String userName, String authParty, Integer cursor, Integer count, @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
-                                                                          @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,String startTIme,String endTime) {
+                                                                          @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, String startTIme, String endTime) {
         if (null == sysUser) {
             return ResponseJson.error("用户信息异常", null);
         }
@@ -793,7 +832,7 @@ public class AuthApi {
         if (cursor == null) {
             cursor = 0;
         }
-        return authService.getPublishedVideo(userName, authParty, status, cursor, count, authUserId, pageNum, pageSize,startTIme,endTime);
+        return authService.getPublishedVideo(userName, authParty, status, cursor, count, authUserId, pageNum, pageSize, startTIme, endTime);
     }
 
     /**
@@ -851,23 +890,26 @@ public class AuthApi {
     public ResponseJson<ChallengeRoundVo> getInfoById(Integer videoId) {
         return authService.getInfoById(videoId);
     }
+
     @GetMapping("/getDyVidoInfo")
-    public ResponseJson getDyVidoInfo(@CurrentUser SysUser sysUser){
+    public ResponseJson getDyVidoInfo(@CurrentUser SysUser sysUser) {
         Integer userIdentity = sysUser.getUserIdentity();
         Integer authUserId = 2 == userIdentity ? sysUser.getId() : 3 == userIdentity ? sysUser.getParentId() : null;
         return authService.getDyVidoInfo(authUserId);
     }
 //------------------------------------------抖音挑战赛1.7.7版本----------------------------------------------------------------------------------------------------------------
+
     /**
      * 查询机构信息(后端)
+     *
      * @param mobile
      * @return
      */
     @GetMapping("/get/auth/info")
     public ResponseJson<PageInfo<RossChallengeRoundVo>> getAuthInfo(String mobile,
-                                                                    @CurrentUser SysUser sysUser,Integer authenticationStatus,
-                                                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
-                                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){
+                                                                    @CurrentUser SysUser sysUser, Integer authenticationStatus,
+                                                                    @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+                                                                    @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
         if (null == sysUser) {
             return ResponseJson.error("用户信息异常", null);
         }
@@ -877,25 +919,29 @@ public class AuthApi {
         if (null == authUserId) {
             return ResponseJson.error("供应商用户id不能为空", null);
         }
-        return authService.getAuthInfo(mobile,pageNum,pageSize,authUserId,authenticationStatus);
+        return authService.getAuthInfo(mobile, pageNum, pageSize, authUserId, authenticationStatus);
     }
+
     /**
      * 根据id删除机构信息
+     *
      * @param id
      * @return
      */
     @GetMapping("/del/auth/info")
-    public ResponseJson delAuthInfoById(Integer id){
+    public ResponseJson delAuthInfoById(Integer id) {
         //删除机构信息
         return authService.delAuthInfoById(id);
     }
+
     /**
      * 根据id删除视频信息
+     *
      * @param id
      * @return
      */
     @GetMapping("/del/video/info")
-    public ResponseJson delVideoInfoById(Integer id){
+    public ResponseJson delVideoInfoById(Integer id) {
         return authService.delVideoInfoById(id);
     }
 }

+ 50 - 34
src/main/java/com/caimei/mapper/cmMapper/AuthMapper.java

@@ -1,5 +1,6 @@
 package com.caimei.mapper.cmMapper;
 
+import com.caimei.model.po.AuthQrcodePo;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.LdmDataPo;
 import com.caimei.model.po.TownPo;
@@ -7,6 +8,7 @@ import com.caimei.model.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -19,8 +21,9 @@ import java.util.List;
 @Mapper
 public interface AuthMapper {
 
-    List<AuthVo> getAuthList(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("mobile") String mobile, @Param("status") Integer status, @Param("starFlag")  Integer starFlag, @Param("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus, @Param("sendStatus") Integer sendStatus,@Param("authCode") String authCode);
-    List<AuthVo> getAuthListAll(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("mobile") String mobile, @Param("status") Integer status, @Param("starFlag")  Integer starFlag, @Param("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus, @Param("sendStatus") Integer sendStatus,@Param("name") String name,@Param("snCode") String snCode);
+    List<AuthVo> getAuthList(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("mobile") String mobile, @Param("status") Integer status, @Param("starFlag") Integer starFlag, @Param("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus, @Param("sendStatus") Integer sendStatus, @Param("authCode") String authCode);
+
+    List<AuthVo> getAuthListAll(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("mobile") String mobile, @Param("status") Integer status, @Param("starFlag") Integer starFlag, @Param("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus, @Param("sendStatus") Integer sendStatus, @Param("name") String name, @Param("snCode") String snCode);
 
     Integer getClubUserIdByAuthId(Integer authId);
 
@@ -32,7 +35,7 @@ public interface AuthMapper {
 
     void updateAuthByAuthId(CmBrandAuthPo auth);
 
-    void updateRelaByAuthId(Integer authId,@Param("relationId")String relationId,@Param("relationName")String relationName);
+    void updateRelaByAuthId(Integer authId, @Param("relationId") String relationId, @Param("relationName") String relationName);
 
     CmBrandAuthPo getRelationInfo(Integer id);
 
@@ -94,7 +97,7 @@ public interface AuthMapper {
 
     List<String> getCityNames(Integer ProvinceId);
 
-    Integer getCityIdByProvinceId(@Param("provinceId")Integer provinceId,@Param("cityName") String cityName);
+    Integer getCityIdByProvinceId(@Param("provinceId") Integer provinceId, @Param("cityName") String cityName);
 
     String getProvinceNameById(Integer provinceId);
 
@@ -114,26 +117,29 @@ public interface AuthMapper {
 
     void checkAuth(Integer authId);
 
-    void starAuth(@Param("authId") Integer authId, @Param("starFlag") Integer starFlag,@Param("starNum") String starNum);
+    void starAuth(@Param("authId") Integer authId, @Param("starFlag") Integer starFlag, @Param("starNum") String starNum);
 
     void addScanCount(Integer authId);
 
     //根据id查询机构集合
     List<AuthFormVo> getAuthIdList(@Param("relationIdList") String[] relationIdList);
+
     //获取关联机构的信息
-    AuthFormVo  getRelationgInfo(Integer authId,Integer authUserId);
+    AuthFormVo getRelationgInfo(Integer authId, Integer authUserId);
+
     /**
-     *  1.7.4版本
+     * 1.7.4版本
      * 获取可绑定机构机构信息
-     * **/
+     **/
     List<AuthFormVo> getClubBindAuth(Integer authUserId);
 
     List<ProductFormVo> getRelationgList(String snCode);
 
     String getPrefix(Integer authUserId);
 
-    void saveVideoInfo(@Param("userName") String userName,@Param("cover") String cover,@Param("ossUrl") String ossUrl,@Param("ossName") String ossName,@Param("title") String title,@Param("releaseTime") String releaseTime,@Param("authId") Integer authId,@Param("authUserId")Integer authUserId);
-    void saveVideo(@Param("userName") String userName,@Param("cover") String cover,@Param("ossUrl") String ossUrl,@Param("ossName") String ossName,@Param("title") String title,@Param("releaseTime") String releaseTime,@Param("authId") Integer authId,@Param("linked") String linked,@Param("authUserId")Integer authUserId,@Param("clubUserId")Integer clubUserId);
+    void saveVideoInfo(@Param("userName") String userName, @Param("cover") String cover, @Param("ossUrl") String ossUrl, @Param("ossName") String ossName, @Param("title") String title, @Param("releaseTime") String releaseTime, @Param("authId") Integer authId, @Param("authUserId") Integer authUserId);
+
+    void saveVideo(@Param("userName") String userName, @Param("cover") String cover, @Param("ossUrl") String ossUrl, @Param("ossName") String ossName, @Param("title") String title, @Param("releaseTime") String releaseTime, @Param("authId") Integer authId, @Param("linked") String linked, @Param("authUserId") Integer authUserId, @Param("clubUserId") Integer clubUserId);
 
     String getauthUserId(@Param("authId") Integer authId);
 
@@ -141,35 +147,35 @@ public interface AuthMapper {
 
     Integer checkActivityTime(@Param("releaseTime") String releaseTime);
 
-    List<ChallengeRoundVo> getPublishedVideoList(@Param("clubUserName")String clubUserName,@Param("status")Integer status,Integer authUserId,@Param("startTime")String startTime,@Param("endTime")String endTime);
+    List<ChallengeRoundVo> getPublishedVideoList(@Param("clubUserName") String clubUserName, @Param("status") Integer status, Integer authUserId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
-    List<ChallengeRoundVo> getPublishedVideoListNoRanking(@Param("clubUserName")String clubUserName,@Param("status")Integer status,Integer authUserId,@Param("startTime")String startTime,@Param("endTime")String endTime);
+    List<ChallengeRoundVo> getPublishedVideoListNoRanking(@Param("clubUserName") String clubUserName, @Param("status") Integer status, Integer authUserId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
-    List<ChallengeRoundVo> getPublishedVideo(@Param("mobile")String mobile,@Param("authParty")String authParty,@Param("status")Integer status,@Param("authUserId")Integer authUserId,@Param("startTime")String startTime,@Param("endTime")String endTime);
+    List<ChallengeRoundVo> getPublishedVideo(@Param("mobile") String mobile, @Param("authParty") String authParty, @Param("status") Integer status, @Param("authUserId") Integer authUserId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
-    List<ChallengeRoundVo> getPublishedVideoNoRanking(@Param("mobile")String mobile,@Param("authParty")String authParty,@Param("status")Integer status,@Param("authUserId")Integer authUserId,@Param("startTime")String startTime,@Param("endTime")String endTime);
+    List<ChallengeRoundVo> getPublishedVideoNoRanking(@Param("mobile") String mobile, @Param("authParty") String authParty, @Param("status") Integer status, @Param("authUserId") Integer authUserId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
-    List<ChallengeRoundVo> getAuthPartylist(@Param("authUserId")Integer authUserId);
+    List<ChallengeRoundVo> getAuthPartylist(@Param("authUserId") Integer authUserId);
 
     List<ChallengeActivityVo> checkActivityId();
 
-    void saveActivityInfo(@Param("startTime") String startTime,@Param("endTime")String endTime,@Param("status")Integer status,@Param("authUserId")Integer authUserId);
+    void saveActivityInfo(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("status") Integer status, @Param("authUserId") Integer authUserId);
 
-    void upActivityInfo(@Param("startTime") String startTime,@Param("endTime")String endTime,@Param("status")Integer status,@Param("authUserId")Integer authUserId);
+    void upActivityInfo(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("status") Integer status, @Param("authUserId") Integer authUserId);
 
-    ChallengeActivityVo  getActivityTime(@Param("authUserId") Integer authUserId);
+    ChallengeActivityVo getActivityTime(@Param("authUserId") Integer authUserId);
 
-    void savaShareIdByAuthId(@Param("authId")Integer authId,@Param("shareId")String shareId);
+    void savaShareIdByAuthId(@Param("authId") Integer authId, @Param("shareId") String shareId);
 
-    String getShareId(@Param("shareId")String shareId);
+    String getShareId(@Param("shareId") String shareId);
 
-    void savaItemIdByShareId(@Param("shareId")String shareId,@Param("itemId")String itemId);
+    void savaItemIdByShareId(@Param("shareId") String shareId, @Param("itemId") String itemId);
 
     String getMobileByAuthId(Integer authId);
 
     String getAuthUserName(Integer authId);
 
-    void savaDyCommand(Integer authId,@Param("content")String content);
+    void savaDyCommand(Integer authId, @Param("content") String content);
 
     String getOssNameId(Integer videoID);
 
@@ -181,38 +187,38 @@ public interface AuthMapper {
 
     void upStatusById(Integer id);
 
-    String getReleaseTime(@Param("userName")String userName );
+    String getReleaseTime(@Param("userName") String userName);
 
     List<ChallengeRoundVo> getRoundlist();
 
-    void upVidoInfoById(Integer videoId,@Param("diggCount")String diggCount,@Param("playCount") String playCount);
+    void upVidoInfoById(Integer videoId, @Param("diggCount") String diggCount, @Param("playCount") String playCount);
 
     void saveRossInfo(RossChallengeRoundVo rossChallengeRoundVo);
 
-    List<Integer> getClubUserId(@Param("mobile")String mobile);
+    List<Integer> getClubUserId(@Param("mobile") String mobile);
 
-    List<RossChallengeRoundVo> getInfoByUserName(@Param("userName")String userName);
+    List<RossChallengeRoundVo> getInfoByUserName(@Param("userName") String userName);
 
     List<RossChallengeRoundVo> getcontestedInfo(Integer authUserId);
 
-    RossChallengeRoundVo getcontestedInfoByUserName(@Param("mobile")String mobile,@Param("startTime")String startTime,@Param("endTime")String endTime);
+    RossChallengeRoundVo getcontestedInfoByUserName(@Param("mobile") String mobile, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
 
-    List<RossChallengeVideo> getVideoAll(@Param("mobileOrAuthpart")String mobileOrAuthpart,Integer authUserId,@Param("StartTime")String StartTime,@Param("endTime")String endTime);
+    List<RossChallengeVideo> getVideoAll(@Param("mobileOrAuthpart") String mobileOrAuthpart, Integer authUserId, @Param("StartTime") String StartTime, @Param("endTime") String endTime);
 
-    List<RossChallengeVideo> getVideoByUsername(@Param("mobile")String mobile,@Param("StartTime")String StartTime,@Param("endTime")String endTime);
+    List<RossChallengeVideo> getVideoByUsername(@Param("mobile") String mobile, @Param("StartTime") String StartTime, @Param("endTime") String endTime);
 
-    List<RossChallengeVideo> checkVideoByUsername(@Param("mobile")String mobile,@Param("startTime")String startTime,@Param("endTime")String endTime);
+    List<RossChallengeVideo> checkVideoByUsername(@Param("mobile") String mobile, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
-    void upVideoDiggCount(Integer videoId,Integer diggFlag,@Param("clubUserIds")String clubUserIds);
+    void upVideoDiggCount(Integer videoId, Integer diggFlag, @Param("clubUserIds") String clubUserIds);
 
-    List<RossChallengeRoundVo> getAuthInfo(@Param("mobile")String mobile,@Param("authUserId")Integer authUserId,@Param("StartTime")String StartTime,@Param("endTime")String endTime,Integer authenticationStatus);
+    List<RossChallengeRoundVo> getAuthInfo(@Param("mobile") String mobile, @Param("authUserId") Integer authUserId, @Param("StartTime") String StartTime, @Param("endTime") String endTime, Integer authenticationStatus);
 
     void delAuthInfoById(Integer id);
 
     void delVideoInfoById(Integer id);
 
-    void delVideoInfoByUserName(@Param("mobile")String mobile);
+    void delVideoInfoByUserName(@Param("mobile") String mobile);
 
     RossChallengeRoundVo getRoundById(Integer id);
 
@@ -220,5 +226,15 @@ public interface AuthMapper {
 
     String getAuthparty(Integer authUserId);
 
-    List<ClubUserVo> getclubuserInfo(Integer authUserId,@Param("clubUserIds")String clubUserIds);
+    List<ClubUserVo> getclubuserInfo(Integer authUserId, @Param("clubUserIds") String clubUserIds);
+
+    List<AuthQrcodePo> findQrCodes(Integer authUserId, Integer productTypeId, Integer unionStatus);
+
+    void insertQrCode(AuthQrcodePo qrcodePo);
+
+    void updateQrCodes(@Param("qrcodePos") List<AuthQrcodePo> qrcodePos);
+
+    void concatQrcode(@Param("authId") Integer authId, @Param("id") Integer id);
+
+    List<AuthVo> getConcatList(Integer id,Integer authUserId, Integer productTypeId, String authParty);
 }

+ 32 - 0
src/main/java/com/caimei/model/po/AuthQrcodePo.java

@@ -0,0 +1,32 @@
+package com.caimei.model.po;
+
+import lombok.Data;
+
+@Data
+public class AuthQrcodePo {
+
+    private Integer id;
+    /**
+     * 替代链接id
+     */
+    private String qrCodeId;
+    /**
+     * 仪器品类Id
+     */
+    private Integer productTypeId;
+    private Integer authId;
+    private Integer authUserId;
+    private String addtime;
+    /**
+     * 关联状态 未关联0,已关联1
+     */
+    private Integer unionStatus;
+    /**
+     * 仪器名称
+     */
+    private String productName;
+    /**
+     * 机构名称
+     */
+    private String authParty;
+}

+ 103 - 40
src/main/java/com/caimei/service/auth/AuthService.java

@@ -2,6 +2,7 @@ package com.caimei.service.auth;
 
 import com.caimei.annotation.CurrentUser;
 import com.caimei.model.ResponseJson;
+import com.caimei.model.po.AuthQrcodePo;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.SysUser;
 import com.caimei.model.vo.*;
@@ -37,8 +38,9 @@ public interface AuthService {
      * @param auditStatus      审核状态:0审核未通过,1审核通过,2待审核
      * @return AuthVo
      */
-    ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty, String mobile, Integer status, Integer starFlag, Integer auditStatus, Integer lowerAuditStatus, Integer shopAuditStatus, Integer sendStatus,String authCode ,Integer pageNum, Integer pageSize);
-    ResponseJson<PageInfo<AuthVo>> getAuthListAll(Integer listType, Integer authUserId, String authParty, String mobile, Integer status, Integer starFlag, Integer auditStatus, Integer lowerAuditStatus, Integer shopAuditStatus, Integer sendStatus, String name,String snCode,Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty, String mobile, Integer status, Integer starFlag, Integer auditStatus, Integer lowerAuditStatus, Integer shopAuditStatus, Integer sendStatus, String authCode, Integer pageNum, Integer pageSize);
+
+    ResponseJson<PageInfo<AuthVo>> getAuthListAll(Integer listType, Integer authUserId, String authParty, String mobile, Integer status, Integer starFlag, Integer auditStatus, Integer lowerAuditStatus, Integer shopAuditStatus, Integer sendStatus, String name, String snCode, Integer pageNum, Integer pageSize);
 
     /**
      * 更新授权状态
@@ -51,8 +53,9 @@ public interface AuthService {
 
     /**
      * 删除授权
-     * @param authId    授权id
-     * @return  ResponseJson
+     *
+     * @param authId 授权id
+     * @return ResponseJson
      */
     ResponseJson deleteAuth(Integer authId);
 
@@ -69,10 +72,10 @@ public interface AuthService {
     /**
      * 审核品牌授权
      *
-     * @param authId            授权id
-     * @param auditStatus       审核状态
-     * @param invalidReason     审核不通过原因
-     * @param auditBy           审核人用户id
+     * @param authId        授权id
+     * @param auditStatus   审核状态
+     * @param invalidReason 审核不通过原因
+     * @param auditBy       审核人用户id
      * @param source
      * @return ResponseJson
      */
@@ -80,8 +83,9 @@ public interface AuthService {
 
     /**
      * 导入excel中的授权机构和商品数据
-     * @param file          excel表格
-     * @param authUserId    供应商用户id
+     *
+     * @param file       excel表格
+     * @param authUserId 供应商用户id
      * @param createBy
      * @return
      */
@@ -89,7 +93,8 @@ public interface AuthService {
 
     /**
      * 授权机构回显数据
-     * @param authId    机构id
+     *
+     * @param authId 机构id
      * @return
      */
     ResponseJson<AuthFormVo> getAuthFormData(Integer authId);
@@ -101,6 +106,7 @@ public interface AuthService {
 
     /**
      * ldm门店图/备注导入
+     *
      * @param authUserId
      * @return
      */
@@ -108,6 +114,7 @@ public interface AuthService {
 
     /**
      * 生成机构授权牌
+     *
      * @param auth
      * @return
      */
@@ -116,10 +123,11 @@ public interface AuthService {
     /**
      * 添加水印
      */
-    String addWaterMark(String image,Integer type);
+    String addWaterMark(String image, Integer type);
 
     /**
      * 更改查看标记
+     *
      * @param authId
      * @return
      */
@@ -128,46 +136,56 @@ public interface AuthService {
     /**
      * 更改明星标识
      */
-    ResponseJson starAuth(Integer authId, Integer starFlag,String starNum);
+    ResponseJson starAuth(Integer authId, Integer starFlag, String starNum);
+
     /**
      * 获取机构关联的机构信息
      * 1.7.4版本:编辑时新加关联机构操作
-     *
      */
-    ResponseJson<List<AuthFormVo>> getRelationgInfo(String  snCode, Integer authUserId);
+    ResponseJson<List<AuthFormVo>> getRelationgInfo(String snCode, Integer authUserId);
+
     /**
      * 获取可绑定机构机构信息
-     * **/
+     **/
     ResponseJson<List<AuthFormVo>> getClubBindAuth(Integer authUserId);
 
     /**
      * 用户扫码授权,获取code值
+     *
      * @param response
      * @return
      * @throws IOException
      */
     ResponseJson getDouYingCode(HttpServletResponse response) throws IOException;
+
     /**
      * 根据用户的code值获取AcessToken
      * ccode 用户授权登录code
      **/
     ResponseJson getDouYingAcessToken(String ccode) throws IOException;
+
     /**
      * h5的方式上传视频
+     *
      * @return
      * @throws IOException
      */
-    ResponseJson getclientToken(String title,String videoPath,Integer authId) throws IOException;
+    ResponseJson getclientToken(String title, String videoPath, Integer authId) throws IOException;
+
     /**
      * 保存视频信息
+     *
      * @return
      */
     ResponseJson saveVideoInfo(ChallengeRoundVo challengeRoundVo);
+
     /**
      * 1.7.7(ROSS)保存视频信息
+     *
      * @return
      */
     ResponseJson<RossChallengeVideo> saveVideo(RossChallengeVideo rossChallengeVideo);
+
     /**
      * 根据authid获取authUserId
      */
@@ -175,6 +193,7 @@ public interface AuthService {
 
     /**
      * 判断是否存在userName
+     *
      * @param userName
      * @return
      */
@@ -182,22 +201,25 @@ public interface AuthService {
 
     /**
      * 验证是否在活动时间内
+     *
      * @return
      */
     boolean checkActivityTime(String releaseTime);
 
     /**
      * 获取已发布视频(前端)
+     *
      * @param clubUserName
      * @param status
      * @param cursor
      * @param count
      * @return
      */
-    ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideoList(String clubUserName,Integer status,Integer cursor,Integer count,Integer pageNum,Integer pageSize,Integer authUserId);
+    ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideoList(String clubUserName, Integer status, Integer cursor, Integer count, Integer pageNum, Integer pageSize, Integer authUserId);
 
     /**
      * 获取已发布视频(后端)
+     *
      * @param mobile
      * @param authParty
      * @param status
@@ -206,31 +228,36 @@ public interface AuthService {
      * @param authUserId
      * @return
      */
-    ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideo(String mobile,String authParty,Integer status,Integer cursor,Integer count,Integer authUserId,Integer pageNum,Integer pageSize,String startTIme,String endTime);
+    ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideo(String mobile, String authParty, Integer status, Integer cursor, Integer count, Integer authUserId, Integer pageNum, Integer pageSize, String startTIme, String endTime);
 
     /**
      * 获取机构已发布视频的机构下拉列表
+     *
      * @param authUserId
      * @return
      */
     ResponseJson<List<ChallengeRoundVo>> getAuthPartylist(Integer authUserId);
+
     /**
      * 保存活动信息
+     *
      * @param startTime
      * @param endTime
      * @param status
      * @return
      */
-    ResponseJson saveActivityTime(String startTime,String endTime,Integer status,Integer authUserId);
+    ResponseJson saveActivityTime(String startTime, String endTime, Integer status, Integer authUserId);
 
     /**
      * 获取活动信息
+     *
      * @return
      */
-     ResponseJson<ChallengeActivityVo> getActivityTime(Integer authUserId);
+    ResponseJson<ChallengeActivityVo> getActivityTime(Integer authUserId);
 
     /**
      * 判断shareId是否存在
+     *
      * @param shareId
      * @return
      */
@@ -238,26 +265,31 @@ public interface AuthService {
 
     /**
      * 根据ShareId保存itemId (webhook触发时调用)
+     *
      * @param shareId
      * @param itemId
      */
-     void savaItemIdByShareId(String shareId,String itemId);
+    void savaItemIdByShareId(String shareId, String itemId);
 
     /**
      * 判断活动开启状态
+     *
      * @param sysUser
      * @return
      */
-     ResponseJson<ChallengeActivityVo> getActivitty(Integer sysUser);
+    ResponseJson<ChallengeActivityVo> getActivitty(Integer sysUser);
 
     /**
      * 根据authId获取手机号
+     *
      * @param authId
      * @return
      */
     String getMobileByAuthId(Integer authId);
+
     /**
      * 根据authId获取供应商名称
+     *
      * @param authId
      * @return
      */
@@ -265,18 +297,20 @@ public interface AuthService {
 
     /**
      * 获取发布时间
+     *
      * @param userName
      * @return
      */
     String getReleaseTime(String userName);
 
-        /**
-         * 保存抖音口令
-         */
-   void savaDyCommand(Integer authId,String content);
+    /**
+     * 保存抖音口令
+     */
+    void savaDyCommand(Integer authId, String content);
 
     /**
      * 根据authId获取ossName
+     *
      * @param videoID
      * @return
      */
@@ -284,82 +318,102 @@ public interface AuthService {
 
     /**
      * 删除视频
+     *
      * @param videoID
      */
     void deleteVideoByAuthId(Integer videoID);
 
     /**
      * 下载视频
+     *
      * @param fileId
      * @param response
      * @return
      */
-    ResponseJson downLoadChoseZip(String fileId,HttpServletResponse response);
+    ResponseJson downLoadChoseZip(String fileId, HttpServletResponse response);
+
     /**
      * 根据id获取信息
-     *
      */
-     ResponseJson<ChallengeRoundVo> getInfoById(Integer videoId);
+    ResponseJson<ChallengeRoundVo> getInfoById(Integer videoId);
+
+    ResponseJson getDyVidoInfo(Integer authUserId);
 
-     ResponseJson getDyVidoInfo(Integer authUserId);
     /**
      * 新增参赛机构信息
+     *
      * @param rossChallengeRoundVo
      * @return
      */
     ResponseJson saveRossInfo(RossChallengeRoundVo rossChallengeRoundVo);
+
     /**
      * 根据手机号码获取信息
+     *
      * @param userName
      * @return
      */
-    RossChallengeRoundVo getInfoByUserName(String userName,Integer authUserId);
+    RossChallengeRoundVo getInfoByUserName(String userName, Integer authUserId);
+
     /**
      * 验证用户是否已经报名
+     *
      * @param mobile
      * @return
      */
-    ResponseJson<RossChallengeRoundVo> checkContestedInfo(String mobile,Integer authUserId);
+    ResponseJson<RossChallengeRoundVo> checkContestedInfo(String mobile, Integer authUserId);
+
     /**
      * 获取已报名信息列表
+     *
      * @return
      */
     ResponseJson<List<RossChallengeRoundVo>> getcontestedInfo(Integer authUserId);
+
     /**
      * 查询视频列表
+     *
      * @param mobileOrAuthpart 电话号码或者机构名称
      * @return
      */
-    ResponseJson<PageInfo<RossChallengeVideo>> getVideoAll(String mobileOrAuthpart,Integer clubUserId,Integer authUserId,Integer pageNum,Integer pageSize);
+    ResponseJson<PageInfo<RossChallengeVideo>> getVideoAll(String mobileOrAuthpart, Integer clubUserId, Integer authUserId, Integer pageNum, Integer pageSize);
 
     /**
      * 根据手机号码查询该机构视频列表
-     * @param mobile  登录账号
+     *
+     * @param mobile 登录账号
      * @return
      */
-    ResponseJson<List<RossChallengeVideo>> getVideoByUsername(String mobile,Integer clubUserId,Integer authUserId);
+    ResponseJson<List<RossChallengeVideo>> getVideoByUsername(String mobile, Integer clubUserId, Integer authUserId);
+
     /**
      * 验证机构是否已经上传了3个视频
+     *
      * @param mobile 登录账号
      * @return
      */
-    ResponseJson<List<RossChallengeVideo>> checkVideoByUsername(String mobile,Integer authUserId);
+    ResponseJson<List<RossChallengeVideo>> checkVideoByUsername(String mobile, Integer authUserId);
 
     /**
      * 点赞与取消点赞
+     *
      * @param id
      * @param diggFlag
      * @return
      */
-    ResponseJson upVideoDiggCount(Integer id,Integer diggFlag,Integer clubUserId,String clubUserIds);
+    ResponseJson upVideoDiggCount(Integer id, Integer diggFlag, Integer clubUserId, String clubUserIds);
+
     /**
      * 查询机构信息(后端)
+     *
      * @param mobile
      * @return
      */
-    ResponseJson<PageInfo<RossChallengeRoundVo>> getAuthInfo(String mobile,Integer pageNum,Integer pageSize,Integer authUserId,Integer authenticationStatus);
+    ResponseJson<PageInfo<RossChallengeRoundVo>> getAuthInfo(String mobile, Integer pageNum, Integer pageSize, Integer authUserId, Integer authenticationStatus);
+
     /**
      * 根据id删除机构信息
+     *
      * @param id
      * @return
      */
@@ -367,8 +421,17 @@ public interface AuthService {
 
     /**
      * 根据id删除视频信息
+     *
      * @param id
      * @return
      */
-     ResponseJson delVideoInfoById(Integer id);
+    ResponseJson delVideoInfoById(Integer id);
+
+    ResponseJson<PageInfo<AuthQrcodePo>> getQrcodeList(Integer authUserId, Integer unionStatus, Integer productTypeId, Integer pageNum, Integer pageSize);
+
+    ResponseJson makeQrcode(Integer authUserId, Integer productTypeId, Integer num);
+
+    ResponseJson concatQrcode(Integer authId, Integer id);
+
+    ResponseJson<PageInfo<AuthVo>> getConcatList(Integer id,Integer authUserId, Integer productTypeId, String authParty, Integer pageNum, Integer pageSize);
 }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 284 - 261
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java


+ 260 - 114
src/main/resources/mapper/AuthMapper.xml

@@ -62,8 +62,8 @@
     </update>
     <update id="updateRelaByAuthId">
         update cm_brand_auth
-        set relationId          = #{relationId},
-            relationName        = #{relationName}
+        set relationId   = #{relationId},
+            relationName = #{relationName}
         where id = #{authId}
     </update>
     <update id="updateAuthAuditStatus">
@@ -76,7 +76,9 @@
         where id = #{authId}
     </update>
     <select id="getRelationInfo" resultType="com.caimei.model.po.CmBrandAuthPo">
-        select relationId,relationName  from cm_brand_auth where id=#{id}
+        select relationId, relationName
+        from cm_brand_auth
+        where id = #{id}
     </select>
     <update id="deleteAuthByAuthId">
         update cm_brand_auth
@@ -145,9 +147,11 @@
         where authId = #{authId}
     </delete>
     <select id="getClubUserIdByAuthId" resultType="java.lang.Integer">
-        select cbcu1.id from cm_brand_club_user cbcu1 left join cm_brand_auth a
-        on a.createBy = cbcu1.id
-        where a.id=#{authId}
+        select cbcu1.id
+        from cm_brand_club_user cbcu1
+                 left join cm_brand_auth a
+                           on a.createBy = cbcu1.id
+        where a.id = #{authId}
     </select>
     <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
         select a.id as authId, a.authUserId, authParty, cbcu2.mobile, a.status, a.auditStatus, a.shopAuditStatus,
@@ -243,7 +247,8 @@
     </select>
 
     <select id="getAuthListAll" resultType="com.caimei.model.vo.AuthVo">
-        select DISTINCT a.id as authId, a.authUserId, authParty, cbcu2.mobile, a.status, a.auditStatus, a.shopAuditStatus,
+        select DISTINCT a.id as authId, a.authUserId, authParty, cbcu2.mobile, a.status, a.auditStatus,
+        a.shopAuditStatus,
         a.createTime,
         if(a.createSource = 1,ifnull(cu.loginAccount, cu.name),cbcu1.mobile) as createBy,ifnull(au.loginAccount,au.name)
         as auditBy,a.auditTime,a.invalidReason,
@@ -416,19 +421,22 @@
         select provinceID
         from province
         where name like
-              concat(#{provinceName}, '%') limit 1;
+              concat(#{provinceName}, '%')
+        limit 1;
     </select>
     <select id="getCityId" resultType="java.lang.Integer">
         select cityID
         from city
         where name like
-              concat(#{cityName}, '%') limit 1;
+              concat(#{cityName}, '%')
+        limit 1;
     </select>
     <select id="getTownId" resultType="java.lang.Integer">
         select townID
         from town
         where name like
-              concat(#{townName}, '%') limit 1;
+              concat(#{townName}, '%')
+        limit 1;
     </select>
     <select id="getLdmLatestClubId" resultType="java.lang.Integer">
         select ldmClubId
@@ -444,19 +452,22 @@
         select name
         from nissan_base_region1
         where code = #{regId1}
-          and level = 0 limit 1
+          and level = 0
+        limit 1
     </select>
     <select id="getCityName" resultType="java.lang.String">
         select name
         from nissan_base_region1
         where code = #{regId1}
-          and level = 1 limit 1
+          and level = 1
+        limit 1
     </select>
     <select id="getTownName" resultType="java.lang.String">
         select name
         from nissan_base_region1
         where code = #{regId1}
-          and level = 2 limit 1
+          and level = 2
+        limit 1
     </select>
     <select id="getTownList" resultType="com.caimei.model.po.TownPo">
         select townID as townId, cityID as cityId
@@ -586,7 +597,8 @@
     <select id="getAdminUserId" resultType="java.lang.Integer">
         select authUserId
         from cm_brand_auth_user
-        where userIdentity = 1 limit 1
+        where userIdentity = 1
+        limit 1
     </select>
     <select id="getAuthTemplate" resultType="com.caimei.model.vo.TemplateVo">
         select at.id as templateId, templateImage, qrPosition, qrSize
@@ -629,17 +641,16 @@
     </select>
 
     <select id="getClubBindAuth" resultType="com.caimei.model.vo.AuthFormVo">
-        select au.id as authId,au.authParty
+        select au.id as authId, au.authParty
         from cm_brand_auth au
-        where au.id not in (
-            select cu.authId
-
-            from cm_brand_auth a
-                     left join cm_brand_club_user cu on cu.authId = a.id
-            where cu.authUserId = #{authUserId}
-              and cu.delFlag = 0
-              and (a.id is null || a.delFlag = 0))
-          and au.delFlag = 0 and au.authUserId = #{authUserId}
+        where au.id not in (select cu.authId
+                            from cm_brand_auth a
+                                     left join cm_brand_club_user cu on cu.authId = a.id
+                            where cu.authUserId = #{authUserId}
+                              and cu.delFlag = 0
+                              and (a.id is null || a.delFlag = 0))
+          and au.delFlag = 0
+          and au.authUserId = #{authUserId}
     </select>
 
 
@@ -647,20 +658,22 @@
         select DISTINCT r.authId as relationId
         from cm_brand_product_relation r
                  LEFT JOIN cm_brand_auth_product a on r.productId = a.id
-        where snCode =#{snCode}
+        where snCode = #{snCode}
     </select>
     <select id="getPrefix" resultType="java.lang.String">
-        select ifnull(prefix,'app')
+        select ifnull(prefix, 'app')
         from cm_brand_auth_user
         where authUserId = #{authUserId}
     </select>
     <insert id="saveVideoInfo">
-        insert into cm_challenge_round(userName,title,ossName,ossUrl,cover,releaseTime,authId,authUserId)
-        values(#{userName},#{title},#{ossName},#{ossUrl},#{cover},#{releaseTime},#{authId},#{authUserId})
+        insert into cm_challenge_round(userName, title, ossName, ossUrl, cover, releaseTime, authId, authUserId)
+        values (#{userName}, #{title}, #{ossName}, #{ossUrl}, #{cover}, #{releaseTime}, #{authId}, #{authUserId})
     </insert>
     <insert id="saveVideo">
-        insert into cm_ross_challenge_video(userName,title,ossName,ossUrl,cover,releaseTime,authId,linked,authUserId,clubUserId)
-        values(#{userName},#{title},#{ossName},#{ossUrl},#{cover},#{releaseTime},#{authId},#{linked},#{authUserId},#{clubUserId})
+        insert into cm_ross_challenge_video(userName, title, ossName, ossUrl, cover, releaseTime, authId, linked,
+                                            authUserId, clubUserId)
+        values (#{userName}, #{title}, #{ossName}, #{ossUrl}, #{cover}, #{releaseTime}, #{authId}, #{linked},
+                #{authUserId}, #{clubUserId})
     </insert>
     <select id="getauthUserId" resultType="java.lang.String">
         select authUserId
@@ -675,128 +688,149 @@
     <select id="checkActivityTime" resultType="java.lang.Integer">
         select id
         from cm_challenge_activity
-        where startTime  &lt;#{releaseTime}  and  endTime &gt;#{releaseTime} and status=1
+        where startTime &lt; #{releaseTime}
+          and endTime &gt; #{releaseTime}
+          and status = 1
     </select>
     <select id="getPublishedVideoList" resultType="com.caimei.model.vo.ChallengeRoundVo">
-        select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
+        select
+        cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
         from cm_challenge_round cr
         left join cm_brand_auth cba on cr.authId=cba.id
         left join cm_challenge_activity cca on cca.authUserId=cr.authUserId
-               where cr.authUserId=#{authUserId}
+        where cr.authUserId=#{authUserId}
         <if test="clubUserName != null and clubUserName != ''">
             and (cr.userName like concat('%', #{clubUserName})
-            or  cba.authParty like concat('%', #{clubUserName},'%') )
+            or cba.authParty like concat('%', #{clubUserName},'%') )
         </if>
-       and  cr.releaseTime &gt;#{startTime} and  cr.releaseTime&lt;#{endTime}
+        and cr.releaseTime &gt;#{startTime} and cr.releaseTime&lt;#{endTime}
     </select>
     <select id="getPublishedVideoListNoRanking" resultType="com.caimei.model.vo.ChallengeRoundVo">
-        select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
+        select
+        cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
         from cm_challenge_round cr
         left join cm_brand_auth cba on cr.authId=cba.id
         left join cm_challenge_activity cca on cca.authUserId=cr.authUserId
         where cr.authUserId=#{authUserId}
         <if test="clubUserName != null and clubUserName != ''">
             and (cr.userName like concat('%', #{clubUserName})
-            or  cba.authParty like concat('%', #{clubUserName},'%') )
+            or cba.authParty like concat('%', #{clubUserName},'%') )
         </if>
-        and  (cr.releaseTime &lt;#{startTime} or  cr.releaseTime &gt;#{endTime})
+        and (cr.releaseTime &lt;#{startTime} or cr.releaseTime &gt;#{endTime})
     </select>
     <select id="getPublishedVideo" resultType="com.caimei.model.vo.ChallengeRoundVo">
-        select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
+        select
+        cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
         from cm_challenge_round cr
         left join cm_brand_auth cba on cr.authId=cba.id
         left join cm_challenge_activity cca on cca.authUserId=cr.authUserId
         where cr.authUserId=#{authUserId}
-        and  cr.releaseTime &gt;#{startTime} and  cr.releaseTime&lt;#{endTime}
+        and cr.releaseTime &gt;#{startTime} and cr.releaseTime&lt;#{endTime}
         <if test="mobile != null and mobile != ''">
             and cr.userName like concat('%', #{mobile})
         </if>
         <if test="authParty != null and authParty != ''">
-            and  cba.authParty like concat('%', #{authParty},'%')
+            and cba.authParty like concat('%', #{authParty},'%')
         </if>
         <if test="status != null">
             and cr.status = #{status}
         </if>
     </select>
     <select id="getPublishedVideoNoRanking" resultType="com.caimei.model.vo.ChallengeRoundVo">
-        select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
+        select
+        cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
         from cm_challenge_round cr
         left join cm_brand_auth cba on cr.authId=cba.id
         left join cm_challenge_activity cca on cca.authUserId=cr.authUserId
         where cr.authUserId=#{authUserId}
-        and  (cr.releaseTime &lt;#{startTime} or  cr.releaseTime &gt;#{endTime})
+        and (cr.releaseTime &lt;#{startTime} or cr.releaseTime &gt;#{endTime})
         <if test="mobile != null and mobile != ''">
             and cr.userName like concat('%', #{mobile})
         </if>
         <if test="authParty != null and authParty != ''">
-            and  cba.authParty like concat('%', #{authParty},'%')
+            and cba.authParty like concat('%', #{authParty},'%')
         </if>
         <if test="status != null">
             and cr.status = #{status}
         </if>
     </select>
     <select id="checkActivityId" resultType="com.caimei.model.vo.ChallengeActivityVo">
-        select id,authUserId
+        select id, authUserId
         from cm_challenge_activity
     </select>
     <insert id="saveActivityInfo">
-            insert into cm_challenge_activity(startTime,endTime,status,authUserId)
-            values(#{startTime},#{endTime},#{status},#{authUserId})
+        insert into cm_challenge_activity(startTime, endTime, status, authUserId)
+        values (#{startTime}, #{endTime}, #{status}, #{authUserId})
     </insert>
     <update id="upActivityInfo">
-        update cm_challenge_activity set
-            startTime=#{startTime},
+        update cm_challenge_activity
+        set startTime=#{startTime},
             endTime=#{endTime},
-            status = #{status}
-        where authUserId=#{authUserId}
+            status   = #{status}
+        where authUserId = #{authUserId}
     </update>
     <select id="getActivityTime" resultType="com.caimei.model.vo.ChallengeActivityVo">
-        select id,startTime,endTime,status,authUserId
+        select id, startTime, endTime, status, authUserId
         from cm_challenge_activity
-        where authUserId=#{authUserId}
+        where authUserId = #{authUserId}
     </select>
     <update id="savaShareIdByAuthId">
-        update cm_challenge_round set
-            shareId=#{shareId}
-        where authId=#{authId}
+        update cm_challenge_round
+        set shareId=#{shareId}
+        where authId = #{authId}
     </update>
     <select id="getShareId" resultType="java.lang.String">
         select shareId
         from cm_challenge_round
-        where shareId=#{shareId}
+        where shareId = #{shareId}
     </select>
     <update id="savaItemIdByShareId">
-        update cm_challenge_round set
-            itemId=#{itemId},
+        update cm_challenge_round
+        set itemId=#{itemId},
             status=1
-        where shareId=#{shareId}
+        where shareId = #{shareId}
     </update>
     <select id="getAuthUserName" resultType="java.lang.String">
         select name
         from cm_brand_auth cba
-        left join cm_brand_auth_user cu on cu.authUserId=cba.authUserId
-        where cba.id=#{authId}
+                 left join cm_brand_auth_user cu on cu.authUserId = cba.authUserId
+        where cba.id = #{authId}
     </select>
     <select id="getMobileByAuthId" resultType="java.lang.String">
         select userName
         from cm_challenge_round cr
-        where cr.authId=#{authId}
+        where cr.authId = #{authId}
     </select>
     <update id="savaDyCommand">
-        update cm_challenge_round set
-            dyCommand=#{content}
-        where authId=#{authId}
+        update cm_challenge_round
+        set dyCommand=#{content}
+        where authId = #{authId}
     </update>
     <select id="getAuthPartylist" resultType="com.caimei.model.vo.ChallengeRoundVo">
-        select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId, cr.authId,cba.authParty,cr.dyCommand,cr.diggCount,cr.playCount
-        from cm_challenge_round cr left join cm_brand_auth cba
-        on cr.authId=cba.id
-        where cr.authUserId=#{authUserId}
+        select cr.id,
+               cr.userName,
+               cr.itemId,
+               cr.title,
+               cr.ossName,
+               cr.ossUrl,
+               cr.cover,
+               cr.releaseTime,
+               cr.status,
+               cr.shareId,
+               cr.authId,
+               cba.authParty,
+               cr.dyCommand,
+               cr.diggCount,
+               cr.playCount
+        from cm_challenge_round cr
+                 left join cm_brand_auth cba
+                           on cr.authId = cba.id
+        where cr.authUserId = #{authUserId}
     </select>
     <select id="getOssNameId" resultType="java.lang.String">
         select ossName
         from cm_challenge_round cr
-        where cr.id=#{videoID}
+        where cr.id = #{videoID}
     </select>
     <delete id="deleteVideoById">
         delete
@@ -804,52 +838,96 @@
         where id = #{videoID}
     </delete>
     <select id="getChallengeRoundInfo" resultType="com.caimei.model.vo.ChallengeRoundVo">
-        select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId, cr.authId,cr.dyCommand,cr.diggCount,cr.playCount
+        select cr.id,
+               cr.userName,
+               cr.itemId,
+               cr.title,
+               cr.ossName,
+               cr.ossUrl,
+               cr.cover,
+               cr.releaseTime,
+               cr.status,
+               cr.shareId,
+               cr.authId,
+               cr.dyCommand,
+               cr.diggCount,
+               cr.playCount
         from cm_challenge_round cr
-        where cr.id=#{videoID}
+        where cr.id = #{videoID}
     </select>
     <select id="getChallengeVideoInfo" resultType="com.caimei.model.vo.RossChallengeVideo">
         select cr.*
         from cm_ross_challenge_video cr
-        where cr.id=#{videoID}
+        where cr.id = #{videoID}
     </select>
     <update id="upStatusById">
-        update cm_challenge_activity set
-            status = 0
-        where id=#{id}
+        update cm_challenge_activity
+        set status = 0
+        where id = #{id}
     </update>
     <select id="getReleaseTime" resultType="java.lang.String">
         select releaseTime
         from cm_challenge_round cr
-        where cr.userName=#{userName}
+        where cr.userName = #{userName}
     </select>
     <select id="getRoundlist" resultType="com.caimei.model.vo.ChallengeRoundVo">
-        select cr.id,cr.userName,cr.authUserId,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId, cr.authId,cr.dyCommand,cr.diggCount,cr.playCount
+        select cr.id,
+               cr.userName,
+               cr.authUserId,
+               cr.itemId,
+               cr.title,
+               cr.ossName,
+               cr.ossUrl,
+               cr.cover,
+               cr.releaseTime,
+               cr.status,
+               cr.shareId,
+               cr.authId,
+               cr.dyCommand,
+               cr.diggCount,
+               cr.playCount
         from cm_challenge_round cr
     </select>
     <update id="upVidoInfoById">
-        update cm_challenge_round set
-            diggCount=#{diggCount},
+        update cm_challenge_round
+        set diggCount=#{diggCount},
             playCount=#{playCount}
-        where id=#{videoId}
+        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,clubUserId)
-        values(#{authUserId},#{authId},#{userName},#{contestStatus},#{contestTime},#{licenseOssUrl},#{licenseOssName},#{authenticationStatus},#{clubUserId})
+        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>
+    <insert id="insertQrCode" parameterType="com.caimei.model.po.AuthQrcodePo" useGeneratedKeys="true" keyProperty="id">
+        INSERT INTO cm_brand_auth_qrcode(authUserId, productTypeId, addtime)
+        VALUES (#{authUserId}, #{productTypeId}, now())
     </insert>
     <select id="getClubUserId" resultType="java.lang.Integer">
-        select id from cm_brand_club_user where mobile=#{mobile}
+        select id
+        from cm_brand_club_user
+        where mobile = #{mobile}
         order by addTime desc
     </select>
     <select id="getInfoByUserName" resultType="com.caimei.model.vo.RossChallengeRoundVo">
-        select * from cm_ross_challenge_round where userName=#{userName} and contestStatus=1
+        select *
+        from cm_ross_challenge_round
+        where userName = #{userName}
+          and contestStatus = 1
     </select>
     <select id="getcontestedInfo" resultType="com.caimei.model.vo.RossChallengeRoundVo">
-        select * from cm_ross_challenge_round where  contestStatus=1 and authUserId=#{authUserId}
+        select *
+        from cm_ross_challenge_round
+        where contestStatus = 1
+          and authUserId = #{authUserId}
     </select>
     <select id="getcontestedInfoByUserName" resultType="com.caimei.model.vo.RossChallengeRoundVo">
-        select * from cm_ross_challenge_round where userName=#{mobile}
-           and contestTime &gt; #{startTime} and contestTime &lt; #{endTime}
+        select *
+        from cm_ross_challenge_round
+        where userName = #{mobile}
+          and contestTime &gt; #{startTime}
+          and contestTime &lt; #{endTime}
     </select>
     <select id="getVideoAll" resultType="com.caimei.model.vo.RossChallengeVideo">
         select cr.*,cba.authParty from cm_ross_challenge_video cr
@@ -858,35 +936,52 @@
         and cr.releaseTime &gt; #{StartTime} and cr.releaseTime &lt; #{endTime}
         <if test="mobileOrAuthpart != null and mobileOrAuthpart != ''">
             and (cr.userName like concat('%', #{mobileOrAuthpart})
-            or  cba.authParty like concat('%', #{mobileOrAuthpart},'%') )
+            or cba.authParty like concat('%', #{mobileOrAuthpart},'%') )
         </if>
         order by cr.diggCount desc,releaseTime
     </select>
     <select id="getVideoByUsername" resultType="com.caimei.model.vo.RossChallengeVideo">
-        select * from cm_ross_challenge_video
-        where
-           userName = #{mobile}
-          and releaseTime &gt; #{StartTime} and releaseTime &lt; #{endTime}
-        order by diggCount desc,releaseTime
+        select *
+        from cm_ross_challenge_video
+        where userName = #{mobile}
+          and releaseTime &gt; #{StartTime}
+          and releaseTime &lt; #{endTime}
+        order by diggCount desc, releaseTime
     </select>
     <select id="checkVideoByUsername" resultType="com.caimei.model.vo.RossChallengeVideo">
-        select * from cm_ross_challenge_video
+        select *
+        from cm_ross_challenge_video
         where userName = #{mobile}
-          and releaseTime &gt; #{startTime} and releaseTime &lt; #{endTime}
+          and releaseTime &gt; #{startTime}
+          and releaseTime &lt; #{endTime}
     </select>
     <update id="upVideoDiggCount">
         update cm_ross_challenge_video
-            <set>
-                clubUserIds=#{clubUserIds}
+        <set>
+            clubUserIds=#{clubUserIds}
             <if test="null != diggFlag and diggFlag==1">
                 ,diggCount=diggCount+1
             </if>
             <if test="null != diggFlag and diggFlag==0">
                 ,diggCount=diggCount-1
             </if>
-            </set>
+        </set>
         where id=#{videoId}
     </update>
+    <update id="updateQrCodes">
+        UPDATE cm_brand_auth_qrcode
+        SET qrCodeId = concat('HC', id)
+        WHERE id in
+        <foreach item="code" collection="qrcodePos" open="(" separator="," close=")">
+            #{code.id}
+        </foreach>
+    </update>
+    <update id="concatQrcode">
+        update cm_brand_auth_qrcode
+        set authId      = #{authId},
+            unionStatus = 1
+        where id = #{id}
+    </update>
     <select id="getAuthInfo" resultType="com.caimei.model.vo.RossChallengeRoundVo">
         select cr.*,cba.authParty from cm_ross_challenge_round cr
         left join cm_brand_auth cba on cr.authId=cba.id
@@ -895,44 +990,95 @@
             and cr.contestTime &gt; #{StartTime} and cr.contestTime &lt; #{endTime}
         </if>
         <if test="null!=mobile and mobile !=''">
-            and  cr.userName like concat('%', #{mobile})
+            and cr.userName like concat('%', #{mobile})
         </if>
         <if test="null!=authenticationStatus">
-            and  cr.authenticationStatus=#{authenticationStatus}
+            and cr.authenticationStatus=#{authenticationStatus}
         </if>
         order by contestTime desc
     </select>
     <delete id="delAuthInfoById">
-        delete from cm_ross_challenge_round where id=#{id}
+        delete
+        from cm_ross_challenge_round
+        where id = #{id}
     </delete>
     <delete id="delVideoInfoById">
-        delete from cm_ross_challenge_video where id=#{id}
+        delete
+        from cm_ross_challenge_video
+        where id = #{id}
     </delete>
     <delete id="delVideoInfoByUserName">
-        delete from cm_ross_challenge_video where userName=#{mobile}
+        delete
+        from cm_ross_challenge_video
+        where userName = #{mobile}
     </delete>
     <select id="getRoundById" resultType="com.caimei.model.vo.RossChallengeRoundVo">
-        select * from cm_ross_challenge_round where id=#{id}
+        select *
+        from cm_ross_challenge_round
+        where id = #{id}
     </select>
     <select id="getRoundByAuthUserID" resultType="com.caimei.model.vo.RossChallengeRoundVo">
-        select * from cm_ross_challenge_round where authUserId=#{authUserId} and contestStatus=1
+        select *
+        from cm_ross_challenge_round
+        where authUserId = #{authUserId}
+          and contestStatus = 1
     </select>
     <select id="getAuthparty" resultType="java.lang.String">
-        select name from cm_brand_auth_user where authUserId=#{authUserId}
+        select name
+        from cm_brand_auth_user
+        where authUserId = #{authUserId}
     </select>
     <select id="getclubuserInfo" resultType="com.caimei.model.vo.ClubUserVo">
         select cu.name,cu.mobile,cu.addTime,
-            (case
-                 when cu.name is null then '未认证'
-                 when cu.name is not null then '已认证' end
-            ) as authenticationStatus,
-               cu.status
+        (case
+        when cu.name is null then '未认证'
+        when cu.name is not null then '已认证' end
+        ) as authenticationStatus,
+        cu.status
         from cm_brand_club_user cu
         LEFT JOIN cm_brand_auth a ON cu.authId = a.id
         where a.authUserId=#{authUserId}
         <if test="clubUserIds != null and clubUserIds!=''">
-           and  find_in_set(cu.id,#{clubUserIds})
+            and find_in_set(cu.id,#{clubUserIds})
         </if>
         order by cu.addTime desc
     </select>
+    <select id="findQrCodes" resultType="com.caimei.model.po.AuthQrcodePo">
+        select cba.id,cba.authId,cba.authUserId,cba.qrCodeId,cba.addtime,cba.unionStatus,cbp.name as productName,cbu.authParty
+        from cm_brand_auth_qrcode cba
+        left join cm_brand_product_type cbp on cba.productTypeId = cbp.id
+        left join cm_brand_auth cbu on cbu.id = cba.authId
+        where cba.authUserId = #{authUserId} and cba.delFlag = 0
+        <if test="unionStatus != null and unionStatus!=''">
+            and cba.unionStatus = #{unionStatus}
+        </if>
+        <if test="productTypeId != null and productTypeId!=''">
+            and cba.productTypeId = #{productTypeId}
+        </if>
+    </select>
+    <select id="getConcatList" resultType="com.caimei.model.vo.AuthVo">
+        select a.id as authId,
+               a.authUserId,
+               a.authParty,
+               a.status,
+               a.auditStatus,
+               a.shopAuditStatus,
+               a.createTime,
+               a.authCode
+        from cm_brand_auth a
+        LEFT JOIN cm_brand_auth_qrcode cbq ON a.id = cbq.authId
+        where a.authUserId = #{authUserId}
+          and a.delFlag = 0
+          and a.shopAuditStatus = 1
+          AND cbq.authId IS NULL
+          and exists(select 1
+                     from cm_brand_auth_product cp
+                     left join cm_brand_product_relation cbr on cp.id = cbr.productId
+                     where cp.productTypeId = #{productTypeId}
+                       and cbr.authId = a.id)
+        <if test="authParty != null and authParty != ''">
+            and a.authParty like concat('%', #{authParty},'%')
+        </if>
+        order by a.createTime desc, a.id desc
+    </select>
 </mapper>

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov