Aslee před 2 roky
rodič
revize
96499ed441

+ 2 - 0
src/main/java/com/caimei/controller/admin/auth/AuthApi.java

@@ -2,6 +2,7 @@ package com.caimei.controller.admin.auth;
 
 import com.alibaba.fastjson.JSONObject;
 import com.caimei.annotation.CurrentUser;
+import com.caimei.annotation.Idempotent;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.SysUser;
@@ -139,6 +140,7 @@ public class AuthApi {
             "logo;customFlag:是否需要自定义属性:0否,1是;remarks:店铺备注;createBy:创建人id;source:1供应商保存,2机构保存" +
             "linkMan:运营联系人;linkMobile:运营联系人手机号", required = true)
     @PostMapping("/save")
+    @Idempotent(prefix = "idempotent_auth_save", keys = {"#params"}, expire = 5)
     public ResponseJson saveAuth(@CurrentUser SysUser sysUser, @RequestBody String params) throws ParseException {
         if (null == sysUser) {
             return ResponseJson.error("用户信息异常", null);

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

@@ -123,6 +123,7 @@ public class AuthProductApi {
      */
     @ApiOperation("添加/编辑授权商品")
     @PostMapping("/save")
+    @Idempotent(prefix = "idempotent_product_save", keys = {"#productSaveDto"}, expire = 5)
     public ResponseJson saveProduct(@CurrentUser SysUser sysUser, @RequestBody ProductSaveDto productSaveDto) throws IOException {
         // 获取创建人用户id
         Integer userIdentity = sysUser.getUserIdentity();
@@ -206,6 +207,7 @@ public class AuthProductApi {
         // 获取供应商用户id
         Integer userIdentity = sysUser.getUserIdentity();
         Integer authUserId = 2 == userIdentity ? sysUser.getId() : 3 == userIdentity ? sysUser.getParentId() : null;
+        Integer createBy = (2 == userIdentity || 3 == userIdentity) ? sysUser.getId() : null;
         if (null == authUserId) {
             return ResponseJson.error("供应商用户id不能为空", null);
         }
@@ -214,7 +216,6 @@ public class AuthProductApi {
         Integer infoId = paramsMap.getInteger("infoId");
         String name = paramsMap.getString("name");
         String image = paramsMap.getString("image");
-        Integer createBy = paramsMap.getInteger("createBy");
         String paramListStr = paramsMap.getString("paramList");
         List<ProductParamPo> paramList = JSONArray.parseArray(paramListStr, ProductParamPo.class);
         if (null == infoId) {

+ 1 - 0
src/main/java/com/caimei/controller/admin/sys/SysUserApi.java

@@ -102,6 +102,7 @@ public class SysUserApi {
         }
         Integer userIdentity = currentUser.getUserIdentity();
         sysUser.setUserIdentity(1 == userIdentity ? 1 : 3);
+        sysUser.setLoginAccount(1 == userIdentity ? sysUser.getUsername() : sysUser.getLoginAccount());
         sysUser.setParentId(1 == userIdentity ? 1 : 2 == userIdentity ? currentUser.getId() : currentUser.getParentId());
         sysUser.setCreateBy(currentUser.getId());
         return sysUserService.createUser(sysUser);

+ 5 - 0
src/main/java/com/caimei/model/po/ProductTypePo.java

@@ -92,4 +92,9 @@ public class ProductTypePo {
      * 参数列表
      */
     private List<ProductParamPo> paramList;
+
+    /**
+     * 是否查看过:1是,0否
+     */
+    private Integer checkFlag;
 }

+ 13 - 8
src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java

@@ -78,11 +78,6 @@ public class AuthProductServiceImpl implements AuthProductService {
         this.uploadService = uploadService;
     }
 
-    private String endpoint = "https://oss-cn-shenzhen.aliyuncs.com";
-    private String accessKeyId = "LTAI4GBL3o4YkWnbKYgf2Xia";
-    private String accessKeySecret = "dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK";
-    private String bucketName = "caimei-oss";
-
     @Override
     public ResponseJson<PageInfo<ProductListVo>> getProductList(Integer listType, Integer authId, String productName,
                                                                 String snCode, Integer status, Integer auditStatus,
@@ -662,6 +657,10 @@ public class AuthProductServiceImpl implements AuthProductService {
     public ResponseJson<ProductTypePo> saveProductType(Integer productTypeId, Integer authUserId, Integer infoId, String name, String image, Integer createBy, List<ProductParamPo> paramList, Integer createSource) throws IOException {
         // 是否为添加操作
         boolean insertFlag = null == productTypeId;
+        ProductTypePo dbProductType = null;
+        if (!insertFlag) {
+            dbProductType = authProductMapper.getProductType(productTypeId, null, null);
+        }
         /*
          * 组装设备分类数据
          */
@@ -676,12 +675,19 @@ public class AuthProductServiceImpl implements AuthProductService {
         /*productType.setStatus(2);
         productType.setAuditStatus(2);*/
         // 供应商保存,直接上线;机构保存,需要供应商审核通过后才上线
-        productType.setStatus(1 == createSource ? 1 : 2);
-        productType.setAuditStatus(1 == createSource ? 1 : 2);
+        if (null != dbProductType && 1 != dbProductType.getAuditStatus()) {
+            // 被驳回的数据,编辑变为待审核状态
+            productType.setStatus(2);
+            productType.setAuditStatus(2);
+        } else {
+            productType.setStatus(1 == createSource ? 1 : 2);
+            productType.setAuditStatus(1 == createSource ? 1 : 2);
+        }
         Integer adminUserId = authMapper.getAdminUserId();
         productType.setAuditBy(adminUserId);
         productType.setAuditTime(new Date());
         productType.setCreateSource(createSource);
+        productType.setCheckFlag(0);
         if (insertFlag) {
             // 创建人id
             productType.setCreateBy(createBy);
@@ -695,7 +701,6 @@ public class AuthProductServiceImpl implements AuthProductService {
         } else {
             // 设备分类id
             productType.setProductTypeId(productTypeId);
-            ProductTypePo dbProductType = authProductMapper.getProductType(productTypeId, null, null);
             // 设备分类图片是否重新上传
             boolean updateImageFlag = (StringUtils.isNotBlank(productType.getImage()) && !productType.getImage().equals(dbProductType.getImage()))
                     || (StringUtils.isEmpty(productType.getPcImage()) || StringUtils.isEmpty(productType.getAppletsImage()));

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

@@ -455,7 +455,7 @@ public class AuthServiceImpl implements AuthService {
         if (2 == source) {
             authMapper.updateAuthShopAuditStatus(authId, status, auditStatus, invalidReason, auditBy, auditTime);
         }
-        return ResponseJson.success("审核品牌授权成功");
+        return ResponseJson.success("审核机构认证成功");
     }
 
 

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

@@ -114,9 +114,9 @@
     </delete>
     <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, a.createTime,
-        if(a.createSource = 1,cu.name,cbcu1.mobile) as createBy,au.name as auditBy,a.auditTime,a.invalidReason,
+        if(a.createSource = 1,ifnull(cu.loginAccount, cu.name),cbcu1.mobile) as createBy,ifnull(au.loginAccount,au.name) as auditBy,a.auditTime,a.invalidReason,
                ifnull(a.shopInvalidReason, a.invalidReason) as shopInvalidReason,
-        a.sendStatus, ifnull(au1.name,au1.mobile) as shopAuditBy,a.shopAuditTime,
+        a.sendStatus, ifnull(au1.loginAccount,au1.name) as shopAuditBy,a.shopAuditTime,
         ifnull(ap.waitAuditNum,0) as waitAuditNum,
         ifnull(bp.waitAuditNum,0) as shopWaitAuditNum,
         if(ifnull(ap.waitAuditNum,0)>0,0,1) as lowerAuditStatus,
@@ -134,7 +134,7 @@
             left join cm_brand_product_relation r on p.id = r.productId
             where shopAuditStatus = 2 group by r.authId) bp on a.id = bp.authId
         left join (select r.authId,count(*) as productNum from cm_brand_auth_product p
-            left join cm_brand_product_relation r on p.id = r.productId group by r.authId) cp
+            left join cm_brand_product_relation r on p.id = r.productId and p.shopAuditStatus = 1 group by r.authId) cp
             on a.id = cp.authId
         where a.authUserId = #{authUserId} and a.delFlag = 0
         <if test="authParty != null and authParty != ''">
@@ -285,6 +285,7 @@
         from cm_brand_auth a
         left join cm_brand_club_user u on a.id = u.authId and u.delFlag = 0
         <where>
+            a.delFlag = 0
             <if test="authUserId != null">
                 and a.authUserId = #{authUserId}
             </if>
@@ -301,7 +302,7 @@
                a.auditStatus,
                a.createTime,
                cu.name as createBy,
-               au.name as auditBy,
+               ifnull(au.loginAccount,au.name) as auditBy,
                a.auditTime,
                a.invalidReason
         from cm_brand_auth a
@@ -344,7 +345,7 @@
                  left join province p on a.provinceId = p.provinceID
                  left join city c on a.cityId = c.cityID
                  left join town t on a.townId = t.townID
-        where id = #{authId}
+        where id = #{authId} and a.delFlag = 0
     </select>
     <select id="getTownNames" resultType="java.lang.String">
         select name from town
@@ -392,7 +393,7 @@
     <select id="getAuthTemplate" resultType="com.caimei.model.vo.TemplateVo">
         select at.id as templateId, templateImage, qrPosition, qrSize
         from cm_brand_auth_template at
-            left join cm_brand_auth a on at.authUserId = a.authUserId
+            left join cm_brand_auth a on at.authUserId = a.authUserId and a.delFlag = 0
         where at.status = 1
         <if test="templateType == 1">
             and at.authFlag = 1

+ 24 - 18
src/main/resources/mapper/AuthProductMapper.xml

@@ -19,8 +19,8 @@
         values (#{productId}, #{paramName}, #{paramContent})
     </insert>
     <insert id="insertProductType" keyColumn="id" keyProperty="productTypeId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductTypePo">
-        insert into cm_brand_product_type (authUserId, infoId, name, image, pcImage, appletsImage, status, auditStatus, auditBy, auditTime, createBy, createSource, createTime, delFlag)
-        values (#{authUserId}, #{infoId}, #{name}, #{image}, #{pcImage}, #{appletsImage}, #{status}, #{auditStatus}, #{auditBy}, #{auditTime}, #{createBy}, #{createSource}, #{createTime}, 0)
+        insert into cm_brand_product_type (authUserId, infoId, name, image, pcImage, appletsImage, status, auditStatus, auditBy, auditTime, createBy, createSource, createTime, checkFlag, delFlag)
+        values (#{authUserId}, #{infoId}, #{name}, #{image}, #{pcImage}, #{appletsImage}, #{status}, #{auditStatus}, #{auditBy}, #{auditTime}, #{createBy}, #{createSource}, #{createTime}, #{checkFlag}, 0)
     </insert>
     <insert id="insertProductTypeParam">
         insert into cm_brand_product_type_param (productTypeId, name, content)
@@ -113,7 +113,8 @@
         </if>
         image = #{image},
         status = #{status},
-        auditStatus = #{auditStatus}
+        auditStatus = #{auditStatus},
+        checkFlag = #{checkFlag}
         where id = #{productTypeId}
     </update>
     <update id="updateProductTypeStatus">
@@ -171,20 +172,22 @@
         update cm_brand_product_type set checkFlag = 1 where id = #{productTypeId}
     </update>
     <select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
-        select r.id as relationId,p.id as productId,a.authUserId, if(p.productTypeId is null,p.name,t.name) as productName,
-               snCode,p.status,p.auditStatus,p.shopAuditStatus, p.createTime,
-               if(p.createSource = 1,cu.name,cbcu.mobile) as createBy,
-               au.name as auditBy,p.auditTime,p.invalidReason,ifnull(p.shopInvalidReason,p.invalidReason) as shopInvalidReason,
-               ifnull(au1.name,au1.mobile) as shopAuditBy, p.shopAuditTime, p.checkFlag, p.scanCount
+        select r.id as relationId,p.id as productId,a.authUserId, if(p.productTypeId is null,p.name,t.name) as
+        productName,
+        snCode,p.status,p.auditStatus,p.shopAuditStatus, p.createTime,
+        if(p.createSource = 1,ifnull(cu.loginAccount, cu.name),cbcu.mobile) as createBy,
+        ifnull(au.loginAccount,au.name) as
+        auditBy,p.auditTime,p.invalidReason,ifnull(p.shopInvalidReason,p.invalidReason) as shopInvalidReason,
+        ifnull(au1.loginAccount,au1.name) as shopAuditBy, p.shopAuditTime, p.checkFlag, p.scanCount
         from cm_brand_auth_product p
         left join cm_brand_product_relation r on p.id = r.productId
-        left join cm_brand_auth a on r.authId = a.id
+        left join cm_brand_auth a on r.authId = a.id and a.delFlag = 0
         left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
         left join cm_brand_auth_user cu on p.createBy = cu.authUserId
         left join cm_brand_auth_user au on p.auditBy = au.authUserId
         left join cm_brand_auth_user au1 on p.shopAuditBy = au1.authUserId
         left join cm_brand_club_user cbcu on p.createBy = cbcu.id and cbcu.delFlag = 0
-        where r.authId = #{authId}
+        where a.id = #{authId}
         <if test="productName != null and productName != ''">
             and (t.name like CONCAT('%',#{productName},'%') or t.name like CONCAT('%',#{productName},'%'))
         </if>
@@ -282,6 +285,7 @@
         left join cm_brand_auth a on r.authId = a.id
         left join cm_brand_auth_user au on a.authUserId = au.authUserId
         <where>
+            a.delFlag = 0
             <if test="listType == 1">
                 and p.productTypeId = #{productTypeId}
                 and au.status = 1
@@ -310,6 +314,7 @@
                 </if>
             </if>
         </where>
+        group by p.id
         order by p.createTime desc
     </select>
     <select id="getAuthProductList" resultType="com.caimei.model.vo.ProductFormVo">
@@ -348,7 +353,7 @@
         from cm_brand_auth_product p
                  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_auth a on r.authId = a.id
+                 left join cm_brand_auth a on r.authId = a.id and a.delFlag = 0
                  left join cm_brand_auth_user u on a.authUserId = u.authUserId
                  left join cm_brand_auth_shop_info i on t.infoId = i.id
         where p.id = #{productId}
@@ -378,8 +383,8 @@
     </select>
     <select id="getProductTypeList" resultType="com.caimei.model.vo.ProductTypeListVo">
         select t.id as productTypeId,t.name,t.image,t.status,t.auditStatus,t.createTime,
-        if(t.createSource = 1,cu.name,cbcu.mobile) as createBy,
-        au.name as auditBy,t.auditTime,t.invalidReason,t.checkFlag
+        if(t.createSource = 1,ifnull(cu.loginAccount, cu.name),cbcu.mobile) as createBy,
+        ifnull(au.loginAccount,au.name) as auditBy,t.auditTime,t.invalidReason,t.checkFlag
         from cm_brand_product_type t
         left join cm_brand_auth_user cu on t.createBy = cu.authUserId
         left join cm_brand_auth_user au on t.auditBy = au.authUserId
@@ -414,9 +419,10 @@
         order by t.id desc
     </select>
     <select id="getProductType" resultType="com.caimei.model.po.ProductTypePo">
-        select t.id as productTypeId, infoId, i.brandName, t.name, image, pcImage, appletsImage, t.authUserId, createBy
+        select t.id as productTypeId, infoId, i.brandName, t.name, image, pcImage, appletsImage, t.authUserId, t.auditStatus, createBy
         from cm_brand_product_type t left join cm_brand_auth_shop_info i on t.infoId = i.id
         <where>
+            t.delFlag = 0
             <if test="productTypeId != null">
                 and t.id = #{productTypeId}
             </if>
@@ -442,7 +448,7 @@
         from cm_brand_auth_product p
                  left join cm_brand_product_relation r on p.id = r.productId
                  left join cm_brand_auth a on r.authId = a.id
-        where p.id = #{productId}
+        where p.id = #{productId} and a.delFlag = 0
         limit 1
     </select>
     <select id="getProductTypeParamList" resultType="com.caimei.model.po.ProductParamPo">
@@ -485,13 +491,13 @@
         select DISTINCT snCode
         from cm_brand_auth_product p
                  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
-        where a.authUserId = #{authUserId} and (r.authType = 2 or (r.authType = 1 and a.id != #{authId}) ) and p.auditStatus = 1
+                 left join cm_brand_auth a on a.id = r.authId
+        where a.authUserId = #{authUserId} and a.delFlag = 0 and (r.authType = 2 or (r.authType = 1 and a.id != #{authId}) ) and p.auditStatus = 1
     </select>
     <select id="getProductClubList" resultType="com.caimei.model.vo.WxClubListVo">
         select a.id as authId, a.authParty, a.logo
         from cm_brand_auth a
                  left join cm_brand_product_relation r on a.id = r.authId
-        where r.productId = #{productId}
+        where r.productId = #{productId} and a.delFlag = 0
     </select>
 </mapper>

+ 1 - 1
src/main/resources/mapper/AuthTemplateMapper.xml

@@ -45,7 +45,7 @@
     </update>
     <update id="clearProductFlag">
         update cm_brand_auth_template
-        set productFlag = 1
+        set productFlag = 0
         where authUserId = #{authUserId}
     </update>
 

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

@@ -43,7 +43,7 @@
     </update>
     <select id="getClubList" resultType="com.caimei.model.vo.ClubVo">
         select id as authId,authParty as authParty,createTime
-        from cm_brand_auth where authUserId = #{authUserId}
+        from cm_brand_auth where authUserId = #{authUserId} and delFlag = 0
         <if test="authParty != null and authParty != ''">
             and authParty like concat('%',#{authParty},'%')
         </if>
@@ -56,13 +56,13 @@
         cu.mobile,
         cu.addTime,
         cu.nickName,
-        cu.mobile,
         cu.openId,
         cu.status
         from cm_brand_club_user cu
         left join cm_brand_auth a on cu.authId = a.id
         where cu.authUserId = #{authUserId}
         and cu.delFlag = 0
+        and (a.id is null || a.delFlag = 0)
         <if test="name != null and name != ''">
             and cu.name like concat('%',#{name},'%')
         </if>
@@ -106,14 +106,14 @@
     </select>
     <select id="checkMobile" resultType="java.lang.Integer">
         select cu.id as clubUserId from cm_brand_club_user cu
-        left join cm_brand_auth a on cu.authId = a.id
+        left join cm_brand_auth a on cu.authId = a.id and a.delFlag = 0
         left join cm_brand_auth_user au on a.authUserId = au.authUserId
         where cu.mobile = #{mobile} and au.appId = #{appId} and cu.delFlag = 0 limit 1
     </select>
     <select id="getWxClubUser" resultType="com.caimei.model.vo.WxClubUserVo">
         select cu.id as clubUserId, cu.authId as authId, cu.authUserId, cu.mobile, cu.status
         from cm_brand_club_user cu
-                 left join cm_brand_auth a on cu.authId = a.id
+                 left join cm_brand_auth a on cu.authId = a.id and a.delFlag = 0
                  left join cm_brand_auth_user au on a.authUserId = au.authUserId
         where cu.delFlag = 0
           <if test="mobile != null and mobile != ''">
@@ -149,6 +149,7 @@
                  left join city c on a.cityId = c.cityID
                  left join town t on a.townId = t.townID
         where a.id = #{authId}
+          and a.delFlag = 0
           and u.status = 1
           and a.status = 1
           and a.auditStatus = 1;
@@ -158,7 +159,7 @@
     </select>
     <select id="getWxStarClubList" resultType="com.caimei.model.vo.WxClubListVo">
         select id as authId, authParty as authParty,concat(ifnull(p.name,''),ifnull(c.name,''),ifnull(t.name,'')) as area,a.address,a.mobile,a.logo,
-        ifnull(round(st_distance(point(a.lng,a.lat),point(#{lng},#{lat}))*111195/1000,2),99999) as distance
+        99999 as distance
         from cm_brand_auth a
         left join cm_brand_auth_user au on a.authUserId = au.authUserId
         left join province p on a.provinceId = p.provinceID

+ 4 - 4
src/main/resources/mapper/DoctorMapper.xml

@@ -71,7 +71,7 @@
         </delete>
     <select id="getDoctorList" resultType="com.caimei.model.vo.DoctorListVo">
         select id as doctorId, a.name as doctorName,a.certificateNo, a.status, a.auditStatus, a.createTime, cu.name as createBy,
-               au.name as auditBy,a.auditTime,a.invalidReason, a.checkFlag
+        ifnull(au.loginAccount,au.name) as auditBy,a.auditTime,a.invalidReason, a.checkFlag
         from cm_brand_doctor a
                  left join cm_brand_auth_user cu on a.createBy = cu.authUserId
                  left join cm_brand_auth_user au on a.auditBy = au.authUserId
@@ -128,7 +128,7 @@
         select d.id as doctorId, d.doctorType, d.name as doctorName,d.certificateNo,ifnull(cba.authParty,d.clubName) as clubName,d.image as doctorImage
         from cm_brand_doctor d
         left join cm_brand_auth_user au on d.authUserId = au.authUserId
-        left join cm_brand_auth cba on d.authId = cba.id
+        left join cm_brand_auth cba on d.authId = cba.id and cba.delFlag = 0
         where
         au.status = 1
         and d.status = 1
@@ -137,7 +137,7 @@
             and au.authUserId = #{authUserId}
         </if>
         <if test="authId != null">
-            and d.authId = #{authId}
+            and cba.id = #{authId}
         </if>
         <if test="doctorType != null">
             and d.doctorType = #{doctorType}
@@ -158,7 +158,7 @@
                image  as doctorImage
         from cm_brand_doctor d
                  left join cm_brand_auth_user au on d.authUserId = au.authUserId
-                 left join cm_brand_auth cba on d.authId = cba.id
+                 left join cm_brand_auth cba on d.authId = cba.id and cba.delFlag = 0
         where d.id = #{doctorId}
           and au.status = 1
           and d.status = 1

+ 1 - 1
src/main/resources/mapper/FileMapper.xml

@@ -143,7 +143,7 @@
         left join cm_brand_product_relation r on p.id = r.productId
         left join cm_brand_auth a on r.authId = a.id
         left join cm_brand_auth_user u on a.authUserId = u.authUserId
-        left join cm_brand_product_type t on p.productTypeId = t.id
+        left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
         where a.delFlag = 0
         <if test="authId != null">
             and a.id = #{authId}

+ 1 - 1
src/main/resources/mapper/LoginMapper.xml

@@ -13,7 +13,7 @@
     <select id="getClubUserByOpenId" resultType="com.caimei.model.vo.WxClubUserVo">
         select cu.id as clubUserId, cu.authId, a.authUserId, cu.mobile, cu.openId
         from cm_brand_club_user cu
-                 left join cm_brand_auth a on cu.authId = a.id
+                 left join cm_brand_auth a on cu.authId = a.id and a.delFlag = 0
                  left join cm_brand_auth_user au on a.authUserId = au.authUserId
         where openId = #{openId} and au.appId = #{appId}
           and cu.delFlag = 0

+ 2 - 2
src/main/resources/mapper/LogisticsMapper.xml

@@ -10,8 +10,8 @@
     <select id="getCertificateLogistics" resultType="com.caimei.model.vo.CertificateLogisticsVo">
         select a.authParty, logisticsCompanyName as companyName, logisticsCompanyCode as companyCode, nu as logisticsNumber,
                state, info, remarksImage, li.remarks, updateDate
-               from logistics_information li left join cm_brand_auth a on li.authId = a.id
-        where authId = #{authId}
+               from logistics_information li left join cm_brand_auth a on li.authId = a.id and a.delFlag = 0
+        where a.id = #{authId}
     </select>
     <select id="getLogisticsCompanyList" resultType="com.caimei.model.vo.LogisticsCompanyVo">
         select id, label as companyName, value as companyCode

+ 10 - 11
src/main/resources/mapper/ShopMapper.xml

@@ -83,17 +83,17 @@
         ifnull(tw.productTypeWaitNum,0) as productTypeWaitNum
         from cm_brand_auth_user u
         left join cm_brand_auth_shop_info s on u.authUserId = s.authUserId
-        left join (select authUserId, count(*) as authWaitNum from cm_brand_auth where auditStatus = 2 and shopAuditStatus = 1 group by authUserId) aw on u.authUserId = aw.authUserId
+        left join (select authUserId, count(*) as authWaitNum from cm_brand_auth where auditStatus = 2 and shopAuditStatus = 1 and delFlag = 0 group by authUserId) aw on u.authUserId = aw.authUserId
         left join (select a.authUserId, count(*) as productWaitNum from cm_brand_auth_product p left join cm_brand_product_relation r on p.id = r.productId left join cm_brand_auth a on a.id = r.authId
-        where p.auditStatus = 2 and p.shopAuditStatus = 1 group by a.authUserId) pw on u.authUserId = pw.authUserId
+        where p.auditStatus = 2 and p.shopAuditStatus = 1 and a.delFlag = 0 group by a.authUserId) pw on u.authUserId = pw.authUserId
         left join (select authUserId, count(*) as articleWaitNum from cm_brand_article where auditStatus = 2 group by authUserId) arw on u.authUserId = arw.authUserId
         left join (select authUserId, count(*) as imageWaitNum from cm_brand_image where auditStatus = 2 group by authUserId) iw on u.authUserId = iw.authUserId
         left join (select authUserId, count(*) as videoWaitNum from cm_brand_video where auditStatus = 2 group by authUserId) vw on u.authUserId = vw.authUserId
         left join (select authUserId, count(*) as fileWaitNum from cm_brand_file where auditStatus = 2 and fileType = 1 group by authUserId) fw on u.authUserId = fw.authUserId
         left join (select authUserId, count(*) as zipWaitNum from cm_brand_file where auditStatus = 2 and fileType = 2 group by authUserId) zw on u.authUserId = zw.authUserId
         left join (select authUserId, count(*) as doctorWaitNum from cm_brand_doctor where auditStatus = 2 group by authUserId) dw on u.authUserId = dw.authUserId
-        left join (select authUserId, count(*) as productTypeWaitNum from cm_brand_product_type where auditStatus = 2 group by authUserId) tw on u.authUserId = tw.authUserId
-        left join (select authUserId, count(*) as waitSendNum from cm_brand_auth where auditStatus = 1 and sendStatus = 0 group by authUserId) sw on u.authUserId = sw.authUserId
+        left join (select authUserId, count(*) as productTypeWaitNum from cm_brand_product_type where auditStatus = 2 and delFlag = 0 group by authUserId) tw on u.authUserId = tw.authUserId
+        left join (select authUserId, count(*) as waitSendNum from cm_brand_auth where auditStatus = 1 and sendStatus = 0 and delFlag = 0 group by authUserId) sw on u.authUserId = sw.authUserId
         where u.userIdentity = 2
         <if test="shopName != null and shopName !=''">
             AND u.name like CONCAT('%',#{shopName},'%')
@@ -222,7 +222,7 @@
         select count(*)
         from cm_brand_auth_product p
                  left join cm_brand_product_relation r on p.id = r.productId
-                 left join cm_brand_auth a on r.authId = a.id
+                 left join cm_brand_auth a on r.authId = a.id and a.delFlag = 0
         where a.authUserId = #{authUserId}
           and p.auditStatus = 2
     </select>
@@ -230,8 +230,8 @@
         select count(*)
         from cm_brand_auth_product p
                  left join cm_brand_product_relation r on p.id = r.productId
-                 left join cm_brand_product_type t on p.productTypeId = t.id
-                 left join cm_brand_auth a on r.authId = a.id
+                 left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
+                 left join cm_brand_auth a on r.authId = a.id and a.delFlag = 0
         where a.authUserId = #{authUserId}
           and if(p.productTypeId is not null, t.infoId, p.infoId) = #{infoId}
     </select>
@@ -240,9 +240,8 @@
         handleTime
         from cm_brand_club_feedback cf
         left join cm_brand_club_user cu on cf.clubUserId = cu.id and cu.delFlag = 0
-        left join cm_brand_auth a on cu.authId = a.id
-        left join cm_brand_auth_user au on cu.authUserId = au.authUserId
-        where (a.authUserId = #{authUserId} or au.authUserId = #{authUserId})
+        left join cm_brand_auth a on cu.authId = a.id and a.delFlag = 0
+        where a.authUserId = #{authUserId}
         <if test="authParty != null and authParty != ''">
             and a.authParty like concat('%',#{authParty},'%')
         </if>
@@ -257,7 +256,7 @@
         select cf.id as feedbackId, a.authParty as authParty, cu.mobile, content, commitTime, handleStatus, handleResult, handleTime
         from cm_brand_club_feedback cf
                  left join cm_brand_club_user cu on cf.clubUserId = cu.id and cu.delFlag = 0
-                 left join cm_brand_auth a on cu.authId = a.id
+                 left join cm_brand_auth a on cu.authId = a.id and a.delFlag = 0
         where cf.id = #{feedbackId}
     </select>
     <select id="getShopStatus" resultType="java.lang.Integer">