Browse Source

bugfix-提测

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

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

@@ -123,6 +123,7 @@ public class AuthProductApi {
      */
      */
     @ApiOperation("添加/编辑授权商品")
     @ApiOperation("添加/编辑授权商品")
     @PostMapping("/save")
     @PostMapping("/save")
+    @Idempotent(prefix = "idempotent_product_save", keys = {"#productSaveDto"}, expire = 5)
     public ResponseJson saveProduct(@CurrentUser SysUser sysUser, @RequestBody ProductSaveDto productSaveDto) throws IOException {
     public ResponseJson saveProduct(@CurrentUser SysUser sysUser, @RequestBody ProductSaveDto productSaveDto) throws IOException {
         // 获取创建人用户id
         // 获取创建人用户id
         Integer userIdentity = sysUser.getUserIdentity();
         Integer userIdentity = sysUser.getUserIdentity();
@@ -206,6 +207,7 @@ public class AuthProductApi {
         // 获取供应商用户id
         // 获取供应商用户id
         Integer userIdentity = sysUser.getUserIdentity();
         Integer userIdentity = sysUser.getUserIdentity();
         Integer authUserId = 2 == userIdentity ? sysUser.getId() : 3 == userIdentity ? sysUser.getParentId() : null;
         Integer authUserId = 2 == userIdentity ? sysUser.getId() : 3 == userIdentity ? sysUser.getParentId() : null;
+        Integer createBy = (2 == userIdentity || 3 == userIdentity) ? sysUser.getId() : null;
         if (null == authUserId) {
         if (null == authUserId) {
             return ResponseJson.error("供应商用户id不能为空", null);
             return ResponseJson.error("供应商用户id不能为空", null);
         }
         }
@@ -214,7 +216,6 @@ public class AuthProductApi {
         Integer infoId = paramsMap.getInteger("infoId");
         Integer infoId = paramsMap.getInteger("infoId");
         String name = paramsMap.getString("name");
         String name = paramsMap.getString("name");
         String image = paramsMap.getString("image");
         String image = paramsMap.getString("image");
-        Integer createBy = paramsMap.getInteger("createBy");
         String paramListStr = paramsMap.getString("paramList");
         String paramListStr = paramsMap.getString("paramList");
         List<ProductParamPo> paramList = JSONArray.parseArray(paramListStr, ProductParamPo.class);
         List<ProductParamPo> paramList = JSONArray.parseArray(paramListStr, ProductParamPo.class);
         if (null == infoId) {
         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();
         Integer userIdentity = currentUser.getUserIdentity();
         sysUser.setUserIdentity(1 == userIdentity ? 1 : 3);
         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.setParentId(1 == userIdentity ? 1 : 2 == userIdentity ? currentUser.getId() : currentUser.getParentId());
         sysUser.setCreateBy(currentUser.getId());
         sysUser.setCreateBy(currentUser.getId());
         return sysUserService.createUser(sysUser);
         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;
     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;
         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
     @Override
     public ResponseJson<PageInfo<ProductListVo>> getProductList(Integer listType, Integer authId, String productName,
     public ResponseJson<PageInfo<ProductListVo>> getProductList(Integer listType, Integer authId, String productName,
                                                                 String snCode, Integer status, Integer auditStatus,
                                                                 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 {
     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;
         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.setStatus(2);
         productType.setAuditStatus(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();
         Integer adminUserId = authMapper.getAdminUserId();
         productType.setAuditBy(adminUserId);
         productType.setAuditBy(adminUserId);
         productType.setAuditTime(new Date());
         productType.setAuditTime(new Date());
         productType.setCreateSource(createSource);
         productType.setCreateSource(createSource);
+        productType.setCheckFlag(0);
         if (insertFlag) {
         if (insertFlag) {
             // 创建人id
             // 创建人id
             productType.setCreateBy(createBy);
             productType.setCreateBy(createBy);
@@ -695,7 +701,6 @@ public class AuthProductServiceImpl implements AuthProductService {
         } else {
         } else {
             // 设备分类id
             // 设备分类id
             productType.setProductTypeId(productTypeId);
             productType.setProductTypeId(productTypeId);
-            ProductTypePo dbProductType = authProductMapper.getProductType(productTypeId, null, null);
             // 设备分类图片是否重新上传
             // 设备分类图片是否重新上传
             boolean updateImageFlag = (StringUtils.isNotBlank(productType.getImage()) && !productType.getImage().equals(dbProductType.getImage()))
             boolean updateImageFlag = (StringUtils.isNotBlank(productType.getImage()) && !productType.getImage().equals(dbProductType.getImage()))
                     || (StringUtils.isEmpty(productType.getPcImage()) || StringUtils.isEmpty(productType.getAppletsImage()));
                     || (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) {
         if (2 == source) {
             authMapper.updateAuthShopAuditStatus(authId, status, auditStatus, invalidReason, auditBy, auditTime);
             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>
     </delete>
     <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
     <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,
         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,
                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(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,
@@ -134,7 +134,7 @@
             left join cm_brand_product_relation r on p.id = r.productId
             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
             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 (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
             on a.id = cp.authId
         where a.authUserId = #{authUserId} and a.delFlag = 0
         where a.authUserId = #{authUserId} and a.delFlag = 0
         <if test="authParty != null and authParty != ''">
         <if test="authParty != null and authParty != ''">
@@ -285,6 +285,7 @@
         from cm_brand_auth a
         from cm_brand_auth a
         left join cm_brand_club_user u on a.id = u.authId and u.delFlag = 0
         left join cm_brand_club_user u on a.id = u.authId and u.delFlag = 0
         <where>
         <where>
+            a.delFlag = 0
             <if test="authUserId != null">
             <if test="authUserId != null">
                 and a.authUserId = #{authUserId}
                 and a.authUserId = #{authUserId}
             </if>
             </if>
@@ -301,7 +302,7 @@
                a.auditStatus,
                a.auditStatus,
                a.createTime,
                a.createTime,
                cu.name as createBy,
                cu.name as createBy,
-               au.name as auditBy,
+               ifnull(au.loginAccount,au.name) as auditBy,
                a.auditTime,
                a.auditTime,
                a.invalidReason
                a.invalidReason
         from cm_brand_auth a
         from cm_brand_auth a
@@ -344,7 +345,7 @@
                  left join province p on a.provinceId = p.provinceID
                  left join province p on a.provinceId = p.provinceID
                  left join city c on a.cityId = c.cityID
                  left join city c on a.cityId = c.cityID
                  left join town t on a.townId = t.townID
                  left join town t on a.townId = t.townID
-        where id = #{authId}
+        where id = #{authId} and a.delFlag = 0
     </select>
     </select>
     <select id="getTownNames" resultType="java.lang.String">
     <select id="getTownNames" resultType="java.lang.String">
         select name from town
         select name from town
@@ -392,7 +393,7 @@
     <select id="getAuthTemplate" resultType="com.caimei.model.vo.TemplateVo">
     <select id="getAuthTemplate" resultType="com.caimei.model.vo.TemplateVo">
         select at.id as templateId, templateImage, qrPosition, qrSize
         select at.id as templateId, templateImage, qrPosition, qrSize
         from cm_brand_auth_template at
         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
         where at.status = 1
         <if test="templateType == 1">
         <if test="templateType == 1">
             and at.authFlag = 1
             and at.authFlag = 1

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

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

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

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

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

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

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

@@ -71,7 +71,7 @@
         </delete>
         </delete>
     <select id="getDoctorList" resultType="com.caimei.model.vo.DoctorListVo">
     <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,
         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
         from cm_brand_doctor 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_auth_user au on a.auditBy = au.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
         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
         from cm_brand_doctor d
         left join cm_brand_auth_user au on d.authUserId = au.authUserId
         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
         where
         au.status = 1
         au.status = 1
         and d.status = 1
         and d.status = 1
@@ -137,7 +137,7 @@
             and au.authUserId = #{authUserId}
             and au.authUserId = #{authUserId}
         </if>
         </if>
         <if test="authId != null">
         <if test="authId != null">
-            and d.authId = #{authId}
+            and cba.id = #{authId}
         </if>
         </if>
         <if test="doctorType != null">
         <if test="doctorType != null">
             and d.doctorType = #{doctorType}
             and d.doctorType = #{doctorType}
@@ -158,7 +158,7 @@
                image  as doctorImage
                image  as doctorImage
         from cm_brand_doctor d
         from cm_brand_doctor d
                  left join cm_brand_auth_user au on d.authUserId = au.authUserId
                  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}
         where d.id = #{doctorId}
           and au.status = 1
           and au.status = 1
           and d.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_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
         left join cm_brand_auth_user u on a.authUserId = u.authUserId
         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
         where a.delFlag = 0
         <if test="authId != null">
         <if test="authId != null">
             and a.id = #{authId}
             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 id="getClubUserByOpenId" resultType="com.caimei.model.vo.WxClubUserVo">
         select cu.id as clubUserId, cu.authId, a.authUserId, cu.mobile, cu.openId
         select cu.id as clubUserId, cu.authId, a.authUserId, cu.mobile, cu.openId
         from cm_brand_club_user cu
         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
                  left join cm_brand_auth_user au on a.authUserId = au.authUserId
         where openId = #{openId} and au.appId = #{appId}
         where openId = #{openId} and au.appId = #{appId}
           and cu.delFlag = 0
           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 id="getCertificateLogistics" resultType="com.caimei.model.vo.CertificateLogisticsVo">
         select a.authParty, logisticsCompanyName as companyName, logisticsCompanyCode as companyCode, nu as logisticsNumber,
         select a.authParty, logisticsCompanyName as companyName, logisticsCompanyCode as companyCode, nu as logisticsNumber,
                state, info, remarksImage, li.remarks, updateDate
                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>
     <select id="getLogisticsCompanyList" resultType="com.caimei.model.vo.LogisticsCompanyVo">
     <select id="getLogisticsCompanyList" resultType="com.caimei.model.vo.LogisticsCompanyVo">
         select id, label as companyName, value as companyCode
         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
         ifnull(tw.productTypeWaitNum,0) as productTypeWaitNum
         from cm_brand_auth_user u
         from cm_brand_auth_user u
         left join cm_brand_auth_shop_info s on u.authUserId = s.authUserId
         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
         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 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 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 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 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 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 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
         where u.userIdentity = 2
         <if test="shopName != null and shopName !=''">
         <if test="shopName != null and shopName !=''">
             AND u.name like CONCAT('%',#{shopName},'%')
             AND u.name like CONCAT('%',#{shopName},'%')
@@ -222,7 +222,7 @@
         select count(*)
         select count(*)
         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 r.authId = a.id
+                 left join cm_brand_auth a on r.authId = a.id and a.delFlag = 0
         where a.authUserId = #{authUserId}
         where a.authUserId = #{authUserId}
           and p.auditStatus = 2
           and p.auditStatus = 2
     </select>
     </select>
@@ -230,8 +230,8 @@
         select count(*)
         select count(*)
         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
-                 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}
         where a.authUserId = #{authUserId}
           and if(p.productTypeId is not null, t.infoId, p.infoId) = #{infoId}
           and if(p.productTypeId is not null, t.infoId, p.infoId) = #{infoId}
     </select>
     </select>
@@ -240,9 +240,8 @@
         handleTime
         handleTime
         from cm_brand_club_feedback cf
         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_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 != ''">
         <if test="authParty != null and authParty != ''">
             and a.authParty like concat('%',#{authParty},'%')
             and a.authParty like concat('%',#{authParty},'%')
         </if>
         </if>
@@ -257,7 +256,7 @@
         select cf.id as feedbackId, a.authParty as authParty, cu.mobile, content, commitTime, handleStatus, handleResult, handleTime
         select cf.id as feedbackId, a.authParty as authParty, cu.mobile, content, commitTime, handleStatus, handleResult, handleTime
         from cm_brand_club_feedback cf
         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_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}
         where cf.id = #{feedbackId}
     </select>
     </select>
     <select id="getShopStatus" resultType="java.lang.Integer">
     <select id="getShopStatus" resultType="java.lang.Integer">