Bladeren bron

ross认证通part4

Aslee 2 jaren geleden
bovenliggende
commit
5c95757255
36 gewijzigde bestanden met toevoegingen van 2070 en 72 verwijderingen
  1. 4 2
      src/main/java/com/caimei/controller/admin/auth/AuthApi.java
  2. 63 0
      src/main/java/com/caimei/controller/wechat/WxAddressApi.java
  3. 69 0
      src/main/java/com/caimei/controller/wechat/WxAuthApi.java
  4. 1 2
      src/main/java/com/caimei/controller/wechat/WxUploadApi.java
  5. 2 4
      src/main/java/com/caimei/mapper/cmMapper/AuthMapper.java
  6. 1 1
      src/main/java/com/caimei/mapper/cmMapper/AuthProductMapper.java
  7. 0 1
      src/main/java/com/caimei/mapper/cmMapper/ClubMapper.java
  8. 3 0
      src/main/java/com/caimei/mapper/cmMapper/FileMapper.java
  9. 1 0
      src/main/java/com/caimei/model/en/QrCodeSize.java
  10. 25 0
      src/main/java/com/caimei/model/po/CmBrandAuthPo.java
  11. 5 0
      src/main/java/com/caimei/model/po/ProductPo.java
  12. 6 1
      src/main/java/com/caimei/model/vo/AuthFormVo.java
  13. 19 0
      src/main/java/com/caimei/model/vo/AuthVo.java
  14. 3 0
      src/main/java/com/caimei/model/vo/ClubUserVo.java
  15. 1 1
      src/main/java/com/caimei/model/vo/ProductFormVo.java
  16. 13 0
      src/main/java/com/caimei/model/vo/ProductListVo.java
  17. 3 0
      src/main/java/com/caimei/model/vo/WxClubUserVo.java
  18. 3 0
      src/main/java/com/caimei/model/vo/WxProductListVo.java
  19. 2 2
      src/main/java/com/caimei/service/auth/AuthService.java
  20. 1724 1
      src/main/java/com/caimei/service/auth/impl/AddressServiceImpl.java
  21. 0 2
      src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java
  22. 9 7
      src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java
  23. 4 5
      src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java
  24. 14 2
      src/main/java/com/caimei/service/auth/impl/DownloadServiceImpl.java
  25. 13 5
      src/main/java/com/caimei/service/auth/impl/LogisticsServiceImpl.java
  26. 1 1
      src/main/java/com/caimei/service/auth/impl/ShopServiceImpl.java
  27. 8 2
      src/main/java/com/caimei/service/wechat/impl/LoginServiceImpl.java
  28. 14 4
      src/main/java/com/caimei/service/wechat/impl/RegisterServiceImpl.java
  29. 9 5
      src/main/java/com/caimei/service/wechat/impl/WxUserServiceImpl.java
  30. 3 0
      src/main/java/com/caimei/utils/SmsUtils.java
  31. 1 1
      src/main/resources/config/beta/application-beta.yml
  32. 22 11
      src/main/resources/mapper/AuthMapper.xml
  33. 12 7
      src/main/resources/mapper/AuthProductMapper.xml
  34. 1 1
      src/main/resources/mapper/ClubMapper.xml
  35. 7 1
      src/main/resources/mapper/FileMapper.xml
  36. 4 3
      src/main/resources/mapper/ShopMapper.xml

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

@@ -45,6 +45,7 @@ public class AuthApi {
             @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1授权列表,2授权审核列表,3供应商审核列表,4授权牌物流列表"),
             @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
             @ApiImplicitParam(name = "authParty", required = false, value = "授权机构"),
+            @ApiImplicitParam(name = "mobile", required = false, value = "机构用户手机号"),
             @ApiImplicitParam(name = "status", required = false, value = "上线状态:0已下线,1已上线,2待上线"),
             @ApiImplicitParam(name = "auditStatus", required = false, value = "审核状态:0审核未通过,1审核通过,2待审核"),
             @ApiImplicitParam(name = "lowerAuditStatus", required = false, value = "商品信息审核状态:0未完成审核,1已完成审核"),
@@ -54,12 +55,12 @@ public class AuthApi {
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
     @GetMapping("/list")
-    public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty,
+    public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty, String mobile,
                                                       Integer status, Integer auditStatus, Integer lowerAuditStatus,
                                                       Integer shopAuditStatus, Integer sendStatus,
                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return authService.getAuthList(listType, authUserId, authParty, status, auditStatus, lowerAuditStatus, shopAuditStatus, sendStatus, pageNum, pageSize);
+        return authService.getAuthList(listType, authUserId, authParty, mobile, status, auditStatus, lowerAuditStatus, shopAuditStatus, sendStatus, pageNum, pageSize);
     }
 
     @ApiOperation("机构下拉框列表")
@@ -169,6 +170,7 @@ public class AuthApi {
         auth.setEmpNum(empNum);
         auth.setLogo(logo);
         auth.setCreateBy(createBy);
+        auth.setCreateSource(1);
         return authService.saveAuth(auth, bannerList, false, source);
     }
 

+ 63 - 0
src/main/java/com/caimei/controller/wechat/WxAddressApi.java

@@ -0,0 +1,63 @@
+package com.caimei.controller.wechat;
+
+
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.AddressSelectVo;
+import com.caimei.service.auth.AddressService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+/**
+ * 地址Api
+ *
+ * @author : Aslee
+ * @date : 2021/7/2
+ */
+@Api(tags = "微信地址API")
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/wx/address")
+public class WxAddressApi {
+
+    private final AddressService addressService;
+
+    /**
+     * 收货地址下拉选项列表
+     */
+    @ApiOperation("收货地址下拉选项列表(旧:/club/province(city)(town))")
+    @ApiImplicitParams({
+            @ApiImplicitParam(required = false, name = "type", value = "选项类型:0省(默认),1市,2区"),
+            @ApiImplicitParam(required = false, name = "parentId", value = "父级地址Id")
+    })
+    @GetMapping("/select")
+    public ResponseJson<List<AddressSelectVo>> getSelectAddress(Integer type, Integer parentId) {
+        if (null == type) {
+            type = 0;
+        } else {
+            if (null == parentId) {
+                return ResponseJson.error("父级地址Id不能为空!", null);
+            }
+        }
+        return addressService.getSelectAddress(type, parentId);
+    }
+
+
+    /**
+     * 所有地址下拉完整数据
+     */
+    @ApiOperation("所有地址完整数据(旧:/club/address)")
+    @GetMapping("/select/all")
+    public ResponseJson<List<AddressSelectVo>> getAllSelectAddress() {
+        return addressService.getAllSelectAddress();
+    }
+
+}

+ 69 - 0
src/main/java/com/caimei/controller/wechat/WxAuthApi.java

@@ -1,7 +1,9 @@
 package com.caimei.controller.wechat;
 
+import com.alibaba.fastjson.JSONObject;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.dto.ProductSaveDto;
+import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.vo.*;
 import com.caimei.module.base.entity.vo.AuthProductVo;
 import com.caimei.service.auth.*;
@@ -16,6 +18,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -176,6 +179,72 @@ public class WxAuthApi {
         return authService.getAuthFormData(authId);
     }
 
+
+    @ApiOperation("添加/编辑授权")
+    @ApiImplicitParam(name = "params", value = "authId:授权id;authUserId:供应商用户id;authParty:授权机构;provinceId;cityId;" +
+            "townId;address;lngAndLat;mobile;userMobile:对应机构用户手机号;" +
+            "firstClubType:一级分类为医美=1,生美=2,项目公司=3,个人=4,其他=5;" +
+            "secondClubType:医美的二级分类为诊所=1、门诊=2、医院=3,其他=4。生美二级分类,美容院=5,养生馆=6,其他=7;" +
+            "medicalLicenseImage:医疗许可证图;empNum:员工人数;"+
+            "logo;customFlag:是否需要自定义属性:0否,1是;remarks:店铺备注;createBy:创建人id;source:1供应商保存,2机构保存", required = true)
+    @PostMapping("/save")
+    public ResponseJson saveAuth(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer authId = paramsMap.getInteger("authId");
+        Integer authUserId = paramsMap.getInteger("authUserId");
+        Integer provinceId = paramsMap.getInteger("provinceId");
+        Integer cityId = paramsMap.getInteger("cityId");
+        Integer townId = paramsMap.getInteger("townId");
+        String address = paramsMap.getString("address");
+        String lngAndLat = paramsMap.getString("lngAndLat");
+        String mobile = paramsMap.getString("mobile");
+        String userMobile = paramsMap.getString("userMobile");
+        Integer firstClubType = paramsMap.getInteger("firstClubType");
+        Integer secondClubType = paramsMap.getInteger("secondClubType");
+        String medicalLicenseImage = paramsMap.getString("medicalLicenseImage");
+        Integer empNum = paramsMap.getInteger("empNum");
+        String logo = paramsMap.getString("logo");
+        Integer customFlag = paramsMap.getInteger("customFlag");
+        String remarks = paramsMap.getString("remarks");
+        List<String> bannerList = (List<String>) paramsMap.get("bannerList");
+        String authParty = paramsMap.getString("authParty");
+        Integer createBy = paramsMap.getInteger("createBy");
+        Integer source = paramsMap.getInteger("source");
+        if (null == source) {
+            // 默认供应商保存
+            source = 1;
+        }
+        /*
+            组装授权数据
+         */
+        CmBrandAuthPo auth = new CmBrandAuthPo();
+        auth.setId(authId);
+        auth.setAuthUserId(authUserId);
+        auth.setAuthParty(authParty);
+        auth.setProvinceId(provinceId);
+        auth.setCityId(cityId);
+        auth.setTownId(townId);
+        auth.setAddress(address);
+        auth.setCustomFlag(customFlag);
+        auth.setRemarks(remarks);
+        if (StringUtils.isEmpty(lngAndLat)) {
+            return ResponseJson.error("参数异常,经纬度不能为空");
+        }
+        String[] split = lngAndLat.split(",");
+        auth.setLng(new BigDecimal(split[0]));
+        auth.setLat(new BigDecimal(split[1]));
+        auth.setMobile(mobile);
+        auth.setUserMobile(userMobile);
+        auth.setFirstClubType(firstClubType);
+        auth.setSecondClubType(secondClubType);
+        auth.setMedicalLicenseImage(medicalLicenseImage);
+        auth.setEmpNum(empNum);
+        auth.setLogo(logo);
+        auth.setCreateBy(createBy);
+        auth.setCreateSource(1);
+        return authService.saveAuth(auth, bannerList, false, 2);
+    }
+
     @ApiOperation("设备分类下拉框列表")
     @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id")
     @GetMapping("/product/type/select")

+ 1 - 2
src/main/java/com/caimei/controller/wechat/WxUploadApi.java

@@ -1,6 +1,5 @@
 package com.caimei.controller.wechat;
 
-import com.caimei.controller.admin.auth.UploadApi;
 import com.caimei.service.auth.UploadService;
 import com.caimei.utils.OSSUtils;
 import io.swagger.annotations.Api;
@@ -35,7 +34,7 @@ import java.util.UUID;
 @RequiredArgsConstructor
 @RequestMapping("/wx/upload")
 public class WxUploadApi {
-    private static final Logger logger = LoggerFactory.getLogger(UploadApi.class);
+    private static final Logger logger = LoggerFactory.getLogger(WxUploadApi.class);
     @Value("${caimei.imageDomain}")
     private String imageDomain;
     private final UploadService uploadService;

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

@@ -1,12 +1,10 @@
 package com.caimei.mapper.cmMapper;
 
-import com.caimei.model.po.CertificateLogisticsPo;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.LdmDataPo;
 import com.caimei.model.po.TownPo;
 import com.caimei.model.vo.AuthFormVo;
 import com.caimei.model.vo.AuthVo;
-import com.caimei.model.vo.CertificateLogisticsVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -22,7 +20,7 @@ import java.util.List;
 @Mapper
 public interface AuthMapper {
 
-    List<AuthVo> getAuthList(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus, @Param("sendStatus") Integer sendStatus);
+    List<AuthVo> getAuthList(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("mobile") String mobile, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus, @Param("sendStatus") Integer sendStatus);
 
     void updateAuthStatusByAuthId(@Param("authId") Integer authId, @Param("status") Integer status);
 
@@ -78,7 +76,7 @@ public interface AuthMapper {
 
     AuthVo getAuthById(Integer authId);
 
-    void updateAuthShopAuditStatus(@Param("authId") Integer authId, @Param("shopAuditStatus") Integer auditStatus, @Param("shopInvalidReason") String invalidReason, @Param("shopAuditTime") Date auditTime);
+    void updateAuthShopAuditStatus(@Param("authId") Integer authId, @Param("shopAuditStatus") Integer auditStatus, @Param("shopInvalidReason") String invalidReason, @Param("shopAuditBy") Integer auditBy, @Param("shopAuditTime") Date auditTime);
 
     List<String> getTownNames();
 

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

@@ -86,7 +86,7 @@ public interface AuthProductMapper {
 
     Integer getProductCountByTypeId(Integer productTypeId);
 
-    void updateProductShopAuditStatus(@Param("productId") Integer productId, @Param("productTypeId") Integer productTypeId, @Param("shopAuditStatus") Integer auditStatus, @Param("shopInvalidReason") String invalidReason, @Param("shopAuditTime") Date auditTime);
+    void updateProductShopAuditStatus(@Param("productId") Integer productId, @Param("productTypeId") Integer productTypeId, @Param("shopAuditStatus") Integer auditStatus, @Param("shopInvalidReason") String invalidReason, @Param("shopAuditBy") Integer auditBy, @Param("shopAuditTime") Date auditTime);
 
     ProductPo getProductPo(Integer productId);
 

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

@@ -5,7 +5,6 @@ import com.caimei.model.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.Date;
 import java.util.List;
 
 /**

+ 3 - 0
src/main/java/com/caimei/mapper/cmMapper/FileMapper.java

@@ -3,6 +3,7 @@ package com.caimei.mapper.cmMapper;
 import com.caimei.model.po.CourseFilePo;
 import com.caimei.model.po.ProductImagePo;
 import com.caimei.model.po.FilePo;
+import com.caimei.model.vo.AuthVo;
 import com.caimei.model.vo.CourseFileListVo;
 import com.caimei.model.vo.FileListVo;
 import com.caimei.model.vo.WxFileListVo;
@@ -48,4 +49,6 @@ public interface FileMapper {
     void deleteCourseFileByFileId(Integer fileId);
 
     List<ProductImagePo> getProductImageList(Integer authUserId);
+
+    List<AuthVo> getAuthImageList(Integer authUserId);
 }

+ 1 - 0
src/main/java/com/caimei/model/en/QrCodeSize.java

@@ -9,6 +9,7 @@ import java.util.Date;
  * @author Aslee
  */
 public class QrCodeSize {
+    public static final int XLARGE = 1000;
     public static final int LARGE = 137;
     public static final int MEDIUM = 104;
     public static final int SMALL = 70;

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

@@ -112,21 +112,46 @@ public class CmBrandAuthPo {
      */
     private Integer status;
 
+    /**
+     * 管理员审核人id,对应cm_brand_auth_user
+     */
+    private Integer auditBy;
+
     /**
      * 审核状态:0审核未通过,1审核通过,2待审核
      */
     private Integer auditStatus;
 
+    /**
+     * 审核时间
+     */
+    private Date auditTime;
+
+    /**
+     * 供应商审核人id
+     */
+    private Integer shopAuditBy;
+
     /**
      * 供应商审核状态:0审核未通过,1审核通过,2待审核
      */
     private Integer shopAuditStatus;
 
+    /**
+     * 供应商审核时间
+     */
+    private Date shopAuditTime;
+
     /**
      * 创建人Id
      */
     private Integer createBy;
 
+    /**
+     * 创建来源:1供应商添加,2机构用户添加
+     */
+    private Integer createSource;
+
     /**
      * 删除标志:1已删除,0不是
      */

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

@@ -123,4 +123,9 @@ public class ProductPo {
      * 创建人Id
      */
     private Integer createBy;
+
+    /**
+     * 创建来源:1供应商添加,2机构用户添加
+     */
+    private Integer createSource;
 }

+ 6 - 1
src/main/java/com/caimei/model/vo/AuthFormVo.java

@@ -128,5 +128,10 @@ public class AuthFormVo implements Serializable {
     /**
      * 审核不通过原因
      */
-    private Integer invalidReason;
+    private String invalidReason;
+
+    /**
+     * 是否已绑定用户账号:0未绑定,1已绑定
+     */
+    private Integer bindStatus;
 }

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

@@ -21,12 +21,18 @@ public class AuthVo {
     @ApiModelProperty("授权机构")
     private String authParty;
 
+    @ApiModelProperty("机构用户手机号")
+    private String mobile;
+
     @ApiModelProperty("上线状态:0已下线,1已上线,2待上线")
     private Integer status;
 
     @ApiModelProperty("审核状态:0审核未通过,1审核通过,2待审核")
     private Integer auditStatus;
 
+    @ApiModelProperty("供应商审核状态:0审核未通过,1审核通过,2待审核")
+    private Integer shopAuditStatus;
+
     @ApiModelProperty("寄送状态:0未寄送,1已寄送")
     private Integer sendStatus;
 
@@ -42,6 +48,9 @@ public class AuthVo {
     @ApiModelProperty("下级待审核数量")
     private Integer waitAuditNum;
 
+    @ApiModelProperty("供应商审核下级待审核数量")
+    private Integer shopWaitAuditNum;
+
     @ApiModelProperty("审核人")
     private String auditBy;
 
@@ -50,4 +59,14 @@ public class AuthVo {
 
     @ApiModelProperty("审核不通过原因")
     private String invalidReason;
+
+    /**
+     * 供应商审核人
+     */
+    private String shopAuditBy;
+
+    /**
+     * 供应商审核时间
+     */
+    private Date shopAuditTime;
 }

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

@@ -31,6 +31,9 @@ public class ClubUserVo {
     @ApiModelProperty("openId")
     private String openId;
 
+    @ApiModelProperty("启用状态:0停用,1启用")
+    private Integer status;
+
     @ApiModelProperty("添加时间")
     private Date addTime;
 }

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

@@ -102,5 +102,5 @@ public class ProductFormVo {
     /**
      * 审核不通过原因
      */
-    private Integer invalidReason;
+    private String invalidReason;
 }

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

@@ -26,6 +26,9 @@ public class ProductListVo {
     @ApiModelProperty("审核状态:0审核未通过,1审核通过,2待审核")
     private Integer auditStatus;
 
+    @ApiModelProperty("供应商审核状态:0审核未通过,1审核通过,2待审核")
+    private Integer shopAuditStatus;
+
     @ApiModelProperty("创建时间")
     private Date createTime;
 
@@ -40,4 +43,14 @@ public class ProductListVo {
 
     @ApiModelProperty("审核不通过原因")
     private String invalidReason;
+
+    /**
+     * 供应商审核人
+     */
+    private String shopAuditBy;
+
+    /**
+     * 供应商审核时间
+     */
+    private Date shopAuditTime;
 }

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

@@ -35,4 +35,7 @@ public class WxClubUserVo {
 
     @ApiModelProperty("accessToken")
     private String accessToken;
+
+    @ApiModelProperty("状态:0停用,1启用")
+    private Integer status;
 }

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

@@ -29,4 +29,7 @@ public class WxProductListVo {
 
     @ApiModelProperty("机构名称")
     private String clubName;
+
+    @ApiModelProperty("审核状态:0未通过,1已通过,2待审核")
+    private String auditStatus;
 }

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

@@ -1,6 +1,5 @@
 package com.caimei.service.auth;
 
-import com.alibaba.fastjson.JSONArray;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.vo.AuthFormVo;
@@ -25,6 +24,7 @@ public interface AuthService {
      * @param listType         列表类型:1授权列表,2授权审核列表
      * @param authUserId       供应商用户id
      * @param authParty        授权机构
+     * @param mobile
      * @param status           上线状态:0已下线,1已上线,2待上线
      * @param auditStatus      审核状态:0审核未通过,1审核通过,2待审核
      * @param lowerAuditStatus 商品信息审核状态:0未完成审核,1已完成审核
@@ -33,7 +33,7 @@ public interface AuthService {
      * @param pageSize         一页多少条
      * @return AuthVo
      */
-    ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty, Integer status, Integer auditStatus, Integer lowerAuditStatus, Integer shopAuditStatus, Integer sendStatus, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty, String mobile, Integer status, Integer auditStatus, Integer lowerAuditStatus, Integer shopAuditStatus, Integer sendStatus, Integer pageNum, Integer pageSize);
 
     /**
      * 更新授权状态

File diff suppressed because it is too large
+ 1724 - 1
src/main/java/com/caimei/service/auth/impl/AddressServiceImpl.java


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

@@ -5,8 +5,6 @@ import com.caimei.model.ResponseJson;
 import com.caimei.model.po.ClubUserPo;
 import com.caimei.model.vo.*;
 import com.caimei.service.auth.AuthClubService;
-import com.caimei.utils.AliyunSmsUtil;
-import com.caimei.utils.CodeUtil;
 import com.caimei.utils.Md5Util;
 import com.caimei.utils.SmsUtils;
 import com.github.pagehelper.PageHelper;

+ 9 - 7
src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java

@@ -210,16 +210,18 @@ public class AuthProductServiceImpl implements AuthProductService {
             product.setOriginalCertificateImage(product.getCertificateImage());
             // 创建人id
             product.setCreateBy(createBy);
+            // 创建来源
+            product.setCreateSource(source);
             // 创建时间
             product.setCreateTime(new Date());
-            /*if (1 == source && (null == addQrCodeFlag || 0 == addQrCodeFlag)) {
+            if (1 == source && (null == addQrCodeFlag || 0 == addQrCodeFlag)) {
                 //授权牌照不添加二维码,直接添加水印
                 product.setPcCertificateImage(addWaterMark(product.getCertificateImage(), 1));
                 product.setAppletsCertificateImage(addWaterMark(product.getCertificateImage(), 2));
-            }*/
+            }
             // 插入授权商品
             authProductMapper.insertProduct(product);
-            /*if (1 == source && (null != addQrCodeFlag && 1 == addQrCodeFlag)) {
+            if (1 == source && (null != addQrCodeFlag && 1 == addQrCodeFlag)) {
                 // 生成二维码授权牌
                 String addQrCodeImg = addQrCode(product.getCertificateImage(), product.getProductId(), addTemplateType);
                 product.setCertificateImage(addQrCodeImg);
@@ -228,13 +230,13 @@ public class AuthProductServiceImpl implements AuthProductService {
                 product.setAppletsCertificateImage(addWaterMark(addQrCodeImg, 2));
                 //更新授权牌照
                 authProductMapper.updateCertificateImage(product);
-            }*/
+            }
             // 自动生成授权牌
 
         } else {
             // 商品id
             product.setProductId(productId);
-            /*if (1 == source) {
+            if (1 == source) {
                 ProductPo dbProduct = authProductMapper.getImageByProductId(productId);
                 // 数据库该商品授权牌是否添加二维码
                 Integer dbAddQrCodeFlag = dbProduct.getAddQrCodeFlag();
@@ -304,7 +306,7 @@ public class AuthProductServiceImpl implements AuthProductService {
                     product.setPcCertificateImage(addWaterMark(product.getCertificateImage(), 1));
                     product.setAppletsCertificateImage(addWaterMark(product.getCertificateImage(), 2));
                 }
-            }*/
+            }
             // 自动生成授权牌
 
             // 更新授权商品
@@ -451,7 +453,7 @@ public class AuthProductServiceImpl implements AuthProductService {
                     productTypeId = productType.getProductTypeId();
                 }
             }
-            authProductMapper.updateProductShopAuditStatus(productId, productTypeId, auditStatus, invalidReason, auditTime);
+            authProductMapper.updateProductShopAuditStatus(productId, productTypeId, auditStatus, invalidReason, auditBy, auditTime);
         }
         return ResponseJson.success("审核商品成功");
     }

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

@@ -1,6 +1,5 @@
 package com.caimei.service.auth.impl;
 
-import com.alibaba.fastjson.JSONArray;
 import com.caimei.config.FastDfsClient;
 import com.caimei.mapper.cmMapper.AuthMapper;
 import com.caimei.mapper.cmMapper.AuthProductMapper;
@@ -89,7 +88,7 @@ public class AuthServiceImpl implements AuthService {
 
     @Override
     public ResponseJson<PageInfo<AuthVo>> getAuthList(Integer listType, Integer authUserId, String authParty,
-                                                      Integer status, Integer auditStatus, Integer lowerAuditStatus,
+                                                      String mobile, Integer status, Integer auditStatus, Integer lowerAuditStatus,
                                                       Integer shopAuditStatus, Integer sendStatus,
                                                       Integer pageNum, Integer pageSize) {
         if (null == authUserId) {
@@ -97,7 +96,7 @@ public class AuthServiceImpl implements AuthService {
         }
         listType = null == listType ? 1 : listType;
         PageHelper.startPage(pageNum, pageSize);
-        List<AuthVo> authList = authMapper.getAuthList(listType, authUserId, authParty, status, auditStatus, lowerAuditStatus, shopAuditStatus, sendStatus);
+        List<AuthVo> authList = authMapper.getAuthList(listType, authUserId, authParty, mobile, status, auditStatus, lowerAuditStatus, shopAuditStatus, sendStatus);
         PageInfo<AuthVo> pageData = new PageInfo<>(authList);
         return ResponseJson.success(pageData);
     }
@@ -153,7 +152,7 @@ public class AuthServiceImpl implements AuthService {
 
     @Override
     public ResponseJson<List<AuthVo>> getAuthSelectList(Integer authUserId) {
-        List<AuthVo> authList = authMapper.getAuthList(1, authUserId, null, null, null, null, null, null);
+        List<AuthVo> authList = authMapper.getAuthList(1, authUserId, null, null, null, null, null, null, null);
         return ResponseJson.success(authList);
     }
 
@@ -250,7 +249,7 @@ public class AuthServiceImpl implements AuthService {
             authMapper.updateAuthAuditStatus(authId, status, auditStatus, invalidReason, auditBy, auditTime);
         }
         if (2 == source) {
-            authMapper.updateAuthShopAuditStatus(authId, auditStatus, invalidReason, auditTime);
+            authMapper.updateAuthShopAuditStatus(authId, auditStatus, invalidReason, auditBy, auditTime);
         }
         return ResponseJson.success("审核品牌授权成功");
     }

+ 14 - 2
src/main/java/com/caimei/service/auth/impl/DownloadServiceImpl.java

@@ -4,6 +4,7 @@ import com.caimei.mapper.cmMapper.FileMapper;
 import com.caimei.model.en.QrCodeSize;
 import com.caimei.model.po.ProductImagePo;
 import com.caimei.model.po.UploadFilePo;
+import com.caimei.model.vo.AuthVo;
 import com.caimei.service.auth.DownloadService;
 import com.caimei.service.auth.UploadService;
 import com.caimei.utils.ImageUtils;
@@ -65,6 +66,7 @@ public class DownloadServiceImpl implements DownloadService {
         }
         ArrayList<UploadFilePo> fileList = new ArrayList<>();
         List<ProductImagePo> productImageList = fileMapper.getProductImageList(authUserId);
+        List<AuthVo> authImageList = fileMapper.getAuthImageList(authUserId);
         if (1 == type) {
             productImageList.forEach(productImage -> {
                 UploadFilePo file = new UploadFilePo();
@@ -76,7 +78,7 @@ public class DownloadServiceImpl implements DownloadService {
             productImageList.forEach(productImage -> {
                 String qrCodeLink = wwwServer + "/product/auth/product-" + productImage.getProductId() + ".html";
                 // 生成二维码
-                BufferedImage qrCodeImage = ImageUtils.createQrCode(qrCodeLink, QrCodeSize.LARGE);
+                BufferedImage qrCodeImage = ImageUtils.createQrCode(qrCodeLink, QrCodeSize.XLARGE);
                 String fileName = productImage.getAuthParty() + "-" + productImage.getSnCode();
                 String imagePath = createBufferedImageFile(qrCodeImage, fileName, "png");
                 UploadFilePo file = new UploadFilePo();
@@ -85,7 +87,17 @@ public class DownloadServiceImpl implements DownloadService {
                 fileList.add(file);
             });
         } else {
-
+            authImageList.forEach(authImage -> {
+                String qrCodeLink = wwwServer + "/" + authUserId + "/app/approve/club/detail?id=" + authImage.getAuthId();
+                // 生成二维码
+                BufferedImage qrCodeImage = ImageUtils.createQrCode(qrCodeLink, QrCodeSize.LARGE);
+                String fileName = authImage.getAuthParty();
+                String imagePath = createBufferedImageFile(qrCodeImage, fileName, "png");
+                UploadFilePo file = new UploadFilePo();
+                file.setFileUrl(imagePath);
+                file.setFileName(authImage.getAuthParty());
+                fileList.add(file);
+            });
         }
         String fileName = 1 == type ? "授权牌" : 2 == type ? "设备二维码" : "机构二维码";
         // 将授权牌压缩成zip文件

+ 13 - 5
src/main/java/com/caimei/service/auth/impl/LogisticsServiceImpl.java

@@ -92,11 +92,19 @@ public class LogisticsServiceImpl implements LogisticsService {
     @Override
     public ResponseJson certificateLogistics(Integer authId) {
         CertificateLogisticsVo certificateLogistics = logisticsMapper.getCertificateLogistics(authId);
-        String[] imageArr = certificateLogistics.getRemarksImage().split("##");
-        List<String> imageList = Arrays.asList(imageArr);
-        certificateLogistics.setImageList(imageList);
-        List<RouterVo> routers = JSONArray.parseArray(certificateLogistics.getInfo(), RouterVo.class);
-        certificateLogistics.setRouterList(routers);
+        if (null != certificateLogistics) {
+            String remarksImage = certificateLogistics.getRemarksImage();
+            if (StringUtils.isNotEmpty(remarksImage)) {
+                String[] imageArr = remarksImage.split("##");
+                List<String> imageList = Arrays.asList(imageArr);
+                certificateLogistics.setImageList(imageList);
+            }
+            String info = certificateLogistics.getInfo();
+            if (StringUtils.isNotEmpty(info)) {
+                List<RouterVo> routers = JSONArray.parseArray(info, RouterVo.class);
+                certificateLogistics.setRouterList(routers);
+            }
+        }
         return ResponseJson.success(certificateLogistics);
     }
 

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

@@ -422,7 +422,7 @@ public class ShopServiceImpl implements ShopService {
         if (StringUtils.isEmpty(mobile)) {
             return ResponseJson.error("参数异常,请输入手机号");
         }
-        String verifyCode = CodeUtil.generateCodeInt(6);
+        String verifyCode = "prod".equals(active) ? CodeUtil.generateCodeInt(6) : "666666";;
         String content = "您的短信验证码为:" + verifyCode + ",该验证码 5 分钟内有效,请勿泄漏于他人。";
         Boolean sendSms = SmsUtils.sendSms(11, mobile, content);
         if (!sendSms) {

+ 8 - 2
src/main/java/com/caimei/service/wechat/impl/LoginServiceImpl.java

@@ -14,6 +14,7 @@ import com.caimei.service.wechat.LoginService;
 import com.caimei.utils.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -41,6 +42,9 @@ public class LoginServiceImpl implements LoginService {
     @Resource
     private AuthMapper authMapper;
 
+    @Value("${spring.profiles.active}")
+    private String active;
+
     @Override
     public ResponseJson<WxClubUserVo> loginByAuthorization(String code, String appId) {
         if (StringUtils.isEmpty(code)) {
@@ -100,7 +104,7 @@ public class LoginServiceImpl implements LoginService {
                 shopName = "上海品辉";
             }
         }
-        String verifyCode = CodeUtil.generateCodeInt(6);
+        String verifyCode = "prod".equals(active) ? CodeUtil.generateCodeInt(6) : "666666";;
         String content = "欢迎登录" + shopName + "会员,您的短信验证码为:" + verifyCode + ",该验证码 5 分钟内有效,请勿泄漏于他人。";
         Boolean sendSms = SmsUtils.sendSms(11, mobile, content);
         if (!sendSms) {
@@ -139,7 +143,7 @@ public class LoginServiceImpl implements LoginService {
         }
         // 校验机构用户是否存在
         WxClubUserVo wxClubUser = clubMapper.getWxClubUser(mobile, appId, null, null, null);
-        if (null == wxClubUser) {
+        if (null == wxClubUser || 1 != wxClubUser.getStatus()) {
             return ResponseJson.error("抱歉,您的手机号暂无权限登录", null);
         }
         // 校验机构和供应商的状态是否为已上线
@@ -211,6 +215,8 @@ public class LoginServiceImpl implements LoginService {
         Boolean passwordVerify;
         if (null == clubUser) {
             return ResponseJson.error("用户不存在", null);
+        } else if (1 != clubUser.getStatus()) {
+            return ResponseJson.error("账号被停用", null);
         } else {
             String dbPassword = clubMapper.getDbPassword(clubUser.getClubUserId());
             // 比对密码

+ 14 - 4
src/main/java/com/caimei/service/wechat/impl/RegisterServiceImpl.java

@@ -57,14 +57,17 @@ public class RegisterServiceImpl implements RegisterService {
         AuthFormVo auth = null;
         if (null != authId) {
             auth = authMapper.getAuthBaseInfo(null, authId);
+            if (1 == auth.getBindStatus()) {
+                return ResponseJson.error("该认证信息已被账号注册!", null);
+            }
         }/* else {
             auth = authMapper.getAuthBaseInfo(mobile, authUserId, null);
         }*/
         // 校验验证码是否正确
         String redisVerifyCode = null == redisService.get("code:" + mobile) ? null : redisService.get("code:" + mobile).toString();
-        /*if (!verifyCode.equals(redisVerifyCode)) {
+        if (!verifyCode.equals(redisVerifyCode)) {
             return ResponseJson.error("验证码错误,请重新输入", null);
-        }*/
+        }
         String md5Password = Md5Util.md5(password);
         /*
          * 构建机构用户数据
@@ -76,11 +79,11 @@ public class RegisterServiceImpl implements RegisterService {
             clubUser.setAuthId(auth.getAuthId());
             clubUser.setName(auth.getAuthParty());
             // 是否已有其他账号绑定该机构
-            WxClubUserVo oldUser = clubMapper.getWxClubUser(null, null, null, auth.getAuthId(), null);
+            /*WxClubUserVo oldUser = clubMapper.getWxClubUser(null, null, null, auth.getAuthId(), null);
             if (null != oldUser) {
                 // 解绑
                 clubMapper.unbindAuthId(oldUser.getClubUserId());
-            }
+            }*/
         }
         clubUser.setStatus(1);
         clubUser.setPassword(md5Password);
@@ -126,6 +129,9 @@ public class RegisterServiceImpl implements RegisterService {
             String[] split = lngAndLat.split(",");
             auth.setLng(new BigDecimal(split[0]));
             auth.setLat(new BigDecimal(split[1]));
+            auth.setCustomFlag(0);
+            auth.setCreateBy(clubUserId);
+            auth.setCreateSource(2);
             List<String> bannerList = (List<String>) authMap.get("bannerList");
             ResponseJson result = authService.saveAuth(auth, bannerList, false, 2);
             int code = result.getCode();
@@ -137,6 +143,9 @@ public class RegisterServiceImpl implements RegisterService {
                 CmBrandAuthPo data = (CmBrandAuthPo) result.getData();
                 authId = data.getId();
             }
+        }
+        WxClubUserVo clubUser = clubMapper.getWxClubUser(null, null, null, null, clubUserId);
+        if (null == clubUser.getAuthId()) {
             // 保存机构用户对应的机构id
             clubMapper.bindAuthId(clubUserId, authId);
         }
@@ -151,6 +160,7 @@ public class RegisterServiceImpl implements RegisterService {
                 for (ProductSaveDto product : productList) {
                     product.setAuthId(authId);
                     product.setSource(2);
+                    product.setCreateBy(clubUserId);
                     ResponseJson result = authProductService.saveProduct(product, false);
                     if (0 != result.getCode()) {
                         // 设置手动回滚事务

+ 9 - 5
src/main/java/com/caimei/service/wechat/impl/WxUserServiceImpl.java

@@ -10,6 +10,7 @@ import com.caimei.utils.CodeUtil;
 import com.caimei.utils.Md5Util;
 import com.caimei.utils.SmsUtils;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -33,6 +34,9 @@ public class WxUserServiceImpl implements WxUserService {
     @Resource
     private AuthMapper authMapper;
 
+    @Value("${spring.profiles.active}")
+    private String active;
+
 
     @Override
     public ResponseJson<Map<String, Object>> getUserInfo(String mobile, Integer authUserId, Integer clubUserId, Integer authId) {
@@ -59,12 +63,12 @@ public class WxUserServiceImpl implements WxUserService {
         if (2 == type) {
             // 获取手机号对应机构用户
             WxClubUserVo clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
-            if (null == clubUser) {
+            if (null == clubUser || 1 != clubUser.getStatus()) {
                 return ResponseJson.error("用户不存在");
             }
         }
-        String verifyCode = CodeUtil.generateCodeInt(6);
-        String content = "您的短信验证码为:" + verifyCode + ",该验证码 5 分钟内有效,请勿泄漏于他人。";
+        String verifyCode = "prod".equals(active) ? CodeUtil.generateCodeInt(6) : "666666";
+        String content = "您的短信验证码为:" + verifyCode + ",该验证码 " + (1 == type ? 30 : 5) + " 分钟内有效,请勿泄漏于他人。";
         Boolean sendSms = SmsUtils.sendSms(11, mobile, content);
         String msgType = 1 == type ? "注册" : 2 == type ? "忘记密码" : "";
         if (!sendSms) {
@@ -76,7 +80,7 @@ public class WxUserServiceImpl implements WxUserService {
         log.info(content);
         long expireTime = 300L;
         if (1 == type) {
-            expireTime = 60 * 20L;
+            expireTime = 60 * 30L;
         }
         redisService.set("code:" + mobile, verifyCode, expireTime);
         return ResponseJson.success("发送成功");
@@ -86,7 +90,7 @@ public class WxUserServiceImpl implements WxUserService {
     public ResponseJson updatePassword(String mobile, String verifyCode, String password, Integer authUserId) {
         // 获取手机号对应机构用户
         WxClubUserVo clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
-        if (null == clubUser) {
+        if (null == clubUser || 1 != clubUser.getStatus()) {
             return ResponseJson.error("用户不存在");
         }
         // 校验验证码是否正确

+ 3 - 0
src/main/java/com/caimei/utils/SmsUtils.java

@@ -38,6 +38,9 @@ public class SmsUtils {
 
     public static Boolean sendSms(int martId, String mobile, String content) {
         try {
+            if (!"prod".equals(active)) {
+                return true;
+            }
             if (StringUtils.isNotBlank(mobile) && mobile.length() == 11) {
                 String regex = "^(1[3-9]\\d{9}$)";
                 Pattern pattern = Pattern.compile(regex);

+ 1 - 1
src/main/resources/config/beta/application-beta.yml

@@ -63,7 +63,7 @@ logging:
 
 # swagger文档显示配置
 swagger:
-  enabled: false
+  enabled: true
 
 # 新旧www服务域名
 caimei:

+ 22 - 11
src/main/resources/mapper/AuthMapper.xml

@@ -4,10 +4,12 @@
     <insert id="insertAuth" keyColumn="id" keyProperty="id" useGeneratedKeys="true" parameterType="com.caimei.model.po.CmBrandAuthPo">
         insert into cm_brand_auth (authUserId, authParty, provinceId, cityId, townId, address, lng, lat,
                                    mobile, userMobile, firstClubType, secondClubType, medicalLicenseImage, empNum,
-                                   logo, customFlag, remarks, status, createTime, createBy, auditStatus, shopAuditStatus, delFlag)
+                                   logo, customFlag, remarks, status, createTime, createBy, createSource, auditBy,
+                                   auditTime, auditStatus, shopAuditBy, shopAuditTime, shopAuditStatus, delFlag)
         values (#{authUserId}, #{authParty}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{lng}, #{lat},
                 #{mobile}, #{userMobile}, #{firstClubType}, #{secondClubType}, #{medicalLicenseImage}, #{empNum},
-                #{logo}, #{customFlag}, #{remarks}, #{status}, NOW(), #{createBy}, #{auditStatus}, #{shopAuditStatus}, #{delFlag})
+                #{logo}, #{customFlag}, #{remarks}, #{status}, NOW(), #{createBy}, #{createSource}, #{auditBy},
+                #{auditTime}, #{auditStatus}, #{shopAuditBy}, #{shopAuditTime}, #{shopAuditStatus}, #{delFlag});
     </insert>
     <insert id="insertBanner">
         insert into cm_brand_auth_banner (authId, banner)
@@ -63,6 +65,7 @@
             auditStatus = #{shopAuditStatus},
         </if>
         shopInvalidReason = #{shopInvalidReason},
+        shopAuditBy = #{shopAuditBy},
         shopAuditTime = #{shopAuditTime}
         where id = #{authId}
     </update>
@@ -75,19 +78,23 @@
         delete from cm_brand_auth_banner where authId = #{authId}
     </delete>
     <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
-        select id as authId, authParty, a.status, a.auditStatus, a.shopAuditStatus, a.createTime, cu.name as createBy,
-            au.name as auditBy,a.auditTime,a.invalidReason,a.sendStatus,
+        select a.id as authId, 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,
+               a.sendStatus, 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
         from cm_brand_auth a
         left join cm_brand_auth_user cu on a.createBy = cu.authUserId
+        left join cm_brand_club_user cbcu1 on a.createBy = cbcu1.id
         left join cm_brand_auth_user au on a.auditBy = au.authUserId
+        left join cm_brand_auth_user au1 on a.shopAuditBy = au1.authUserId
+        left join cm_brand_club_user cbcu2 on a.id = cbcu2.authId and cbcu2.delFlag = 0
         left join (select authId,count(*) as waitAuditNum from cm_brand_auth_product where auditStatus = 2 and shopAuditStatus = 1 group by
             authId) ap on a.id = ap.authId
         left join (select authId,count(*) as waitAuditNum from cm_brand_auth_product where shopAuditStatus = 2 group by
             authId) bp on a.id = bp.authId
-        where a.authUserId = #{authUserId} and delFlag = 0
+        where a.authUserId = #{authUserId} and a.delFlag = 0
         <if test="authParty != null and authParty != ''">
             and a.authParty like CONCAT('%',#{authParty},'%')
         </if>
@@ -100,15 +107,18 @@
         <if test="1 == listType or 2 == listType">
             and a.shopAuditStatus = 1
         </if>
+        <if test="mobile != null and mobile != ''">
+            and cbcu2.mobile like concat('%', #{mobile},'%')
+        </if>
         <if test="4 == listType">
             and a.auditStatus = 1
         </if>
         <if test="shopAuditStatus != null">
             <if test="0 == shopAuditStatus">
-                and (a.shopAuditStatus = 2 or ifnull(bp.waitAuditNum,0) > 0)
+                and (a.shopAuditStatus = 2 or (a.shopAuditStatus = 1 and ifnull(bp.waitAuditNum,0) > 0))
             </if>
             <if test="1 == shopAuditStatus">
-                and (a.shopAuditStatus = 0 or a.shopAuditStatus = 1 or ifnull(bp.waitAuditNum,0) > 0)
+                and (a.shopAuditStatus = 0 or (a.shopAuditStatus = 1 and ifnull(bp.waitAuditNum,0) = 0))
             </if>
         </if>
         <if test="sendStatus != null">
@@ -214,14 +224,15 @@
         select provinceID from city where cityID = #{cityId}
     </select>
     <select id="getAuthBaseInfo" resultType="com.caimei.model.vo.AuthFormVo">
-        select id as authId, authParty, auditStatus, shopAuditStatus
-        from cm_brand_auth
+        select a.id as authId, authParty, auditStatus, shopAuditStatus,if(u.id is null,0,1) as bindStatus
+        from cm_brand_auth a
+        left join cm_brand_club_user u on a.id = u.authId
         <where>
             <if test="authUserId != null">
-                and authUserId = #{authUserId}
+                and a.authUserId = #{authUserId}
             </if>
             <if test="authId != null">
-                and id = #{authId}
+                and a.id = #{authId}
             </if>
         </where>
     </select>

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

@@ -126,19 +126,24 @@
             name = null,
             image = null,
         </if>
+        shopAuditBy = #{shopAuditBy},
         shopAuditTime = #{shopAuditTime}
         where id = #{productId}
     </update>
     <select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
-        select p.id as productId,t.name as productName,snCode,p.status,p.auditStatus,p.createTime,cu.name as createBy,
-               au.name as auditBy,p.auditTime,p.invalidReason
+        select p.id as productId,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,au1.name as shopAuditBy,p.shopAuditTime
         from cm_brand_auth_product p
         left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
         left join cm_brand_auth_user cu on p.createBy = cu.authUserId
         left join cm_brand_auth_user au on p.auditBy = au.authUserId
-        where authId = #{authId}
+        left join cm_brand_auth_user au1 on p.shopAuditBy = au1.authUserId
+        left join cm_brand_club_user cbcu on p.createBy = cbcu.id
+        where p.authId = #{authId}
         <if test="productName != null and productName != ''">
-            and t.name like CONCAT('%',#{productName},'%')
+            and (t.name like CONCAT('%',#{productName},'%') or t.name like CONCAT('%',#{productName},'%'))
         </if>
         <if test="snCode != null and snCode != ''">
             and snCode like CONCAT('%',#{snCode},'%')
@@ -149,7 +154,7 @@
         <if test="auditStatus != null">
             and p.auditStatus = #{auditStatus}
         </if>
-        <if test="2 == listType">
+        <if test="1 == listType or 2 == listType">
             and p.shopAuditStatus = 1
         </if>
         <if test="shopAuditStatus != null">
@@ -157,7 +162,7 @@
                 and p.shopAuditStatus = 2
             </if>
             <if test="1 == shopAuditStatus">
-                and (p.shopAuditStatus = 0 or p.shopAuditStatus = 2)
+                and (p.shopAuditStatus = 0 or p.shopAuditStatus = 1)
             </if>
         </if>
         <choose>
@@ -165,7 +170,7 @@
                 order by (case p.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc,p.createTime desc
             </when>
             <when test="listType == 3">
-                order by (case p.shopAuditStatus when 2 then 2 when 0 then 1 else 0 end) desc, a.createTime desc
+                order by (case p.shopAuditStatus when 2 then 2 when 0 then 1 else 0 end) desc, p.createTime desc
             </when>
             <otherwise>
                 order by p.createTime desc

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

@@ -108,7 +108,7 @@
         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
+        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_user au on a.authUserId = au.authUserId

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

@@ -128,7 +128,13 @@
     <select id="getProductImageList" resultType="com.caimei.model.po.ProductImagePo">
         SELECT p.id as productId, certificateImage,a.authParty,p.snCode
         FROM cm_brand_auth_product p
-                 left join cm_brand_auth a on p.authId = a.id
+                 left join cm_brand_auth a on p.authId = a.id and a.delFlag = 0
                  left join cm_brand_auth_user u on a.authUserId = u.authUserId where u.authUserId = #{authUserId};
     </select>
+    <select id="getAuthImageList" resultType="com.caimei.model.vo.AuthVo">
+        select a.id as authId, a.authParty
+        from cm_brand_auth a
+            left join cm_brand_auth_user u on a.authUserId = u.authUserId
+        where u.authUserId = #{authUserId};
+    </select>
 </mapper>

+ 4 - 3
src/main/resources/mapper/ShopMapper.xml

@@ -322,9 +322,10 @@
         select cf.id as feedbackId, a.authParty as clubName, cu.mobile, content, commitTime, handleStatus, handleResult,
         handleTime
         from cm_brand_club_feedback cf
-        join cm_brand_club_user cu on cf.clubUserId = cu.id
-        join cm_brand_auth a on cu.authId = a.id
-        where a.authUserId = #{authUserId}
+        left join cm_brand_club_user cu on cf.clubUserId = cu.id
+        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})
         <if test="clubName != null and clubName != ''">
             and a.authParty like concat('%',#{clubName},'%')
         </if>

Some files were not shown because too many files changed in this diff