Przeglądaj źródła

授权/商品审核

Aslee 3 lat temu
rodzic
commit
24b057c75a

+ 17 - 3
src/main/java/com/caimei/controller/AuthApi.java

@@ -76,15 +76,29 @@ public class AuthApi {
      * 添加/编辑授权
      * 添加/编辑授权
      */
      */
     @ApiOperation("添加/编辑授权")
     @ApiOperation("添加/编辑授权")
-    @ApiImplicitParam(name = "params", value = "authId:授权id;authUserId:供应商用户id;authParty:授权机构;status:授权状态:0下架,1上架;createBy:创建人id", required = true)
+    @ApiImplicitParam(name = "params", value = "authId:授权id;authUserId:供应商用户id;authParty:授权机构;createBy:创建人id", required = true)
     @PostMapping("/save")
     @PostMapping("/save")
     public ResponseJson saveAuth(@RequestBody String params) {
     public ResponseJson saveAuth(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
         JSONObject paramsMap = JSONObject.parseObject(params);
         Integer authId = paramsMap.getInteger("authId");
         Integer authId = paramsMap.getInteger("authId");
         Integer authUserId = paramsMap.getInteger("authUserId");
         Integer authUserId = paramsMap.getInteger("authUserId");
         String authParty = paramsMap.getString("authParty");
         String authParty = paramsMap.getString("authParty");
-        Integer status = paramsMap.getInteger("status");
         Integer createBy = paramsMap.getInteger("createBy");
         Integer createBy = paramsMap.getInteger("createBy");
-        return authService.saveAuth(authId, authUserId, authParty, status, createBy);
+        return authService.saveAuth(authId, authUserId, authParty, createBy);
+    }
+
+
+    /**
+     * 审核品牌授权
+     */
+    @ApiOperation("审核品牌授权")
+    @ApiImplicitParam(name = "params", value = "authId:授权id;auditStatus:审核状态:0审核未通过,1审核通过,2待审核;invalidReason:审核不通过原因", required = true)
+    @PostMapping("/audit")
+    public ResponseJson auditAuth(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer authId = paramsMap.getInteger("authId");
+        Integer auditStatus = paramsMap.getInteger("auditStatus");
+        String invalidReason = paramsMap.getString("invalidReason");
+        return authService.auditAuth(authId, auditStatus, invalidReason);
     }
     }
 }
 }

+ 18 - 2
src/main/java/com/caimei/controller/AuthProductApi.java

@@ -1,11 +1,13 @@
 package com.caimei.controller;
 package com.caimei.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.dto.ProductSaveDto;
 import com.caimei.model.dto.ProductSaveDto;
 import com.caimei.model.vo.ProductFormVo;
 import com.caimei.model.vo.ProductFormVo;
 import com.caimei.model.vo.ProductListVo;
 import com.caimei.model.vo.ProductListVo;
 import com.caimei.service.AuthProductService;
 import com.caimei.service.AuthProductService;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
+import com.google.gson.JsonObject;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiImplicitParams;
@@ -54,7 +56,7 @@ public class AuthProductApi {
      * 更新授权商品状态
      * 更新授权商品状态
      */
      */
     @ApiOperation("更新授权商品状态")
     @ApiOperation("更新授权商品状态")
-    @ApiImplicitParam(name = "params", value = "productId:授权商品id;status:上架状态:0下架 1上架", required = true)
+    @ApiImplicitParam(name = "params", value = "productId:授权商品id;status:上线状态:0已下线,1已上线,2待上线", required = true)
     @PostMapping("/update/status")
     @PostMapping("/update/status")
     public ResponseJson updateProductStatus(@RequestBody Map<String,Integer> params) {
     public ResponseJson updateProductStatus(@RequestBody Map<String,Integer> params) {
         Integer productId = params.get("productId");
         Integer productId = params.get("productId");
@@ -83,7 +85,7 @@ public class AuthProductApi {
      *                   snCode                 商品SN码
      *                   snCode                 商品SN码
      *                   productImage           商品图片
      *                   productImage           商品图片
      *                   certificateImage       授权牌照
      *                   certificateImage       授权牌照
-     *                   status                 上架状态:0下架,1上架
+     *                   status                 上线状态:0已下线,1已上线,2待上线
      *                   createBy               创建人id
      *                   createBy               创建人id
      *                   paramList              商品参数列表
      *                   paramList              商品参数列表
      * }
      * }
@@ -115,4 +117,18 @@ public class AuthProductApi {
     public ResponseJson updateAllWatermark(){
     public ResponseJson updateAllWatermark(){
         return authProductService.updateAllWaterMark();
         return authProductService.updateAllWaterMark();
     }
     }
+
+    /**
+     * 审核商品
+     */
+    @ApiOperation("审核商品")
+    @ApiImplicitParam(name = "params", value = "productId:授权商品id;auditStatus:审核状态:0审核未通过,1审核通过,2待审核;invalidReason:审核不通过原因", required = true)
+    @PostMapping("/audit")
+    public ResponseJson auditProduct(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer productId = paramsMap.getInteger("productId");
+        Integer auditStatus = paramsMap.getInteger("auditStatus");
+        String invalidReason = paramsMap.getString("invalidReason");
+        return authProductService.auditProduct(productId, auditStatus, invalidReason);
+    }
 }
 }

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

@@ -2,7 +2,6 @@ package com.caimei.mapper;
 
 
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.vo.AuthVo;
 import com.caimei.model.vo.AuthVo;
-import com.caimei.model.vo.BrandVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -26,4 +25,8 @@ public interface AuthMapper {
     void insertAuth(CmBrandAuthPo auth);
     void insertAuth(CmBrandAuthPo auth);
 
 
     void updateAuthByAuthId(CmBrandAuthPo auth);
     void updateAuthByAuthId(CmBrandAuthPo auth);
+
+    Integer getProductWaitAuditNum(Integer authId);
+
+    void updateAuthAuditStatus(@Param("authId") Integer authId, @Param("auditStatus") Integer auditStatus, @Param("invalidReason") String invalidReason);
 }
 }

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

@@ -45,4 +45,6 @@ public interface AuthProductMapper {
     List<ProductPo> getAllImage();
     List<ProductPo> getAllImage();
 
 
     void updateImageByProductId(ProductPo product);
     void updateImageByProductId(ProductPo product);
+
+    void updateProductAuditStatus(@Param("productId") Integer productId, @Param("auditStatus") Integer auditStatus, @Param("invalidReason") String invalidReason);
 }
 }

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

@@ -59,4 +59,8 @@ public interface ShopMapper {
     List<ShopInfoVo> getShopInfoByUserId(Integer authUserId);
     List<ShopInfoVo> getShopInfoByUserId(Integer authUserId);
 
 
     Integer getUserIdByShopName(String shopName);
     Integer getUserIdByShopName(String shopName);
+
+    Integer getAuthWaitAuditNum(Integer authUserId);
+
+    Integer getProductWaitAuditNum(Integer authUserId);
 }
 }

+ 0 - 4
src/main/java/com/caimei/model/dto/ProductSaveDto.java

@@ -45,10 +45,6 @@ public class ProductSaveDto {
     @ApiModelProperty("授权牌照")
     @ApiModelProperty("授权牌照")
     private String certificateImage;
     private String certificateImage;
 
 
-    @NotNull(message = "上架状态不能为空")
-    @ApiModelProperty("上架状态:0下架,1上架")
-    private Integer status;
-
     @NotNull(message = "创建人id不能为空")
     @NotNull(message = "创建人id不能为空")
     @ApiModelProperty("创建人id")
     @ApiModelProperty("创建人id")
     private Integer createBy;
     private Integer createBy;

+ 1 - 1
src/main/java/com/caimei/model/po/CmBrandAuthPo.java

@@ -23,7 +23,7 @@ public class CmBrandAuthPo {
     private String authParty;
     private String authParty;
 
 
     /**
     /**
-     * 上架状态:0已下架,1已上架
+     * 上线状态:0已下线,1已上线,2待上线
      */
      */
     private Integer status;
     private Integer status;
 
 

+ 1 - 1
src/main/java/com/caimei/model/po/ProductPo.java

@@ -68,7 +68,7 @@ public class ProductPo {
     private String appletsCertificateImage;
     private String appletsCertificateImage;
 
 
     /**
     /**
-     * 上架状态:0下架,1上架
+     * 上线状态:0已下线,1已上线,2待上线
      */
      */
     private Integer status;
     private Integer status;
 
 

+ 13 - 2
src/main/java/com/caimei/model/vo/AuthVo.java

@@ -22,11 +22,17 @@ public class AuthVo {
     private String authParty;
     private String authParty;
 
 
     /**
     /**
-     * 上架状态:0已下架,1已上架
+     * 上线状态:0已下线,1已上线,2待上线
      */
      */
-    @ApiModelProperty("上架状态:0已下架,1已上架")
+    @ApiModelProperty("上线状态:0已下线,1已上线,2待上线")
     private Integer status;
     private Integer status;
 
 
+    /**
+     * 审核状态:0审核未通过,1审核通过,2待审核
+     */
+    @ApiModelProperty("审核状态:0审核未通过,1审核通过,2待审核")
+    private Integer auditStatus;
+
     /**
     /**
      * 创建时间
      * 创建时间
      */
      */
@@ -39,4 +45,9 @@ public class AuthVo {
     @ApiModelProperty("创建人")
     @ApiModelProperty("创建人")
     private String createBy;
     private String createBy;
 
 
+    @ApiModelProperty("下级审核状态,0未完成审核,1已完成审核")
+    private Integer lowerAuditStatus;
+
+    @ApiModelProperty("下级待审核数量")
+    private Integer waitAuditNum;
 }
 }

+ 0 - 3
src/main/java/com/caimei/model/vo/ProductFormVo.java

@@ -37,7 +37,4 @@ public class ProductFormVo {
 
 
     @ApiModelProperty("商品参数列表")
     @ApiModelProperty("商品参数列表")
     private List<ProductParamPo> paramList;
     private List<ProductParamPo> paramList;
-
-    @ApiModelProperty("上架状态:0下架,1上架")
-    private Integer status;
 }
 }

+ 4 - 1
src/main/java/com/caimei/model/vo/ProductListVo.java

@@ -20,9 +20,12 @@ public class ProductListVo {
     @ApiModelProperty("商品SN码")
     @ApiModelProperty("商品SN码")
     private String snCode;
     private String snCode;
 
 
-    @ApiModelProperty("上架状态")
+    @ApiModelProperty("上线状态:0下线,1上线,2待上线")
     private Integer status;
     private Integer status;
 
 
+    @ApiModelProperty("审核状态:0审核未通过,1审核通过,2待审核")
+    private Integer auditStatus;
+
     @ApiModelProperty("创建时间")
     @ApiModelProperty("创建时间")
     private Date createTime;
     private Date createTime;
 
 

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

@@ -76,4 +76,9 @@ public class ShopListVo implements Serializable {
     @ApiModelProperty("创建人")
     @ApiModelProperty("创建人")
     private String createBy;
     private String createBy;
 
 
+    @ApiModelProperty("下级审核状态,0未完成审核,1已完成审核")
+    private Integer lowerAuditStatus;
+
+    @ApiModelProperty("下级待审核数量")
+    private Integer waitAuditNum;
 }
 }

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

@@ -32,7 +32,7 @@ public interface AuthProductService {
     /**
     /**
      * 更新授权商品状态
      * 更新授权商品状态
      * @param productId     授权商品id
      * @param productId     授权商品id
-     * @param status        上架状态:0下架 1上架
+     * @param status        上线状态:0已下线,1已上线,2待上线
      * @return  ResponseJson
      * @return  ResponseJson
      */
      */
     ResponseJson updateProductStatus(Integer productId, Integer status);
     ResponseJson updateProductStatus(Integer productId, Integer status);
@@ -53,7 +53,7 @@ public interface AuthProductService {
      *                   snCode                 商品SN码
      *                   snCode                 商品SN码
      *                   productImage           商品图片
      *                   productImage           商品图片
      *                   certificateImage       授权牌照
      *                   certificateImage       授权牌照
-     *                   status                 上架状态:0下架,1上架
+     *                   status                 上线状态:0已下线,1已上线,2待上线
      *                   createBy               创建人id
      *                   createBy               创建人id
      *                   paramList              商品参数列表
      *                   paramList              商品参数列表
      * }
      * }
@@ -80,4 +80,14 @@ public interface AuthProductService {
      * @return  ResponseJson
      * @return  ResponseJson
      */
      */
     ResponseJson updateAllWaterMark();
     ResponseJson updateAllWaterMark();
+
+    /**
+     * 审核商品
+     *
+     * @param productId         商品id
+     * @param auditStatus       审核状态
+     * @param invalidReason     审核不通过原因
+     * @return ResponseJson
+     */
+    ResponseJson auditProduct(Integer productId, Integer auditStatus, String invalidReason);
 }
 }

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

@@ -46,9 +46,18 @@ public interface AuthService {
      * @param authId            授权id
      * @param authId            授权id
      * @param authUserId        供应商用户id
      * @param authUserId        供应商用户id
      * @param authParty         授权机构
      * @param authParty         授权机构
-     * @param status            授权状态:0已下架 1已上架
      * @param createBy          创建人id
      * @param createBy          创建人id
      * @return  ResponseJson
      * @return  ResponseJson
      */
      */
-    ResponseJson saveAuth(Integer authId, Integer authUserId, String authParty, Integer status, Integer createBy);
+    ResponseJson saveAuth(Integer authId, Integer authUserId, String authParty, Integer createBy);
+
+    /**
+     * 审核品牌授权
+     *
+     * @param authId            授权id
+     * @param auditStatus       审核状态
+     * @param invalidReason     审核不通过原因
+     * @return ResponseJson
+     */
+    ResponseJson auditAuth(Integer authId, Integer auditStatus, String invalidReason);
 }
 }

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

@@ -100,7 +100,6 @@ public class AuthProductServiceImpl implements AuthProductService {
         String snCode = productSaveDto.getSnCode();
         String snCode = productSaveDto.getSnCode();
         String productImage = productSaveDto.getProductImage();
         String productImage = productSaveDto.getProductImage();
         String certificateImage = productSaveDto.getCertificateImage();
         String certificateImage = productSaveDto.getCertificateImage();
-        Integer status = productSaveDto.getStatus();
         Integer createBy = productSaveDto.getCreateBy();
         Integer createBy = productSaveDto.getCreateBy();
         List<ProductParamPo> paramList = productSaveDto.getParamList();
         List<ProductParamPo> paramList = productSaveDto.getParamList();
         if (null == authId) {
         if (null == authId) {
@@ -125,11 +124,6 @@ public class AuthProductServiceImpl implements AuthProductService {
         if (StringUtils.isBlank(certificateImage)) {
         if (StringUtils.isBlank(certificateImage)) {
             return ResponseJson.error("参数异常,请上传授权牌照", null);
             return ResponseJson.error("参数异常,请上传授权牌照", null);
         }
         }
-        if (null == status) {
-            return ResponseJson.error("参数异常,请输入商品状态值", null);
-        } else if (status != 0 && status != 1) {
-            return ResponseJson.error("商品状态值只能为0或1");
-        }
         if (null == paramList || paramList.size() <= 0) {
         if (null == paramList || paramList.size() <= 0) {
             return ResponseJson.error("参数异常,商品参数列表不能为空", null);
             return ResponseJson.error("参数异常,商品参数列表不能为空", null);
         }
         }
@@ -151,8 +145,8 @@ public class AuthProductServiceImpl implements AuthProductService {
         product.setProductImage(productImage);
         product.setProductImage(productImage);
         // 授权牌照
         // 授权牌照
         product.setCertificateImage(certificateImage);
         product.setCertificateImage(certificateImage);
-        // 上架状态:0下架,1上架
-        product.setStatus(status);
+        // 商品信息保存后,上线状态默认为“待上线”
+        product.setStatus(2);
         if (insertFlag) {
         if (insertFlag) {
             // 创建人id
             // 创建人id
             product.setCreateBy(createBy);
             product.setCreateBy(createBy);
@@ -277,4 +271,19 @@ public class AuthProductServiceImpl implements AuthProductService {
         });
         });
         return ResponseJson.success("更新商品水印图片成功");
         return ResponseJson.success("更新商品水印图片成功");
     }
     }
+
+    @Override
+    public ResponseJson auditProduct(Integer productId, Integer auditStatus, String invalidReason) {
+        if (productId == null) {
+            return ResponseJson.error("请输入商品id");
+        }
+        if (auditStatus == null) {
+            return ResponseJson.error("请输入审核结果");
+        }
+        if (auditStatus == 0 && StringUtils.isEmpty(invalidReason)) {
+            return ResponseJson.error("请输入审核不通过的理由");
+        }
+        authProductMapper.updateProductAuditStatus(productId, auditStatus, invalidReason);
+        return ResponseJson.success("审核品牌授权成功");
+    }
 }
 }

+ 29 - 10
src/main/java/com/caimei/service/impl/AuthServiceImpl.java

@@ -45,6 +45,16 @@ public class AuthServiceImpl implements AuthService {
         }
         }
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
         List<AuthVo> authList = authMapper.getAuthList(authUserId, authParty);
         List<AuthVo> authList = authMapper.getAuthList(authUserId, authParty);
+        authList.forEach(auth->{
+            Integer waitAuditNum = authMapper.getProductWaitAuditNum(auth.getAuthId());
+            if (waitAuditNum > 0) {
+                auth.setLowerAuditStatus(0);
+                auth.setWaitAuditNum(waitAuditNum);
+            } else {
+                auth.setLowerAuditStatus(1);
+                auth.setWaitAuditNum(0);
+            }
+        });
         PageInfo<AuthVo> pageData = new PageInfo<>(authList);
         PageInfo<AuthVo> pageData = new PageInfo<>(authList);
         return ResponseJson.success(pageData);
         return ResponseJson.success(pageData);
     }
     }
@@ -52,12 +62,10 @@ public class AuthServiceImpl implements AuthService {
     @Override
     @Override
     public ResponseJson updateAuthStatus(Integer authId, Integer status) {
     public ResponseJson updateAuthStatus(Integer authId, Integer status) {
         if (authId == null) {
         if (authId == null) {
-            return ResponseJson.error("请输入用户id");
+            return ResponseJson.error("请输入授权id");
         }
         }
         if (status == null) {
         if (status == null) {
             return ResponseJson.error("请输入要更新的状态值");
             return ResponseJson.error("请输入要更新的状态值");
-        } else if (status != 0 && status != 1) {
-            return ResponseJson.error("状态值只能为0或1");
         }
         }
         authMapper.updateAuthStatusByAuthId(authId, status);
         authMapper.updateAuthStatusByAuthId(authId, status);
         if (status == 0) {
         if (status == 0) {
@@ -85,18 +93,13 @@ public class AuthServiceImpl implements AuthService {
     }
     }
 
 
     @Override
     @Override
-    public ResponseJson saveAuth(Integer authId, Integer authUserId, String authParty, Integer status, Integer createBy) {
+    public ResponseJson saveAuth(Integer authId, Integer authUserId, String authParty, Integer createBy) {
         if (null == authUserId) {
         if (null == authUserId) {
             return ResponseJson.error("参数异常,请输入供应商用户id");
             return ResponseJson.error("参数异常,请输入供应商用户id");
         }
         }
         if (StringUtils.isBlank(authParty)) {
         if (StringUtils.isBlank(authParty)) {
             return ResponseJson.error("参数异常,请输入授权机构名称");
             return ResponseJson.error("参数异常,请输入授权机构名称");
         }
         }
-        if (null == status) {
-            return ResponseJson.error("参数异常,请输入授权状态值");
-        } else if (status != 0 && status != 1) {
-            return ResponseJson.error("参数异常,授权状态值只能为0或1");
-        }
         if (null == createBy) {
         if (null == createBy) {
             return ResponseJson.error("参数异常,请输入创建人id");
             return ResponseJson.error("参数异常,请输入创建人id");
         }
         }
@@ -106,7 +109,8 @@ public class AuthServiceImpl implements AuthService {
         CmBrandAuthPo auth = new CmBrandAuthPo();
         CmBrandAuthPo auth = new CmBrandAuthPo();
         auth.setAuthUserId(authUserId);
         auth.setAuthUserId(authUserId);
         auth.setAuthParty(authParty);
         auth.setAuthParty(authParty);
-        auth.setStatus(status);
+        // 保存品牌授权信息,上线状态默认为“待上线”
+        auth.setStatus(2);
         if (null == authId) {
         if (null == authId) {
             auth.setCreateBy(createBy);
             auth.setCreateBy(createBy);
             auth.setCreateTime(new Date());
             auth.setCreateTime(new Date());
@@ -123,4 +127,19 @@ public class AuthServiceImpl implements AuthService {
             }
             }
         return ResponseJson.success("保存品牌授权成功");
         return ResponseJson.success("保存品牌授权成功");
     }
     }
+
+    @Override
+    public ResponseJson auditAuth(Integer authId, Integer auditStatus, String invalidReason) {
+        if (authId == null) {
+            return ResponseJson.error("请输入授权id");
+        }
+        if (auditStatus == null) {
+            return ResponseJson.error("请输入审核结果");
+        }
+        if (auditStatus == 0 && StringUtils.isEmpty(invalidReason)) {
+            return ResponseJson.error("请输入审核不通过的理由");
+        }
+        authMapper.updateAuthAuditStatus(authId, auditStatus, invalidReason);
+        return ResponseJson.success("审核品牌授权成功");
+    }
 }
 }

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

@@ -40,6 +40,20 @@ public class ShopServiceImpl implements ShopService {
     public ResponseJson<PageInfo<ShopListVo>> getShopList(String shopName, Integer shopType, Integer brandId, String mobile, String linkMan, Integer pageNum, Integer pageSize) {
     public ResponseJson<PageInfo<ShopListVo>> getShopList(String shopName, Integer shopType, Integer brandId, String mobile, String linkMan, Integer pageNum, Integer pageSize) {
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
         List<ShopListVo> shopList = shopMapper.getShopList(shopName, shopType, brandId, mobile, linkMan);
         List<ShopListVo> shopList = shopMapper.getShopList(shopName, shopType, brandId, mobile, linkMan);
+        shopList.forEach(shop->{
+            // 授权待审核数量
+            Integer authWaitAuditNum = shopMapper.getAuthWaitAuditNum(shop.getAuthUserId());
+            // 商品待审核数量
+            Integer productWaitAuditNum = shopMapper.getProductWaitAuditNum(shop.getAuthUserId());
+            int waitAuditNum = authWaitAuditNum + productWaitAuditNum;
+            if (waitAuditNum > 0) {
+                shop.setLowerAuditStatus(0);
+                shop.setWaitAuditNum(waitAuditNum);
+            }else {
+                shop.setLowerAuditStatus(1);
+                shop.setWaitAuditNum(0);
+            }
+        });
         PageInfo<ShopListVo> pageData = new PageInfo<>(shopList);
         PageInfo<ShopListVo> pageData = new PageInfo<>(shopList);
         return ResponseJson.success(pageData);
         return ResponseJson.success(pageData);
     }
     }

+ 12 - 0
src/main/resources/backup.sql

@@ -82,5 +82,17 @@ UPDATE `cm_brand_auth_product` set brandId = 144 where id = 1;
 UPDATE `cm_brand_auth_product` set brandId = 39 where id = 2;
 UPDATE `cm_brand_auth_product` set brandId = 39 where id = 2;
 UPDATE `cm_brand_auth_product` set brandId = 204 where id between 3 and 62;
 UPDATE `cm_brand_auth_product` set brandId = 204 where id between 3 and 62;
 
 
+# ==================================正品联盟6月优化start===============================================
+ALTER TABLE `cm_brand_auth`
+    ADD COLUMN `auditStatus` INT NULL COMMENT '审核状态:0审核未通过,1审核通过,2待审核' AFTER `status`,
+    ADD COLUMN `invalidReason` VARCHAR(255) NULL COMMENT '审核不通过原因' AFTER `auditStatus`,
+    CHANGE COLUMN `status` `status` INT NULL  DEFAULT NULL COMMENT '上架状态:0已下线,1已上线,2待上线' ;
+
+ALTER TABLE `cm_brand_auth_product`
+    ADD COLUMN `auditStatus` INT NULL COMMENT '审核状态:0审核未通过,1审核通过,2待审核' AFTER `status`,
+    ADD COLUMN `invalidReason` VARCHAR(255) NULL COMMENT '审核不通过原因' AFTER `auditStatus`,
+    CHANGE COLUMN `status` `status` INT NULL DEFAULT NULL COMMENT '上架状态:0下线,1上线,2待上线' ;
+
+# ==================================正品联盟6月优化end===============================================
 
 
 
 

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

@@ -16,11 +16,17 @@
             status    = #{status}
             status    = #{status}
         where id = #{id}
         where id = #{id}
     </update>
     </update>
+    <update id="updateAuthAuditStatus">
+        update cm_brand_auth
+        set auditStatus   = #{auditStatus},
+            invalidReason = #{invalidReason}
+        where id = #{authId}
+    </update>
     <delete id="deleteAuthByAuthId">
     <delete id="deleteAuthByAuthId">
         delete from cm_brand_auth where id = #{authId}
         delete from cm_brand_auth where id = #{authId}
     </delete>
     </delete>
     <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
     <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
-        select id as authId, authParty, a.status, a.createTime, u.name as createBy
+        select id as authId, authParty, a.status, a.auditStatus, a.createTime, u.name as createBy
         from cm_brand_auth a
         from cm_brand_auth a
                  left join cm_brand_auth_user u on a.createBy = u.authUserId
                  left join cm_brand_auth_user u on a.createBy = u.authUserId
         where a.authUserId = #{authUserId}
         where a.authUserId = #{authUserId}
@@ -29,4 +35,10 @@
         </if>
         </if>
         order by a.createTime desc
         order by a.createTime desc
     </select>
     </select>
+    <select id="getProductWaitAuditNum" resultType="java.lang.Integer">
+        select count(*)
+        from cm_brand_auth_product
+        where authId = #{authId}
+          and auditStatus = 2
+    </select>
 </mapper>
 </mapper>

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

@@ -51,6 +51,12 @@
             `appletsCertificateImage` = #{appletsCertificateImage}
             `appletsCertificateImage` = #{appletsCertificateImage}
         where id = #{productId};
         where id = #{productId};
     </update>
     </update>
+    <update id="updateProductAuditStatus">
+        update cm_brand_auth_product
+        set auditStatus   = #{auditStatus},
+            invalidReason = #{invalidReason}
+        where id = #{productId}
+    </update>
     <delete id="deleteProductByProductId">
     <delete id="deleteProductByProductId">
         delete from cm_brand_auth_product where id = #{productId}
         delete from cm_brand_auth_product where id = #{productId}
     </delete>
     </delete>
@@ -58,7 +64,7 @@
         delete from cm_brand_product_param where productId = #{productId}
         delete from cm_brand_product_param where productId = #{productId}
     </delete>
     </delete>
     <select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
     <select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
-        select id as productId,p.name as productName,snCode,p.status,p.createTime,u.name as createBy
+        select id as productId,p.name as productName,snCode,p.status,p.auditStatus,p.createTime,u.name as createBy
         from cm_brand_auth_product p
         from cm_brand_auth_product p
         left join cm_brand_auth_user u on p.createBy = u.authUserId
         left join cm_brand_auth_user u on p.createBy = u.authUserId
         where authId = #{authId}
         where authId = #{authId}

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

@@ -195,4 +195,18 @@
     <select id="getUserIdByShopName" resultType="java.lang.Integer">
     <select id="getUserIdByShopName" resultType="java.lang.Integer">
         select authUserId from cm_brand_auth_user where name = #{shopName} and userIdentity = 2 limit 1
         select authUserId from cm_brand_auth_user where name = #{shopName} and userIdentity = 2 limit 1
     </select>
     </select>
+    <select id="getAuthWaitAuditNum" resultType="java.lang.Integer">
+        select count(*)
+        from cm_brand_auth
+        where authUserId = #{authUserId}
+          and auditStatus = 2
+    </select>
+    <select id="getProductWaitAuditNum" resultType="java.lang.Integer">
+        select *
+        from cm_brand_auth_product p
+                 left join cm_brand_auth a on p.authId = a.id
+        where a.authUserId = #{authUserId}
+          and p.auditStatus = 2
+    </select>
+
 </mapper>
 </mapper>