Quellcode durchsuchen

正品联盟资料库优化part2

Aslee vor 3 Jahren
Ursprung
Commit
0310255dc6
47 geänderte Dateien mit 1730 neuen und 55 gelöschten Zeilen
  1. 4 2
      src/main/java/com/caimei/config/ApiConfig.java
  2. 11 2
      src/main/java/com/caimei/controller/ArticleApi.java
  3. 92 0
      src/main/java/com/caimei/controller/FileApi.java
  4. 12 3
      src/main/java/com/caimei/controller/ImageApi.java
  5. 31 1
      src/main/java/com/caimei/controller/ShopApi.java
  6. 41 0
      src/main/java/com/caimei/controller/UploadApi.java
  7. 92 0
      src/main/java/com/caimei/controller/VideoApi.java
  8. 3 0
      src/main/java/com/caimei/mapper/ArticleMapper.java
  9. 33 0
      src/main/java/com/caimei/mapper/FileMapper.java
  10. 5 0
      src/main/java/com/caimei/mapper/ImageMapper.java
  11. 6 0
      src/main/java/com/caimei/mapper/ShopMapper.java
  12. 35 0
      src/main/java/com/caimei/mapper/VideoMapper.java
  13. 62 0
      src/main/java/com/caimei/model/po/FilePo.java
  14. 62 0
      src/main/java/com/caimei/model/po/VideoPo.java
  15. 26 0
      src/main/java/com/caimei/model/vo/ArticleFormVo.java
  16. 20 0
      src/main/java/com/caimei/model/vo/AuthFileVo.java
  17. 38 0
      src/main/java/com/caimei/model/vo/FeedbackVo.java
  18. 25 4
      src/main/java/com/caimei/model/vo/FileVo.java
  19. 25 0
      src/main/java/com/caimei/model/vo/ImageFormVo.java
  20. 41 0
      src/main/java/com/caimei/model/vo/VideoVo.java
  21. 8 0
      src/main/java/com/caimei/service/ArticleService.java
  22. 64 0
      src/main/java/com/caimei/service/FileService.java
  23. 10 1
      src/main/java/com/caimei/service/ImageService.java
  24. 25 0
      src/main/java/com/caimei/service/SDKService.java
  25. 25 1
      src/main/java/com/caimei/service/ShopService.java
  26. 64 0
      src/main/java/com/caimei/service/VideoService.java
  27. 14 4
      src/main/java/com/caimei/service/impl/ArticleServiceImpl.java
  28. 1 1
      src/main/java/com/caimei/service/impl/AuthProductServiceImpl.java
  29. 3 3
      src/main/java/com/caimei/service/impl/AuthServiceImpl.java
  30. 155 0
      src/main/java/com/caimei/service/impl/FileServiceImpl.java
  31. 24 8
      src/main/java/com/caimei/service/impl/ImageServiceImpl.java
  32. 64 0
      src/main/java/com/caimei/service/impl/SDKServiceImpl.java
  33. 44 5
      src/main/java/com/caimei/service/impl/ShopServiceImpl.java
  34. 154 0
      src/main/java/com/caimei/service/impl/VideoServiceImpl.java
  35. 48 0
      src/main/java/com/caimei/utils/SHA1.java
  36. 82 0
      src/main/java/com/caimei/utils/WxUtils.java
  37. 31 0
      src/main/java/com/caimei/wxController/SDKAPI.java
  38. 40 0
      src/main/resources/backup.sql
  39. 8 1
      src/main/resources/config/beta/application-beta.yml
  40. 10 12
      src/main/resources/config/dev/application-dev.yml
  41. 7 0
      src/main/resources/config/prod/application-prod.yml
  42. 5 0
      src/main/resources/mapper/ArticleMapper.xml
  43. 0 7
      src/main/resources/mapper/AuthMapper.xml
  44. 75 0
      src/main/resources/mapper/FileMapper.xml
  45. 6 0
      src/main/resources/mapper/ImageMapper.xml
  46. 21 0
      src/main/resources/mapper/ShopMapper.xml
  47. 78 0
      src/main/resources/mapper/VideoMapper.xml

+ 4 - 2
src/main/java/com/caimei/config/ApiConfig.java

@@ -23,9 +23,11 @@ public class ApiConfig implements WebMvcConfigurer {
         //excludePathPatterns 用于排除拦截
         registry.addInterceptor(apiInterceptor)
                 .addPathPatterns("/auth/**")
+                .addPathPatterns("/club/**")
                 .addPathPatterns("/shop/**")
-                .addPathPatterns("/upload/**")
-                .addPathPatterns("/user/update/password");
+//                .addPathPatterns("/upload/**")
+                .addPathPatterns("/user/update/password")
+                .addPathPatterns("/data/**");
 //                .excludePathPatterns("/order/shareCode");
     }
 }

+ 11 - 2
src/main/java/com/caimei/controller/ArticleApi.java

@@ -2,7 +2,9 @@ package com.caimei.controller;
 
 import com.alibaba.fastjson.JSONObject;
 import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.ArticleFormVo;
 import com.caimei.model.vo.ArticleVo;
+import com.caimei.model.vo.ImageFormVo;
 import com.caimei.service.ArticleService;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
@@ -16,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
 import java.util.Map;
 
 /**
- * 供应商API
+ * 资料库文章API
  *
  * @author : Aslee
  * @date : 2021/7/8
@@ -49,7 +51,7 @@ public class ArticleApi {
     }
 
     @ApiOperation("添加/编辑文章")
-    @ApiImplicitParam(name = "params", value = "articleId:文章id;authUserId:供应商用户id;articleTitle:文章标题;articleImage:文章图片;articleContent:文章内容;createBy:创建人用户id", required = true)
+    @ApiImplicitParam(name = "params", value = "articleId:文章id;authUserId:供应商用户id;articleTitle:文章标题;articleImage:文章图片;articleContent:文章内容", required = true)
     @PostMapping("/save")
     public ResponseJson saveArticle(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
@@ -61,6 +63,13 @@ public class ArticleApi {
         return articleService.saveArticle(articleId, authUserId, articleTitle, articleImage, articleContent);
     }
 
+    @ApiOperation("文章回显数据")
+    @ApiImplicitParam(name = "articleId", value = "文章id", required = true)
+    @GetMapping("/form/data")
+    public ResponseJson<ArticleFormVo> getArticleFormData(Integer articleId) {
+        return articleService.getArticleFormData(articleId);
+    }
+
     @ApiOperation("更新文章状态")
     @ApiImplicitParam(name = "params", value = "articleId:文章id;status:文章状态:0停用 1启用;", required = true)
     @PostMapping("/update/status")

+ 92 - 0
src/main/java/com/caimei/controller/FileApi.java

@@ -0,0 +1,92 @@
+package com.caimei.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.FileVo;
+import com.caimei.service.FileService;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Map;
+
+/**
+ * 资料库文件API
+ *
+ * @author : Aslee
+ * @date : 2021/7/9
+ */
+@Api(tags = "资料库文件API")
+@Slf4j
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/data/file")
+public class FileApi {
+
+    private final FileService fileService;
+
+
+    @ApiOperation("文件列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1文件列表,2文件审核列表"),
+            @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
+            @ApiImplicitParam(name = "fileTitle", required = false, value = "文件标题"),
+            @ApiImplicitParam(name = "auditStatus", required = false, value = "审核状态:0审核未通过,1审核通过,2待审核"),
+            @ApiImplicitParam(name = "status", required = false, value = "文件状态:0已下线,1已上线,2待上线"),
+            @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
+            @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
+    })
+    @GetMapping("/list")
+    public ResponseJson<PageInfo<FileVo>> getFileList(Integer listType, Integer authUserId, String fileTitle, Integer auditStatus, Integer status,
+                                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+                                                            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
+        return fileService.getFileList(listType, authUserId, fileTitle, auditStatus, status, pageNum, pageSize);
+    }
+
+    @ApiOperation("添加/编辑文件")
+    @ApiImplicitParam(name = "params", required = false, value = "fileId:文件id;authUserId:供应商用户id;fileTitle:文件标题;fileUrl:文件链接")
+    @PostMapping("/save")
+    public ResponseJson saveFile(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer fileId = paramsMap.getInteger("fileId");
+        Integer authUserId = paramsMap.getInteger("authUserId");
+        String fileTitle = paramsMap.getString("fileTitle");
+        String fileUrl = paramsMap.getString("fileUrl");
+        return fileService.saveFile(fileId, authUserId, fileTitle, fileUrl);
+    }
+
+    @ApiOperation("更新文件状态")
+    @ApiImplicitParam(name = "params", value = "fileId:文件id;status:文件状态:0停用 1启用;", required = true)
+    @PostMapping("/update/status")
+    public ResponseJson updateFileStatus(@RequestBody Map<String,Integer> params) {
+        Integer fileId = params.get("fileId");
+        Integer status = params.get("status");
+        return fileService.updateFileStatus(fileId, status);
+    }
+
+    @ApiOperation("删除文件")
+    @ApiImplicitParam(name = "params", value = "fileId:文件id", required = true)
+    @PostMapping("/delete")
+    public ResponseJson deleteFile(@RequestBody Map<String,Integer> params) {
+        Integer fileId = params.get("fileId");
+        return fileService.deleteFile(fileId);
+    }
+
+    @ApiOperation("审核文件")
+    @ApiImplicitParam(name = "params", value = "fileId:文件id;auditStatus:审核状态:0审核未通过,1审核通过,2待审核;invalidReason:审核不通过原因;auditBy:审核人用户id", required = true)
+    @PostMapping("/audit")
+    public ResponseJson auditFile(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer fileId = paramsMap.getInteger("fileId");
+        Integer auditStatus = paramsMap.getInteger("auditStatus");
+        String invalidReason = paramsMap.getString("invalidReason");
+        Integer auditBy = paramsMap.getInteger("auditBy");
+        return fileService.auditFile(fileId, auditStatus, invalidReason, auditBy);
+    }
+}

+ 12 - 3
src/main/java/com/caimei/controller/ImageApi.java

@@ -1,7 +1,9 @@
 package com.caimei.controller;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.ImageFormVo;
 import com.caimei.model.vo.ImageVo;
 import com.caimei.service.ImageService;
 import com.github.pagehelper.PageInfo;
@@ -16,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
 import java.util.Map;
 
 /**
- * 供应商API
+ * 资料库图片API
  *
  * @author : Aslee
  * @date : 2021/7/9
@@ -49,17 +51,24 @@ public class ImageApi {
     }
 
     @ApiOperation("添加/编辑图片")
-    @ApiImplicitParam(name = "params", value = "imageId:图片id;authUserId:供应商用户id;imageTitle:图片标题;imageImage:图片图片;imageContent:图片内容;createBy:创建人用户id", required = true)
+    @ApiImplicitParam(name = "params", value = "imageId:图片id;authUserId:供应商用户id;imageTitle:图片标题;imageArr:图片数组", required = true)
     @PostMapping("/save")
     public ResponseJson saveImage(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
         Integer imageId = paramsMap.getInteger("imageId");
         Integer authUserId = paramsMap.getInteger("authUserId");
         String imageTitle = paramsMap.getString("imageTitle");
-        String[] imageArr = (String[]) paramsMap.get("imageArr");
+        JSONArray imageArr = paramsMap.getJSONArray("imageArr");
         return imageService.saveImage(imageId, authUserId, imageTitle, imageArr);
     }
 
+    @ApiOperation("图片回显数据")
+    @ApiImplicitParam(name = "imageId", value = "图片id", required = true)
+    @GetMapping("/form/data")
+    public ResponseJson<ImageFormVo> getImageFormData(Integer imageId) {
+        return imageService.getImageFormData(imageId);
+    }
+
     @ApiOperation("更新图片状态")
     @ApiImplicitParam(name = "params", value = "imageId:图片id;status:图片状态:0停用 1启用;", required = true)
     @PostMapping("/update/status")

+ 31 - 1
src/main/java/com/caimei/controller/ShopApi.java

@@ -194,7 +194,7 @@ public class ShopApi {
             @ApiImplicitParam(name = "file", required = false, value = "代理声明文件"),
     })
     @PostMapping("/upload/file")
-    public ResponseJson<FileVo> uploadFile(Integer authUserId, Integer brandId, MultipartFile file) {
+    public ResponseJson<AuthFileVo> uploadFile(Integer authUserId, Integer brandId, MultipartFile file) {
         return shopService.uploadFile(authUserId, brandId, file);
     }
 
@@ -222,4 +222,34 @@ public class ShopApi {
     public ResponseJson<List<CountryVo>> getCountryList(){
         return shopService.getCountryList();
     }
+
+    @ApiOperation("用户反馈列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "authUserId", required = false, value = "供应商用户id"),
+            @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
+            @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
+    })
+    @GetMapping("/feedback/list")
+    public ResponseJson<PageInfo<FeedbackVo>> getFeedbackList(Integer authUserId,
+                                                              @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+                                                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){
+        return shopService.getFeedbackList(authUserId, pageNum, pageSize);
+    }
+
+    @ApiOperation("用户反馈表单数据")
+    @ApiImplicitParam(name = "feedbackId", required = false, value = "反馈id")
+    @GetMapping("/feedback/form/data")
+    public ResponseJson<FeedbackVo> getFeedbackFormData(Integer feedbackId){
+        return shopService.getFeedbackFormData(feedbackId);
+    }
+
+    @ApiOperation("处理用户反馈")
+    @ApiImplicitParam(name = "params", required = false, value = "feedbackId:反馈id;handleResult:处理结果")
+    @PostMapping("/feedback/handle")
+    public ResponseJson handleFeedback(@RequestBody String params){
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer feedbackId = paramsMap.getInteger("feedbackId");
+        String handleResult = paramsMap.getString("handleResult");
+        return shopService.handleFeedback(feedbackId, handleResult);
+    }
 }

+ 41 - 0
src/main/java/com/caimei/controller/UploadApi.java

@@ -1,11 +1,16 @@
 package com.caimei.controller;
 
 import com.caimei.config.FastDfsClient;
+import com.caimei.mapper.FileMapper;
+import com.caimei.model.po.FilePo;
+import com.caimei.utils.OSSUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,7 +18,9 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.annotation.Resource;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
@@ -33,6 +40,8 @@ public class UploadApi {
     private final FastDfsClient client;
     @Value("${caimei.imageDomain}")
     private String imageDomain;
+    @Value("${spring.profiles.active}")
+    private String active;
 
     /**
      * 上传图片
@@ -63,10 +72,42 @@ public class UploadApi {
         int index = originalFilename.lastIndexOf(".");
         String exet = originalFilename.substring(index);
         String filePath = "/mnt/newdatadrive/data/runtime/jar-instance/zplma/tempImage/";
+        if ("dev".equals(active)){
+            filePath = "D:\\uploadImage\\";
+        }
         filePath += "\\" + randomUUID + exet;
         file.transferTo(new File(filePath));
         logger.info(">>>>>>>>>>>>>>>>图片上传路径:" + filePath);
         return client.uploadFile(filePath);
     }
 
+    @ApiOperation("上传文件")
+    @ApiImplicitParam(name = "file", value = "文件", required = true)
+    @PostMapping("/file")
+    public Map<String, Object> uploadFile(MultipartFile file) throws IOException {
+        Map<String, Object> map = new HashMap<>(2);
+        String fileAllName = file.getOriginalFilename();
+        String fileType = fileAllName.substring(fileAllName.lastIndexOf(".") + 1);
+        String fileName = file.getResource().getFilename();
+        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
+        String filePath = uuid + "." + fileType;
+        String contentType = OSSUtils.getContentType(fileAllName);
+        log.info(">>>>>>>>>>>>>上传文件");
+        //保存本地
+        File uploadFile = OSSUtils.ossUpload(file);
+        //判断文件的唯一性,转换成16进制md5值
+        String md5Hex = DigestUtils.md5Hex(new FileInputStream(uploadFile));
+        //将文件上传oss
+        String url = OSSUtils.ossUpload(filePath, uploadFile, contentType);
+        if (StringUtils.isNotEmpty(url)) {
+            map.put("fileUrl", url);
+            map.put("msg", "上传成功");
+            logger.info(">>>>>>>>>>>>>>>>文件上传成功:" + url);
+        } else {
+            map.put("msg", "上传失败");
+            logger.info(">>>>>>>>>>>>>>>>文件上传失败:");
+        }
+        return map;
+    }
+
 }

+ 92 - 0
src/main/java/com/caimei/controller/VideoApi.java

@@ -0,0 +1,92 @@
+package com.caimei.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.VideoVo;
+import com.caimei.service.VideoService;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Map;
+
+/**
+ * 资料库视频API
+ *
+ * @author : Aslee
+ * @date : 2021/7/9
+ */
+@Api(tags = "资料库视频API")
+@Slf4j
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/data/video")
+public class VideoApi {
+
+    private final VideoService videoService;
+
+
+    @ApiOperation("视频列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "listType", required = false, value = "列表类型:1视频列表,2视频审核列表"),
+            @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
+            @ApiImplicitParam(name = "videoTitle", required = false, value = "视频标题"),
+            @ApiImplicitParam(name = "auditStatus", required = false, value = "审核状态:0审核未通过,1审核通过,2待审核"),
+            @ApiImplicitParam(name = "status", required = false, value = "视频状态:0已下线,1已上线,2待上线"),
+            @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
+            @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
+    })
+    @GetMapping("/list")
+    public ResponseJson<PageInfo<VideoVo>> getVideoList(Integer listType, Integer authUserId, String videoTitle, Integer auditStatus, Integer status,
+                                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+                                                            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
+        return videoService.getVideoList(listType, authUserId, videoTitle, auditStatus, status, pageNum, pageSize);
+    }
+
+    @ApiOperation("添加/编辑视频")
+    @ApiImplicitParam(name = "params", required = false, value = "videoId:视频id;authUserId:供应商用户id;videoTitle:视频标题;videoUrl:视频链接")
+    @PostMapping("/save")
+    public ResponseJson saveVideo(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer videoId = paramsMap.getInteger("videoId");
+        Integer authUserId = paramsMap.getInteger("authUserId");
+        String videoTitle = paramsMap.getString("videoTitle");
+        String videoUrl = paramsMap.getString("videoUrl");
+        return videoService.saveVideo(videoId, authUserId, videoTitle, videoUrl);
+    }
+
+    @ApiOperation("更新视频状态")
+    @ApiImplicitParam(name = "params", value = "videoId:视频id;status:视频状态:0停用 1启用;", required = true)
+    @PostMapping("/update/status")
+    public ResponseJson updateVideoStatus(@RequestBody Map<String,Integer> params) {
+        Integer videoId = params.get("videoId");
+        Integer status = params.get("status");
+        return videoService.updateVideoStatus(videoId, status);
+    }
+
+    @ApiOperation("删除视频")
+    @ApiImplicitParam(name = "params", value = "videoId:视频id", required = true)
+    @PostMapping("/delete")
+    public ResponseJson deleteVideo(@RequestBody Map<String,Integer> params) {
+        Integer videoId = params.get("videoId");
+        return videoService.deleteVideo(videoId);
+    }
+
+    @ApiOperation("审核视频")
+    @ApiImplicitParam(name = "params", value = "videoId:视频id;auditStatus:审核状态:0审核未通过,1审核通过,2待审核;invalidReason:审核不通过原因;auditBy:审核人用户id", required = true)
+    @PostMapping("/audit")
+    public ResponseJson auditVideo(@RequestBody String params) {
+        JSONObject paramsMap = JSONObject.parseObject(params);
+        Integer videoId = paramsMap.getInteger("videoId");
+        Integer auditStatus = paramsMap.getInteger("auditStatus");
+        String invalidReason = paramsMap.getString("invalidReason");
+        Integer auditBy = paramsMap.getInteger("auditBy");
+        return videoService.auditVideo(videoId, auditStatus, invalidReason, auditBy);
+    }
+}

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

@@ -1,6 +1,7 @@
 package com.caimei.mapper;
 
 import com.caimei.model.po.ArticlePo;
+import com.caimei.model.vo.ArticleFormVo;
 import com.caimei.model.vo.ArticleVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -28,4 +29,6 @@ public interface ArticleMapper {
     void deleteArticleByArticleId(Integer articleId);
 
     void updateArticleAuditStatus(@Param("articleId") Integer articleId, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus, @Param("invalidReason") String invalidReason, @Param("auditBy") Integer auditBy, @Param("auditTime") Date auditTime);
+
+    ArticleFormVo getArticleForm(Integer articleId);
 }

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

@@ -0,0 +1,33 @@
+package com.caimei.mapper;
+
+import com.caimei.model.po.FilePo;
+import com.caimei.model.vo.FileVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/8
+ */
+@Mapper
+public interface FileMapper {
+
+    List<FileVo> getFileList(Integer listType, @Param("authUserId") Integer authUserId, @Param("fileTitle") String fileTitle, @Param("auditStatus") Integer auditStatus, @Param("status") Integer status);
+
+    void insertFile(FilePo file);
+
+    void updateFileByFileId(FilePo file);
+
+    void updateFileStatusByFileId(@Param("fileId") Integer fileId, @Param("status") Integer status);
+
+    void deleteFileByFileId(Integer fileId);
+
+    void updateFileAuditStatus(@Param("fileId") Integer fileId, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus, @Param("invalidReason") String invalidReason, @Param("auditBy") Integer auditBy, @Param("auditTime") Date auditTime);
+
+    void updateFileSelective(FilePo file);
+}

+ 5 - 0
src/main/java/com/caimei/mapper/ImageMapper.java

@@ -1,6 +1,7 @@
 package com.caimei.mapper;
 
 import com.caimei.model.po.ImagePo;
+import com.caimei.model.vo.ImageFormVo;
 import com.caimei.model.vo.ImageVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -32,4 +33,8 @@ public interface ImageMapper {
     void deleteImageDetail(Integer imageId);
 
     void insertImageDetail(@Param("imageId") Integer imageId, @Param("image") String image);
+
+    ImageFormVo getImageForm(Integer imageId);
+
+    List<String> getImageListByImageId(Integer imageId);
 }

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

@@ -65,4 +65,10 @@ public interface ShopMapper {
     Integer getProductWaitAuditNum(Integer authUserId);
 
     Integer getProductCount(@Param("authUserId") Integer authUserId, @Param("brandId") Integer brandId);
+
+    List<FeedbackVo> getFeedbackList(Integer authUserId);
+
+    FeedbackVo getFeedback(Integer feedbackId);
+
+    void handleFeedback(@Param("feedbackId") Integer feedbackId, @Param("handleResult") String handleResult);
 }

+ 35 - 0
src/main/java/com/caimei/mapper/VideoMapper.java

@@ -0,0 +1,35 @@
+package com.caimei.mapper;
+
+import com.caimei.model.po.VideoPo;
+import com.caimei.model.vo.VideoVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/8
+ */
+@Mapper
+public interface VideoMapper {
+
+    List<VideoVo> getVideoList(Integer listType, @Param("authUserId") Integer authUserId, @Param("videoTitle") String videoTitle, @Param("auditStatus") Integer auditStatus, @Param("status") Integer status);
+
+    void insertVideo(VideoPo video);
+
+    void updateVideoByVideoId(VideoPo video);
+
+    void updateVideoStatusByVideoId(@Param("videoId") Integer videoId, @Param("status") Integer status);
+
+    void deleteVideoByVideoId(Integer videoId);
+
+    void updateVideoAuditStatus(@Param("videoId") Integer videoId, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus, @Param("invalidReason") String invalidReason, @Param("auditBy") Integer auditBy, @Param("auditTime") Date auditTime);
+
+    void updateVideoSelective(VideoPo video);
+
+    Integer getFileNumByMd5Hex(String md5Hex);
+}

+ 62 - 0
src/main/java/com/caimei/model/po/FilePo.java

@@ -0,0 +1,62 @@
+package com.caimei.model.po;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * cm_brand_file
+ * @author  Aslee
+ */
+@Data
+public class FilePo {
+    /**
+     * 文件id
+     */
+    private Integer id;
+
+    /**
+     * 供应商用户id
+     */
+    private Integer authUserId;
+
+    /**
+     * 文件标题
+     */
+    private String title;
+
+    /**
+     * 文件链接
+     */
+    private String url;
+
+    /**
+     * 审核状态:0审核未通过,1审核通过,2待审核
+     */
+    private Integer auditStatus;
+
+    /**
+     * 审核不通过原因
+     */
+    private String invalidReason;
+
+    /**
+     * 上线状态:0已下线,1已上线,2待上线
+     */
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 审核人用户id
+     */
+    private Integer auditBy;
+
+    /**
+     * 审核时间
+     */
+    private Date auditTime;
+}

+ 62 - 0
src/main/java/com/caimei/model/po/VideoPo.java

@@ -0,0 +1,62 @@
+package com.caimei.model.po;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * cm_brand_video
+ * @author  Aslee
+ */
+@Data
+public class VideoPo {
+    /**
+     * 视频id
+     */
+    private Integer id;
+
+    /**
+     * 供应商用户id
+     */
+    private Integer authUserId;
+
+    /**
+     * 视频标题
+     */
+    private String title;
+
+    /**
+     * 视频链接
+     */
+    private String url;
+
+    /**
+     * 审核状态:0审核未通过,1审核通过,2待审核
+     */
+    private Integer auditStatus;
+
+    /**
+     * 审核不通过原因
+     */
+    private String invalidReason;
+
+    /**
+     * 上线状态:0已下线,1已上线,2待上线
+     */
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 审核人用户id
+     */
+    private Integer auditBy;
+
+    /**
+     * 审核时间
+     */
+    private Date auditTime;
+}

+ 26 - 0
src/main/java/com/caimei/model/vo/ArticleFormVo.java

@@ -0,0 +1,26 @@
+package com.caimei.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * cm_brand_article
+ * @author Aslee
+ * @date 2021/7/8
+ */
+@Data
+public class ArticleFormVo {
+    @ApiModelProperty("文章id")
+    private Integer articleId;
+
+    @ApiModelProperty("文章标题")
+    private String articleTitle;
+
+    @ApiModelProperty("文章图片")
+    private String articleImage;
+
+    @ApiModelProperty("文章内容")
+    private String articleContent;
+}

+ 20 - 0
src/main/java/com/caimei/model/vo/AuthFileVo.java

@@ -0,0 +1,20 @@
+package com.caimei.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * cm_brand_auth
+ * @author Aslee
+ * @date 2021/5/17
+ */
+@Data
+public class AuthFileVo {
+    @ApiModelProperty("文件id")
+    private Integer fileId;
+
+    @ApiModelProperty("文件名称")
+    private String fileName;
+}

+ 38 - 0
src/main/java/com/caimei/model/vo/FeedbackVo.java

@@ -0,0 +1,38 @@
+package com.caimei.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * cm_brand_club_feedback
+ * @author Aslee
+ * @date 2021/5/17
+ */
+@Data
+public class FeedbackVo {
+    @ApiModelProperty("反馈id")
+    private Integer feedbackId;
+
+    @ApiModelProperty("机构名称")
+    private String clubName;
+
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    @ApiModelProperty("反馈内容")
+    private String content;
+
+    @ApiModelProperty("提交时间")
+    private Date commitTime;
+
+    @ApiModelProperty("处理状态:0未处理,1已处理")
+    private Integer handleStatus;
+
+    @ApiModelProperty("处理结果")
+    private String handleResult;
+
+    @ApiModelProperty("处理时间")
+    private Date handleTime;
+}

+ 25 - 4
src/main/java/com/caimei/model/vo/FileVo.java

@@ -6,15 +6,36 @@ import lombok.Data;
 import java.util.Date;
 
 /**
- * cm_brand_auth
+ * cm_brand_file
  * @author Aslee
- * @date 2021/5/17
+ * @date 2021/7/8
  */
 @Data
 public class FileVo {
     @ApiModelProperty("文件id")
     private Integer fileId;
 
-    @ApiModelProperty("文件名称")
-    private String fileName;
+    @ApiModelProperty("文件标题")
+    private String fileTitle;
+
+    @ApiModelProperty("文件链接")
+    private String fileUrl;
+
+    @ApiModelProperty("审核状态:0审核未通过,1审核通过,2待审核")
+    private Integer auditStatus;
+
+    @ApiModelProperty("审核不通过原因")
+    private String invalidReason;
+
+    @ApiModelProperty("上线状态:0已下线,1已上线,2待上线")
+    private Integer status;
+
+    @ApiModelProperty("创建时间")
+    private Date createTime;
+
+    @ApiModelProperty("审核人")
+    private String auditBy;
+
+    @ApiModelProperty("审核时间")
+    private Date auditTime;
 }

+ 25 - 0
src/main/java/com/caimei/model/vo/ImageFormVo.java

@@ -0,0 +1,25 @@
+package com.caimei.model.vo;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * cm_brand_image
+ * @author Aslee
+ * @date 2021/7/8
+ */
+@Data
+public class ImageFormVo {
+    @ApiModelProperty("图片id")
+    private Integer imageId;
+
+    @ApiModelProperty("图片标题")
+    private String imageTitle;
+
+    @ApiModelProperty("图片详情列表")
+    private List<String> imageList;
+}

+ 41 - 0
src/main/java/com/caimei/model/vo/VideoVo.java

@@ -0,0 +1,41 @@
+package com.caimei.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * cm_brand_video
+ * @author Aslee
+ * @date 2021/7/8
+ */
+@Data
+public class VideoVo {
+    @ApiModelProperty("视频id")
+    private Integer videoId;
+
+    @ApiModelProperty("视频标题")
+    private String videoTitle;
+
+    @ApiModelProperty("视频链接")
+    private String videoUrl;
+
+    @ApiModelProperty("审核状态:0审核未通过,1审核通过,2待审核")
+    private Integer auditStatus;
+
+    @ApiModelProperty("审核不通过原因")
+    private String invalidReason;
+
+    @ApiModelProperty("上线状态:0已下线,1已上线,2待上线")
+    private Integer status;
+
+    @ApiModelProperty("创建时间")
+    private Date createTime;
+
+    @ApiModelProperty("审核人")
+    private String auditBy;
+
+    @ApiModelProperty("审核时间")
+    private Date auditTime;
+}

+ 8 - 0
src/main/java/com/caimei/service/ArticleService.java

@@ -1,6 +1,7 @@
 package com.caimei.service;
 
 import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.ArticleFormVo;
 import com.caimei.model.vo.ArticleVo;
 import com.github.pagehelper.PageInfo;
 
@@ -61,4 +62,11 @@ public interface ArticleService {
      * @return
      */
     ResponseJson auditArticle(Integer articleId, Integer auditStatus, String invalidReason, Integer auditBy);
+
+    /**
+     * 文章回显数据
+     * @param articleId     文章id
+     * @return
+     */
+    ResponseJson<ArticleFormVo> getArticleFormData(Integer articleId);
 }

+ 64 - 0
src/main/java/com/caimei/service/FileService.java

@@ -0,0 +1,64 @@
+package com.caimei.service;
+
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.FileVo;
+import com.github.pagehelper.PageInfo;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/8
+ */
+public interface FileService {
+
+    /**
+     * 获取文件列表
+     *
+     * @param listType      列表类型:1文件列表,2文件审核列表
+     * @param authUserId    供应商用户id
+     * @param fileTitle    文件标题
+     * @param auditStatus   审核状态
+     * @param status        上线状态
+     * @param pageNum       第几页
+     * @param pageSize      一页多少条
+     * @return  FileVo
+     */
+    ResponseJson<PageInfo<FileVo>> getFileList(Integer listType, Integer authUserId, String fileTitle, Integer auditStatus, Integer status, Integer pageNum, Integer pageSize);
+
+    /**
+     * 添加/编辑文件
+     * @param fileId           文件id
+     * @param authUserId        供应商用户id
+     * @param fileTitle        文件标题
+     * @param fileUrl             文件链接
+     * @return  ResponseJson
+     */
+    ResponseJson saveFile(Integer fileId, Integer authUserId, String fileTitle, String fileUrl);
+
+    /**
+     * 更新文件状态
+     * @param fileId       文件id
+     * @param status        文件状态:0停用 1启用
+     * @return  ResponseJson
+     */
+    ResponseJson updateFileStatus(Integer fileId, Integer status);
+
+    /**
+     * 删除文件
+     * @param fileId     文件id
+     * @return  ResponseJson
+     */
+    ResponseJson deleteFile(Integer fileId);
+
+    /**
+     * 审核文件
+     * @param fileId           文件id
+     * @param auditStatus       审核状态:0审核未通过,1审核通过,2待审核
+     * @param invalidReason     审核不通过原因
+     * @param auditBy           审核人用户id
+     * @return
+     */
+    ResponseJson auditFile(Integer fileId, Integer auditStatus, String invalidReason, Integer auditBy);
+
+}

+ 10 - 1
src/main/java/com/caimei/service/ImageService.java

@@ -1,6 +1,8 @@
 package com.caimei.service;
 
+import com.alibaba.fastjson.JSONArray;
 import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.ImageFormVo;
 import com.caimei.model.vo.ImageVo;
 import com.github.pagehelper.PageInfo;
 
@@ -34,7 +36,7 @@ public interface ImageService {
      * @param imageArr          图片数组
      * @return  ResponseJson
      */
-    ResponseJson saveImage(Integer imageId, Integer authUserId, String imageTitle, String[] imageArr);
+    ResponseJson saveImage(Integer imageId, Integer authUserId, String imageTitle, JSONArray imageArr);
 
     /**
      * 更新图片状态
@@ -60,4 +62,11 @@ public interface ImageService {
      * @return
      */
     ResponseJson auditImage(Integer imageId, Integer auditStatus, String invalidReason, Integer auditBy);
+
+    /**
+     * 图片回显数据
+     * @param imageId   图片id
+     * @return
+     */
+    ResponseJson<ImageFormVo> getImageFormData(Integer imageId);
 }

+ 25 - 0
src/main/java/com/caimei/service/SDKService.java

@@ -0,0 +1,25 @@
+package com.caimei.service;
+
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.FileVo;
+import com.github.pagehelper.PageInfo;
+
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/14
+ */
+public interface SDKService {
+
+    /**
+     * 获取公众号配置数据
+     * @param appId         公众号appId
+     * @param appSecret     公众号appSecret
+     * @param url           公众号url
+     * @return
+     */
+    ResponseJson<Map<String, String>> getConfigData(String appId, String appSecret, String url);
+}

+ 25 - 1
src/main/java/com/caimei/service/ShopService.java

@@ -55,7 +55,7 @@ public interface ShopService {
      * @param file       上传文件
      * @return
      */
-    ResponseJson<FileVo> uploadFile(Integer authUserId, Integer brandId, MultipartFile file);
+    ResponseJson<AuthFileVo> uploadFile(Integer authUserId, Integer brandId, MultipartFile file);
 
     /**
      * 添加供应商
@@ -105,4 +105,28 @@ public interface ShopService {
      * @return CountryVo
      */
     ResponseJson<List<CountryVo>> getCountryList();
+
+    /**
+     * 用户反馈列表
+     * @param authUserId    供应商用户id
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    ResponseJson<PageInfo<FeedbackVo>> getFeedbackList(Integer authUserId, Integer pageNum, Integer pageSize);
+
+    /**
+     * 用户反馈表单数据
+     * @param feedbackId    反馈id
+     * @return
+     */
+    ResponseJson<FeedbackVo> getFeedbackFormData(Integer feedbackId);
+
+    /**
+     * 处理用户反馈
+     * @param feedbackId    反馈id
+     * @param handleResult  处理结果
+     * @return
+     */
+    ResponseJson handleFeedback(Integer feedbackId, String handleResult);
 }

+ 64 - 0
src/main/java/com/caimei/service/VideoService.java

@@ -0,0 +1,64 @@
+package com.caimei.service;
+
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.VideoVo;
+import com.github.pagehelper.PageInfo;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/8
+ */
+public interface VideoService {
+
+    /**
+     * 获取视频列表
+     *
+     * @param listType      列表类型:1视频列表,2视频审核列表
+     * @param authUserId    供应商用户id
+     * @param videoTitle    视频标题
+     * @param auditStatus   审核状态
+     * @param status        上线状态
+     * @param pageNum       第几页
+     * @param pageSize      一页多少条
+     * @return  VideoVo
+     */
+    ResponseJson<PageInfo<VideoVo>> getVideoList(Integer listType, Integer authUserId, String videoTitle, Integer auditStatus, Integer status, Integer pageNum, Integer pageSize);
+
+    /**
+     * 添加/编辑视频
+     * @param videoId           视频id
+     * @param authUserId        供应商用户id
+     * @param videoTitle        视频标题
+     * @param videoUrl             视频链接
+     * @return  ResponseJson
+     */
+    ResponseJson saveVideo(Integer videoId, Integer authUserId, String videoTitle, String videoUrl);
+
+    /**
+     * 更新视频状态
+     * @param videoId       视频id
+     * @param status        视频状态:0停用 1启用
+     * @return  ResponseJson
+     */
+    ResponseJson updateVideoStatus(Integer videoId, Integer status);
+
+    /**
+     * 删除视频
+     * @param videoId     视频id
+     * @return  ResponseJson
+     */
+    ResponseJson deleteVideo(Integer videoId);
+
+    /**
+     * 审核视频
+     * @param videoId           视频id
+     * @param auditStatus       审核状态:0审核未通过,1审核通过,2待审核
+     * @param invalidReason     审核不通过原因
+     * @param auditBy           审核人用户id
+     * @return
+     */
+    ResponseJson auditVideo(Integer videoId, Integer auditStatus, String invalidReason, Integer auditBy);
+
+}

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

@@ -3,6 +3,7 @@ package com.caimei.service.impl;
 import com.caimei.mapper.ArticleMapper;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.po.ArticlePo;
+import com.caimei.model.vo.ArticleFormVo;
 import com.caimei.model.vo.ArticleVo;
 import com.caimei.service.ArticleService;
 import com.github.pagehelper.PageHelper;
@@ -42,7 +43,7 @@ public class ArticleServiceImpl implements ArticleService {
 
     @Override
     public ResponseJson saveArticle(Integer articleId, Integer authUserId, String articleTitle, String articleImage, String articleContent) {
-        if (null == authUserId) {
+        if (null == articleId && null == authUserId) {
             return ResponseJson.error("参数异常,请输入供应商用户id");
         }
         if (StringUtils.isEmpty(articleTitle)) {
@@ -89,9 +90,9 @@ public class ArticleServiceImpl implements ArticleService {
         }
         articleMapper.updateArticleStatusByArticleId(articleId, status);
         if (0 == status) {
-            return ResponseJson.success("下线品牌授权成功");
+            return ResponseJson.success("下线文章成功");
         } else {
-            return ResponseJson.success("上线品牌授权成功");
+            return ResponseJson.success("上线文章成功");
         }
     }
 
@@ -114,7 +115,7 @@ public class ArticleServiceImpl implements ArticleService {
             return ResponseJson.error("请输入审核结果");
         }
         if (0 == auditStatus && StringUtils.isEmpty(invalidReason)) {
-            return ResponseJson.error("请输入审核不通过的理由");
+            return ResponseJson.error("请输入审核不通过的原因");
         }
         if (null == auditBy) {
             return ResponseJson.error("请输入审核人用户id");
@@ -132,4 +133,13 @@ public class ArticleServiceImpl implements ArticleService {
         articleMapper.updateArticleAuditStatus(articleId, status, auditStatus, invalidReason, auditBy, auditTime);
         return ResponseJson.success("审核文章成功");
     }
+
+    @Override
+    public ResponseJson<ArticleFormVo> getArticleFormData(Integer articleId) {
+        if (null == articleId) {
+            return ResponseJson.error("请输入文章id", null);
+        }
+        ArticleFormVo article = articleMapper.getArticleForm(articleId);
+        return ResponseJson.success(article);
+    }
 }

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

@@ -284,7 +284,7 @@ public class AuthProductServiceImpl implements AuthProductService {
             return ResponseJson.error("请输入审核结果");
         }
         if (auditStatus == 0 && StringUtils.isEmpty(invalidReason)) {
-            return ResponseJson.error("请输入审核不通过的理由");
+            return ResponseJson.error("请输入审核不通过的原因");
         }
         if (auditBy == null) {
             return ResponseJson.error("请输入审核人用户id");

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

@@ -53,12 +53,12 @@ public class AuthServiceImpl implements AuthService {
             Integer waitAuditNum = auth.getWaitAuditNum();
             if (waitAuditNum > 0) {
                 auth.setLowerAuditStatus(0);
-                if ( 1 == lowerAuditStatus) {
+                if (null != lowerAuditStatus && 1 == lowerAuditStatus) {
                     iterator.remove();
                 }
             } else {
                 auth.setLowerAuditStatus(1);
-                if ( 0 == lowerAuditStatus) {
+                if (null != lowerAuditStatus && 0 == lowerAuditStatus) {
                     iterator.remove();
                 }
             }
@@ -147,7 +147,7 @@ public class AuthServiceImpl implements AuthService {
             return ResponseJson.error("请输入审核结果");
         }
         if (auditStatus == 0 && StringUtils.isEmpty(invalidReason)) {
-            return ResponseJson.error("请输入审核不通过的理由");
+            return ResponseJson.error("请输入审核不通过的原因");
         }
         if (auditBy == null) {
             return ResponseJson.error("请输入审核人用户id");

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

@@ -0,0 +1,155 @@
+package com.caimei.service.impl;
+
+import com.caimei.mapper.FileMapper;
+import com.caimei.model.ResponseJson;
+import com.caimei.model.po.FilePo;
+import com.caimei.model.vo.FileVo;
+import com.caimei.service.FileService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+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;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/9
+ */
+@Slf4j
+@Service
+public class FileServiceImpl implements FileService {
+
+    @Resource
+    private FileMapper fileMapper;
+
+    @Value("${aliyunConfig.accessKeyId}")
+    private String accessKeyId;
+
+    @Value("${aliyunConfig.accessKeySecret}")
+    private String accessKeySecret;
+
+    @Value("${aliyunConfig.bucketName}")
+    private String bucketName;
+
+    @Value("${aliyunConfig.endpoint}")
+    private String endpoint;
+
+    @Value("${spring.profiles.active}")
+    private String active;
+
+    @Override
+    public ResponseJson<PageInfo<FileVo>> getFileList(Integer listType, Integer authUserId, String fileTitle, Integer auditStatus, Integer status, Integer pageNum, Integer pageSize) {
+        if (null == authUserId) {
+            return ResponseJson.error("参数异常,请输入供应商用户id", null);
+        }
+        listType = null == listType ? 1 : listType;
+        PageHelper.startPage(pageNum, pageSize);
+        List<FileVo> fileList = fileMapper.getFileList(listType, authUserId, fileTitle, auditStatus, status);
+        PageInfo<FileVo> pageData = new PageInfo<>(fileList);
+        return ResponseJson.success(pageData);
+    }
+
+    @Override
+    public ResponseJson saveFile(Integer fileId, Integer authUserId, String fileTitle, String fileUrl) {
+        if (null == fileId && null == authUserId) {
+            return ResponseJson.error("参数异常,请输入供应商用户id");
+        }
+        if (StringUtils.isEmpty(fileTitle)) {
+            return ResponseJson.error("参数异常,请输入文件标题");
+        }
+        if (null == fileUrl) {
+            return ResponseJson.error("参数异常,请上传文件");
+        }
+        /*
+            组装文件数据
+        */
+        FilePo dataFile = new FilePo();
+        if (null != fileId) {
+            /*
+                更新文件
+             */
+            dataFile.setId(fileId);
+            dataFile.setTitle(fileTitle);
+            dataFile.setUrl(fileUrl);
+            // 上线状态默认为“待上线”,审核状态为“待审核”
+            dataFile.setStatus(2);
+            dataFile.setAuditStatus(2);
+            fileMapper.updateFileSelective(dataFile);
+        } else {
+                /*
+                    新增文件
+                 */
+            dataFile.setAuthUserId(authUserId);
+            dataFile.setTitle(fileTitle);
+            dataFile.setUrl(fileUrl);
+            dataFile.setCreateTime(new Date());
+            // 上线状态默认为“待上线”,审核状态为“待审核”
+            dataFile.setStatus(2);
+            dataFile.setAuditStatus(2);
+            fileMapper.insertFile(dataFile);
+        }
+        return ResponseJson.success("保存文件成功");
+    }
+
+    @Override
+    public ResponseJson updateFileStatus(Integer fileId, Integer status) {
+        if (null == fileId) {
+            return ResponseJson.error("请输入文件id");
+        }
+        if (null == status) {
+            return ResponseJson.error("请输入要更新的状态值");
+        }
+        fileMapper.updateFileStatusByFileId(fileId, status);
+        if (0 == status) {
+            return ResponseJson.success("下线文件成功");
+        } else {
+            return ResponseJson.success("上线文件成功");
+        }
+    }
+
+    @Override
+    public ResponseJson deleteFile(Integer fileId) {
+        if (null == fileId) {
+            return ResponseJson.error("参数异常,请输入文件id");
+        }
+        // 删除文件
+        fileMapper.deleteFileByFileId(fileId);
+        return ResponseJson.success("删除文件成功");
+    }
+
+    @Override
+    public ResponseJson auditFile(Integer fileId, Integer auditStatus, String invalidReason, Integer auditBy) {
+        if (null == fileId) {
+            return ResponseJson.error("请输入文件id");
+        }
+        if (null == auditStatus) {
+            return ResponseJson.error("请输入审核结果");
+        }
+        if (0 == auditStatus && StringUtils.isEmpty(invalidReason)) {
+            return ResponseJson.error("请输入审核不通过的原因");
+        }
+        if (null == auditBy) {
+            return ResponseJson.error("请输入审核人用户id");
+        }
+        Date auditTime = new Date();
+        // 授权状态更新
+        Integer status = null;
+        if (0 == auditStatus) {
+            // 审核不通过,下线文件
+            status = 0;
+        } else {
+            // 审核通过,上线文件
+            status = 1;
+        }
+        fileMapper.updateFileAuditStatus(fileId, status, auditStatus, invalidReason, auditBy, auditTime);
+        return ResponseJson.success("审核文件成功");
+    }
+
+}

+ 24 - 8
src/main/java/com/caimei/service/impl/ImageServiceImpl.java

@@ -1,8 +1,10 @@
 package com.caimei.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
 import com.caimei.mapper.ImageMapper;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.po.ImagePo;
+import com.caimei.model.vo.ImageFormVo;
 import com.caimei.model.vo.ImageVo;
 import com.caimei.service.ImageService;
 import com.github.pagehelper.PageHelper;
@@ -41,14 +43,14 @@ public class ImageServiceImpl implements ImageService {
     }
 
     @Override
-    public ResponseJson saveImage(Integer imageId, Integer authUserId, String imageTitle, String[] imageArr) {
-        if (null == authUserId) {
+    public ResponseJson saveImage(Integer imageId, Integer authUserId, String imageTitle, JSONArray imageArr) {
+        if (null == imageId && null == authUserId) {
             return ResponseJson.error("参数异常,请输入供应商用户id");
         }
         if (StringUtils.isEmpty(imageTitle)) {
             return ResponseJson.error("参数异常,请输入图片标题");
         }
-        if (null == imageArr || imageArr.length <= 0) {
+        if (null == imageArr || imageArr.size() <= 0) {
             return ResponseJson.error("参数异常,请上传图片");
         }
         /*
@@ -72,8 +74,8 @@ public class ImageServiceImpl implements ImageService {
             imageMapper.deleteImageDetail(imageId);
         }
         // 保存图片详情
-        for (String s : imageArr) {
-            imageMapper.insertImageDetail(image.getId(), s);
+        for (Object s : imageArr) {
+            imageMapper.insertImageDetail(image.getId(), s.toString());
         }
         return ResponseJson.success("保存图片成功");
     }
@@ -88,9 +90,9 @@ public class ImageServiceImpl implements ImageService {
         }
         imageMapper.updateImageStatusByImageId(imageId, status);
         if (0 == status) {
-            return ResponseJson.success("下线品牌授权成功");
+            return ResponseJson.success("下线图片成功");
         } else {
-            return ResponseJson.success("上线品牌授权成功");
+            return ResponseJson.success("上线图片成功");
         }
     }
 
@@ -115,7 +117,7 @@ public class ImageServiceImpl implements ImageService {
             return ResponseJson.error("请输入审核结果");
         }
         if (0 == auditStatus && StringUtils.isEmpty(invalidReason)) {
-            return ResponseJson.error("请输入审核不通过的理由");
+            return ResponseJson.error("请输入审核不通过的原因");
         }
         if (null == auditBy) {
             return ResponseJson.error("请输入审核人用户id");
@@ -133,4 +135,18 @@ public class ImageServiceImpl implements ImageService {
         imageMapper.updateImageAuditStatus(imageId, status, auditStatus, invalidReason, auditBy, auditTime);
         return ResponseJson.success("审核图片成功");
     }
+
+    @Override
+    public ResponseJson<ImageFormVo> getImageFormData(Integer imageId) {
+        if (null == imageId) {
+            return ResponseJson.error("参数异常,请输入图片id", null);
+        }
+        ImageFormVo image = imageMapper.getImageForm(imageId);
+        if (null == image) {
+            return ResponseJson.error("图片不存在", null);
+        }
+        List<String> imageList = imageMapper.getImageListByImageId(imageId);
+        image.setImageList(imageList);
+        return ResponseJson.success(image);
+    }
 }

+ 64 - 0
src/main/java/com/caimei/service/impl/SDKServiceImpl.java

@@ -0,0 +1,64 @@
+package com.caimei.service.impl;
+
+import com.caimei.mapper.VideoMapper;
+import com.caimei.model.ResponseJson;
+import com.caimei.model.po.VideoPo;
+import com.caimei.model.vo.VideoVo;
+import com.caimei.service.SDKService;
+import com.caimei.service.VideoService;
+import com.caimei.utils.CodeUtil;
+import com.caimei.utils.SHA1;
+import com.caimei.utils.WxUtils;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+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;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/14
+ */
+@Slf4j
+@Service
+public class SDKServiceImpl implements SDKService {
+
+    @Override
+    public ResponseJson<Map<String, String>> getConfigData(String appId, String appSecret, String url) {
+        if (StringUtils.isEmpty(appId)) {
+            return ResponseJson.error("参数异常,请输入appId", null);
+        }
+        if (StringUtils.isEmpty(appSecret)) {
+            return ResponseJson.error("参数异常,请输入appSecret", null);
+        }
+        if (StringUtils.isEmpty(url)) {
+            return ResponseJson.error("参数异常,请输入url", null);
+        }
+        // 获取accessToken
+        String accessToken = WxUtils.getAccessToken(appId, appSecret);
+        // 获取jsapiTicket
+        Map<String, String> ticketMap = WxUtils.getJsapiTicket(accessToken);
+        String ticket = ticketMap.get("ticket");
+        // 生成noncestr(随机字符串)和timestamp(时间戳)
+        String noncestr = CodeUtil.getRandomCharAndNumr(8);
+        String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
+        String signStr = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "&timestamp=" + timestamp + "&url=" + url;
+        String signature = SHA1.getSHA1(signStr);
+        Map<String, String> map = new HashMap<>(5);
+        map.put("timestamp", timestamp);
+        map.put("accessToken", accessToken);
+        map.put("ticket", ticket);
+        map.put("noncestr", noncestr);
+        map.put("signature", signature);
+        return ResponseJson.success(map);
+    }
+}

+ 44 - 5
src/main/java/com/caimei/service/impl/ShopServiceImpl.java

@@ -13,6 +13,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -101,7 +102,7 @@ public class ShopServiceImpl implements ShopService {
     }
 
     @Override
-    public ResponseJson<FileVo> uploadFile(Integer authUserId, Integer brandId, MultipartFile file) {
+    public ResponseJson<AuthFileVo> uploadFile(Integer authUserId, Integer brandId, MultipartFile file) {
         authUserId = (null != authUserId && authUserId > 0) ? authUserId : null;
         String fileAllName = file.getOriginalFilename();
         String fileType = fileAllName.substring(fileAllName.lastIndexOf(".") + 1);
@@ -130,8 +131,14 @@ public class ShopServiceImpl implements ShopService {
                 if (null != authUserId) {
                     deleteFile(authUserId, brandId);
                 }
-                //将新文件上传oss
-                OSSUtils.ossUpload(filePath, uploadFile, contentType);
+                // 查找oss中是否已存在该文件,若存在则不需要重新上传
+                CmBrandAuthFilePo searchFile = new CmBrandAuthFilePo();
+                searchFile.setMd5Hex(md5Hex);
+                CmBrandAuthFilePo sameFile = shopMapper.getStatementFile(searchFile);
+                if (null == sameFile) {
+                    //将新文件上传oss
+                    OSSUtils.ossUpload(filePath, uploadFile, contentType);
+                }
                 //删除本地文件
                 OSSUtils.deleteFile(uploadFile);
                 //保存关联关系
@@ -139,7 +146,7 @@ public class ShopServiceImpl implements ShopService {
                 cmBrandAuthFile.setAuthUserId(authUserId);
                 cmBrandAuthFile.setBrandId(brandId);
                 cmBrandAuthFile.setName(fileName);
-                cmBrandAuthFile.setOssName(filePath);
+                cmBrandAuthFile.setOssName(null == sameFile ? filePath : sameFile.getOssName());
                 cmBrandAuthFile.setMd5Hex(md5Hex);
                 cmBrandAuthFile.setUploadTime(new Date());
                 shopMapper.insertStatementFile(cmBrandAuthFile);
@@ -147,7 +154,7 @@ public class ShopServiceImpl implements ShopService {
                 //删除本地文件
                 OSSUtils.deleteFile(uploadFile);
             }
-            FileVo fileVo = new FileVo();
+            AuthFileVo fileVo = new AuthFileVo();
             fileVo.setFileId(cmBrandAuthFile.getId());
             fileVo.setFileName(cmBrandAuthFile.getName());
             return ResponseJson.success("文件上传成功", fileVo);
@@ -342,4 +349,36 @@ public class ShopServiceImpl implements ShopService {
         List<CountryVo> countryList =  shopMapper.getCountryList();
         return ResponseJson.success(countryList);
     }
+
+    @Override
+    public ResponseJson<PageInfo<FeedbackVo>> getFeedbackList(Integer authUserId, Integer pageNum, Integer pageSize) {
+        if (null == authUserId) {
+            return ResponseJson.error("参数异常,请输入供应商用户id", null);
+        }
+        PageHelper.startPage(pageNum, pageSize);
+        List<FeedbackVo> feedbackList = shopMapper.getFeedbackList(authUserId);
+        PageInfo<FeedbackVo> pageData = new PageInfo<>(feedbackList);
+        return ResponseJson.success(pageData);
+    }
+
+    @Override
+    public ResponseJson<FeedbackVo> getFeedbackFormData(Integer feedbackId) {
+        if (null == feedbackId) {
+            return ResponseJson.error("参数异常,请输入用户反馈id", null);
+        }
+        FeedbackVo feedback = shopMapper.getFeedback(feedbackId);
+        return ResponseJson.success(feedback);
+    }
+
+    @Override
+    public ResponseJson handleFeedback(Integer feedbackId, String handleResult) {
+        if (null == feedbackId) {
+            return ResponseJson.error("参数异常,请输入用户反馈id", null);
+        }
+        if (StringUtils.isEmpty(handleResult)) {
+            return ResponseJson.error("参数异常,请输入用户反馈处理结果", null);
+        }
+        shopMapper.handleFeedback(feedbackId, handleResult);
+        return ResponseJson.success("处理成功");
+    }
 }

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

@@ -0,0 +1,154 @@
+package com.caimei.service.impl;
+
+import com.caimei.mapper.VideoMapper;
+import com.caimei.model.ResponseJson;
+import com.caimei.model.po.VideoPo;
+import com.caimei.model.vo.VideoVo;
+import com.caimei.service.VideoService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+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;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/7/9
+ */
+@Slf4j
+@Service
+public class VideoServiceImpl implements VideoService {
+
+    @Resource
+    private VideoMapper videoMapper;
+
+    @Value("${aliyunConfig.accessKeyId}")
+    private String accessKeyId;
+
+    @Value("${aliyunConfig.accessKeySecret}")
+    private String accessKeySecret;
+
+    @Value("${aliyunConfig.bucketName}")
+    private String bucketName;
+
+    @Value("${aliyunConfig.endpoint}")
+    private String endpoint;
+
+    @Value("${spring.profiles.active}")
+    private String active;
+
+    @Override
+    public ResponseJson<PageInfo<VideoVo>> getVideoList(Integer listType, Integer authUserId, String videoTitle, Integer auditStatus, Integer status, Integer pageNum, Integer pageSize) {
+        if (null == authUserId) {
+            return ResponseJson.error("参数异常,请输入供应商用户id", null);
+        }
+        listType = null == listType ? 1 : listType;
+        PageHelper.startPage(pageNum, pageSize);
+        List<VideoVo> videoList = videoMapper.getVideoList(listType, authUserId, videoTitle, auditStatus, status);
+        PageInfo<VideoVo> pageData = new PageInfo<>(videoList);
+        return ResponseJson.success(pageData);
+    }
+
+    @Override
+    public ResponseJson saveVideo(Integer videoId, Integer authUserId, String videoTitle, String videoUrl) {
+        if (null == videoId && null == authUserId) {
+            return ResponseJson.error("参数异常,请输入供应商用户id");
+        }
+        if (StringUtils.isEmpty(videoTitle)) {
+            return ResponseJson.error("参数异常,请输入视频标题");
+        }
+        if (null == videoUrl) {
+            return ResponseJson.error("参数异常,请上传视频");
+        }
+        /*
+            组装视频数据
+        */
+        VideoPo video = new VideoPo();
+        if (null != videoId) {
+            /*
+                更新视频
+             */
+            video.setId(videoId);
+            video.setTitle(videoTitle);
+            video.setUrl(videoUrl);
+            // 上线状态默认为“待上线”,审核状态为“待审核”
+            video.setStatus(2);
+            video.setAuditStatus(2);
+            videoMapper.updateVideoSelective(video);
+        } else {
+                /*
+                    新增视频
+                 */
+            video.setAuthUserId(authUserId);
+            video.setTitle(videoTitle);
+            video.setUrl(videoUrl);
+            video.setCreateTime(new Date());
+            // 上线状态默认为“待上线”,审核状态为“待审核”
+            video.setStatus(2);
+            video.setAuditStatus(2);
+            videoMapper.insertVideo(video);
+        }
+        return ResponseJson.success("保存视频成功");
+    }
+
+    @Override
+    public ResponseJson updateVideoStatus(Integer videoId, Integer status) {
+        if (null == videoId) {
+            return ResponseJson.error("请输入视频id");
+        }
+        if (null == status) {
+            return ResponseJson.error("请输入要更新的状态值");
+        }
+        videoMapper.updateVideoStatusByVideoId(videoId, status);
+        if (0 == status) {
+            return ResponseJson.success("下线视频成功");
+        } else {
+            return ResponseJson.success("上线视频成功");
+        }
+    }
+
+    @Override
+    public ResponseJson deleteVideo(Integer videoId) {
+        if (null == videoId) {
+            return ResponseJson.error("参数异常,请输入视频id");
+        }
+        // 删除视频
+        videoMapper.deleteVideoByVideoId(videoId);
+        return ResponseJson.success("删除视频成功");
+    }
+
+    @Override
+    public ResponseJson auditVideo(Integer videoId, Integer auditStatus, String invalidReason, Integer auditBy) {
+        if (null == videoId) {
+            return ResponseJson.error("请输入视频id");
+        }
+        if (null == auditStatus) {
+            return ResponseJson.error("请输入审核结果");
+        }
+        if (0 == auditStatus && StringUtils.isEmpty(invalidReason)) {
+            return ResponseJson.error("请输入审核不通过的原因");
+        }
+        if (null == auditBy) {
+            return ResponseJson.error("请输入审核人用户id");
+        }
+        Date auditTime = new Date();
+        // 授权状态更新
+        Integer status = null;
+        if (0 == auditStatus) {
+            // 审核不通过,下线视频
+            status = 0;
+        } else {
+            // 审核通过,上线视频
+            status = 1;
+        }
+        videoMapper.updateVideoAuditStatus(videoId, status, auditStatus, invalidReason, auditBy, auditTime);
+        return ResponseJson.success("审核视频成功");
+    }
+}

+ 48 - 0
src/main/java/com/caimei/utils/SHA1.java

@@ -0,0 +1,48 @@
+package com.caimei.utils;
+/**
+ * 对公众平台发送给公众账号的消息加解密示例代码.
+ * 
+ * @copyright Copyright (c) 1998-2014 Tencent Inc.
+ */
+
+// ------------------------------------------------------------------------
+
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
+
+/**
+ * SHA1 class
+ *
+ * 计算公众平台的消息签名接口.
+ */
+public class SHA1 {
+
+	/**
+	 * 用SHA1算法生成安全签名
+	 * @param signStr  签名
+	 * @return 安全签名
+	 * @throws
+	 */
+	public static String getSHA1(String signStr) {
+		char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+				'a', 'b', 'c', 'd', 'e', 'f' };
+		try {
+			MessageDigest mdTemp = MessageDigest.getInstance("SHA1");
+			mdTemp.update(signStr.getBytes("UTF-8"));
+			byte[] md = mdTemp.digest();
+			int j = md.length;
+			char[] buf = new char[j * 2];
+			int k = 0;
+			for (int i = 0; i < j; i++) {
+				byte byte0 = md[i];
+				buf[k++] = hexDigits[byte0 >>> 4 & 0xf];
+				buf[k++] = hexDigits[byte0 & 0xf];
+			}
+			return new String(buf);
+		} catch (Exception e) {
+			return null;
+		}
+	}
+}

+ 82 - 0
src/main/java/com/caimei/utils/WxUtils.java

@@ -0,0 +1,82 @@
+package com.caimei.utils;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.aliyun.opensearch.sdk.dependencies.org.apache.http.client.HttpClient;
+import com.aliyun.opensearch.sdk.dependencies.org.apache.http.client.ResponseHandler;
+import com.aliyun.opensearch.sdk.dependencies.org.apache.http.client.methods.HttpGet;
+import com.aliyun.opensearch.sdk.dependencies.org.apache.http.impl.client.BasicResponseHandler;
+import com.aliyun.opensearch.sdk.dependencies.org.apache.http.impl.client.DefaultHttpClient;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Aslee
+ * @date   2021/7/14
+ */
+public class WxUtils {
+	public final static String GET_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=SECRET";
+    public final static String GET_TICKET_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi";
+
+    /**
+     * 获取accessToken
+     * @param appId         公众号appId
+     * @param appSecret     公众号appSecret
+     * @return
+     */
+	public static String getAccessToken(String appId,String appSecret){
+		String requestUrl = GET_TOKEN_URL.replace("APPID", appId).replace("SECRET", appSecret);
+		HttpClient client = null;
+		String accessToken = null;
+		try {
+            client = new DefaultHttpClient();
+            HttpGet httpget = new HttpGet(requestUrl);
+			ResponseHandler<String> responseHandler = new BasicResponseHandler();
+			String response = client.execute(httpget, responseHandler);
+			JSONObject tokenJson = JSONObject.parseObject(response);
+			accessToken = String.valueOf(tokenJson.get("access_token"));
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			client.getConnectionManager().shutdown();
+		}
+		return accessToken;
+	}
+
+    /**
+     * 获取jsapi_ticket
+     * @param accessToken   accessToken
+     * @return
+     */
+	public static Map<String,String> getJsapiTicket(String accessToken){
+        String requestUrl = GET_TICKET_URL.replace("ACCESS_TOKEN", accessToken);
+        HttpClient client = null;
+        Map<String, String> result = new HashMap<String, String>();
+        try {
+            client = new DefaultHttpClient();
+            HttpGet httpget = new HttpGet(requestUrl);
+            ResponseHandler<String> responseHandler = new BasicResponseHandler();
+            String response = client.execute(httpget, responseHandler);
+            JSONObject ticketJson = JSONObject.parseObject(response);
+            String errcode = String.valueOf(ticketJson.get("errcode"));
+            String errmsg = String.valueOf(ticketJson.get("errmsg"));
+            String ticket = String.valueOf(ticketJson.get("ticket"));
+            String expiresIn = String.valueOf(ticketJson.get("expires_in"));
+            result.put("errcode", errcode);
+            result.put("errmsg", errmsg);
+            result.put("ticket", ticket);
+            result.put("expiresIn", expiresIn);
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            client.getConnectionManager().shutdown();
+        }
+        return result;
+    }
+
+
+
+
+}

+ 31 - 0
src/main/java/com/caimei/wxController/SDKAPI.java

@@ -0,0 +1,31 @@
+package com.caimei.wxController;
+
+import com.caimei.model.ResponseJson;
+import com.caimei.service.SDKService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+@Api(tags = "微信SDKAPI")
+@Slf4j
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/wxsdk")
+public class SDKAPI {
+    private final SDKService sdkService;
+
+
+    @ApiOperation("获取公众号数据")
+    @GetMapping("/config/data")
+    public ResponseJson<Map<String, String>> getConfigData(String appId, String appSecret, String url) {
+        return sdkService.getConfigData(appId, appSecret, url);
+    }
+
+
+}

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

@@ -152,5 +152,45 @@ CREATE TABLE `cm_brand_image_detail` (
                                           `image` VARCHAR(255) NULL COMMENT '图片路径',
                                           PRIMARY KEY (`id`))
     COMMENT = '正品联盟资料库图片详情';
+
+CREATE TABLE `cm_brand_video` (
+                                       `id` INT NOT NULL AUTO_INCREMENT,
+                                       `authUserId` INT NULL COMMENT '供应商用户id',
+                                       `title` VARCHAR(300) NULL COMMENT '视频标题',
+                                       `url` VARCHAR(300) NULL COMMENT '视频路径',
+                                       `status` INT NULL COMMENT '上线状态:0已下线,1已上线,2待上线',
+                                       `createTime` DATETIME NULL COMMENT '创建时间',
+                                       `auditStatus` INT NULL COMMENT '审核状态:0审核未通过,1审核通过,2待审核',
+                                       `invalidReason` VARCHAR(300) NULL COMMENT '审核不通过原因',
+                                       `auditBy` INT NULL COMMENT '审核人用户id',
+                                       `auditTime` DATETIME NULL COMMENT '审核时间',
+                                       PRIMARY KEY (`id`))
+    COMMENT = '正品联盟资料库视频';
+
+CREATE TABLE `cm_brand_file` (
+                                 `id` INT NOT NULL AUTO_INCREMENT,
+                                 `authUserId` INT NULL COMMENT '供应商用户id',
+                                 `title` VARCHAR(300) NULL COMMENT '视频标题',
+                                 `url` VARCHAR(300) NULL COMMENT '文件链接',
+                                 `status` INT NULL COMMENT '上线状态:0已下线,1已上线,2待上线',
+                                 `createTime` DATETIME NULL COMMENT '创建时间',
+                                 `auditStatus` INT NULL COMMENT '审核状态:0审核未通过,1审核通过,2待审核',
+                                 `invalidReason` VARCHAR(300) NULL COMMENT '审核不通过原因',
+                                 `auditBy` INT NULL COMMENT '审核人用户id',
+                                 `auditTime` DATETIME NULL COMMENT '审核时间',
+                                 PRIMARY KEY (`id`))
+    COMMENT = '正品联盟资料库文件';
+
+CREATE TABLE `cm_brand_club_feedback` (
+                                               `id` INT NOT NULL AUTO_INCREMENT,
+                                               `clubUserId` INT NULL COMMENT '机构用户id',
+                                               `content` VARCHAR(300) NULL COMMENT '反馈内容',
+                                               `commitTime` DATETIME NULL COMMENT '提交时间',
+                                               `handleStatus` INT NULL COMMENT '处理状态:0未处理,1已处理',
+                                               `handleResult` VARCHAR(300) NULL COMMENT '处理结果',
+                                               `handleTime` DATETIME NULL COMMENT '处理时间',
+                                               PRIMARY KEY (`id`))
+    COMMENT = '机构意见反馈表';
+
 # ==================================正品联盟7月优化end===============================================
 

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

@@ -71,4 +71,11 @@ fdfs:
     width: 150
     height: 150
   tracker-list:            #TrackerList参数,支持多个
-    - 172.31.165.28:22122
+    - 172.31.165.28:22122
+
+aliyunConfig:
+  #阿里云oss存储
+  accessKeyId: LTAI4GBL3o4YkWnbKYgf2Xia
+  accessKeySecret: dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK
+  bucketName: caimei-oss
+  endpoint: https://oss-cn-shenzhen.aliyuncs.com

+ 10 - 12
src/main/resources/config/dev/application-dev.yml

@@ -18,9 +18,9 @@ spring:
   #数据源连接--end
 
   redis:
-    host: 119.29.0.46
-    port: 6380
-    password: 6#xsI%b4o@5c3RoE
+    host: 192.168.2.100
+    port: 6379
+#    password: 6#xsI%b4o@5c3RoE
     #Redis数据库索引(默认为0)
     database: 0
     #连接池最大连接数(使用负值表示没有限制)
@@ -58,7 +58,7 @@ caimei:
   oldapi: http://localhost:8100
   zplmapi: http://localhost:8012
   #图片服务器
-  imageDomain: https://img-b.caimei365.com
+  imageDomain: http://192.168.2.100
 
 #DFS配置
 fdfs:
@@ -70,12 +70,10 @@ fdfs:
   tracker-list:            #TrackerList参数,支持多个
     - 192.168.2.100:22122
 
-#消息队列
-rabbitmq:
-  host: 192.168.2.100
-  port: 5672
-  username: cmuser
-  password: 6#xsI%b4o@5c3RoE
-  virtual-host: /
-  connection-timeout: 3000
+aliyunConfig:
+  #阿里云oss存储
+  accessKeyId: LTAI4GBL3o4YkWnbKYgf2Xia
+  accessKeySecret: dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK
+  bucketName: caimei-oss
+  endpoint: https://oss-cn-shenzhen.aliyuncs.com
 

+ 7 - 0
src/main/resources/config/prod/application-prod.yml

@@ -69,3 +69,10 @@ fdfs:
     height: 150
   tracker-list:            #TrackerList参数,支持多个
     - 172.31.165.24:22122
+
+aliyunConfig:
+  #阿里云oss存储
+  accessKeyId: LTAI4GBL3o4YkWnbKYgf2Xia
+  accessKeySecret: dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK
+  bucketName: caimei-oss
+  endpoint: https://oss-cn-shenzhen.aliyuncs.com

+ 5 - 0
src/main/resources/mapper/ArticleMapper.xml

@@ -56,4 +56,9 @@
             </otherwise>
         </choose>
     </select>
+    <select id="getArticleForm" resultType="com.caimei.model.vo.ArticleFormVo">
+        select id as articleId, title as articleTitle, image as articleImage, content as articleContent
+        from cm_brand_article
+        where id = #{articleId}
+    </select>
 </mapper>

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

@@ -61,11 +61,4 @@
         where authId = #{authId}
           and auditStatus = 2
     </select>
-    <select id="getClubList" resultType="com.caimei.model.vo.ClubVo">
-        select id as authId,authParty as clubName,createTime
-        from cm_brand_auth where auditBy = #{authUserId}
-        <if test="clubName != null and clubName != ''">
-            and authParty like concat('%',#{clubName},'%')
-        </if>
-    </select>
 </mapper>

+ 75 - 0
src/main/resources/mapper/FileMapper.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.mapper.FileMapper">
+    <insert id="insertFile" keyColumn="id" keyProperty="id" parameterType="com.caimei.model.po.FilePo" useGeneratedKeys="true">
+        insert into cm_brand_file(authUserId, title, url, auditStatus, status, createTime)
+        values (#{authUserId}, #{title}, #{url}, #{auditStatus}, #{status}, #{createTime})
+    </insert>
+    <update id="updateFileByFileId">
+        update cm_brand_file
+        set title       = #{title},
+            status      = #{status},
+            auditStatus = #{auditStatus}
+        where id = #{id}
+    </update>
+    <update id="updateFileStatusByFileId">
+        update cm_brand_file
+        set status = #{status}
+        where id = #{fileId}
+    </update>
+    <update id="updateFileAuditStatus">
+        update cm_brand_file
+        set status        = #{status},
+            auditStatus   = #{auditStatus},
+            invalidReason = #{invalidReason},
+            auditBy       = #{auditBy},
+            auditTime     = #{auditTime}
+        where id = #{fileId}
+    </update>
+    <update id="updateFileSelective">
+        update cm_brand_file
+        <set>
+            <if test="title != null and title != ''">
+                title = #{title},
+            </if>
+            <if test="url != null and url != ''">
+                url = #{url},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+            <if test="auditStatus != null">
+                auditStatus = #{auditStatus},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+    <delete id="deleteFileByFileId">
+        delete from cm_brand_file where id = #{fileId}
+    </delete>
+    <select id="getFileList" resultType="com.caimei.model.vo.FileVo">
+        select a.id as fileId,a.title as fileTitle,a.url as fileUrl,
+        a.auditStatus,a.invalidReason,a.status,a.createTime,
+        au.name as auditBy,a.auditTime
+        from cm_brand_file a
+        left join cm_brand_auth_user au on a.auditBy = au.authUserId
+        where a.authUserId = #{authUserId}
+        <if test="fileTitle != null and fileTitle != ''">
+            and a.title like concat('%',#{fileTitle},'%')
+        </if>
+        <if test="auditStatus != null">
+            and a.auditStatus = #{auditStatus}
+        </if>
+        <if test="status != null">
+            and a.status = #{status}
+        </if>
+        <choose>
+            <when test="listType == 2">
+                order by a.auditStatus desc, a.createTime desc
+            </when>
+            <otherwise>
+                order by a.createTime desc
+            </otherwise>
+        </choose>
+    </select>
+</mapper>

+ 6 - 0
src/main/resources/mapper/ImageMapper.xml

@@ -61,4 +61,10 @@
             </otherwise>
         </choose>
     </select>
+    <select id="getImageForm" resultType="com.caimei.model.vo.ImageFormVo">
+        select id as imageId,title as imageTitle from cm_brand_image where id = #{imageId}
+    </select>
+    <select id="getImageListByImageId" resultType="java.lang.String">
+        select image from cm_brand_image_detail where imageId = #{imageId}
+    </select>
 </mapper>

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

@@ -84,6 +84,13 @@
         </set>
         where authUserId = #{authUserId} and brandId = #{brandId}
     </update>
+    <update id="handleFeedback">
+        update cm_brand_club_feedback
+        set handleResult = #{handleResult},
+            handleStatus = 1,
+            handleTime   = NOW()
+        where id = #{feedbackId}
+    </update>
     <delete id="deleteStatementFile">
         delete from cm_brand_auth_file where id = #{id}
     </delete>
@@ -224,5 +231,19 @@
                  left join cm_brand_auth_product p on p.authId = a.id
         where a.authUserId = #{authUserId} and p.brandId = #{brandId}
     </select>
+    <select id="getFeedbackList" resultType="com.caimei.model.vo.FeedbackVo">
+        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}
+    </select>
+    <select id="getFeedback" resultType="com.caimei.model.vo.FeedbackVo">
+        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}
+    </select>
 
 </mapper>

+ 78 - 0
src/main/resources/mapper/VideoMapper.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.mapper.VideoMapper">
+    <insert id="insertVideo" keyColumn="id" keyProperty="id" parameterType="com.caimei.model.po.VideoPo" useGeneratedKeys="true">
+        insert into cm_brand_video(authUserId, title, url, auditStatus, status, createTime)
+        values (#{authUserId}, #{title}, #{url}, #{auditStatus}, #{status}, #{createTime})
+    </insert>
+    <update id="updateVideoByVideoId">
+        update cm_brand_video
+        set title       = #{title},
+            status      = #{status},
+            auditStatus = #{auditStatus}
+        where id = #{id}
+    </update>
+    <update id="updateVideoStatusByVideoId">
+        update cm_brand_video
+        set status = #{status}
+        where id = #{videoId}
+    </update>
+    <update id="updateVideoAuditStatus">
+        update cm_brand_video
+        set status        = #{status},
+            auditStatus   = #{auditStatus},
+            invalidReason = #{invalidReason},
+            auditBy       = #{auditBy},
+            auditTime     = #{auditTime}
+        where id = #{videoId}
+    </update>
+    <update id="updateVideoSelective">
+        update cm_brand_video
+        <set>
+            <if test="title != null and title != ''">
+                title = #{title},
+            </if>
+            <if test="url != null and url != ''">
+                url = #{url},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+            <if test="auditStatus != null">
+                auditStatus = #{auditStatus},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+    <delete id="deleteVideoByVideoId">
+        delete from cm_brand_video where id = #{videoId}
+    </delete>
+    <select id="getVideoList" resultType="com.caimei.model.vo.VideoVo">
+        select a.id as videoId,a.title as videoTitle,a.url as videoUrl,
+        a.auditStatus,a.invalidReason,a.status,a.createTime,
+        au.name as auditBy,a.auditTime
+        from cm_brand_video a
+        left join cm_brand_auth_user au on a.auditBy = au.authUserId
+        where a.authUserId = #{authUserId}
+        <if test="videoTitle != null and videoTitle != ''">
+            and a.title like concat('%',#{videoTitle},'%')
+        </if>
+        <if test="auditStatus != null">
+            and a.auditStatus = #{auditStatus}
+        </if>
+        <if test="status != null">
+            and a.status = #{status}
+        </if>
+        <choose>
+            <when test="listType == 2">
+                order by a.auditStatus desc, a.createTime desc
+            </when>
+            <otherwise>
+                order by a.createTime desc
+            </otherwise>
+        </choose>
+    </select>
+    <select id="getFileNumByMd5Hex" resultType="java.lang.Integer">
+        select count(*) from cm_brand_video where md5Hex = #{md5Hex}
+    </select>
+</mapper>