Browse Source

bugfix-联调

Aslee 2 years ago
parent
commit
addc6874cc

+ 8 - 7
src/main/java/com/caimei/controller/admin/auth/AuthApi.java

@@ -50,6 +50,7 @@ public class AuthApi {
             @ApiImplicitParam(name = "authParty", required = false, value = "授权机构"),
             @ApiImplicitParam(name = "authParty", required = false, value = "授权机构"),
             @ApiImplicitParam(name = "mobile", required = false, value = "机构用户手机号"),
             @ApiImplicitParam(name = "mobile", required = false, value = "机构用户手机号"),
             @ApiImplicitParam(name = "status", required = false, value = "上线状态:0已下线,1已上线,2待上线"),
             @ApiImplicitParam(name = "status", required = false, value = "上线状态:0已下线,1已上线,2待上线"),
+            @ApiImplicitParam(name = "starFlag", required = false, value = "明星机构标识:0不是,1是"),
             @ApiImplicitParam(name = "auditStatus", required = false, value = "审核状态:0审核未通过,1审核通过,2待审核"),
             @ApiImplicitParam(name = "auditStatus", required = false, value = "审核状态:0审核未通过,1审核通过,2待审核"),
             @ApiImplicitParam(name = "lowerAuditStatus", required = false, value = "商品信息审核状态:0未完成审核,1已完成审核"),
             @ApiImplicitParam(name = "lowerAuditStatus", required = false, value = "商品信息审核状态:0未完成审核,1已完成审核"),
             @ApiImplicitParam(name = "shopAuditStatus", required = false, value = "供应商审核状态:0未审核,1已审核"),
             @ApiImplicitParam(name = "shopAuditStatus", required = false, value = "供应商审核状态:0未审核,1已审核"),
@@ -59,7 +60,7 @@ public class AuthApi {
     })
     })
     @GetMapping("/list")
     @GetMapping("/list")
     public ResponseJson<PageInfo<AuthVo>> getAuthList(@CurrentUser SysUser sysUser, Integer listType, String authParty, String mobile,
     public ResponseJson<PageInfo<AuthVo>> getAuthList(@CurrentUser SysUser sysUser, Integer listType, String authParty, String mobile,
-                                                      Integer status, Integer auditStatus, Integer lowerAuditStatus,
+                                                      Integer status, Integer starFlag, Integer auditStatus, Integer lowerAuditStatus,
                                                       Integer shopAuditStatus, Integer sendStatus,
                                                       Integer shopAuditStatus, Integer sendStatus,
                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
                                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
@@ -72,7 +73,7 @@ public class AuthApi {
         if (null == authUserId) {
         if (null == authUserId) {
             return ResponseJson.error("供应商用户id不能为空", null);
             return ResponseJson.error("供应商用户id不能为空", null);
         }
         }
-        return authService.getAuthList(listType, authUserId, authParty, mobile, status, auditStatus, lowerAuditStatus, shopAuditStatus, sendStatus, pageNum, pageSize);
+        return authService.getAuthList(listType, authUserId, authParty, mobile, status, starFlag, auditStatus, lowerAuditStatus, shopAuditStatus, sendStatus, pageNum, pageSize);
     }
     }
 
 
     @ApiOperation("机构下拉框列表")
     @ApiOperation("机构下拉框列表")
@@ -285,12 +286,12 @@ public class AuthApi {
     }
     }
 
 
     @ApiOperation("勾选明星机构")
     @ApiOperation("勾选明星机构")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "authId", required = true, value = "授权机构id"),
-            @ApiImplicitParam(name = "starFlag", required = true, value = "明星机构标识:0不是,1是")
-    })
+    @ApiImplicitParam(name = "params", required = true, value = "authId:机构id;starFlag:明星机构标识:1明星机构,0不是")
     @PostMapping("/star")
     @PostMapping("/star")
-    public ResponseJson starAuth(Integer authId, Integer starFlag) {
+    public ResponseJson starAuth(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer authId = paramsMap.getInteger("authId");
+        Integer starFlag = paramsMap.getInteger("starFlag");
         if (null == authId) {
         if (null == authId) {
             return ResponseJson.error("机构id不能为空");
             return ResponseJson.error("机构id不能为空");
         }
         }

+ 3 - 2
src/main/java/com/caimei/controller/admin/auth/AuthProductApi.java

@@ -66,8 +66,9 @@ public class AuthProductApi {
 
 
 
 
     @ApiOperation("供应商下审核通过设备sn码列表")
     @ApiOperation("供应商下审核通过设备sn码列表")
+    @ApiImplicitParam(name = "authId", required = true, value = "授权id")
     @GetMapping("/sn/list")
     @GetMapping("/sn/list")
-    public ResponseJson<List<String>> getSnCodeList(@CurrentUser SysUser sysUser) {
+    public ResponseJson<List<String>> getSnCodeList(@CurrentUser SysUser sysUser, Integer authId) {
         if (null == sysUser) {
         if (null == sysUser) {
             return ResponseJson.error("用户信息异常", null);
             return ResponseJson.error("用户信息异常", null);
         }
         }
@@ -77,7 +78,7 @@ public class AuthProductApi {
         if (null == authUserId) {
         if (null == authUserId) {
             return ResponseJson.error("供应商用户id不能为空", null);
             return ResponseJson.error("供应商用户id不能为空", null);
         }
         }
-        return authProductService.getSnCodeList(authUserId);
+        return authProductService.getSnCodeList(authUserId, authId);
     }
     }
 
 
 
 

+ 14 - 5
src/main/java/com/caimei/controller/admin/auth/ShopApi.java

@@ -79,6 +79,11 @@ public class ShopApi {
         return shopService.getShopList(listType, shopName, loginAccount, shopType, infoId, mobile, linkMan, lowerAuditStatus, sendStatus, pageNum, pageSize);
         return shopService.getShopList(listType, shopName, loginAccount, shopType, infoId, mobile, linkMan, lowerAuditStatus, sendStatus, pageNum, pageSize);
     }
     }
 
 
+    @GetMapping("/cm/list")
+    public ResponseJson<List<CmShopVo>> getCmShopList(){
+        return shopService.getCmShopList();
+    }
+
     /**
     /**
      * 获取供应商回显数据
      * 获取供应商回显数据
      *
      *
@@ -157,10 +162,10 @@ public class ShopApi {
         if (StringUtils.isEmpty(logo)) {
         if (StringUtils.isEmpty(logo)) {
             return ResponseJson.error("供应商logo不能为空");
             return ResponseJson.error("供应商logo不能为空");
         }
         }
-        String qrCodeImage = (String) paramsMap.get("qrCodeImage");
-        Integer wxAccountType = (Integer) paramsMap.get("wxAccountType");
-        String appId = (String) paramsMap.get("appId");
-        String appSecret = (String) paramsMap.get("appSecret");
+        String qrCodeImage = paramsMap.getString("qrCodeImage");
+        Integer wxAccountType = paramsMap.getInteger("wxAccountType");
+        String appId = paramsMap.getString("appId");
+        String appSecret = paramsMap.getString("appSecret");
         Integer createBy = paramsMap.getInteger("createBy");
         Integer createBy = paramsMap.getInteger("createBy");
         /*
         /*
             组装供应商用户数据
             组装供应商用户数据
@@ -201,7 +206,11 @@ public class ShopApi {
         List<ShopInfoDto> shopInfoList = new ArrayList<>();
         List<ShopInfoDto> shopInfoList = new ArrayList<>();
         List<String> brandNameList = new ArrayList<>();
         List<String> brandNameList = new ArrayList<>();
         for (Map<String, Object> infoMap : shopInfoData) {
         for (Map<String, Object> infoMap : shopInfoData) {
-            Integer infoId = (Integer) infoMap.get("infoId");
+            Integer infoId = null;
+            String infoIdStr = infoMap.get("infoId").toString();
+            if (StringUtils.isNotEmpty(infoIdStr)) {
+                infoId = Integer.parseInt(infoIdStr);
+            }
             String brandName = (String) infoMap.get("brandName");
             String brandName = (String) infoMap.get("brandName");
             String brandLogo = (String) infoMap.get("brandLogo");
             String brandLogo = (String) infoMap.get("brandLogo");
             String producePlace = (String) infoMap.get("producePlace");
             String producePlace = (String) infoMap.get("producePlace");

+ 3 - 1
src/main/java/com/caimei/mapper/cmMapper/AuthMapper.java

@@ -21,7 +21,7 @@ import java.util.List;
 @Mapper
 @Mapper
 public interface AuthMapper {
 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("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus, @Param("sendStatus") Integer sendStatus);
+    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("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus, @Param("sendStatus") Integer sendStatus, @Param("auditStatus") Integer auditStatus);
 
 
     void updateAuthStatusByAuthId(@Param("authId") Integer authId, @Param("status") Integer status);
     void updateAuthStatusByAuthId(@Param("authId") Integer authId, @Param("status") Integer status);
 
 
@@ -110,4 +110,6 @@ public interface AuthMapper {
     void checkAuth(Integer authId);
     void checkAuth(Integer authId);
 
 
     void starAuth(@Param("authId") Integer authId, @Param("starFlag") Integer starFlag);
     void starAuth(@Param("authId") Integer authId, @Param("starFlag") Integer starFlag);
+
+    void addScanCount(Integer authId);
 }
 }

+ 3 - 1
src/main/java/com/caimei/mapper/cmMapper/AuthProductMapper.java

@@ -101,7 +101,9 @@ public interface AuthProductMapper {
 
 
     ProductFormVo getProductInfo(@Param("productId") Integer productId, @Param("snCode") String snCode);
     ProductFormVo getProductInfo(@Param("productId") Integer productId, @Param("snCode") String snCode);
 
 
-    List<String> getSnCodeList(Integer authUserId);
+    List<String> getSnCodeList(Integer authUserId, Integer authId);
 
 
     List<WxClubListVo> getProductClubList(Integer productId);
     List<WxClubListVo> getProductClubList(Integer productId);
+
+    void addScanCount(Integer productId);
 }
 }

+ 1 - 0
src/main/java/com/caimei/mapper/cmMapper/ShopMapper.java

@@ -87,4 +87,5 @@ public interface ShopMapper {
 
 
     void updateShopLogo(@Param("authUserId") Integer authUserId, @Param("logo") String logo);
     void updateShopLogo(@Param("authUserId") Integer authUserId, @Param("logo") String logo);
 
 
+    List<CmShopVo> getCmShopList();
 }
 }

+ 5 - 0
src/main/java/com/caimei/model/vo/AuthVo.java

@@ -117,6 +117,11 @@ public class AuthVo {
      */
      */
     private Integer starFlag;
     private Integer starFlag;
 
 
+    /**
+     * 扫码次数
+     */
+    private Integer scanCount;
+
     /**
     /**
      *  设备列表最大参数数量
      *  设备列表最大参数数量
      */
      */

+ 21 - 0
src/main/java/com/caimei/model/vo/CmShopVo.java

@@ -0,0 +1,21 @@
+package com.caimei.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author Aslee
+ * @date 2022/8/1
+ */
+@Data
+public class CmShopVo {
+    /**
+     * 采美供应商id
+     */
+    private Integer cmShopId;
+
+    /**
+     * 采美供应商名称
+     */
+    private String cmShopName;
+}

+ 5 - 0
src/main/java/com/caimei/model/vo/ProductListVo.java

@@ -85,4 +85,9 @@ public class ProductListVo {
      * 是否查看过:1是,0否
      * 是否查看过:1是,0否
      */
      */
     private Integer checkFlag;
     private Integer checkFlag;
+
+    /**
+     * 扫码次数
+     */
+    private Integer scanCount;
 }
 }

+ 2 - 1
src/main/java/com/caimei/service/auth/AuthProductService.java

@@ -180,9 +180,10 @@ public interface AuthProductService {
     /**
     /**
      * sn码列表
      * sn码列表
      * @param authUserId
      * @param authUserId
+     * @param authId
      * @return
      * @return
      */
      */
-    ResponseJson<List<String>> getSnCodeList(Integer authUserId);
+    ResponseJson<List<String>> getSnCodeList(Integer authUserId, Integer authId);
 }
 }
 
 
 
 

+ 3 - 2
src/main/java/com/caimei/service/auth/AuthService.java

@@ -26,14 +26,15 @@ public interface AuthService {
      * @param authParty        授权机构
      * @param authParty        授权机构
      * @param mobile
      * @param mobile
      * @param status           上线状态:0已下线,1已上线,2待上线
      * @param status           上线状态:0已下线,1已上线,2待上线
-     * @param auditStatus      审核状态:0审核未通过,1审核通过,2待审核
+     * @param starFlag         明星机构标识:0不是,1是
      * @param lowerAuditStatus 商品信息审核状态:0未完成审核,1已完成审核
      * @param lowerAuditStatus 商品信息审核状态:0未完成审核,1已完成审核
      * @param shopAuditStatus  供应商审核状态:0审核未通过,1审核通过,2待审核
      * @param shopAuditStatus  供应商审核状态:0审核未通过,1审核通过,2待审核
      * @param pageNum          第几页
      * @param pageNum          第几页
      * @param pageSize         一页多少条
      * @param pageSize         一页多少条
+     * @param auditStatus      审核状态:0审核未通过,1审核通过,2待审核
      * @return AuthVo
      * @return AuthVo
      */
      */
-    ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty, String mobile, Integer status, Integer auditStatus, Integer lowerAuditStatus, Integer shopAuditStatus, Integer sendStatus, 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, Integer pageNum, Integer pageSize);
 
 
     /**
     /**
      * 更新授权状态
      * 更新授权状态

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

@@ -160,4 +160,10 @@ public interface ShopService {
      * 删除供应商品牌信息
      * 删除供应商品牌信息
      */
      */
     ResponseJson deleteShopInfo(Integer authUserId, Integer infoId);
     ResponseJson deleteShopInfo(Integer authUserId, Integer infoId);
+
+    /**
+     * 采美供应商列表
+     * @return
+     */
+    ResponseJson<List<CmShopVo>> getCmShopList();
 }
 }

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

@@ -114,6 +114,8 @@ public class AuthClubServiceImpl implements AuthClubService {
             doctor.setTagList(tagList);
             doctor.setTagList(tagList);
         });
         });
         clubDetail.setDoctorList(doctorList);
         clubDetail.setDoctorList(doctorList);
+        // 增加扫码次数
+        authMapper.addScanCount(authId);
         return ResponseJson.success(clubDetail);
         return ResponseJson.success(clubDetail);
     }
     }
 
 

+ 12 - 6
src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java

@@ -185,10 +185,6 @@ public class AuthProductServiceImpl implements AuthProductService {
         if (StringUtils.isBlank(snCode)) {
         if (StringUtils.isBlank(snCode)) {
             return ResponseJson.error("参数异常,请输入商品SN码", null);
             return ResponseJson.error("参数异常,请输入商品SN码", null);
         }
         }
-        Integer productIdBySnCode = authProductMapper.getProductIdBySnCode(snCode);
-        if (null != productIdBySnCode && !productIdBySnCode.equals(productId)) {
-            return ResponseJson.error("参数异常,该商品SN码已存在,请重新输入", null);
-        }
         if (1 == source) {
         if (1 == source) {
             if (2 == certificateImageType && StringUtils.isEmpty(certificateImage)) {
             if (2 == certificateImageType && StringUtils.isEmpty(certificateImage)) {
                 return ResponseJson.error("授权牌不能为空");
                 return ResponseJson.error("授权牌不能为空");
@@ -205,6 +201,14 @@ public class AuthProductServiceImpl implements AuthProductService {
             dbRelation = authProductMapper.getProductRelation(relationId, null, null);
             dbRelation = authProductMapper.getProductRelation(relationId, null, null);
             dbProduct = authProductMapper.getProductFormData(relationId);
             dbProduct = authProductMapper.getProductFormData(relationId);
         }
         }
+        Integer productIdBySnCode = authProductMapper.getProductIdBySnCode(snCode);
+        if (1 == authType) {
+            if (null != productIdBySnCode && !productIdBySnCode.equals(productId)) {
+                return ResponseJson.error("该商品SN码已存在,请重新输入", null);
+            }
+        } else {
+            productId = productIdBySnCode;
+        }
         /*
         /*
             组装商品数据
             组装商品数据
          */
          */
@@ -619,6 +623,8 @@ public class AuthProductServiceImpl implements AuthProductService {
         authProduct.setClubList(authProductMapper.getProductClubList(productId));
         authProduct.setClubList(authProductMapper.getProductClubList(productId));
         // 商品参数
         // 商品参数
         authProduct.setParamList(authProductMapper.getAuthProductParams(productId));
         authProduct.setParamList(authProductMapper.getAuthProductParams(productId));
+        // 增加扫码次数
+        authProductMapper.addScanCount(productId);
         return ResponseJson.success(authProduct);
         return ResponseJson.success(authProduct);
     }
     }
 
 
@@ -772,8 +778,8 @@ public class AuthProductServiceImpl implements AuthProductService {
     }
     }
 
 
     @Override
     @Override
-    public ResponseJson<List<String>> getSnCodeList(Integer authUserId) {
-        List<String> snCodeList = authProductMapper.getSnCodeList(authUserId);
+    public ResponseJson<List<String>> getSnCodeList(Integer authUserId, Integer authId) {
+        List<String> snCodeList = authProductMapper.getSnCodeList(authUserId, authId);
         return ResponseJson.success(snCodeList);
         return ResponseJson.success(snCodeList);
     }
     }
 
 

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

@@ -58,9 +58,6 @@ public class AuthServiceImpl implements AuthService {
     @Value("${caimei.zpapi}")
     @Value("${caimei.zpapi}")
     private String zpServer;
     private String zpServer;
 
 
-    @Resource
-    private AuthProductMapper authProductMapper;
-
     private AuthProductService authProductService;
     private AuthProductService authProductService;
 
 
     @Autowired
     @Autowired
@@ -93,12 +90,11 @@ public class AuthServiceImpl implements AuthService {
 
 
     @Override
     @Override
     public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty,
     public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty,
-                                                      String mobile, Integer status, Integer auditStatus, Integer lowerAuditStatus,
-                                                      Integer shopAuditStatus, Integer sendStatus,
-                                                      Integer pageNum, Integer pageSize) {
+                                                      String mobile, Integer status, Integer starFlag, Integer auditStatus,
+                                                      Integer lowerAuditStatus, Integer shopAuditStatus, Integer sendStatus, Integer pageNum, Integer pageSize) {
         listType = null == listType ? 1 : listType;
         listType = null == listType ? 1 : listType;
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
-        List<AuthVo> authList = authMapper.getAuthList(listType, authUserId, authParty, mobile, status, auditStatus, lowerAuditStatus, shopAuditStatus, sendStatus);
+        List<AuthVo> authList = authMapper.getAuthList(listType, authUserId, authParty, mobile, status, starFlag, auditStatus, lowerAuditStatus, shopAuditStatus, sendStatus);
         PageInfo<AuthVo> pageData = new PageInfo<>(authList);
         PageInfo<AuthVo> pageData = new PageInfo<>(authList);
         return ResponseJson.success(pageData);
         return ResponseJson.success(pageData);
     }
     }
@@ -154,7 +150,7 @@ public class AuthServiceImpl implements AuthService {
 
 
     @Override
     @Override
     public ResponseJson<List<AuthVo>> getAuthSelectList(Integer authUserId) {
     public ResponseJson<List<AuthVo>> getAuthSelectList(Integer authUserId) {
-        List<AuthVo> authList = authMapper.getAuthList(1, authUserId, null, null, null, null, null, null, null);
+        List<AuthVo> authList = authMapper.getAuthList(1, authUserId, null, null, null, null, null, null, null, null);
         return ResponseJson.success(authList);
         return ResponseJson.success(authList);
     }
     }
 
 

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

@@ -432,4 +432,10 @@ public class ShopServiceImpl implements ShopService {
         return ResponseJson.success("删除成功");
         return ResponseJson.success("删除成功");
     }
     }
 
 
+    @Override
+    public ResponseJson<List<CmShopVo>> getCmShopList() {
+        List<CmShopVo> cmShopList = shopMapper.getCmShopList();
+        return ResponseJson.success(cmShopList);
+    }
+
 }
 }

+ 7 - 1
src/main/resources/mapper/AuthMapper.xml

@@ -106,6 +106,9 @@
         set starFlag = #{starFlag}
         set starFlag = #{starFlag}
         where id = #{authId}
         where id = #{authId}
     </update>
     </update>
+    <update id="addScanCount">
+        update cm_brand_auth set scanCount = scanCount + 1 where id = #{authId}
+    </update>
     <delete id="deleteBanner">
     <delete id="deleteBanner">
         delete from cm_brand_auth_banner where authId = #{authId}
         delete from cm_brand_auth_banner where authId = #{authId}
     </delete>
     </delete>
@@ -116,7 +119,7 @@
         ifnull(ap.waitAuditNum,0) as waitAuditNum,
         ifnull(ap.waitAuditNum,0) as waitAuditNum,
         ifnull(bp.waitAuditNum,0) as shopWaitAuditNum,
         ifnull(bp.waitAuditNum,0) as shopWaitAuditNum,
         if(ifnull(ap.waitAuditNum,0)>0,0,1) as lowerAuditStatus,
         if(ifnull(ap.waitAuditNum,0)>0,0,1) as lowerAuditStatus,
-        a.checkFlag,a.starFlag
+        a.checkFlag,a.starFlag,a.scanCount
         from cm_brand_auth a
         from cm_brand_auth a
         left join cm_brand_auth_user cu on a.createBy = cu.authUserId
         left join cm_brand_auth_user cu on a.createBy = cu.authUserId
         left join cm_brand_club_user cbcu1 on a.createBy = cbcu1.id
         left join cm_brand_club_user cbcu1 on a.createBy = cbcu1.id
@@ -136,6 +139,9 @@
         <if test="status != null">
         <if test="status != null">
             and a.status = #{status}
             and a.status = #{status}
         </if>
         </if>
+        <if test="starFlag != null">
+            and a.starFlag = #{starFlag}
+        </if>
         <if test="auditStatus != null">
         <if test="auditStatus != null">
             and a.auditStatus = #{auditStatus}
             and a.auditStatus = #{auditStatus}
         </if>
         </if>

+ 10 - 5
src/main/resources/mapper/AuthProductMapper.xml

@@ -30,6 +30,11 @@
         insert into cm_brand_product_relation (authId, productId, authType)
         insert into cm_brand_product_relation (authId, productId, authType)
         values (#{authId}, #{productId}, #{authType})
         values (#{authId}, #{productId}, #{authType})
     </insert>
     </insert>
+    <insert id="addScanCount">
+        update cm_brand_auth_product
+        set scanCount = scanCount + 1
+        where id = #{productId}
+    </insert>
 
 
     <update id="updateProductStatusByProductId">
     <update id="updateProductStatusByProductId">
         update cm_brand_auth_product
         update cm_brand_auth_product
@@ -163,11 +168,11 @@
         where id = #{relationId}
         where id = #{relationId}
     </update>
     </update>
     <select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
     <select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
-        select p.id as productId,if(p.productTypeId is null,p.name,t.name) as productName,
+        select r.id as relationId,p.id as productId,if(p.productTypeId is null,p.name,t.name) as productName,
         snCode,p.status,p.auditStatus,p.shopAuditStatus, p.createTime,
         snCode,p.status,p.auditStatus,p.shopAuditStatus, p.createTime,
         if(p.createSource = 1,cu.name,cbcu.mobile) as createBy,
         if(p.createSource = 1,cu.name,cbcu.mobile) as createBy,
         au.name as auditBy,p.auditTime,p.invalidReason, ifnull(au1.name,au1.mobile) as shopAuditBy,
         au.name as auditBy,p.auditTime,p.invalidReason, ifnull(au1.name,au1.mobile) as shopAuditBy,
-        p.shopAuditTime,r.id as relationId, p.checkFlag
+        p.shopAuditTime, p.checkFlag, p.scanCount
         from cm_brand_auth_product p
         from cm_brand_auth_product p
         left join cm_brand_product_relation r on p.id = r.productId
         left join cm_brand_product_relation r on p.id = r.productId
         left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
         left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
@@ -457,7 +462,7 @@
         where productId = #{productId}
         where productId = #{productId}
     </select>
     </select>
     <select id="getProductInfo" resultType="com.caimei.model.vo.ProductFormVo">
     <select id="getProductInfo" resultType="com.caimei.model.vo.ProductFormVo">
-        select p.id as productId,p.snCode, if(p.productTypeId is null,p.name,t.name) as productName,
+        select p.id as productId, p.productTypeId, p.snCode, if(p.productTypeId is null,p.name,t.name) as productName,
         certificateImageType,certificateImage,purchaseWay,invoiceImage,p.auditStatus
         certificateImageType,certificateImage,purchaseWay,invoiceImage,p.auditStatus
         from cm_brand_auth_product p
         from cm_brand_auth_product p
         left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
         left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
@@ -465,7 +470,7 @@
             <if test="productId != null">
             <if test="productId != null">
                 and p.id = #{productId}
                 and p.id = #{productId}
             </if>
             </if>
-            <if test="snCode != null">
+            <if test="snCode != null and snCode != ''">
                 and p.snCode = #{snCode}
                 and p.snCode = #{snCode}
             </if>
             </if>
         </where>
         </where>
@@ -475,7 +480,7 @@
         from cm_brand_auth_product p
         from cm_brand_auth_product p
                  left join cm_brand_product_relation r on p.id = r.productId
                  left join cm_brand_product_relation r on p.id = r.productId
                  left join cm_brand_auth a on a.id = r.authId and a.delFlag = 0
                  left join cm_brand_auth a on a.id = r.authId and a.delFlag = 0
-        where a.authUserId = #{authUserId} and p.auditStatus = 1
+        where a.authUserId = #{authUserId} and (r.authType = 2 or (r.authType = 1 and a.id != #{authId}) ) and p.auditStatus = 1
     </select>
     </select>
     <select id="getProductClubList" resultType="com.caimei.model.vo.WxClubListVo">
     <select id="getProductClubList" resultType="com.caimei.model.vo.WxClubListVo">
         select a.id as authId, a.authParty, a.logo
         select a.id as authId, a.authParty, a.logo

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

@@ -294,5 +294,10 @@
     <select id="getLoginAccount" resultType="java.lang.String">
     <select id="getLoginAccount" resultType="java.lang.String">
         select loginAccount from cm_brand_auth_user where authUserId = #{authUserId}
         select loginAccount from cm_brand_auth_user where authUserId = #{authUserId}
     </select>
     </select>
+    <select id="getCmShopList" resultType="com.caimei.model.vo.CmShopVo">
+        select shopID as cmShopId, name as cmShopName
+        from shop
+        where shopType in (1, 2) and status = 90
+    </select>
 
 
 </mapper>
 </mapper>