Browse Source

ldm版本part7

Aslee 3 years ago
parent
commit
4ae18651c1

+ 2 - 2
src/main/java/com/caimei/config/ApiInterceptor.java

@@ -33,11 +33,11 @@ public class ApiInterceptor implements HandlerInterceptor {
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
         String token = request.getHeader("X-Token");
         String token = request.getHeader("X-Token");
         String cacheToken = null != token ? String.valueOf(redisService.get(token)) : null;
         String cacheToken = null != token ? String.valueOf(redisService.get(token)) : null;
-        /*if (null == cacheToken || !JwtUtil.isVerify(cacheToken)) {
+        if (null == cacheToken || !JwtUtil.isVerify(cacheToken)) {
             // Token失效
             // Token失效
             response.sendRedirect(zplmapi + "/unauthorized");
             response.sendRedirect(zplmapi + "/unauthorized");
             return false;
             return false;
-        }*/
+        }
         return true;
         return true;
     }
     }
 
 

+ 7 - 4
src/main/java/com/caimei/config/WxApiInterceptor.java

@@ -48,11 +48,14 @@ public class WxApiInterceptor implements HandlerInterceptor {
             // 订阅号登录用户
             // 订阅号登录用户
             String[] cacheArr = cacheValue.split(",");
             String[] cacheArr = cacheValue.split(",");
             String mobile = cacheArr[0];
             String mobile = cacheArr[0];
-            String appId = cacheArr[1];
-            clubUser = clubMapper.getWxClubUser(mobile, appId, null);
-        } else {
+            Integer authUserId = Integer.parseInt(cacheArr[1]);
+            clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null);
+        } else if (null != cacheValue && cacheValue.contains("|")){
             // 服务号登录用户
             // 服务号登录用户
-            clubUser = loginMapper.findClubUserByOpenId(cacheValue);
+            String[] cacheArr = cacheValue.split("\\|");
+            String openId = cacheArr[0];
+            String appId = cacheArr[1];
+            clubUser = loginMapper.getClubUserByOpenId(openId, appId);
         }
         }
         if (null == cacheValue || null == clubUser) {
         if (null == cacheValue || null == clubUser) {
             // Token失效
             // Token失效

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

@@ -69,8 +69,8 @@ public class LoginApi {
         JSONObject parseObject = JSONObject.parseObject(params);
         JSONObject parseObject = JSONObject.parseObject(params);
         String mobile = parseObject.getString("mobile");
         String mobile = parseObject.getString("mobile");
         String verifyCode = parseObject.getString("verifyCode");
         String verifyCode = parseObject.getString("verifyCode");
-        String appId = parseObject.getString("appId");
-        return loginService.loginByVerifyCode(mobile, verifyCode, appId);
+        Integer authUserId = parseObject.getInteger("authUserId");
+        return loginService.loginByVerifyCode(mobile, verifyCode, authUserId);
     }
     }
 
 
     @ApiOperation("校验token是否失效")
     @ApiOperation("校验token是否失效")

+ 1 - 3
src/main/java/com/caimei/controller/wechat/SDKApi.java

@@ -35,9 +35,7 @@ public class SDKApi {
 
 
 
 
     @ApiOperation("获取公众号类型")
     @ApiOperation("获取公众号类型")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "appId", required = true, value = "公众号appId")
-    })
+    @ApiImplicitParam(name = "appId", required = true, value = "公众号appId")
     @GetMapping("/account/type")
     @GetMapping("/account/type")
     public ResponseJson<Integer> getWxAccountType(String appId) {
     public ResponseJson<Integer> getWxAccountType(String appId) {
         return sdkService.getWxAccountType(appId);
         return sdkService.getWxAccountType(appId);

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

@@ -28,7 +28,7 @@ public interface ClubMapper {
 
 
     void insertFeedback(@Param("clubUserId") Integer clubUserId, @Param("content") String content);
     void insertFeedback(@Param("clubUserId") Integer clubUserId, @Param("content") String content);
 
 
-    WxClubUserVo getWxClubUser(@Param("mobile") String mobile, @Param("appId") String appId, @Param("authId") Integer authId);
+    WxClubUserVo getWxClubUser(@Param("mobile") String mobile, @Param("appId") String appId, @Param("authUserId") Integer authUserId, @Param("authId") Integer authId);
 
 
     WxClubDetailsVo getClubDetails(Integer authId);
     WxClubDetailsVo getClubDetails(Integer authId);
 
 

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

@@ -1,7 +1,5 @@
 package com.caimei.mapper.cmMapper;
 package com.caimei.mapper.cmMapper;
 
 
-import com.caimei.model.po.ClubUserPo;
-import com.caimei.model.vo.UserLoginVo;
 import com.caimei.model.vo.WxClubUserVo;
 import com.caimei.model.vo.WxClubUserVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -16,7 +14,7 @@ import org.apache.ibatis.annotations.Param;
 public interface LoginMapper {
 public interface LoginMapper {
 
 
 
 
-    WxClubUserVo findClubUserByOpenId(String openId);
+    WxClubUserVo getClubUserByOpenId(String openId, String appId);
 
 
     void bindClubUser(@Param("mobile") String mobile, @Param("nickName") String nickName, @Param("openId") String openId);
     void bindClubUser(@Param("mobile") String mobile, @Param("nickName") String nickName, @Param("openId") String openId);
 }
 }

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

@@ -100,6 +100,9 @@ public class ShopListVo implements Serializable {
     @ApiModelProperty("文件待审核数量")
     @ApiModelProperty("文件待审核数量")
     private Integer fileWaitNum;
     private Integer fileWaitNum;
 
 
+    @ApiModelProperty("资料包待审核数量")
+    private Integer zipWaitNum;
+
     @ApiModelProperty("医师待审核数量")
     @ApiModelProperty("医师待审核数量")
     private Integer doctorWaitNum;
     private Integer doctorWaitNum;
 
 

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

@@ -142,7 +142,7 @@ public class AuthClubServiceImpl implements AuthClubService {
         clubUser.setMobile(mobile);
         clubUser.setMobile(mobile);
         if (insertFlag) {
         if (insertFlag) {
             // 根据手机号校验该机构下是否已添加该机构用户
             // 根据手机号校验该机构下是否已添加该机构用户
-            WxClubUserVo wxClubUser = clubMapper.getWxClubUser(mobile, null, authId);
+            WxClubUserVo wxClubUser = clubMapper.getWxClubUser(mobile, null, null, authId);
             if (null != wxClubUser) {
             if (null != wxClubUser) {
                 return ResponseJson.error("该用户已存在,请勿重复添加");
                 return ResponseJson.error("该用户已存在,请勿重复添加");
             }
             }

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

@@ -395,9 +395,6 @@ public class AuthProductServiceImpl implements AuthProductService {
         if (null == productTypeId) {
         if (null == productTypeId) {
             return ResponseJson.error("参数异常,请输入设备分类id", null);
             return ResponseJson.error("参数异常,请输入设备分类id", null);
         }
         }
-        if (StringUtils.isNotEmpty(snCode) && 4 != snCode.length()) {
-            return ResponseJson.error("参数异常,请输入SN码后四位", null);
-        }
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
         List<WxProductListVo> productList = authProductMapper.getWxProductList(productTypeId, snCode);
         List<WxProductListVo> productList = authProductMapper.getWxProductList(productTypeId, snCode);
         PageInfo<WxProductListVo> pageData = new PageInfo<>(productList);
         PageInfo<WxProductListVo> pageData = new PageInfo<>(productList);
@@ -449,7 +446,7 @@ public class AuthProductServiceImpl implements AuthProductService {
             productType.setCreateTime(new Date());
             productType.setCreateTime(new Date());
             // 设备分类图片添加水印
             // 设备分类图片添加水印
             productType.setPcImage(addWaterMark(productType.getImage(),1));
             productType.setPcImage(addWaterMark(productType.getImage(),1));
-            productType.setPcImage(addWaterMark(productType.getImage(),2));
+            productType.setAppletsImage(addWaterMark(productType.getImage(),2));
             // 插入设备分类
             // 插入设备分类
             authProductMapper.insertProductType(productType);
             authProductMapper.insertProductType(productType);
         } else {
         } else {

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

@@ -61,9 +61,10 @@ public class ShopServiceImpl implements ShopService {
             int imageWaitNum = shop.getImageWaitNum();
             int imageWaitNum = shop.getImageWaitNum();
             int videoWaitNum = shop.getVideoWaitNum();
             int videoWaitNum = shop.getVideoWaitNum();
             int fileWaitNum = shop.getFileWaitNum();
             int fileWaitNum = shop.getFileWaitNum();
+            int zipWaitNum = shop.getZipWaitNum();
             int doctorWaitNum = shop.getDoctorWaitNum();
             int doctorWaitNum = shop.getDoctorWaitNum();
             int productTypeWaitNum = shop.getProductTypeWaitNum();
             int productTypeWaitNum = shop.getProductTypeWaitNum();
-            int waitAuditNum = 2 == listType ? shop.getWaitAuditNum() : (3 == listType ? (articleWaitNum + imageWaitNum + videoWaitNum + fileWaitNum) : (4 == listType ? doctorWaitNum : (6 == listType ? productTypeWaitNum : 0)));
+            int waitAuditNum = 2 == listType ? shop.getWaitAuditNum() : (3 == listType ? (articleWaitNum + imageWaitNum + videoWaitNum + fileWaitNum + zipWaitNum) : (4 == listType ? doctorWaitNum : (6 == listType ? productTypeWaitNum : 0)));
             if (waitAuditNum > 0) {
             if (waitAuditNum > 0) {
                 shop.setLowerAuditStatus(0);
                 shop.setLowerAuditStatus(0);
             }else {
             }else {

+ 1 - 0
src/main/java/com/caimei/service/data/impl/FileServiceImpl.java

@@ -171,6 +171,7 @@ public class FileServiceImpl implements FileService {
         fileType = null == fileType ? 1 : fileType;
         fileType = null == fileType ? 1 : fileType;
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
         List<WxFileListVo> fileList = fileMapper.getWxFileList(authUserId, fileType, fileTitle);
         List<WxFileListVo> fileList = fileMapper.getWxFileList(authUserId, fileType, fileTitle);
+        fileList.forEach(file -> file.setFilePreviewUrl(OSSUtils.getOssUrl(file.getFileDownloadUrl())));
         PageInfo<WxFileListVo> pageData = new PageInfo<>(fileList);
         PageInfo<WxFileListVo> pageData = new PageInfo<>(fileList);
         return ResponseJson.success(pageData);
         return ResponseJson.success(pageData);
     }
     }

+ 2 - 0
src/main/java/com/caimei/service/data/impl/VideoServiceImpl.java

@@ -6,6 +6,7 @@ import com.caimei.model.po.VideoPo;
 import com.caimei.model.vo.VideoListVo;
 import com.caimei.model.vo.VideoListVo;
 import com.caimei.model.vo.WxVideoListVo;
 import com.caimei.model.vo.WxVideoListVo;
 import com.caimei.service.data.VideoService;
 import com.caimei.service.data.VideoService;
+import com.caimei.utils.OSSUtils;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
@@ -160,6 +161,7 @@ public class VideoServiceImpl implements VideoService {
         }
         }
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
         List<WxVideoListVo> videoList = videoMapper.getWxVideoList(authUserId, videoTitle);
         List<WxVideoListVo> videoList = videoMapper.getWxVideoList(authUserId, videoTitle);
+        videoList.forEach(video-> video.setVideoPreviewUrl(OSSUtils.getOssUrl(video.getVideoDownloadUrl())));
         PageInfo<WxVideoListVo> pageData = new PageInfo<>(videoList);
         PageInfo<WxVideoListVo> pageData = new PageInfo<>(videoList);
         return ResponseJson.success(pageData);
         return ResponseJson.success(pageData);
     }
     }

+ 1 - 1
src/main/java/com/caimei/service/wechat/LoginService.java

@@ -40,5 +40,5 @@ public interface LoginService {
      * @param appId         公众号appId
      * @param appId         公众号appId
      * @return
      * @return
      */
      */
-    ResponseJson<WxClubUserVo> loginByVerifyCode(String mobile, String verifyCode, String appId);
+    ResponseJson<WxClubUserVo> loginByVerifyCode(String mobile, String verifyCode, Integer authUserId);
  }
  }

+ 9 - 11
src/main/java/com/caimei/service/wechat/impl/LoginServiceImpl.java

@@ -6,7 +6,6 @@ import com.caimei.mapper.cmMapper.ClubMapper;
 import com.caimei.mapper.cmMapper.LoginMapper;
 import com.caimei.mapper.cmMapper.LoginMapper;
 import com.caimei.mapper.cmMapper.ShopMapper;
 import com.caimei.mapper.cmMapper.ShopMapper;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.ResponseJson;
-import com.caimei.model.po.ClubUserPo;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.vo.ShopFormVo;
 import com.caimei.model.vo.ShopFormVo;
 import com.caimei.model.vo.WxClubUserVo;
 import com.caimei.model.vo.WxClubUserVo;
@@ -19,7 +18,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
-import java.util.Date;
 import java.util.Map;
 import java.util.Map;
 import java.util.UUID;
 import java.util.UUID;
 
 
@@ -71,7 +69,7 @@ public class LoginServiceImpl implements LoginService {
         String openId = infoMap.get("openId");
         String openId = infoMap.get("openId");
         String accessToken = infoMap.get("accessToken");
         String accessToken = infoMap.get("accessToken");
         log.info("微信授权,openId:>>>>>>>>>>>" + openId);
         log.info("微信授权,openId:>>>>>>>>>>>" + openId);
-        WxClubUserVo clubUser = loginMapper.findClubUserByOpenId(openId);
+        WxClubUserVo clubUser = loginMapper.getClubUserByOpenId(openId, appId);
         if (null == clubUser) {
         if (null == clubUser) {
             clubUser = new WxClubUserVo();
             clubUser = new WxClubUserVo();
             clubUser.setOpenId(openId);
             clubUser.setOpenId(openId);
@@ -80,7 +78,7 @@ public class LoginServiceImpl implements LoginService {
         }
         }
         clubUser.setAccessToken(accessToken);
         clubUser.setAccessToken(accessToken);
         // 登录成功redis保存token
         // 登录成功redis保存token
-        redisService.set(accessToken, openId, 60L * 60 * 4);
+        redisService.set(accessToken, openId + "|" + appId, 60L * 60 * 4);
         return ResponseJson.success(clubUser);
         return ResponseJson.success(clubUser);
     }
     }
 
 
@@ -141,7 +139,7 @@ public class LoginServiceImpl implements LoginService {
             return ResponseJson.error("验证码错误,请重新输入", null);
             return ResponseJson.error("验证码错误,请重新输入", null);
         }
         }
         // 校验机构用户是否存在
         // 校验机构用户是否存在
-        WxClubUserVo wxClubUser = clubMapper.getWxClubUser(mobile, appId, null);
+        WxClubUserVo wxClubUser = clubMapper.getWxClubUser(mobile, appId, null, null);
         if (null == wxClubUser) {
         if (null == wxClubUser) {
             return ResponseJson.error("抱歉,您的手机号暂无权限登录", null);
             return ResponseJson.error("抱歉,您的手机号暂无权限登录", null);
         }
         }
@@ -172,15 +170,15 @@ public class LoginServiceImpl implements LoginService {
     }
     }
 
 
     @Override
     @Override
-    public ResponseJson<WxClubUserVo> loginByVerifyCode(String mobile, String verifyCode, String appId) {
+    public ResponseJson<WxClubUserVo> loginByVerifyCode(String mobile, String verifyCode, Integer authUserId) {
         if (StringUtils.isEmpty(mobile)) {
         if (StringUtils.isEmpty(mobile)) {
             return ResponseJson.error("参数异常,请输入手机号", null);
             return ResponseJson.error("参数异常,请输入手机号", null);
         }
         }
         if (StringUtils.isEmpty(verifyCode)) {
         if (StringUtils.isEmpty(verifyCode)) {
             return ResponseJson.error("参数异常,请输入验证码", null);
             return ResponseJson.error("参数异常,请输入验证码", null);
         }
         }
-        if (StringUtils.isEmpty(appId)) {
-            return ResponseJson.error("参数异常,请输入appId", null);
+        if (null == authUserId) {
+            return ResponseJson.error("参数异常,请输入供应商用户id", null);
         }
         }
         // 校验验证码是否正确
         // 校验验证码是否正确
         String redisVerifyCode = null == redisService.get("code:" + mobile) ? null : redisService.get("code:" + mobile).toString();
         String redisVerifyCode = null == redisService.get("code:" + mobile) ? null : redisService.get("code:" + mobile).toString();
@@ -188,11 +186,11 @@ public class LoginServiceImpl implements LoginService {
             return ResponseJson.error("验证码错误,请重新输入", null);
             return ResponseJson.error("验证码错误,请重新输入", null);
         }
         }
         // 获取手机号对应机构用户
         // 获取手机号对应机构用户
-        WxClubUserVo clubUser = clubMapper.getWxClubUser(mobile, appId, null);
+        WxClubUserVo clubUser = clubMapper.getWxClubUser(mobile, null, authUserId, null);
         if (null == clubUser) {
         if (null == clubUser) {
             clubUser = new WxClubUserVo();
             clubUser = new WxClubUserVo();
             clubUser.setMobile(mobile);
             clubUser.setMobile(mobile);
-            return ResponseJson.error(-2,"抱歉,您的手机号暂无权限登录", clubUser);
+            return ResponseJson.error("抱歉,您的手机号暂无权限登录", clubUser);
         }
         }
         // 校验机构和供应商的状态是否为已上线
         // 校验机构和供应商的状态是否为已上线
         CmBrandAuthPo clubPo = authMapper.getAuthById(clubUser.getAuthId());
         CmBrandAuthPo clubPo = authMapper.getAuthById(clubUser.getAuthId());
@@ -202,7 +200,7 @@ public class LoginServiceImpl implements LoginService {
         }
         }
         // 登录成功redis保存token
         // 登录成功redis保存token
         String accessToken = UUID.randomUUID().toString();
         String accessToken = UUID.randomUUID().toString();
-        redisService.set(accessToken, mobile + "," + appId, 60L * 60 * 24);
+        redisService.set(accessToken, mobile + "," + authUserId, 60L * 60 * 24);
         clubUser.setAccessToken(accessToken);
         clubUser.setAccessToken(accessToken);
         return ResponseJson.success(clubUser);
         return ResponseJson.success(clubUser);
     }
     }

+ 1 - 1
src/main/java/com/caimei/service/wechat/impl/SDKServiceImpl.java

@@ -85,7 +85,7 @@ public class SDKServiceImpl implements SDKService {
     public ResponseJson<Integer> getWxAccountType(String appId) {
     public ResponseJson<Integer> getWxAccountType(String appId) {
         Integer wxAccountType = shopMapper.getWxAccountTypeByAppId(appId);
         Integer wxAccountType = shopMapper.getWxAccountTypeByAppId(appId);
         if (null == wxAccountType) {
         if (null == wxAccountType) {
-            return ResponseJson.error("公众号不存在", null);
+            return ResponseJson.success(3,"公众号不存在", null);
         }
         }
         return ResponseJson.success(wxAccountType);
         return ResponseJson.success(wxAccountType);
     }
     }

+ 3 - 1
src/main/java/com/caimei/task/LdmTask.java

@@ -44,9 +44,10 @@ public class LdmTask {
     /**
     /**
      * 每天凌晨1点读取ldm数据库机构数据,存入采美数据库中
      * 每天凌晨1点读取ldm数据库机构数据,存入采美数据库中
      */
      */
-    @Scheduled(cron = "0 0 0/30 * * ?")
+    @Scheduled(cron = "0 0 2 * * ?")
     public void readLdmData() {
     public void readLdmData() {
         AtomicReference<Integer> ldmLatestClubId = new AtomicReference<>(authMapper.getLdmLatestClubId());
         AtomicReference<Integer> ldmLatestClubId = new AtomicReference<>(authMapper.getLdmLatestClubId());
+        log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>开始同步,ldmLatestClubId:" + ldmLatestClubId.get());
         List<LdmDataPo> ldmDataList = ldmMapper.getLdmClubData(ldmLatestClubId.get());
         List<LdmDataPo> ldmDataList = ldmMapper.getLdmClubData(ldmLatestClubId.get());
         ldmDataList.forEach(ldmData->{
         ldmDataList.forEach(ldmData->{
             ldmLatestClubId.set(ldmData.getId());
             ldmLatestClubId.set(ldmData.getId());
@@ -114,6 +115,7 @@ public class LdmTask {
                 addPicList.forEach(banner -> authMapper.insertBanner(authPo.getId(), banner));
                 addPicList.forEach(banner -> authMapper.insertBanner(authPo.getId(), banner));
             }
             }
         });
         });
+        log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>同步结束,ldmLatestClubId:" + ldmLatestClubId.get());
         authMapper.updateLdmLatestClubId(ldmLatestClubId.get());
         authMapper.updateLdmLatestClubId(ldmLatestClubId.get());
     }
     }
 }
 }

+ 11 - 2
src/main/java/com/caimei/utils/OSSUtils.java

@@ -126,12 +126,18 @@ public class OSSUtils {
         if (".vsd".equalsIgnoreCase(fileExtension)) {
         if (".vsd".equalsIgnoreCase(fileExtension)) {
             return "application/vnd.visio";
             return "application/vnd.visio";
         }
         }
-        if (".ppt".equalsIgnoreCase(fileExtension) || "pptx".equalsIgnoreCase(fileExtension)) {
+        if (".ppt".equalsIgnoreCase(fileExtension)  ) {
             return "application/vnd.ms-powerpoint";
             return "application/vnd.ms-powerpoint";
         }
         }
-        if (".doc".equalsIgnoreCase(fileExtension) || "docx".equalsIgnoreCase(fileExtension)) {
+        if (".pptx".equalsIgnoreCase(fileExtension)) {
+            return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
+        }
+        if (".doc".equalsIgnoreCase(fileExtension) ) {
             return "application/msword";
             return "application/msword";
         }
         }
+        if ("docx".equalsIgnoreCase(fileExtension)) {
+            return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
+        }
         if (".xml".equalsIgnoreCase(fileExtension)) {
         if (".xml".equalsIgnoreCase(fileExtension)) {
             return "text/xml";
             return "text/xml";
         }
         }
@@ -144,6 +150,9 @@ public class OSSUtils {
         if (".pdf".equalsIgnoreCase(fileExtension)) {
         if (".pdf".equalsIgnoreCase(fileExtension)) {
             return "application/pdf";
             return "application/pdf";
         }
         }
+        if (".zip".equalsIgnoreCase(fileExtension)) {
+            return "application/zip";
+        }
         return "text/html";
         return "text/html";
     }
     }
 
 

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

@@ -84,7 +84,7 @@
                 order by (case a.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc,waitAuditNum desc, a.createTime desc
                 order by (case a.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc,waitAuditNum desc, a.createTime desc
             </when>
             </when>
             <otherwise>
             <otherwise>
-                order by a.createTime desc
+                order by a.createTime desc, a.id desc
             </otherwise>
             </otherwise>
         </choose>
         </choose>
     </select>
     </select>

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

@@ -192,7 +192,8 @@
         from cm_brand_auth_product
         from cm_brand_auth_product
     </select>
     </select>
     <select id="getWxProductList" resultType="com.caimei.model.vo.WxProductListVo">
     <select id="getWxProductList" resultType="com.caimei.model.vo.WxProductListVo">
-        select p.id as productId,p.authId, t.name as productName,p.snCode,t.image as productImage,a.authParty as clubName
+        select p.id as productId,p.authId, t.name as productName,p.snCode,t.image as productImage,a.authParty as
+        clubName
         from cm_brand_auth_product p
         from cm_brand_auth_product p
         left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
         left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
         left join cm_brand_auth a on p.authId = a.id
         left join cm_brand_auth a on p.authId = a.id
@@ -206,6 +207,8 @@
         and a.auditStatus = 1
         and a.auditStatus = 1
         and p.status = 1
         and p.status = 1
         and p.auditStatus = 1
         and p.auditStatus = 1
+        and t.status = 1
+        and t.auditStatus = 1
         order by p.createTime desc
         order by p.createTime desc
     </select>
     </select>
     <select id="getBrandIdByBrandName" resultType="java.lang.Integer">
     <select id="getBrandIdByBrandName" resultType="java.lang.Integer">
@@ -254,6 +257,8 @@
           and p.status = 1
           and p.status = 1
           and a.auditStatus = 1
           and a.auditStatus = 1
           and p.auditStatus = 1
           and p.auditStatus = 1
+          and t.status = 1
+          and t.auditStatus = 1
     </select>
     </select>
     <select id="getStatementFile" resultType="com.caimei.module.base.entity.vo.StatementFileVo">
     <select id="getStatementFile" resultType="com.caimei.module.base.entity.vo.StatementFileVo">
         select name,ossName,md5Hex,uploadTime
         select name,ossName,md5Hex,uploadTime
@@ -305,7 +310,7 @@
         select t.id as productTypeId,t.name,t.image
         select t.id as productTypeId,t.name,t.image
         from cm_brand_product_type t
         from cm_brand_product_type t
             left join cm_brand_auth_user u on t.authUserId = u.authUserId
             left join cm_brand_auth_user u on t.authUserId = u.authUserId
-        where u.authUserId = #{authUserId} and t.delFlag = 0
+        where u.authUserId = #{authUserId} and t.delFlag = 0 and t.status = 1 and auditStatus = 1
         <if test="name != null and name != ''">
         <if test="name != null and name != ''">
             and t.name like concat('%',#{name},'%')
             and t.name like concat('%',#{name},'%')
         </if>
         </if>

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

@@ -88,6 +88,9 @@
           <if test="appId != null and appId != ''">
           <if test="appId != null and appId != ''">
               and au.appId = #{appId}
               and au.appId = #{appId}
           </if>
           </if>
+          <if test="authUserId != null">
+              and au.authUserId = #{authUserId}
+          </if>
           <if test="authId != null">
           <if test="authId != null">
               and cu.authId = #{authId}
               and cu.authId = #{authId}
           </if>
           </if>
@@ -97,7 +100,7 @@
     <select id="getClubDetails" resultType="com.caimei.model.vo.WxClubDetailsVo">
     <select id="getClubDetails" resultType="com.caimei.model.vo.WxClubDetailsVo">
         select a.id                           as authId,
         select a.id                           as authId,
                a.authParty,
                a.authParty,
-               concat(p.name, c.name, t.name) as area,
+               concat(ifnull(p.name,''),ifnull(c.name,''),ifnull(t.name,'')) as area,
                a.address,
                a.address,
                a.mobile,
                a.mobile,
                a.logo,
                a.logo,

+ 3 - 2
src/main/resources/mapper/LoginMapper.xml

@@ -10,14 +10,15 @@
         where mobile = #{mobile};
         where mobile = #{mobile};
     </update>
     </update>
 
 
-    <select id="findClubUserByOpenId" 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
                  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}
+        where openId = #{openId} and au.appId = #{appId}
           and cu.delFlag = 0
           and cu.delFlag = 0
           and a.status = 1
           and a.status = 1
           and au.status = 1
           and au.status = 1
+        limit 1
     </select>
     </select>
 </mapper>
 </mapper>

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

@@ -121,6 +121,7 @@
         ifnull(iw.imageWaitNum,0) as imageWaitNum,
         ifnull(iw.imageWaitNum,0) as imageWaitNum,
         ifnull(vw.videoWaitNum,0) as videoWaitNum,
         ifnull(vw.videoWaitNum,0) as videoWaitNum,
         ifnull(fw.fileWaitNum,0) as fileWaitNum,
         ifnull(fw.fileWaitNum,0) as fileWaitNum,
+        ifnull(zw.zipWaitNum,0) as zipWaitNum,
         ifnull(dw.doctorWaitNum,0) as doctorWaitNum,
         ifnull(dw.doctorWaitNum,0) as doctorWaitNum,
         ifnull(tw.productTypeWaitNum,0) as productTypeWaitNum
         ifnull(tw.productTypeWaitNum,0) as productTypeWaitNum
         from cm_brand_auth_user u
         from cm_brand_auth_user u
@@ -132,7 +133,8 @@
         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 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 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 productTypeWaitNum from cm_brand_product_type where auditStatus = 2 group by authUserId) tw on u.authUserId = tw.authUserId
         where u.userIdentity = 2
         where u.userIdentity = 2
@@ -163,7 +165,7 @@
                     and (ifnull(aw.authWaitNum,0)+ifnull(pw.productWaitNum,0)) > 0
                     and (ifnull(aw.authWaitNum,0)+ifnull(pw.productWaitNum,0)) > 0
                 </if>
                 </if>
                 <if test="listType == 3">
                 <if test="listType == 3">
-                    and (ifnull(articleWaitNum,0) + ifnull(imageWaitNum,0) + ifnull(videoWaitNum,0) + ifnull(fileWaitNum,0)) > 0
+                    and (ifnull(articleWaitNum,0) + ifnull(imageWaitNum,0) + ifnull(videoWaitNum,0) + ifnull(fileWaitNum,0) + ifnull(zipWaitNum,0)) > 0
                 </if>
                 </if>
                 <if test="listType == 4">
                 <if test="listType == 4">
                     and ifnull(dw.doctorWaitNum,0) > 0
                     and ifnull(dw.doctorWaitNum,0) > 0
@@ -177,7 +179,7 @@
                     and (ifnull(aw.authWaitNum,0)+ifnull(pw.productWaitNum,0)) = 0
                     and (ifnull(aw.authWaitNum,0)+ifnull(pw.productWaitNum,0)) = 0
                 </if>
                 </if>
                 <if test="listType == 3">
                 <if test="listType == 3">
-                    and (ifnull(articleWaitNum,0) + ifnull(imageWaitNum,0) + ifnull(videoWaitNum,0) + ifnull(fileWaitNum,0)) = 0
+                    and (ifnull(articleWaitNum,0) + ifnull(imageWaitNum,0) + ifnull(videoWaitNum,0) + ifnull(fileWaitNum,0) + ifnull(zipWaitNum,0)) = 0
                 </if>
                 </if>
                 <if test="listType == 4">
                 <if test="listType == 4">
                     and ifnull(dw.doctorWaitNum,0) = 0
                     and ifnull(dw.doctorWaitNum,0) = 0
@@ -193,7 +195,7 @@
                 ORDER BY waitAuditNum desc, u.createTime DESC
                 ORDER BY waitAuditNum desc, u.createTime DESC
             </when>
             </when>
             <when test="listType == 3">
             <when test="listType == 3">
-                ORDER BY (ifnull(articleWaitNum,0) + ifnull(imageWaitNum,0) + ifnull(videoWaitNum,0) + ifnull(fileWaitNum,0)) desc, u.createTime DESC
+                ORDER BY (ifnull(articleWaitNum,0) + ifnull(imageWaitNum,0) + ifnull(videoWaitNum,0) + ifnull(fileWaitNum,0) + ifnull(zipWaitNum,0)) desc, u.createTime DESC
             </when>
             </when>
             <when test="listType == 4">
             <when test="listType == 4">
                 ORDER BY ifnull(dw.doctorWaitNum,0) desc, u.createTime DESC
                 ORDER BY ifnull(dw.doctorWaitNum,0) desc, u.createTime DESC