Переглянути джерело

Merge branch 'master-wps' into test

syh 5 роки тому
батько
коміт
c55bb247c8
66 змінених файлів з 4270 додано та 29 видалено
  1. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  2. 0 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java
  3. 4 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/KuaishouXxlEntity.java
  4. 17 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/base/Page.java
  5. 15 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/base/Request.java
  6. 139 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/base/Response.java
  7. 91 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/config/Context.java
  8. 116 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/FileCallBackController.java
  9. 44 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/UserCallBackController.java
  10. 118 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/UserImplController.java
  11. 241 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsFileController.java
  12. 241 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsFileVersionController.java
  13. 241 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsFileWatermarkController.java
  14. 241 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsUserAclController.java
  15. 241 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsUserController.java
  16. 53 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/FileDTO.java
  17. 34 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/FileHisDTO.java
  18. 40 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/FileListDTO.java
  19. 17 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/FileNewDTO.java
  20. 16 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/FileReqDTO.java
  21. 11 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/UserAclBO.java
  22. 23 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/UserDTO.java
  23. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/WatermarkBO.java
  24. 86 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsFile.java
  25. 66 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsFileVersion.java
  26. 77 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsFileWatermark.java
  27. 42 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsUser.java
  28. 61 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsUserAcl.java
  29. 51 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/WpsFileMapper.java
  30. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/WpsFileVersionMapper.java
  31. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/WpsFileWatermarkMapper.java
  32. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/WpsUserAclMapper.java
  33. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/WpsUserMapper.java
  34. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/xml/WpsFileMapper.xml
  35. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/xml/WpsFileVersionMapper.xml
  36. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/xml/WpsFileWatermarkMapper.xml
  37. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/xml/WpsUserAclMapper.xml
  38. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/xml/WpsUserMapper.xml
  39. 20 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/propertie/OSSProperties.java
  40. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/propertie/QNProperties.java
  41. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/propertie/UploadProperties.java
  42. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/propertie/WpsProperties.java
  43. 46 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/IWpsFileService.java
  44. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/IWpsFileVersionService.java
  45. 17 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/IWpsFileWatermarkService.java
  46. 17 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/IWpsUserAclService.java
  47. 21 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/IWpsUserService.java
  48. 392 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/impl/WpsFileServiceImpl.java
  49. 43 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/impl/WpsFileVersionServiceImpl.java
  50. 33 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/impl/WpsFileWatermarkServiceImpl.java
  51. 35 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/impl/WpsUserAclServiceImpl.java
  52. 64 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/impl/WpsUserServiceImpl.java
  53. 80 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/SignatureUtil.java
  54. 12 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/Token.java
  55. 43 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/WpsUtil.java
  56. 119 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/file/FileType.java
  57. 148 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/file/FileTypeJudge.java
  58. 113 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/file/FileUtil.java
  59. 28 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/upload/ResFileDTO.java
  60. 15 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/upload/UploadFileLocation.java
  61. 481 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/upload/oss/WpsOSSUtil.java
  62. 11 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/upload/qn/MyPutRet.java
  63. 14 0
      jeecg-boot-module-system/src/main/resources/application.yml
  64. 2 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java
  65. 17 7
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java
  66. 3 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -81,6 +81,8 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ctop/byteDance/homePage/report/*", "anon");
         filterChainDefinitionMap.put("/ctop/material/top/cost", "anon");
 
+        filterChainDefinitionMap.put("/v1/**", "anon");
+
         filterChainDefinitionMap.put("/generic/**", "anon");
         filterChainDefinitionMap.put("/", "anon");
         filterChainDefinitionMap.put("/doc.html", "anon");

+ 0 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java

@@ -385,7 +385,6 @@ public class AdvertiserController {
                 }
             }
         }
-
         List<UserAllocation> allocations = userAllocationService.getByProjectId(projectId, systemType);
         if (null != allocations && !allocations.isEmpty()) {
             for (UserAllocation allocation : allocations) {
@@ -421,7 +420,6 @@ public class AdvertiserController {
                 }
             }
         }
-
         List<UserAllocation> allocations = userAllocationService.getByProjectId(projectId, systemType);
         if (null != allocations && !allocations.isEmpty()) {
             for (UserAllocation allocation : allocations) {
@@ -429,7 +427,6 @@ public class AdvertiserController {
                 sheets.add(vo);
             }
         }
-
         OutputStream outputStream = response.getOutputStream();
         String date = DateUtils.formatDate(new Date());
         HttpUtils.setResponseHeader(response, "爱上消消消日报" + date + ".xlsx");

+ 4 - 17
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/KuaishouXxlEntity.java

@@ -30,23 +30,18 @@ public class KuaishouXxlEntity extends BaseRowModel {
     @ExcelProperty(index = 4, value = "非双出价(元)")
     private BigDecimal singleBid;
     /**
-     * 非双出价
-     */
-    @ExcelProperty(index = 5, value = "详情页消耗(元)")
-    private BigDecimal detailCost;
-    /**
      * 激活数
      */
-    @ExcelProperty(index = 6, value = "激活数")
+    @ExcelProperty(index = 5, value = "激活数")
     private int active;
     /**
      * 激活成本
      */
-    @ExcelProperty(index = 7, value = "激活成本")
+    @ExcelProperty(index = 6, value = "激活成本")
     private BigDecimal activeCost;
-    @ExcelProperty(index = 8, value = "每日计划(组)")
+    @ExcelProperty(index = 7, value = "每日计划(组)")
     private int planNum;
-    @ExcelProperty(index = 9, value = "每日素材安排")
+    @ExcelProperty(index = 8, value = "每日素材安排")
     private String mat;
 
     public String getDate() {
@@ -112,12 +107,4 @@ public class KuaishouXxlEntity extends BaseRowModel {
     public void setMat(String mat) {
         this.mat = mat;
     }
-
-    public BigDecimal getDetailCost() {
-        return detailCost;
-    }
-
-    public void setDetailCost(BigDecimal detailCost) {
-        this.detailCost = detailCost;
-    }
 }

+ 17 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/base/Page.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.wps.base;
+
+import lombok.Data;
+
+@Data
+public class Page {
+
+	private int page = 1;
+	private int size = 5;
+
+	public Page(){}
+
+	public Page(int page, int size){
+		this.page = page;
+		this.size = size;
+	}
+}

+ 15 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/base/Request.java

@@ -0,0 +1,15 @@
+package org.jeecg.modules.wps.base;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class Request {
+
+    public static String getHeaderParam(HttpServletRequest request, String key) {
+        return request.getHeader(key);
+    }
+
+    public static String getQueryParam(HttpServletRequest request, String key) {
+        return request.getParameter(key);
+    }
+
+}

+ 139 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/base/Response.java

@@ -0,0 +1,139 @@
+package org.jeecg.modules.wps.base;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.MultiValueMap;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * @author zm
+ * @since 1.0
+ * @version 1.0 2019年7月14日
+ */
+public class Response {
+	// keys
+	private final static String MSG_KEY = "msg";
+	private final static String STATUS_KEY = "status";
+	private final static String CODE_KEY = "code";
+	private final static String DATA_KEY = "data";
+
+	// msg
+	private final static String SUCCESS_MSG = "ok";
+
+	// value
+	private final static String SUCCESS_VALUE = "success";
+
+	/**
+	 * 请求成功,并返回请求结果集
+	 *
+	 * @param data
+	 *            返回到客户端的对象
+	 * @return Spring mvc ResponseEntity
+	 */
+	public static ResponseEntity<Object> success(Map<String, Object> data, String msg) {
+		return getObjectResponseEntity(data, msg);
+	}
+
+	public static ResponseEntity<Object> success(String msg) {
+		Map<String, Object> result = new HashMap<String, Object>(){
+			{
+				put(STATUS_KEY, SUCCESS_VALUE);
+				put(MSG_KEY, msg);
+				put(CODE_KEY, HttpStatus.OK.value());
+			}
+		};
+		return getEntity(result);
+	}
+
+	public static ResponseEntity<Object> success() {
+		Map<String, Object> result = new HashMap<String, Object>(){
+			{
+				put(STATUS_KEY, SUCCESS_VALUE);
+				put(MSG_KEY, SUCCESS_MSG);
+				put(CODE_KEY, HttpStatus.OK.value());
+			}
+		};
+		return getEntity(result);
+	}
+
+	/**
+	 * 请求成功,并返回请求结果集
+	 *
+	 * @param data
+	 *            返回到客户端的对象
+	 * @return Spring mvc ResponseEntity
+	 */
+	public static ResponseEntity<Object> success(Map<String, Object> data) {
+		return getObjectResponseEntity(data, SUCCESS_MSG);
+	}
+
+	public static ResponseEntity<Object> success(Object data) {
+		Map<String, Object> result = new HashMap<String, Object>(){
+			{
+				put(STATUS_KEY, SUCCESS_VALUE);
+				put(MSG_KEY, SUCCESS_MSG);
+				put(CODE_KEY, HttpStatus.OK.value());
+				put(DATA_KEY,data);
+			}
+		};
+		return getEntity(result);
+	}
+
+	public static ResponseEntity<Object> success(boolean data, String msg) {
+		Map<String, Object> result = new HashMap<String, Object>(){
+			{
+				put(STATUS_KEY, SUCCESS_VALUE);
+				put(MSG_KEY, msg);
+				put(CODE_KEY, HttpStatus.OK.value());
+				put(DATA_KEY,data);
+			}
+		};
+		return getEntity(result);
+	}
+
+	public static ResponseEntity<Object> bad(String msg) {
+		Map<String, Object> result = new HashMap<String, Object>(){
+			{
+				put(STATUS_KEY, SUCCESS_VALUE);
+				put(MSG_KEY, msg);
+				put(CODE_KEY, HttpStatus.BAD_REQUEST.value());
+			}
+		};
+		return getEntity(result);
+	}
+
+	private static ResponseEntity<Object> getObjectResponseEntity(Map<String, Object> data, String msg) {
+		Map<String, Object> result = new HashMap<String, Object>(){
+			{
+				put(STATUS_KEY, SUCCESS_VALUE);
+				put(MSG_KEY, msg);
+				put(CODE_KEY, HttpStatus.OK.value());
+				for (Entry<String, Object> entry : data.entrySet()) {
+					put(entry.getKey(),entry.getValue());
+				}
+			}
+		};
+		return getEntity(result);
+	}
+
+	private static ResponseEntity<Object> getEntity(Object body) {
+		List<String> contentType = new ArrayList<String>(){
+			{
+				add("application/json;charset=utf-8");
+			}
+		};
+		MultiValueMap<String, String> headers = new HttpHeaders(){
+			{
+				put("Content-Type", contentType);
+			}
+		};
+		return new ResponseEntity<>(body, headers, HttpStatus.OK);
+	}
+
+}

+ 91 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/config/Context.java

@@ -0,0 +1,91 @@
+package org.jeecg.modules.wps.config;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class Context {
+
+    // wps bi传递的参数,统一放在上下文中,方便使用
+    final static String TOKEN_KEY = "x-wps-weboffice-token";
+    final static String FILE_ID_KEY = "x-weboffice-file-id";
+    final static String USER_AGENT = "User-Agent";
+
+    final static String APP_ID = "_w_appid";
+    final static String SIGNATURE = "_w_signature";
+
+    private static final ThreadLocal<Map<String, String>> securityMap = new ThreadLocal<>();
+
+    private Context() {}
+
+    private static void init() {
+        if (securityMap.get() == null) {
+            Map<String, String> map = new HashMap<>();
+            securityMap.set(map);
+        } else {
+            securityMap.get().clear();
+        }
+    }
+
+    static void setToken(String tokenKey) {
+        init();
+        securityMap.get().put(TOKEN_KEY, tokenKey);
+    }
+
+    public static String getToken() {
+        if (securityMap.get() == null){
+            return null;
+        }
+        else{
+            return securityMap.get().get(TOKEN_KEY);
+        }
+    }
+
+    static void setFileId(String fileId) {
+        securityMap.get().put(FILE_ID_KEY, fileId);
+    }
+
+    public static String getFileId() {
+        if (securityMap.get() == null){
+            return null;
+        } else{
+            return securityMap.get().get(FILE_ID_KEY);
+        }
+    }
+
+    static void setAgent(String agent) {
+        securityMap.get().put(USER_AGENT, agent);
+    }
+
+    public static String getAgent() {
+        if (securityMap.get() == null){
+            return null;
+        } else{
+            return securityMap.get().get(USER_AGENT);
+        }
+    }
+
+    static void setAppId(String appId) {
+        securityMap.get().put(APP_ID, appId);
+    }
+
+    public static String getAppId() {
+        if (securityMap.get() == null){
+            return null;
+        } else{
+            return securityMap.get().get(APP_ID);
+        }
+    }
+
+    static void setSignature(String signature) {
+        securityMap.get().put(SIGNATURE, signature);
+    }
+
+    public static String getSignature() {
+        if (securityMap.get() == null){
+            return null;
+        } else {
+            return securityMap.get().get(SIGNATURE);
+        }
+    }
+
+}

+ 116 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/FileCallBackController.java

@@ -0,0 +1,116 @@
+package org.jeecg.modules.wps.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.modules.wps.base.Response;
+import org.jeecg.modules.wps.dto.FileReqDTO;
+import org.jeecg.modules.wps.service.IWpsFileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Map;
+
+/**
+ * @author zm
+ * 文件相关回调接口
+ */
+@Slf4j
+@RestController
+@RequestMapping("v1/3rd/file")
+public class FileCallBackController{
+
+    @Autowired
+    public FileCallBackController(IWpsFileService fileService) {
+        this.wpsFileService = fileService;
+    }
+
+    private final IWpsFileService wpsFileService;
+
+    /**
+     * 获取文件元数据
+     */
+    @GetMapping("info")
+    public ResponseEntity<Object> getFileInfo(String _w_userid, String _w_filepath, String _w_filetype){
+        log.info("获取文件元数据userId:{},path:{},type:{}",_w_userid,_w_filepath,_w_filetype);
+        try {
+            Map<String,Object> map = wpsFileService.getFileInfo(_w_userid,_w_filepath,_w_filetype);
+            return Response.success(map);
+        }catch (Exception e){
+            return Response.bad("获取文件元数据异常");
+        }
+    }
+
+    /**
+     * 通知此文件目前有哪些人正在协作
+     */
+    @PostMapping("online")
+    public ResponseEntity<Object> fileOnline(@RequestBody JSONObject obj){
+        log.info("通知此文件目前有哪些人正在协作param:{}", JSON.toJSON(obj));
+        return Response.success();
+    }
+
+    /**
+     * 上传文件新版本
+     */
+    @PostMapping("save")
+    public ResponseEntity<Object> fileSave(@RequestBody MultipartFile file, String _w_userid){
+        log.info("上传文件新版本");
+        Map<String,Object> map = wpsFileService.fileSave(file,_w_userid);
+        return Response.success(map);
+    }
+
+    /**
+     * 获取特定版本的文件信息
+     */
+    @GetMapping("version/{version}")
+    public ResponseEntity<Object> fileVersion(@PathVariable Integer version){
+        log.info("获取特定版本的文件信息version:{}",version);
+        Map<String,Object> res = wpsFileService.fileVersion(version);
+        return Response.success(res);
+    }
+
+    /**
+     * 文件重命名
+     */
+    @PutMapping("rename")
+    public ResponseEntity<Object> fileRename(@RequestBody FileReqDTO req, String _w_userid){
+        log.info("文件重命名param:{},userId:{}", JSON.toJSON(req),_w_userid);
+        wpsFileService.fileRename(req.getName(),_w_userid);
+        return Response.success();
+    }
+
+    /**
+     * 获取所有历史版本文件信息
+     */
+    @PostMapping("history")
+    public ResponseEntity<Object> fileHistory(@RequestBody FileReqDTO req){
+        log.info("获取所有历史版本文件信息param:{}", JSON.toJSON(req));
+        Map<String,Object> result = wpsFileService.fileHistory(req);
+        return Response.success(result);
+    }
+
+    /**
+     * 新建文件
+     */
+    @PostMapping("new")
+    public ResponseEntity<Object> fileNew(@RequestBody MultipartFile file, String _w_userid){
+        log.info("新建文件_w_userid:{}",_w_userid);
+        Map<String,Object> res = wpsFileService.fileNew(file,_w_userid);
+        return Response.success(res);
+    }
+
+    /**
+     * 回调通知
+     */
+    @PostMapping("onnotify")
+    public ResponseEntity<Object> onNotify(@RequestBody JSONObject obj){
+        log.info("回调通知param:{}", JSON.toJSON(obj));
+        // TODO
+        // 返回数据暂不处理
+        return Response.success();
+    }
+
+}

+ 44 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/UserCallBackController.java

@@ -0,0 +1,44 @@
+package org.jeecg.modules.wps.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.modules.wps.base.Response;
+import org.jeecg.modules.wps.service.IWpsUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+/**
+ * @author zm
+ * 用户相关回调接口
+ */
+@Slf4j
+@RestController
+@RequestMapping("v1/3rd/user")
+public class UserCallBackController{
+
+    @Autowired
+    private IWpsUserService wpsUserService;
+
+    /**
+     * 获取用户信息
+     */
+    @PostMapping("info")
+    public ResponseEntity<Object> userInfo(@RequestBody JSONObject reqObj){
+        log.info("获取用户信息param:{}", JSON.toJSON(reqObj));
+        try {
+            Map<String,Object> map =
+                    wpsUserService.userInfo(reqObj);
+            return Response.success(map);
+        }catch (Exception e){
+            return Response.bad("获取用户信息异常");
+        }
+    }
+
+}

+ 118 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/UserImplController.java

@@ -0,0 +1,118 @@
+package org.jeecg.modules.wps.controller;
+
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.modules.wps.base.Response;
+import org.jeecg.modules.wps.dto.FileListDTO;
+import org.jeecg.modules.wps.service.IWpsFileService;
+import org.jeecg.modules.wps.util.Token;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author zm
+ * 用户实现获取wps可预览URL
+ */
+@Slf4j
+@RestController
+@RequestMapping("v1/api/file")
+public class UserImplController{
+    @Autowired
+    private IWpsFileService wpsFileService;
+
+    /**
+     * 获取网络文件预览URL
+     * @param fileUrl fileUrl
+     * @return t
+     */
+    @GetMapping("getViewUrlWebPath")
+    public ResponseEntity<Object> getViewUrlWebPath(String fileUrl){
+        log.info("getViewUrlWebPath:fileUrl={}",fileUrl);
+        Token t = wpsFileService.getViewUrl(fileUrl,true);
+        return Response.success(t);
+    }
+
+    /**
+     * 获取所有文件
+     * @return db下的所有文件
+     */
+    @GetMapping("getFileList")
+    public ResponseEntity<Object> getFileList(){
+        log.info("获取所有文件");
+        List<FileListDTO> result = wpsFileService.getFileList();
+        return Response.success(result);
+    }
+
+    /**
+     * 获取所有文件
+     * @return db下的所有文件
+     */
+    @PostMapping("getFileListByPage")
+    public ResponseEntity<Object> getFileListByPage(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
+        Map<String,Object> result = wpsFileService.getFileListByPage(pageNo,pageSize);
+        return Response.success(result);
+    }
+
+    /**
+     * 删除用户文件
+     * @return true Or false
+     */
+    @GetMapping("delFile")
+    public ResponseEntity<Object> delFile(String id){
+        log.info("删除文件:{}",id);
+        int res = wpsFileService.delFile(id);
+        if (res == 1){
+            return Response.success(true,"删除成功");
+        }else if (res == 0){
+            return Response.success(false,"删除失败,该文件不允许被删除");
+        }else {
+            return Response.success(false,"数据异常");
+        }
+    }
+
+    /**
+     * 上传文件
+     */
+    @PostMapping("uploadFile")
+    public ResponseEntity<Object> uploadFile(@RequestParam("file") MultipartFile file){
+        try {
+            wpsFileService.uploadFile(file);
+            return Response.success(true,"上传成功");
+        }catch (Exception e){
+            e.printStackTrace();
+            return Response.success(false,"上传失败");
+        }
+    }
+
+    /**
+     * 通过fileId获取wpsUrl以及token
+     * @param fileId 文件id
+     * @return token(包含url)
+     */
+    @GetMapping("getViewUrlDbPath")
+    public ResponseEntity<Object> getViewUrlDbPath(String fileId, String userId){
+        log.info("getViewUrlDbPath:fileId={},userId={}",fileId,userId);
+        Token t = wpsFileService.getViewUrl(fileId,userId,true);
+        if (t != null){
+            return Response.success(t);
+        }else {
+            return Response.bad("文件不存在或其它异常!");
+        }
+    }
+
+    /**
+     * 通过wps官方模版新建文件
+     * template值 {"word", "excel", "ppt"}
+     */
+    @GetMapping("createTemplateFile")
+    public ResponseEntity<Object> createTemplateFile(String template){
+        String newUrl = wpsFileService.createTemplateFile(template);
+        return Response.success(newUrl);
+    }
+
+}

+ 241 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsFileController.java

@@ -0,0 +1,241 @@
+package org.jeecg.modules.wps.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.wps.entity.WpsFile;
+import org.jeecg.modules.wps.service.IWpsFileService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+ /**
+ * wps文件
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="wps文件")
+@RestController
+@RequestMapping("/ctop/wpsFile")
+public class WpsFileController {
+	@Autowired
+	private IWpsFileService wpsFileService;
+
+	/**
+	  * 分页列表查询
+	 * @param wpsFile
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "wps文件-分页列表查询")
+	@ApiOperation(value="wps文件-分页列表查询", notes="wps文件-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<WpsFile>> queryPageList(WpsFile wpsFile,
+												@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+												@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+												HttpServletRequest req) {
+		Result<IPage<WpsFile>> result = new Result<>();
+		QueryWrapper<WpsFile> queryWrapper = QueryGenerator.initQueryWrapper(wpsFile, req.getParameterMap());
+		Page<WpsFile> page = new Page<WpsFile>(pageNo, pageSize);
+		IPage<WpsFile> pageList = wpsFileService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param wpsFile
+	 * @return
+	 */
+	@AutoLog(value = "wps文件-添加")
+	@ApiOperation(value="wps文件-添加", notes="wps文件-添加")
+	@PostMapping(value = "/add")
+	public Result<WpsFile> add(@RequestBody WpsFile wpsFile) {
+		Result<WpsFile> result = new Result<>();
+		try {
+			wpsFileService.save(wpsFile);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param wpsFile
+	 * @return
+	 */
+	@AutoLog(value = "wps文件-编辑")
+	@ApiOperation(value="wps文件-编辑", notes="wps文件-编辑")
+	@PutMapping(value = "/edit")
+	public Result<WpsFile> edit(@RequestBody WpsFile wpsFile) {
+		Result<WpsFile> result = new Result<WpsFile>();
+		WpsFile wpsFileEntity = wpsFileService.getById(wpsFile.getId());
+		if(wpsFileEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = wpsFileService.updateById(wpsFile);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wps文件-通过id删除")
+	@ApiOperation(value="wps文件-通过id删除", notes="wps文件-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			wpsFileService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "wps文件-批量删除")
+	@ApiOperation(value="wps文件-批量删除", notes="wps文件-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<WpsFile> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<WpsFile> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.wpsFileService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wps文件-通过id查询")
+	@ApiOperation(value="wps文件-通过id查询", notes="wps文件-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<WpsFile> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<WpsFile> result = new Result<>();
+		WpsFile wpsFile = wpsFileService.getById(id);
+		if(wpsFile==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(wpsFile);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<WpsFile> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              WpsFile wpsFile = JSON.parseObject(deString, WpsFile.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(wpsFile, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<WpsFile> pageList = wpsFileService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "wps文件列表");
+      mv.addObject(NormalExcelConstants.CLASS, WpsFile.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("wps文件列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<WpsFile> listWpsFiles = ExcelImportUtil.importExcel(file.getInputStream(), WpsFile.class, params);
+              wpsFileService.saveBatch(listWpsFiles);
+              return Result.ok("文件导入成功!数据行数:" + listWpsFiles.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 241 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsFileVersionController.java

@@ -0,0 +1,241 @@
+package org.jeecg.modules.wps.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.wps.entity.WpsFileVersion;
+import org.jeecg.modules.wps.service.IWpsFileVersionService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+ /**
+ * wps文件版本号
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="wps文件版本号")
+@RestController
+@RequestMapping("/ctop/wpsFileVersion")
+public class WpsFileVersionController {
+	@Autowired
+	private IWpsFileVersionService wpsFileVersionService;
+
+	/**
+	  * 分页列表查询
+	 * @param wpsFileVersion
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "wps文件版本号-分页列表查询")
+	@ApiOperation(value="wps文件版本号-分页列表查询", notes="wps文件版本号-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<WpsFileVersion>> queryPageList(WpsFileVersion wpsFileVersion,
+													   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+													   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+													   HttpServletRequest req) {
+		Result<IPage<WpsFileVersion>> result = new Result<>();
+		QueryWrapper<WpsFileVersion> queryWrapper = QueryGenerator.initQueryWrapper(wpsFileVersion, req.getParameterMap());
+		Page<WpsFileVersion> page = new Page<WpsFileVersion>(pageNo, pageSize);
+		IPage<WpsFileVersion> pageList = wpsFileVersionService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param wpsFileVersion
+	 * @return
+	 */
+	@AutoLog(value = "wps文件版本号-添加")
+	@ApiOperation(value="wps文件版本号-添加", notes="wps文件版本号-添加")
+	@PostMapping(value = "/add")
+	public Result<WpsFileVersion> add(@RequestBody WpsFileVersion wpsFileVersion) {
+		Result<WpsFileVersion> result = new Result<>();
+		try {
+			wpsFileVersionService.save(wpsFileVersion);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param wpsFileVersion
+	 * @return
+	 */
+	@AutoLog(value = "wps文件版本号-编辑")
+	@ApiOperation(value="wps文件版本号-编辑", notes="wps文件版本号-编辑")
+	@PutMapping(value = "/edit")
+	public Result<WpsFileVersion> edit(@RequestBody WpsFileVersion wpsFileVersion) {
+		Result<WpsFileVersion> result = new Result<WpsFileVersion>();
+		WpsFileVersion wpsFileVersionEntity = wpsFileVersionService.getById(wpsFileVersion.getId());
+		if(wpsFileVersionEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = wpsFileVersionService.updateById(wpsFileVersion);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wps文件版本号-通过id删除")
+	@ApiOperation(value="wps文件版本号-通过id删除", notes="wps文件版本号-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			wpsFileVersionService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "wps文件版本号-批量删除")
+	@ApiOperation(value="wps文件版本号-批量删除", notes="wps文件版本号-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<WpsFileVersion> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<WpsFileVersion> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.wpsFileVersionService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wps文件版本号-通过id查询")
+	@ApiOperation(value="wps文件版本号-通过id查询", notes="wps文件版本号-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<WpsFileVersion> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<WpsFileVersion> result = new Result<>();
+		WpsFileVersion wpsFileVersion = wpsFileVersionService.getById(id);
+		if(wpsFileVersion==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(wpsFileVersion);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<WpsFileVersion> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              WpsFileVersion wpsFileVersion = JSON.parseObject(deString, WpsFileVersion.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(wpsFileVersion, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<WpsFileVersion> pageList = wpsFileVersionService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "wps文件版本号列表");
+      mv.addObject(NormalExcelConstants.CLASS, WpsFileVersion.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("wps文件版本号列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<WpsFileVersion> listWpsFileVersions = ExcelImportUtil.importExcel(file.getInputStream(), WpsFileVersion.class, params);
+              wpsFileVersionService.saveBatch(listWpsFileVersions);
+              return Result.ok("文件导入成功!数据行数:" + listWpsFileVersions.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 241 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsFileWatermarkController.java

@@ -0,0 +1,241 @@
+package org.jeecg.modules.wps.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.wps.entity.WpsFileWatermark;
+import org.jeecg.modules.wps.service.IWpsFileWatermarkService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+ /**
+ * wps文件水印
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="wps文件水印")
+@RestController
+@RequestMapping("/ctop/wpsFileWatermark")
+public class WpsFileWatermarkController {
+	@Autowired
+	private IWpsFileWatermarkService wpsFileWatermarkService;
+
+	/**
+	  * 分页列表查询
+	 * @param wpsFileWatermark
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "wps文件水印-分页列表查询")
+	@ApiOperation(value="wps文件水印-分页列表查询", notes="wps文件水印-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<WpsFileWatermark>> queryPageList(WpsFileWatermark wpsFileWatermark,
+														 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+														 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+														 HttpServletRequest req) {
+		Result<IPage<WpsFileWatermark>> result = new Result<>();
+		QueryWrapper<WpsFileWatermark> queryWrapper = QueryGenerator.initQueryWrapper(wpsFileWatermark, req.getParameterMap());
+		Page<WpsFileWatermark> page = new Page<WpsFileWatermark>(pageNo, pageSize);
+		IPage<WpsFileWatermark> pageList = wpsFileWatermarkService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param wpsFileWatermark
+	 * @return
+	 */
+	@AutoLog(value = "wps文件水印-添加")
+	@ApiOperation(value="wps文件水印-添加", notes="wps文件水印-添加")
+	@PostMapping(value = "/add")
+	public Result<WpsFileWatermark> add(@RequestBody WpsFileWatermark wpsFileWatermark) {
+		Result<WpsFileWatermark> result = new Result<>();
+		try {
+			wpsFileWatermarkService.save(wpsFileWatermark);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param wpsFileWatermark
+	 * @return
+	 */
+	@AutoLog(value = "wps文件水印-编辑")
+	@ApiOperation(value="wps文件水印-编辑", notes="wps文件水印-编辑")
+	@PutMapping(value = "/edit")
+	public Result<WpsFileWatermark> edit(@RequestBody WpsFileWatermark wpsFileWatermark) {
+		Result<WpsFileWatermark> result = new Result<WpsFileWatermark>();
+		WpsFileWatermark wpsFileWatermarkEntity = wpsFileWatermarkService.getById(wpsFileWatermark.getId());
+		if(wpsFileWatermarkEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = wpsFileWatermarkService.updateById(wpsFileWatermark);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wps文件水印-通过id删除")
+	@ApiOperation(value="wps文件水印-通过id删除", notes="wps文件水印-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			wpsFileWatermarkService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "wps文件水印-批量删除")
+	@ApiOperation(value="wps文件水印-批量删除", notes="wps文件水印-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<WpsFileWatermark> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<WpsFileWatermark> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.wpsFileWatermarkService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wps文件水印-通过id查询")
+	@ApiOperation(value="wps文件水印-通过id查询", notes="wps文件水印-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<WpsFileWatermark> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<WpsFileWatermark> result = new Result<>();
+		WpsFileWatermark wpsFileWatermark = wpsFileWatermarkService.getById(id);
+		if(wpsFileWatermark==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(wpsFileWatermark);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<WpsFileWatermark> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              WpsFileWatermark wpsFileWatermark = JSON.parseObject(deString, WpsFileWatermark.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(wpsFileWatermark, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<WpsFileWatermark> pageList = wpsFileWatermarkService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "wps文件水印列表");
+      mv.addObject(NormalExcelConstants.CLASS, WpsFileWatermark.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("wps文件水印列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<WpsFileWatermark> listWpsFileWatermarks = ExcelImportUtil.importExcel(file.getInputStream(), WpsFileWatermark.class, params);
+              wpsFileWatermarkService.saveBatch(listWpsFileWatermarks);
+              return Result.ok("文件导入成功!数据行数:" + listWpsFileWatermarks.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 241 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsUserAclController.java

@@ -0,0 +1,241 @@
+package org.jeecg.modules.wps.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.wps.entity.WpsUserAcl;
+import org.jeecg.modules.wps.service.IWpsUserAclService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+ /**
+ * wps用户权限
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="wps用户权限")
+@RestController
+@RequestMapping("/ctop/wpsUserAcl")
+public class WpsUserAclController {
+	@Autowired
+	private IWpsUserAclService wpsUserAclService;
+
+	/**
+	  * 分页列表查询
+	 * @param wpsUserAcl
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "wps用户权限-分页列表查询")
+	@ApiOperation(value="wps用户权限-分页列表查询", notes="wps用户权限-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<WpsUserAcl>> queryPageList(WpsUserAcl wpsUserAcl,
+												   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+												   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+												   HttpServletRequest req) {
+		Result<IPage<WpsUserAcl>> result = new Result<>();
+		QueryWrapper<WpsUserAcl> queryWrapper = QueryGenerator.initQueryWrapper(wpsUserAcl, req.getParameterMap());
+		Page<WpsUserAcl> page = new Page<WpsUserAcl>(pageNo, pageSize);
+		IPage<WpsUserAcl> pageList = wpsUserAclService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param wpsUserAcl
+	 * @return
+	 */
+	@AutoLog(value = "wps用户权限-添加")
+	@ApiOperation(value="wps用户权限-添加", notes="wps用户权限-添加")
+	@PostMapping(value = "/add")
+	public Result<WpsUserAcl> add(@RequestBody WpsUserAcl wpsUserAcl) {
+		Result<WpsUserAcl> result = new Result<>();
+		try {
+			wpsUserAclService.save(wpsUserAcl);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param wpsUserAcl
+	 * @return
+	 */
+	@AutoLog(value = "wps用户权限-编辑")
+	@ApiOperation(value="wps用户权限-编辑", notes="wps用户权限-编辑")
+	@PutMapping(value = "/edit")
+	public Result<WpsUserAcl> edit(@RequestBody WpsUserAcl wpsUserAcl) {
+		Result<WpsUserAcl> result = new Result<WpsUserAcl>();
+		WpsUserAcl wpsUserAclEntity = wpsUserAclService.getById(wpsUserAcl.getId());
+		if(wpsUserAclEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = wpsUserAclService.updateById(wpsUserAcl);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wps用户权限-通过id删除")
+	@ApiOperation(value="wps用户权限-通过id删除", notes="wps用户权限-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			wpsUserAclService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "wps用户权限-批量删除")
+	@ApiOperation(value="wps用户权限-批量删除", notes="wps用户权限-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<WpsUserAcl> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<WpsUserAcl> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.wpsUserAclService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wps用户权限-通过id查询")
+	@ApiOperation(value="wps用户权限-通过id查询", notes="wps用户权限-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<WpsUserAcl> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<WpsUserAcl> result = new Result<>();
+		WpsUserAcl wpsUserAcl = wpsUserAclService.getById(id);
+		if(wpsUserAcl==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(wpsUserAcl);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<WpsUserAcl> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              WpsUserAcl wpsUserAcl = JSON.parseObject(deString, WpsUserAcl.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(wpsUserAcl, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<WpsUserAcl> pageList = wpsUserAclService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "wps用户权限列表");
+      mv.addObject(NormalExcelConstants.CLASS, WpsUserAcl.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("wps用户权限列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<WpsUserAcl> listWpsUserAcls = ExcelImportUtil.importExcel(file.getInputStream(), WpsUserAcl.class, params);
+              wpsUserAclService.saveBatch(listWpsUserAcls);
+              return Result.ok("文件导入成功!数据行数:" + listWpsUserAcls.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 241 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsUserController.java

@@ -0,0 +1,241 @@
+package org.jeecg.modules.wps.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.wps.entity.WpsUser;
+import org.jeecg.modules.wps.service.IWpsUserService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+ /**
+ * wps用户
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="wps用户")
+@RestController
+@RequestMapping("/ctop/wpsUser")
+public class WpsUserController {
+	@Autowired
+	private IWpsUserService wpsUserService;
+
+	/**
+	  * 分页列表查询
+	 * @param wpsUser
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "wps用户-分页列表查询")
+	@ApiOperation(value="wps用户-分页列表查询", notes="wps用户-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<WpsUser>> queryPageList(WpsUser wpsUser,
+												@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+												@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+												HttpServletRequest req) {
+		Result<IPage<WpsUser>> result = new Result<>();
+		QueryWrapper<WpsUser> queryWrapper = QueryGenerator.initQueryWrapper(wpsUser, req.getParameterMap());
+		Page<WpsUser> page = new Page<WpsUser>(pageNo, pageSize);
+		IPage<WpsUser> pageList = wpsUserService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param wpsUser
+	 * @return
+	 */
+	@AutoLog(value = "wps用户-添加")
+	@ApiOperation(value="wps用户-添加", notes="wps用户-添加")
+	@PostMapping(value = "/add")
+	public Result<WpsUser> add(@RequestBody WpsUser wpsUser) {
+		Result<WpsUser> result = new Result<>();
+		try {
+			wpsUserService.save(wpsUser);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param wpsUser
+	 * @return
+	 */
+	@AutoLog(value = "wps用户-编辑")
+	@ApiOperation(value="wps用户-编辑", notes="wps用户-编辑")
+	@PutMapping(value = "/edit")
+	public Result<WpsUser> edit(@RequestBody WpsUser wpsUser) {
+		Result<WpsUser> result = new Result<WpsUser>();
+		WpsUser wpsUserEntity = wpsUserService.getById(wpsUser.getId());
+		if(wpsUserEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = wpsUserService.updateById(wpsUser);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wps用户-通过id删除")
+	@ApiOperation(value="wps用户-通过id删除", notes="wps用户-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			wpsUserService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "wps用户-批量删除")
+	@ApiOperation(value="wps用户-批量删除", notes="wps用户-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<WpsUser> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<WpsUser> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.wpsUserService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wps用户-通过id查询")
+	@ApiOperation(value="wps用户-通过id查询", notes="wps用户-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<WpsUser> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<WpsUser> result = new Result<>();
+		WpsUser wpsUser = wpsUserService.getById(id);
+		if(wpsUser==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(wpsUser);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<WpsUser> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              WpsUser wpsUser = JSON.parseObject(deString, WpsUser.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(wpsUser, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<WpsUser> pageList = wpsUserService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "wps用户列表");
+      mv.addObject(NormalExcelConstants.CLASS, WpsUser.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("wps用户列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<WpsUser> listWpsUsers = ExcelImportUtil.importExcel(file.getInputStream(), WpsUser.class, params);
+              wpsUserService.saveBatch(listWpsUsers);
+              return Result.ok("文件导入成功!数据行数:" + listWpsUsers.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 53 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/FileDTO.java

@@ -0,0 +1,53 @@
+package org.jeecg.modules.wps.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class FileDTO {
+
+    public FileDTO() {
+        super();
+    }
+
+    public FileDTO(String id, String name, int version, int size, String creator,
+                      long create_time, String download_url, UserAclBO user_acl, WatermarkBO watermark) {
+        this.id = id;
+        this.name = name;
+        this.version = version;
+        this.size = size;
+        this.creator = creator;
+        this.create_time = create_time;
+        this.download_url = download_url;
+        this.user_acl = user_acl;
+        this.watermark = watermark;
+    }
+
+    	/*
+	id:  "132aa30a87064",                 //文件id,字符串长度小于40
+    name : "example.doc",                //文件名
+    version: 1,                        //当前版本号,位数小于11
+    size: 200,                        //文件大小,单位为kb
+    creator: "id0",                        //创建者id,字符串长度小于40
+    create_time: 1136185445,            //创建时间,时间戳,单位为秒
+    modifier: "id1000",                    //修改者id,字符串长度小于40
+    modify_time: 1551409818,            //修改时间,时间戳,单位为秒
+    download_url: "http://www.xxx.cn/v1/file?fid=f132aa30a87064",  //文档下载地址
+    */
+
+    private String id;
+    private String name;
+    private int version;
+    private int size;
+    private String creator;
+    private String modifier;
+    private long create_time;
+    private long modify_time;
+    private String download_url;
+
+    private UserAclBO user_acl;
+    private WatermarkBO watermark;
+
+}
+

+ 34 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/FileHisDTO.java

@@ -0,0 +1,34 @@
+package org.jeecg.modules.wps.dto;
+
+import lombok.Data;
+
+@Data
+public class FileHisDTO {
+
+    private String id;
+    private String name;
+    private int version;
+    private int size;
+    private long create_time;
+    private long modify_time;
+    private String download_url;
+
+    private UserDTO creator;
+    private UserDTO modifier;
+
+    public FileHisDTO(){super();}
+
+    public FileHisDTO(String id, String name, int version, int size,
+                      long create_time, long modify_time, String download_url,
+                      UserDTO creator, UserDTO modifier) {
+        this.id = id;
+        this.name = name;
+        this.version = version;
+        this.size = size;
+        this.create_time = create_time;
+        this.modify_time = modify_time;
+        this.download_url = download_url;
+        this.creator = creator;
+        this.modifier = modifier;
+    }
+}

+ 40 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/FileListDTO.java

@@ -0,0 +1,40 @@
+package org.jeecg.modules.wps.dto;
+
+import lombok.Data;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * @author zm
+ * @date 2019.10.7
+ */
+
+@Data
+public class FileListDTO {
+
+    private String id;
+    private String name;
+    private int version;
+    private int size;
+    private String userId;
+    private String creator;
+    private String modifier;
+    private String createTime;
+    private String modifyTime;
+    private String download_url;
+
+    public FileListDTO(String id, String name, int version, int size, String creator,
+                       String modifier, long createTime, long modifyTime, String download_url,String userId) {
+        this.id = id;
+        this.name = name;
+        this.version = version;
+        this.size = size;
+        this.creator = creator;
+        this.modifier = modifier;
+        this.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(Long.valueOf(createTime)));
+        this.modifyTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(Long.valueOf(modifyTime)));
+        this.download_url = download_url;
+        this.userId = userId;
+    }
+}

+ 17 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/FileNewDTO.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.wps.dto;
+
+import lombok.Data;
+
+@Data
+public class FileNewDTO {
+
+    private String redirect_url;
+    private String user_id;
+
+    public FileNewDTO(){super();}
+
+    public FileNewDTO(String redirect_url, String user_id) {
+        this.redirect_url = redirect_url;
+        this.user_id = user_id;
+    }
+}

+ 16 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/FileReqDTO.java

@@ -0,0 +1,16 @@
+package org.jeecg.modules.wps.dto;
+
+import lombok.Data;
+
+@Data
+public class FileReqDTO {
+
+    // 重命名用
+    private String name;
+
+    // 历史信息
+    private String id;
+    private int offset = 0;
+    private int count;
+
+}

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/UserAclBO.java

@@ -0,0 +1,11 @@
+package org.jeecg.modules.wps.dto;
+
+import lombok.Data;
+
+@Data
+public class UserAclBO {
+
+    private int rename = 0; //重命名权限,1为打开该权限,0为关闭该权限,默认为0
+    private int history = 0; //历史版本权限,1为打开该权限,0为关闭该权限,默认为1
+
+}

+ 23 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/UserDTO.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.wps.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class UserDTO {
+
+    private String id = "-1";
+    private String name = " ";
+    private String permission = "read";
+    private String avatar_url = "";
+
+    public UserDTO(){super();}
+
+    public UserDTO(String id, String name, String permission, String avatar_url) {
+        this.id = id;
+        this.name = name;
+        this.permission = permission;
+        this.avatar_url = avatar_url;
+    }
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/dto/WatermarkBO.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.wps.dto;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class WatermarkBO {
+
+    private Integer type = 0;
+    private String value = "";
+    private String fillstyle = "rgba( 192, 192, 192, 0.6 )";
+    private String font = "bold 20px Serif";
+    private BigDecimal rotate = new BigDecimal("0");
+    private Integer horizontal = 50;
+    private Integer vertical = 50;
+
+}

+ 86 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsFile.java

@@ -0,0 +1,86 @@
+package org.jeecg.modules.wps.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * wps文件
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Data
+@TableName("wps_file")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="wps_file对象", description="wps文件")
+public class WpsFile {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private String id;
+	/**name*/
+	@Excel(name = "name", width = 15)
+    @ApiModelProperty(value = "name")
+	private String name;
+	/**version*/
+	@Excel(name = "version", width = 15)
+    @ApiModelProperty(value = "version")
+	private Integer version;
+	/**size*/
+	@Excel(name = "size", width = 15)
+    @ApiModelProperty(value = "size")
+	private Integer size;
+	/**creator*/
+	@Excel(name = "creator", width = 15)
+    @ApiModelProperty(value = "creator")
+	private String creator;
+	/**createTime*/
+	@Excel(name = "createTime", width = 15)
+    @ApiModelProperty(value = "createTime")
+	private Long createTime;
+	/**modifier*/
+	@Excel(name = "modifier", width = 15)
+    @ApiModelProperty(value = "modifier")
+	private String modifier;
+	/**modifyTime*/
+	@Excel(name = "modifyTime", width = 15)
+    @ApiModelProperty(value = "modifyTime")
+	private Long modifyTime;
+	/**downloadUrl*/
+	@Excel(name = "downloadUrl", width = 15)
+    @ApiModelProperty(value = "downloadUrl")
+	private String downloadUrl;
+	/**deleted*/
+	@Excel(name = "deleted", width = 15)
+    @ApiModelProperty(value = "deleted")
+	private String deleted;
+	/**canDelete*/
+	@Excel(name = "canDelete", width = 15)
+    @ApiModelProperty(value = "canDelete")
+	private String canDelete;
+
+	public WpsFile(){super();}
+
+	public WpsFile(String name, int version, int size, String creator,
+					  String modifier, long create_time, long modify_time, String download_url) {
+		this.name = name;
+		this.version = version;
+		this.size = size;
+		this.creator = creator;
+		this.modifier = modifier;
+		this.createTime = create_time;
+		this.modifyTime = modify_time;
+		this.downloadUrl = download_url;
+		this.deleted = "N";
+		this.canDelete = "Y";
+	}
+}

+ 66 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsFileVersion.java

@@ -0,0 +1,66 @@
+package org.jeecg.modules.wps.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * wps文件版本号
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Data
+@TableName("wps_file_version")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="wps_file_version对象", description="wps文件版本号")
+public class WpsFileVersion {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**fileId*/
+	@Excel(name = "fileId", width = 15)
+    @ApiModelProperty(value = "fileId")
+	private String fileId;
+	/**name*/
+	@Excel(name = "name", width = 15)
+    @ApiModelProperty(value = "name")
+	private String name;
+	/**version*/
+	@Excel(name = "version", width = 15)
+    @ApiModelProperty(value = "version")
+	private Integer version;
+	/**downloadUrl*/
+	@Excel(name = "downloadUrl", width = 15)
+    @ApiModelProperty(value = "downloadUrl")
+	private Object downloadUrl;
+	/**size*/
+	@Excel(name = "size", width = 15)
+    @ApiModelProperty(value = "size")
+	private int size;
+	/**creator*/
+	@Excel(name = "creator", width = 15)
+    @ApiModelProperty(value = "creator")
+	private String creator;
+	/**createTime*/
+	@Excel(name = "createTime", width = 15)
+    @ApiModelProperty(value = "createTime")
+	private Integer createTime;
+	/**modifier*/
+	@Excel(name = "modifier", width = 15)
+    @ApiModelProperty(value = "modifier")
+	private String modifier;
+	/**modifyTime*/
+	@Excel(name = "modifyTime", width = 15)
+    @ApiModelProperty(value = "modifyTime")
+	private Integer modifyTime;
+}

+ 77 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsFileWatermark.java

@@ -0,0 +1,77 @@
+package org.jeecg.modules.wps.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+
+/**
+ * wps文件水印
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Data
+@TableName("wps_file_watermark")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="wps_file_watermark对象", description="wps文件水印")
+public class WpsFileWatermark {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+	private Long id;
+	/**fileId*/
+	@Excel(name = "fileId", width = 15)
+    @ApiModelProperty(value = "fileId")
+	private String fileId;
+	/**type*/
+	@Excel(name = "type", width = 15)
+    @ApiModelProperty(value = "type")
+	private Integer type;
+	/**value*/
+	@Excel(name = "value", width = 15)
+    @ApiModelProperty(value = "value")
+	private String value;
+	/**fillstyle*/
+	@Excel(name = "fillstyle", width = 15)
+    @ApiModelProperty(value = "fillstyle")
+	private String fillstyle;
+	/**font*/
+	@Excel(name = "font", width = 15)
+    @ApiModelProperty(value = "font")
+	private String font;
+	/**rotate*/
+	@Excel(name = "rotate", width = 15)
+    @ApiModelProperty(value = "rotate")
+	private java.math.BigDecimal rotate;
+	/**horizontal*/
+	@Excel(name = "horizontal", width = 15)
+    @ApiModelProperty(value = "horizontal")
+	private Integer horizontal;
+	/**vertical*/
+	@Excel(name = "vertical", width = 15)
+    @ApiModelProperty(value = "vertical")
+	private Integer vertical;
+
+	public WpsFileWatermark(){super();}
+
+	public WpsFileWatermark(String fileId) {
+		this.fileId = fileId;
+		this.type = 0;
+		this.value = "";
+		this.fillstyle = "rgba( 192, 192, 192, 0.6 )";
+		this.font = "bold 20px Serif";
+		this.rotate = new BigDecimal("0");
+		this.horizontal = 50;
+		this.vertical = 50;
+	}
+}

+ 42 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsUser.java

@@ -0,0 +1,42 @@
+package org.jeecg.modules.wps.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * wps用户
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Data
+@TableName("wps_user")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="wps_user对象", description="wps用户")
+public class WpsUser {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private String id;
+	/**name*/
+	@Excel(name = "name", width = 15)
+    @ApiModelProperty(value = "name")
+	private String name;
+	/**avatarUrl*/
+	@Excel(name = "avatarUrl", width = 15)
+    @ApiModelProperty(value = "avatarUrl")
+	private Object avatarUrl;
+
+	public WpsUser(String userId, String fileId) {
+
+	}
+}

+ 61 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsUserAcl.java

@@ -0,0 +1,61 @@
+package org.jeecg.modules.wps.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * wps用户权限
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Data
+@TableName("wps_user_acl")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="wps_user_acl对象", description="wps用户权限")
+public class WpsUserAcl {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**userId*/
+	@Excel(name = "userId", width = 15)
+    @ApiModelProperty(value = "userId")
+	private String userId;
+	/**fileId*/
+	@Excel(name = "fileId", width = 15)
+    @ApiModelProperty(value = "fileId")
+	private String fileId;
+	/**permission*/
+	@Excel(name = "permission", width = 15)
+    @ApiModelProperty(value = "permission")
+	private String permission;
+	/**reName*/
+	@Excel(name = "reName", width = 15)
+    @ApiModelProperty(value = "reName")
+	private Integer reName;
+	/**history*/
+	@Excel(name = "history", width = 15)
+    @ApiModelProperty(value = "history")
+	private Integer history;
+
+	public WpsUserAcl() {
+	}
+
+	public WpsUserAcl(String userId, String fileId) {
+		this.userId = userId;
+		this.fileId = fileId;
+		this.permission = "write";
+		this.reName = 1;
+		this.history = 1;
+	}
+}

+ 51 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/WpsFileMapper.java

@@ -0,0 +1,51 @@
+package org.jeecg.modules.wps.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Select;
+import org.jeecg.modules.wps.dto.FileListDTO;
+import org.jeecg.modules.wps.entity.WpsFile;
+
+import java.util.List;
+
+/**
+ * wps文件
+ * @author: jeecg-boot
+ * @date:   2020-06-01
+ * @cersion: V1.0
+ */
+public interface WpsFileMapper extends BaseMapper<WpsFile> {
+
+    @Select("select file.id, " +
+            "       file.name, " +
+            "       file.version, " +
+            "       file.size, " +
+            "       user1.name as 'creator', " +
+            "       user2.name as 'modifier', " +
+            "       file.create_time, " +
+            "       file.modify_time, " +
+            "       '_' as 'download_url', " +
+            "       file.modifier as 'user_id' " +
+            " from wps_file file " +
+            "         left join wps_user user1 on file.creator = user1.id " +
+            "         left join wps_user user2 on file.modifier = user2.id " +
+            " where file.deleted = 'N' " +
+            " order by file.create_time desc ")
+    List<FileListDTO> findAllFile();
+
+    @Select("select file.id, " +
+            "       file.name, " +
+            "       file.version, " +
+            "       file.size, " +
+            "       user1.name as 'creator', " +
+            "       user2.name as 'modifier', " +
+            "       file.create_time, " +
+            "       file.modify_time, " +
+            "       '_' as 'download_url', " +
+            "       file.modifier as 'user_id' " +
+            " from wps_file file " +
+            "         left join wps_user user1 on file.creator = user1.id " +
+            "         left join wps_user user2 on file.modifier = user2.id " +
+            " where file.deleted = 'N' " +
+            " order by file.create_time desc ")
+    List<FileListDTO> getAllFileByPage();
+}

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/WpsFileVersionMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.wps.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.wps.entity.WpsFileVersion;
+
+/**
+ * wps文件版本号
+ * @author: jeecg-boot
+ * @date:   2020-06-01
+ * @cersion: V1.0
+ */
+public interface WpsFileVersionMapper extends BaseMapper<WpsFileVersion> {
+
+}

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/WpsFileWatermarkMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.wps.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.wps.entity.WpsFileWatermark;
+
+/**
+ * wps文件水印
+ * @author: jeecg-boot
+ * @date:   2020-06-01
+ * @cersion: V1.0
+ */
+public interface WpsFileWatermarkMapper extends BaseMapper<WpsFileWatermark> {
+
+}

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/WpsUserAclMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.wps.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.wps.entity.WpsUserAcl;
+
+/**
+ * wps用户权限
+ * @author: jeecg-boot
+ * @date:   2020-06-01
+ * @cersion: V1.0
+ */
+public interface WpsUserAclMapper extends BaseMapper<WpsUserAcl> {
+
+}

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/WpsUserMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.wps.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.wps.entity.WpsUser;
+
+/**
+ * wps用户
+ * @author: jeecg-boot
+ * @date:   2020-06-01
+ * @cersion: V1.0
+ */
+public interface WpsUserMapper extends BaseMapper<WpsUser> {
+
+}

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/xml/WpsFileMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.wps.mapper.WpsFileMapper">
+
+</mapper>

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/xml/WpsFileVersionMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.wps.mapper.WpsFileVersionMapper">
+
+</mapper>

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/xml/WpsFileWatermarkMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.wps.mapper.WpsFileWatermarkMapper">
+
+</mapper>

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/xml/WpsUserAclMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.wps.mapper.WpsUserAclMapper">
+
+</mapper>

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/mapper/xml/WpsUserMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.wps.mapper.WpsUserMapper">
+
+</mapper>

+ 20 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/propertie/OSSProperties.java

@@ -0,0 +1,20 @@
+package org.jeecg.modules.wps.propertie;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = "oss")
+public class OSSProperties {
+
+    private String fileUrlPrefix;
+    private String bucketName;
+    private String diskName;
+    private String regionId;
+    private String endpoint;
+    private String accessKey;
+    private String accessSecret;
+
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/propertie/QNProperties.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.wps.propertie;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = "qn")
+public class QNProperties {
+
+    private String url;
+    private String bucket;
+    private String accessKey;
+    private String secretKey;
+    private String diskName;
+
+}

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/propertie/UploadProperties.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.wps.propertie;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = "upload")
+public class UploadProperties {
+
+    private String fileLocation;
+
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/propertie/WpsProperties.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.wps.propertie;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * 属性文件
+ * @author zm
+ */
+@Data
+@Component
+@ConfigurationProperties(prefix = "wps")
+public class WpsProperties {
+
+
+
+}

+ 46 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/IWpsFileService.java

@@ -0,0 +1,46 @@
+package org.jeecg.modules.wps.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.wps.dto.FileListDTO;
+import org.jeecg.modules.wps.dto.FileReqDTO;
+import org.jeecg.modules.wps.entity.WpsFile;
+import org.jeecg.modules.wps.util.Token;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * wps文件
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+public interface IWpsFileService extends IService<WpsFile> {
+
+    Map<String, Object> getFileInfo(String w_userid, String w_filepath, String w_filetype);
+
+    Map<String, Object> fileSave(MultipartFile file, String w_userid);
+
+    Map<String, Object> fileVersion(Integer version);
+
+    void fileRename(String name, String w_userid);
+
+    Map<String, Object> fileHistory(FileReqDTO req);
+
+    Map<String, Object> fileNew(MultipartFile file, String w_userid);
+
+    Token getViewUrl(String fileUrl, boolean b);
+
+    Token getViewUrl(String fileUrl, String userId,boolean b);
+
+    List<FileListDTO> getFileList();
+
+    Map<String,Object> getFileListByPage(int pageNum,int pageSize);
+
+    int delFile(String id);
+
+    void uploadFile(MultipartFile file);
+
+    String createTemplateFile(String template);
+}

+ 19 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/IWpsFileVersionService.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.wps.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.wps.entity.WpsFileVersion;
+
+import java.util.List;
+
+/**
+ * wps文件版本号
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+public interface IWpsFileVersionService extends IService<WpsFileVersion> {
+
+    WpsFileVersion findByFileIdAndVersion(String fileId, Integer version);
+
+    List<WpsFileVersion> findByFileIdOrderByVersionDesc(String id);
+}

+ 17 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/IWpsFileWatermarkService.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.wps.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.wps.entity.WpsFileWatermark;
+
+/**
+ * wps文件水印
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+public interface IWpsFileWatermarkService extends IService<WpsFileWatermark> {
+
+    WpsFileWatermark findFirstByFileId(String fileId);
+
+    void saveWatermark(String fileId);
+}

+ 17 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/IWpsUserAclService.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.wps.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.wps.entity.WpsUserAcl;
+
+/**
+ * wps用户权限
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+public interface IWpsUserAclService extends IService<WpsUserAcl> {
+
+    WpsUserAcl findFirstByFileIdAndUserId(String fileId, String userId);
+
+    void saveUserFileAcl(String userId, String id);
+}

+ 21 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/IWpsUserService.java

@@ -0,0 +1,21 @@
+package org.jeecg.modules.wps.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.wps.entity.WpsUser;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * wps用户
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+public interface IWpsUserService extends IService<WpsUser> {
+
+    Map<String, Object> userInfo(JSONObject reqObj);
+
+    List<WpsUser> findByIdIn(List<String> userIdList);
+}

+ 392 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/impl/WpsFileServiceImpl.java

@@ -0,0 +1,392 @@
+package org.jeecg.modules.wps.service.impl;
+
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.modules.wps.config.Context;
+import org.jeecg.modules.wps.dto.*;
+import org.jeecg.modules.wps.entity.*;
+import org.jeecg.modules.wps.mapper.WpsFileMapper;
+import org.jeecg.modules.wps.service.*;
+import org.jeecg.modules.wps.util.Token;
+import org.jeecg.modules.wps.util.WpsUtil;
+import org.jeecg.modules.wps.util.file.FileUtil;
+import org.jeecg.modules.wps.util.upload.ResFileDTO;
+import org.jeecg.modules.wps.util.upload.oss.WpsOSSUtil;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.*;
+
+/**
+ * wps文件
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Slf4j
+@Service
+public class WpsFileServiceImpl extends ServiceImpl<WpsFileMapper, WpsFile> implements IWpsFileService {
+    @Autowired
+    private IWpsUserAclService wpsUserAclService;
+    @Autowired
+    private IWpsFileWatermarkService wpsFileWatermarkService;
+    @Autowired
+    private IWpsFileVersionService wpsFileVersionService;
+    @Autowired
+    private IWpsUserService wpsUserService;
+    @Autowired
+    private WpsUtil wpsUtil;
+    @Override
+    public Token getViewUrl(String fileUrl, boolean checkToken){
+        Token t = new Token();
+
+        String fileType = FileUtil.getFileTypeByPath(fileUrl);
+        // fileId使用uuid保证出现同样的文件而是最新文件
+        UUID randomUUID = UUID.randomUUID();
+        String uuid = randomUUID.toString().replace("-","");
+
+        Map<String,String> values = new HashMap<String,String>(){
+            {
+                put("_w_appid", appid);
+                if (checkToken){
+                    put("_w_tokentype","1");
+                }
+                put("_w_userid", "-1");
+                put("_w_filepath",fileUrl);
+                put("_w_filetype","web");
+            }
+        };
+
+        String wpsUrl = wpsUtil.getWpsUrl(values,fileType,uuid);
+
+        t.setToken(uuid);
+        t.setExpires_in(600);
+        t.setWpsUrl(wpsUrl);
+
+        return t;
+    }
+    @Value("wps.domain")
+    private String domain;
+    @Value("wps.appid")
+    private String appid;
+    @Value("wps.appsecret")
+    private String appsecret;
+    @Value("wps.download_host")
+    private String downloadHost;
+    @Value("wps.local_Dir")
+    private String localDir;
+
+    @Override
+    public Token getViewUrl(String fileId,String userId,boolean checkToken){
+        WpsFile fileEntity = this.getById(fileId);
+        if (fileEntity != null){
+            Token t = new Token();
+            String fileName = fileEntity.getName();
+            String fileType = FileUtil.getFileTypeByName(fileName);
+
+            UUID randomUuid = UUID.randomUUID();
+            String uuid = randomUuid.toString().replace("-","");
+
+            Map<String,String> values = new HashMap<>();
+            values.put("_w_appid", appid);
+            if (checkToken){
+                values.put("_w_tokentype","1");
+            }
+            values.put("_w_filepath",fileName);
+            values.put("_w_userid", userId);
+            values.put("_w_filetype","db");
+
+            String wpsUrl = wpsUtil.getWpsUrl(values,fileType,fileEntity.getId());
+            t.setToken(uuid);
+            t.setExpires_in(600);
+            t.setWpsUrl(wpsUrl);
+
+            return t;
+        }
+        return null;
+    }
+
+    @Override
+    public Map<String,Object> getFileInfo(String userId, String filePath,String _w_filetype){
+        if ("web".equalsIgnoreCase(_w_filetype)){
+            return getWebFileInfo(filePath);
+        }else if ("db".equalsIgnoreCase(_w_filetype)){
+            return getDbFileInfo(userId);
+        }
+        return null;
+    }
+
+    private Map<String,Object> getWebFileInfo(String filePath){
+        Map<String,Object>result = new HashMap<>();
+        log.info("_w_filepath:{}",filePath);
+        // 构建默认user信息
+        UserDTO wpsUser = new UserDTO(
+                "-1","我","read","https://zmfiletest.oss-cn-hangzhou.aliyuncs.com/user0.png"
+        );
+
+        // 构建文件
+        FileDTO file = new FileDTO(
+                Context.getFileId(), FileUtil.getFileName(filePath),
+                1,2835,"-1",System.currentTimeMillis(), filePath,
+                // 默认设置为无水印,只读权限
+                new UserAclBO(),new WatermarkBO()
+        );
+        result.put("file",file);
+        result.put("user",wpsUser);
+        return result;
+    }
+
+    private Map<String,Object> getDbFileInfo(String userId){
+        String fileId = Context.getFileId();
+        // 获取文件信息
+        WpsFile fileEntity = this.getById(fileId);
+
+        // 初始化文件读写权限为read
+        String permission = "read";
+
+        // 增加用户权限
+        WpsUserAcl userAclEntity = wpsUserAclService.findFirstByFileIdAndUserId(fileId,userId);
+        UserAclBO userAcl = new UserAclBO();
+        if (userAclEntity != null){
+            BeanUtils.copyProperties(userAclEntity,userAcl);
+            permission = userAclEntity.getPermission();
+        }
+
+        // 增加水印
+        WpsFileWatermark watermarkEntity = wpsFileWatermarkService.findFirstByFileId(fileId);
+        WatermarkBO watermark = new WatermarkBO();
+        if (watermarkEntity != null){
+            BeanUtils.copyProperties(watermarkEntity,watermark);
+        }
+
+        //获取user
+        WpsUser wpsUser = wpsUserService.getById(userId);
+        UserDTO user = new UserDTO();
+        if (wpsUser != null){
+            BeanUtils.copyProperties(wpsUser,user);
+            user.setPermission(permission);
+        }
+
+        // 构建fileInfo
+        FileDTO file = new FileDTO();
+        BeanUtils.copyProperties(fileEntity,file);
+        file.setUser_acl(userAcl);
+        file.setWatermark(watermark);
+
+        return new HashMap<String, Object>(){
+            {
+                put("file", file);
+                put("user", user);
+            }
+        };
+    }
+
+    @Override
+    public void fileRename(String fileName, String userId){
+        String fileId = Context.getFileId();
+        WpsFile file = this.getById(fileId);
+        if (file != null){
+            file.setName(fileName);
+            file.setModifier(userId);
+            Date date = new Date();
+            file.setModifyTime(date.getTime());
+            this.updateById(file);
+        }
+    }
+
+    @Override
+    public Map<String,Object> fileNew(MultipartFile file, String userId){
+        ResFileDTO resFileDTO = WpsOSSUtil.uploadMultipartFile(file);
+
+        String fileName = resFileDTO.getFileName();
+        String fileUrl = resFileDTO.getFileUrl();
+        int fileSize = (int) file.getSize();
+        Date date = new Date();
+        long dataTime = date.getTime();
+        // 保存文件
+        WpsFile f = new WpsFile(fileName,1,fileSize,userId,userId,dataTime,dataTime,fileUrl);
+        this.save(f);
+
+        // 处理权限
+        wpsUserAclService.saveUserFileAcl(userId,f.getId());
+
+        // 处理水印
+        wpsFileWatermarkService.saveWatermark(f.getId());
+
+        // 处理返回
+        Map<String,Object> map = new HashMap<>();
+        map.put("redirect_url",this.getViewUrl(f.getId(),userId,false).getWpsUrl());
+        map.put("user_id",userId);
+        return map;
+    }
+
+    @Override
+    public Map<String,Object> fileHistory(FileReqDTO req){
+        Map<String,Object> map = new HashMap<>();
+        List<FileHisDTO> result = new ArrayList<>(12);
+        if (req.getId() == null){
+            map.put("histories",result);
+            return map;
+        }
+        // 目前先实现获取所有的历史记录
+        List<WpsFileVersion> versionList = wpsFileVersionService.findByFileIdOrderByVersionDesc(req.getId());
+        if (versionList == null || versionList.isEmpty()){
+            map.put("histories",result);
+            return map;
+        }
+        Set<String> userIdSet = new HashSet<>();
+        for (WpsFileVersion fileVersion : versionList){
+            userIdSet.add(fileVersion.getModifier());
+            userIdSet.add(fileVersion.getCreator());
+        }
+        List<String> userIdList = new ArrayList<>(userIdSet);
+        // 获取所有关联的人
+        List<WpsUser> userList = wpsUserService.findByIdIn(userIdList);
+        if (userList == null || userList.isEmpty()){
+            map.put("histories",result);
+            return map;
+        }
+        for (WpsFileVersion fileVersion : versionList){
+            FileHisDTO fileHis = new FileHisDTO();
+            BeanUtils.copyProperties(fileVersion,fileHis);
+            fileHis.setId(fileVersion.getFileId());
+            UserDTO creator = new UserDTO();
+            UserDTO modifier = new UserDTO();
+            for (WpsUser user : userList){
+                if (user.getId().equals(fileVersion.getCreator())){
+                    BeanUtils.copyProperties(user,creator);
+                }
+                if (user.getId().equals(fileVersion.getModifier())){
+                    BeanUtils.copyProperties(user,modifier);
+                }
+            }
+            fileHis.setModifier(modifier);
+            fileHis.setCreator(creator);
+            result.add(fileHis);
+        }
+        map.put("histories",result);
+        return map;
+    }
+
+    @Override
+    public Map<String,Object> fileSave(MultipartFile mFile,String userId){
+        Date date = new Date();
+        // 上传
+        ResFileDTO resFileDTO = WpsOSSUtil.uploadMultipartFile(mFile);
+        int size = (int) resFileDTO.getFileSize();
+
+        String fileId = Context.getFileId();
+        WpsFile file = this.getById(fileId);
+        FileDTO fileInfo = new FileDTO();
+
+        String oldFileUrl = file.getDownloadUrl();
+
+        // 更新当前版本
+        file.setVersion(file.getVersion() + 1);
+        file.setDownloadUrl(resFileDTO.getFileUrl());
+        file.setModifier(userId);
+        file.setModifyTime(date.getTime());
+        file.setSize(size);
+        this.updateById(file);
+
+        // 保存历史版本
+        WpsFileVersion fileVersion = new WpsFileVersion();
+        BeanUtils.copyProperties(file,fileVersion);
+        fileVersion.setFileId(fileId);
+        fileVersion.setVersion(file.getVersion() - 1);
+        fileVersion.setDownloadUrl(oldFileUrl);
+        fileVersion.setSize(size);
+        wpsFileVersionService.save(fileVersion);
+
+        // 返回当前版本信息
+        BeanUtils.copyProperties(file,fileInfo);
+
+        Map<String,Object> map = new HashMap<>();
+        map.put("file",fileInfo);
+        return map;
+    }
+
+
+    @Override
+    public Map<String,Object> fileVersion(Integer version){
+        FileDTO fileInfo = new FileDTO();
+        String fileId = Context.getFileId();
+        WpsFileVersion fileVersion =
+                wpsFileVersionService.findByFileIdAndVersion(fileId,version);
+        if (fileVersion != null){
+            BeanUtils.copyProperties(fileVersion,fileInfo);
+            fileInfo.setId(fileVersion.getFileId());
+        }
+        Map<String,Object> map = new HashMap<>();
+        map.put("file",fileInfo);
+        return map;
+    }
+    @Autowired
+    private WpsFileMapper wpsFileMapper;
+
+    @Override
+    public List<FileListDTO> getFileList(){
+        return wpsFileMapper.findAllFile();
+    }
+    @Override
+    public Map<String,Object> getFileListByPage(int pageNum, int pageSize){
+        Map<String,Object>result = new HashMap<>();
+        PageHelper.startPage(pageNum,pageSize);
+        List<FileListDTO> fileListDTOS = wpsFileMapper.getAllFileByPage();
+        PageInfo<FileListDTO> pageInfo = new PageInfo<>(fileListDTOS);
+        result.put("data",pageInfo);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Override
+    public int delFile(String id){
+        WpsFile file = this.getById(id);
+        if (file != null){
+            if ("Y".equalsIgnoreCase(file.getCanDelete())){
+                // del
+                this.removeById(id);
+                return 1;
+            }else {
+                return 0;
+            }
+        }else {
+            return -1;
+        }
+    }
+
+    @Override
+    public void uploadFile(MultipartFile file){
+        String uploadUserId = "3";
+        ResFileDTO resFileDTO = WpsOSSUtil.uploadMultipartFile(file);
+        // 上传成功后,处理数据库记录值
+        Date date = new Date();
+        long dataTime = date.getTime();
+        // 保存文件
+        WpsFile f = new WpsFile(resFileDTO.getFileName(),1,((int) resFileDTO.getFileSize()),
+                uploadUserId,uploadUserId,dataTime,dataTime, resFileDTO.getFileUrl());
+        this.save(f);
+
+        // 处理权限
+        wpsUserAclService.saveUserFileAcl(uploadUserId,f.getId());
+
+        // 处理水印
+        wpsFileWatermarkService.saveWatermark(f.getId());
+    }
+
+    @Override
+    public String createTemplateFile(String template){
+        boolean typeTrue = FileUtil.checkCode(template);
+        if (typeTrue){
+            return wpsUtil.getTemplateWpsUrl(template,"3");
+        }
+        return "";
+    }
+}

+ 43 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/impl/WpsFileVersionServiceImpl.java

@@ -0,0 +1,43 @@
+package org.jeecg.modules.wps.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.wps.mapper.WpsFileVersionMapper;
+import org.jeecg.modules.wps.entity.WpsFileVersion;
+import org.jeecg.modules.wps.service.IWpsFileVersionService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * wps文件版本号
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Service
+public class WpsFileVersionServiceImpl extends ServiceImpl<WpsFileVersionMapper, WpsFileVersion> implements IWpsFileVersionService {
+
+    @Override
+    public WpsFileVersion findByFileIdAndVersion(String fileId, Integer version) {
+        QueryWrapper<WpsFileVersion>queryWrapper = new QueryWrapper<>();
+        if(null!=fileId&&!fileId.trim().equals("")){
+            queryWrapper.eq("file_id",fileId);
+        }
+        if(null!=version&&version!=0){
+            queryWrapper.eq("version",version);
+        }
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+
+    @Override
+    public List<WpsFileVersion> findByFileIdOrderByVersionDesc(String fileId) {
+        QueryWrapper<WpsFileVersion>queryWrapper = new QueryWrapper<>();
+        if(null!=fileId&&fileId.trim().equals("")){
+            queryWrapper.eq("file_id",fileId);
+        }
+        queryWrapper.orderByDesc("version");
+        return this.list(queryWrapper);
+    }
+}

+ 33 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/impl/WpsFileWatermarkServiceImpl.java

@@ -0,0 +1,33 @@
+package org.jeecg.modules.wps.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.wps.mapper.WpsFileWatermarkMapper;
+import org.jeecg.modules.wps.entity.WpsFileWatermark;
+import org.jeecg.modules.wps.service.IWpsFileWatermarkService;
+import org.springframework.stereotype.Service;
+
+/**
+ * wps文件水印
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Service
+public class WpsFileWatermarkServiceImpl extends ServiceImpl<WpsFileWatermarkMapper, WpsFileWatermark> implements IWpsFileWatermarkService {
+
+    @Override
+    public WpsFileWatermark findFirstByFileId(String fileId) {
+        QueryWrapper<WpsFileWatermark>queryWrapper = new QueryWrapper<>();
+        if(null!=fileId&&!fileId.trim().equals("")){
+            queryWrapper.eq("file_id",fileId);
+        }
+        queryWrapper.orderByDesc("id").last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+
+    @Override
+    public void saveWatermark(String fileId) {
+        this.save(new WpsFileWatermark(fileId));
+    }
+}

+ 35 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/impl/WpsUserAclServiceImpl.java

@@ -0,0 +1,35 @@
+package org.jeecg.modules.wps.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.wps.mapper.WpsUserAclMapper;
+import org.jeecg.modules.wps.entity.WpsUserAcl;
+import org.jeecg.modules.wps.service.IWpsUserAclService;
+import org.springframework.stereotype.Service;
+
+/**
+ * wps用户权限
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Service
+public class WpsUserAclServiceImpl extends ServiceImpl<WpsUserAclMapper, WpsUserAcl> implements IWpsUserAclService {
+    @Override
+    public WpsUserAcl findFirstByFileIdAndUserId(String fileId, String userId) {
+        QueryWrapper<WpsUserAcl> queryWrapper = new QueryWrapper<>();
+        if(null!=fileId&&!fileId.trim().equals("")){
+            queryWrapper.eq("file_id",fileId);
+        }
+        if(null!=userId&&!userId.trim().equals("")){
+            queryWrapper.eq("user_id",userId);
+        }
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+
+    @Override
+    public void saveUserFileAcl(String userId, String fileId) {
+        this.save(new WpsUserAcl(userId,fileId));
+    }
+}

+ 64 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/service/impl/WpsUserServiceImpl.java

@@ -0,0 +1,64 @@
+package org.jeecg.modules.wps.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.wps.mapper.WpsUserMapper;
+import org.jeecg.modules.wps.entity.WpsUser;
+import org.jeecg.modules.wps.service.IWpsUserService;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * wps用户
+ * @author jeecg-boot
+ * @date   2020-06-01
+ * @version V1.0
+ */
+@Service
+public class WpsUserServiceImpl extends ServiceImpl<WpsUserMapper, WpsUser> implements IWpsUserService {
+
+    @Override
+    public Map<String,Object> userInfo(JSONObject reqObj){
+        List<String> ids = null;
+
+        if(reqObj != null) {
+            if(reqObj.containsKey("ids")) {
+                ids = JSONArray.parseArray(reqObj.getString("ids"), String.class);
+            }
+        }
+
+        Map<String,Object> map = new HashMap<>();
+        List<WpsUser> users = new ArrayList<>();
+        if(ids != null && !ids.isEmpty()) {
+            WpsUser user;
+            for (String id : ids) {
+                user = this.getById(id);
+                if (user != null){
+                    users.add(user);
+                }
+            }
+        }
+        map.put("users", users);
+        return map;
+    }
+
+    @Override
+    public List<WpsUser> findByIdIn(List<String> userIdList) {
+        if(null==userIdList||userIdList.isEmpty()){
+            return null;
+        }
+        List<WpsUser> userList = new ArrayList<>();
+        for (String id :userIdList){
+            WpsUser user = this.getById(id);
+            if(null!=user){
+                userList.add(user);
+            }
+        }
+        return userList;
+    }
+}

+ 80 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/SignatureUtil.java

@@ -0,0 +1,80 @@
+package org.jeecg.modules.wps.util;
+
+import org.apache.commons.codec.digest.HmacUtils;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.apache.commons.codec.binary.Base64.encodeBase64String;
+
+
+public class SignatureUtil {
+
+    public static String getKeyValueStr(Map<String, String> params) {
+        List<String> keys = new ArrayList<>();
+        for (Map.Entry<String, String> entry : params.entrySet()) {
+            keys.add(entry.getKey());
+        }
+        StringBuilder sb = new StringBuilder();
+        for (String key : keys) {
+            String value = params.get(key) + "&";
+            sb.append(key).append("=").append(value);
+        }
+        return sb.toString();
+    }
+
+    public static String getSignature(Map<String, String> params, String appSecret) {
+        List<String> keys = new ArrayList<>();
+        for (Map.Entry<String, String> entry : params.entrySet()) {
+            keys.add(entry.getKey());
+        }
+        // 将所有参数按key的升序排序
+        keys.sort(String::compareTo);
+
+        // 构造签名的源字符串
+        StringBuilder contents = new StringBuilder();
+        for (String key : keys) {
+            if (key.equals("_w_signature")) {
+                continue;
+            }
+            contents.append(key).append("=").append(params.get(key));
+        }
+        contents.append("_w_secretkey=").append(appSecret);
+
+        // 进行hmac sha1 签名
+        byte[] bytes = HmacUtils.hmacSha1(appSecret.getBytes(), contents.toString().getBytes());
+
+        //字符串经过Base64编码
+        String sign = encodeBase64String(bytes);
+        try {
+            return URLEncoder.encode(sign, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    public static Map<String, String> paramToMap(String paramStr) {
+        String[] params = paramStr.split("&");
+        return new HashMap<String, String>(){
+            {
+                for (String param1 : params) {
+                    String[] param = param1.split("=");
+                    if (param.length >= 2) {
+                        String key = param[0];
+                        StringBuilder value = new StringBuilder(param[1]);
+                        for (int j = 2; j < param.length; j++) {
+                            value.append("=").append(param[j]);
+                        }
+                        put(key, value.toString());
+                    }
+                }
+            }
+        };
+    }
+
+}

+ 12 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/Token.java

@@ -0,0 +1,12 @@
+package org.jeecg.modules.wps.util;
+
+import lombok.Data;
+
+@Data
+public class Token {
+
+    private int expires_in;
+    private String token;
+    private String wpsUrl;
+
+}

+ 43 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/WpsUtil.java

@@ -0,0 +1,43 @@
+package org.jeecg.modules.wps.util;
+
+import org.jeecg.modules.wps.util.file.FileUtil;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Component
+public class WpsUtil {
+    @Value("wps.domain")
+    private String domain;
+    @Value("wps.appid")
+    private String appid;
+    @Value("wps.appsecret")
+    private String appsecret;
+    @Value("wps.download_host")
+    private String downloadHost;
+    @Value("wps.local_Dir")
+    private String localDir;
+    public String getWpsUrl(Map<String,String> values,String fileType,String fileId){
+        String keyValueStr = SignatureUtil.getKeyValueStr(values);
+        String signature = SignatureUtil.getSignature(values, appsecret);
+        String fileTypeCode = FileUtil.getFileTypeCode(fileType);
+
+        return domain + fileTypeCode + "/" + fileId + "?"
+                + keyValueStr + "_w_signature=" + signature;
+    }
+
+    public String getTemplateWpsUrl(String fileType,String userId){
+        Map<String,String> values = new HashMap<>();
+        values.put("_w_appid", appid);
+        values.put("_w_userid", userId);
+        String keyValueStr = SignatureUtil.getKeyValueStr(values);
+        String signature = SignatureUtil.getSignature(values, appsecret);
+        String fileTypeCode = FileUtil.getTypeCode(fileType);
+
+        return domain + fileTypeCode + "/new/0" + "?"
+                + keyValueStr + "_w_signature=" + signature;
+    }
+
+}

+ 119 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/file/FileType.java

@@ -0,0 +1,119 @@
+package org.jeecg.modules.wps.util.file;
+
+/**
+ * 文件类型枚取
+ */
+public enum FileType {
+
+	JPEG("FFD8FF"),//JPEG (jpg)
+
+	PNG("89504E47"),//PNG (png)
+
+	GIF("47494638"),//GIF (gif)
+
+	TIFF("49492A00"),//TIFF (tif)
+
+	BMP("424D"),//Windows Bitmap (bmp)
+
+	DWG("41433130"),//CAD (dwg)
+
+	PSD("38425053"),// Adobe Photoshop.
+
+	RTF("7B5C727466"),// Rich Text Format.
+
+	XML("3C3F786D6C"),// XML.
+
+	HTML("68746D6C3E"),//HTML (html)
+
+	CSS("48544D4C207B0D0A0942"),// CSS.
+
+	JS("696B2E71623D696B2E71"),// JS.
+
+	EML("44656C69766572792D646174653A"),// Email [thorough only].
+
+	DBX("CFAD12FEC5FD746F"),// Outlook Express.
+
+	PST("2142444E"),// Outlook (pst).
+
+	XLS_DOC("D0CF11E0"), // MS Word/Excel.
+
+	XLSX_DOCX("504B030414000600080000002100"),// MS Word/Excel.
+
+	WPSUSER("504B03040A0000000000"),// WPS(个人版)文字wps、表格et、演示dps都是一样的
+
+	WPS("D0CF11E0A1B11AE10000"),// WPS(专业版)文字wps、表格et、演示dps都是一样的
+
+	VSD("d0cf11e0a1b11ae10000"),// Visio
+
+	MDB("5374616E64617264204A"),// MS Access.
+
+	TORRENT("6431303A637265617465"),// torrent
+
+	WPD("FF575043"),// WordPerfect.
+
+	EPS("252150532D41646F6265"),// Postscript.
+
+	PDF("255044462D312E"),// Adobe Acrobat.
+
+	QDF("AC9EBD8F"),// Quicken.
+
+	PWL("E3828596"),// Windows Password.
+
+	ZIP("504B03040A000008"),// ZIP Archive.
+
+	RAR("52617221"),// RAR Archive.
+
+	JSP("3C2540207061676520"),// JSP Archive.
+
+	JAVA("7061636B61676520"),// JAVA Archive.
+
+	JAR("504B03040A000000"),// JAR Archive.
+
+	MF("4D616E69666573742D56"),// MF Archive.
+
+	EXE("4D5A9000030000000400"),// EXE Archive.
+
+	CHM("49545346030000006000"),// CHM Archive.
+
+	WAV("57415645"),// Wave.
+
+	AVI("41564920"),// AVI.
+
+	RAM("2E7261FD"),// Real Audio.
+
+	RM("2E524D46"),// Real Media.
+
+	MPG("000001BA"),// MPEG (mpg).
+
+	MOV("6D6F6F76"),// Quicktime.
+
+	ASF("3026B2758E66CF11"),// Windows Media.
+
+	MID("4D546864"),// MIDI.
+
+	MP4("00000020667479706d70"),// MP4.
+
+	MP3("49443303000000002176"),// MP3.
+
+	FLV("464C5601050000000900");// FLV.
+
+	private String value = "";
+
+	/**
+	 * Constructor.
+	 *
+	 * @param type
+	 */
+	private FileType(String value) {
+		this.value = value;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+}

+ 148 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/file/FileTypeJudge.java

@@ -0,0 +1,148 @@
+package org.jeecg.modules.wps.util.file;
+
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+* 文件类型判断类
+*/
+@Component
+public class FileTypeJudge {
+
+   /**
+    * 将文件头转换成16进制字符串
+    * @return 16进制字符串
+    */
+   private static String bytesToHexString(byte[] src) {
+
+       StringBuilder stringBuilder = new StringBuilder();
+       if (src == null || src.length <= 0) {
+           return null;
+       }
+       for (int i = 0; i < src.length; i++) {
+           int v = src[i] & 0xFF;
+           String hv = Integer.toHexString(v);
+           if (hv.length() < 2) {
+               stringBuilder.append(0);
+           }
+           stringBuilder.append(hv);
+       }
+       return stringBuilder.toString();
+   }
+
+   /**
+    * 得到文件头
+    * @return 文件头
+    * @throws IOException ex
+    */
+   private static String getFileContent(InputStream is) throws IOException {
+
+       byte[] b = new byte[28];
+
+       InputStream inputStream = null;
+
+       try {
+           is.read(b, 0, 28);
+       } catch (IOException e) {
+           e.printStackTrace();
+           throw e;
+       } finally {
+           if (inputStream != null) {
+               try {
+                   inputStream.close();
+               } catch (IOException e) {
+                   e.printStackTrace();
+                   throw e;
+               }
+           }
+       }
+       return bytesToHexString(b);
+   }
+
+   /**
+    * 判断文件类型
+    * @return 文件类型
+    */
+   public static FileType getType(InputStream is) throws IOException {
+
+       String fileHead = getFileContent(is);
+
+       if (fileHead == null || fileHead.length() == 0) {
+           return null;
+       }
+
+       fileHead = fileHead.toUpperCase();
+
+       FileType[] fileTypes = FileType.values();
+
+
+       for (FileType type : fileTypes) {
+    	   System.out.println(type.getValue());
+           if (fileHead.startsWith(type.getValue())) {
+               return type;
+           }
+       }
+
+       return null;
+   }
+
+   public static Integer isFileType(FileType value) {
+       int type = 7;// 其他
+       // 图片
+       FileType[] pics = { FileType.JPEG, FileType.PNG, FileType.GIF, FileType.TIFF, FileType.BMP, FileType.DWG, FileType.PSD };
+
+       FileType[] docs = { FileType.RTF, FileType.XML, FileType.HTML, FileType.CSS, FileType.JS, FileType.EML, FileType.DBX, FileType.PST, FileType.XLS_DOC, FileType.XLSX_DOCX, FileType.VSD,
+               FileType.MDB, FileType.WPS, FileType.WPD, FileType.EPS, FileType.PDF, FileType.QDF, FileType.PWL, FileType.ZIP, FileType.RAR, FileType.JSP, FileType.JAVA,
+               FileType.JAR, FileType.MF, FileType.EXE, FileType.CHM };
+
+       FileType[] videos = { FileType.AVI, FileType.RAM, FileType.RM, FileType.MPG, FileType.MOV, FileType.ASF, FileType.MP4, FileType.FLV, FileType.MID };
+
+       FileType[] tottents = { FileType.TORRENT };
+
+       FileType[] audios = { FileType.WAV, FileType.MP3 };
+
+       FileType[] others = {};
+
+       // 图片
+       for (FileType fileType : pics) {
+           if (fileType.equals(value)) {
+               type = 1;
+           }
+       }
+       // 文档
+       for (FileType fileType : docs) {
+           if (fileType.equals(value)) {
+               type = 2;
+           }
+       }
+       // 视频
+       for (FileType fileType : videos) {
+           if (fileType.equals(value)) {
+               type = 3;
+           }
+       }
+       // 种子
+       for (FileType fileType : tottents) {
+           if (fileType.equals(value)) {
+               type = 4;
+           }
+       }
+       // 音乐
+       for (FileType fileType : audios) {
+           if (fileType.equals(value)) {
+               type = 5;
+           }
+       }
+       return type;
+   }
+
+/*   public static void main(String args[]) throws Exception {
+       // System.out.println(FileTypeJudge.getType(new FileInputStream("")));
+       for (FileType type : FileType.values()) {
+           System.out.print(type + "\t");
+       }
+   }
+   */
+}

+ 113 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/file/FileUtil.java

@@ -0,0 +1,113 @@
+package org.jeecg.modules.wps.util.file;
+
+import java.nio.charset.StandardCharsets;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Random;
+
+public class FileUtil {
+
+    // office
+    private static String[] office = {"word", "excel", "ppt"};
+
+    // excel
+    private static String[] etExts = {"et", "xls", "xlt", "xlsx", "xlsm", "xltx", "xltm", "csv"};
+
+    // word
+    private static String[] wpsExts = {"doc", "docx", "txt", "dot", "wps", "wpt", "dotx", "docm", "dotm"};
+
+    // ppt
+    private static String[] wppExts = {"ppt", "pptx", "pptm", "pptm", "ppsm", "pps", "potx", "potm", "dpt", "dps"};
+
+    // pdf
+    private static String[] pdfExts = {"pdf"};
+
+    public static String getFileTypeCode(String fileType){
+        for (String et : etExts){
+            if (et.equalsIgnoreCase(fileType)){
+                return "s";
+            }
+        }
+        for (String et : wpsExts){
+            if (et.equalsIgnoreCase(fileType)){
+                return "w";
+            }
+        }
+        for (String et : wppExts){
+            if (et.equalsIgnoreCase(fileType)){
+                return "p";
+            }
+        }
+        for (String et : pdfExts){
+            if (et.equalsIgnoreCase(fileType)){
+                return "f";
+            }
+        }
+        return null;
+    }
+
+    public static boolean checkCode(String fileType){
+        for (String et : office){
+            if (et.equalsIgnoreCase(fileType)){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static String getTypeCode(String fileType){
+        if ("word".equalsIgnoreCase(fileType)){
+            return "w";
+        }if ("excel".equalsIgnoreCase(fileType)){
+            return "s";
+        }if ("ppt".equalsIgnoreCase(fileType)){
+            return "p";
+        }
+        return null;
+    }
+
+    public static String getFileName(String filePath){
+        String[] pathArr = filePath.split("/");
+        String fileName ;
+        if (pathArr.length>1){
+            fileName = pathArr[pathArr.length-1];
+        }else {
+            fileName = filePath;
+        }
+        return fileName;
+    }
+
+    public static String getFileTypeByPath(String filePath){
+        String fileName = getFileName(filePath);
+        String[] arr = fileName.split("\\.");
+        return arr[arr.length-1];
+    }
+
+    public static String getFileTypeByName(String fileName){
+        String[] arr = fileName.split("\\.");
+        return arr[arr.length-1];
+    }
+
+    public static String getFileUUIDName(String fileName,String fileType){
+        String uuid = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
+        String uuidFileName = fileName.replace(".","").replace(fileType,"") + uuid + "." + fileType ;
+        return new String(uuidFileName.getBytes(), StandardCharsets.UTF_8);
+    }
+
+    public static String makeNewFileName(String oldFileName){
+        String fileType = FileUtil.getFileTypeByName(oldFileName);
+        String tempFileName = oldFileName.replace("."+fileType,"");
+        Random ne = new Random();//实例化一个random的对象ne
+        int uuid = ne.nextInt(90000)+10000;//为变量赋随机值10000-99999
+        return  tempFileName + uuid + "." + fileType;
+    }
+
+    public static String makeNewFileName(String oldFileName,String fileType){
+        String tempFileName = oldFileName.replace("."+fileType,"");
+        Random ne = new Random();//实例化一个random的对象ne
+        int uuid = ne.nextInt(90000)+10000;//为变量赋随机值10000-99999
+        return  tempFileName + uuid + "." + fileType;
+    }
+
+
+}

+ 28 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/upload/ResFileDTO.java

@@ -0,0 +1,28 @@
+package org.jeecg.modules.wps.util.upload;
+
+import lombok.Data;
+
+@Data
+public class ResFileDTO {
+
+	private String fileUrl;
+	private String fileName;
+	private String cFileName;
+	private String fileType;
+	private long fileSize;
+	private String md5key;
+
+	public ResFileDTO() {
+		super();
+	}
+
+	public ResFileDTO(String fileUrl, String fileName, String cFileName, String fileType, long fileSize, String md5key) {
+		this.fileUrl = fileUrl;
+		this.fileName = fileName;
+		this.cFileName = cFileName;
+		this.fileType = fileType;
+		this.fileSize = fileSize;
+		this.md5key = md5key;
+	}
+
+}

+ 15 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/upload/UploadFileLocation.java

@@ -0,0 +1,15 @@
+package org.jeecg.modules.wps.util.upload;
+
+public abstract class UploadFileLocation {
+
+    /**
+     * 七牛云 对象存储
+     */
+    public final static String QN = "qn";
+
+    /**
+     * 阿里云 对象存储
+     */
+    public final static String OSS = "oss";
+
+}

+ 481 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/upload/oss/WpsOSSUtil.java

@@ -0,0 +1,481 @@
+package org.jeecg.modules.wps.util.upload.oss;
+
+import com.aliyun.oss.HttpMethod;
+import com.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.*;
+import org.apache.commons.lang.StringUtils;
+import org.jeecg.modules.wps.util.file.FileType;
+import org.jeecg.modules.wps.util.file.FileTypeJudge;
+import org.jeecg.modules.wps.util.file.FileUtil;
+import org.jeecg.modules.wps.util.upload.ResFileDTO;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.*;
+
+@Component
+public class WpsOSSUtil {
+    private static String fileUrlPrefix;
+    /**
+     * 阿里云API的bucket名称
+     */
+    private static String bucketName;
+    private static String diskName;
+    private static String regionId;
+
+    /**
+     * 阿里云API的内或外网域名
+     */
+    private static String endpoint;
+    /**
+     * 阿里云API的密钥Access Key ID
+     */
+    private static String accessKey;
+    /**
+     * 阿里云API的密钥Access Key Secret
+     */
+    private static String accessSecret;
+
+    @Value("${wps.oss.file_url_prefix}")
+    public static void setFileUrlPrefix(String fileUrlPrefix) {
+        WpsOSSUtil.fileUrlPrefix = fileUrlPrefix;
+    }
+
+    @Value("${wps.oss.disk_name}")
+    public static void setDiskName(String diskName) {
+        WpsOSSUtil.diskName = diskName;
+    }
+
+    @Value("${wps.oss.region_Id}")
+    public static void setRegionId(String regionId) {
+        WpsOSSUtil.regionId = regionId;
+    }
+
+    @Value("${wps.oss.bucket_name}")
+    public void setBucketName(String bucketName) {
+        WpsOSSUtil.bucketName = bucketName;
+    }
+
+    @Value("${wps.oss.access_key}")
+    public void setAccessKey(String accessKey) {
+        WpsOSSUtil.accessKey = accessKey;
+    }
+
+    @Value("${wps.oss.access_secret}")
+    public void setAccessSecret(String accessSecret) {
+        WpsOSSUtil.accessSecret = accessSecret;
+    }
+
+    @Value("${wps.oss.endpoint}")
+    public void setEndpoint(String endpoint) {
+        WpsOSSUtil.endpoint = endpoint;
+    }
+
+
+    private static OSSClient getOSSClient(){
+        return new OSSClient(endpoint,accessKey, accessSecret);
+    }
+
+    public static String simpleUploadFilePath(String filePath){
+        File file = new File(filePath);
+        return simpleUploadFile(file);
+    }
+
+    public static String simpleUploadFile(File file){
+        String fileName = file.getName();
+        String newFileName = FileUtil.makeNewFileName(fileName);
+        getOSSClient().putObject(bucketName, diskName + newFileName, file);
+        return (fileUrlPrefix + diskName + newFileName);
+    }
+
+    public String simpleUploadMultipartFile(MultipartFile file){
+        String fileName = file.getOriginalFilename();
+        String newFileName = FileUtil.makeNewFileName(fileName);
+        try {
+            getOSSClient().putObject(bucketName, diskName + newFileName, file.getInputStream());
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return (fileUrlPrefix + diskName + newFileName);
+    }
+
+    public static ResFileDTO uploadMultipartFile(MultipartFile file){
+        String fileName = file.getOriginalFilename();
+        InputStream inputStream;
+        ResFileDTO o = new ResFileDTO();
+        String fileType ;
+        long fileSize = file.getSize();
+        try {
+            inputStream = file.getInputStream();
+            FileType type = FileTypeJudge.getType(inputStream);
+
+            if(type == null || "null".equals(type.toString()) ||
+                    "XLS_DOC".equals(type.toString())|| "XLSX_DOCX".equals(type.toString()) ||
+                    "WPSUSER".equals(type.toString())|| "WPS".equals(type.toString())){
+                fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
+            }else{
+                fileType = type.toString().toLowerCase();
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            //用户上传的文件类型为空,并且通过二进制流获取不到文件类型,因为二进制流只列举了常用的
+            fileType = "";
+        }
+
+        try {
+            o = uploadDetailInputStream(file.getInputStream(),fileName,fileType,fileSize);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return o;
+    }
+
+    public static ResFileDTO uploadDetailInputStream (InputStream in, String fileName , String fileType, long fileSize) {
+        String uuidFileName = FileUtil.getFileUUIDName(fileName,fileType);
+        String fileUrl = fileUrlPrefix + diskName + uuidFileName;
+        String md5key = uploadFile(in, uuidFileName, fileSize, bucketName, diskName,fileName);
+        ResFileDTO o = new ResFileDTO();
+
+        if(md5key != null){
+            o.setFileType(fileType);
+            o.setFileName(fileName);
+            o.setCFileName(uuidFileName);
+            o.setFileUrl(fileUrl);
+            o.setFileSize(fileSize);
+            o.setMd5key(md5key);
+        }
+        return o;
+    }
+
+    /**
+     * 向阿里云的OSS存储中存储文件  --file也可以用InputStream替代
+     * @param bucketName bucket名称
+     * @param diskName 上传文件的目录  --bucket下文件的路径
+     * @return String 唯一MD5数字签名
+     * */
+    public static String uploadFile(InputStream inputStream, String fileName,long fileSize,String bucketName, String diskName,String localFileName) {
+        String resultStr = null;
+        try {
+            OSSClient client =  getOSSClient();
+            //创建上传Object的Metadata
+            ObjectMetadata metadata = new ObjectMetadata();
+            metadata.setContentLength(inputStream.available());
+            metadata.setCacheControl("no-cache");
+            metadata.setHeader("Pragma", "no-cache");
+            metadata.setContentEncoding("utf-8");
+            metadata.setContentType(getContentType(fileName));
+            if(StringUtils.isEmpty(localFileName)){
+                metadata.setContentDisposition("filename=" + fileName);
+            }else{
+                metadata.setContentDisposition("filename=" + localFileName);
+            }
+            //上传文件
+            PutObjectResult putResult = client.putObject(bucketName, diskName + fileName, inputStream, metadata);
+            //解析结果
+            resultStr = putResult.getETag();
+            client.shutdown();
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("上传阿里云OSS服务器异常:"+e.getMessage());
+        }
+        return resultStr;
+    }
+
+    /**
+     * 修改文件元信息
+     * @param fileName   原文件名
+     * @param bucketName 桶名
+     * @param downName   下载时的文件名称
+     */
+    public void changeFileMetaInfo(String fileName,String bucketName,String downName){
+        try{
+            // 创建OSSClient实例。
+            OSS ossClient = getOSSClient();
+            // 设置源文件与目标文件相同,调用ossClient.copyObject方法修改文件元信息。
+            CopyObjectRequest request = new CopyObjectRequest(bucketName, fileName, bucketName, fileName);
+            ObjectMetadata meta = new ObjectMetadata();
+            // 指定上传的内容类型。内容类型决定浏览器将以什么形式、什么编码读取文件。如果没有指定则根据文件的扩展名生成,如果没有扩展名则为默认值application/octet-stream。
+            meta.setContentType(getContentType(fileName));
+            // 设置内容被下载时的名称。
+            System.out.println("downNmme"+downName);
+            meta.setContentDisposition("filename="+downName);
+            // 设置内容被下载时网页的缓存行为。
+            meta.setCacheControl("no-cache");
+            // 设置缓存过期时间,格式是格林威治时间(GMT)。
+            meta.setExpirationTime(com.aliyun.oss.common.utils.DateUtil.parseIso8601Date("2022-10-12T00:00:00.000Z"));
+            // 设置内容被下载时的编码格式。
+            meta.setContentEncoding("utf-8");
+            request.setNewObjectMetadata(meta);
+
+            //修改元信息。
+            ossClient.copyObject(request);
+
+            // 关闭OSSClient。
+            ossClient.shutdown();
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 生成下载的url
+     * @param fileName wjm
+     * @return URL URL
+     */
+    public URL getDownLoadUrl(String fileName, String bucketName){
+        // 创建OSSClient实例。
+        OSS ossClient = getOSSClient();
+        //设置链接时效60分钟
+        Calendar c = Calendar.getInstance();
+        c.setTime(new Date());
+        c.add(Calendar.MINUTE, 60);
+
+        Date date= c.getTime();
+        GeneratePresignedUrlRequest request=new GeneratePresignedUrlRequest(bucketName,fileName, HttpMethod.GET);
+        request.addHeader("policy","");
+        request.setExpiration(date);
+
+        Map<String,String> map=new HashMap<String, String>();
+        map.put("response-content-disposition","attachment");
+        request.setQueryParameter(map);
+        URL url=ossClient.generatePresignedUrl(request);
+        System.out.println(url);
+        return url;
+    }
+
+    /**
+     * 新建Bucket  --Bucket权限:私有
+     * @param bucketName bucket名称
+     * @return true 新建Bucket成功
+     * */
+    public static boolean createBucket(OSSClient client, String bucketName){
+        Bucket bucket = client.createBucket(bucketName);
+        return bucketName.equals(bucket.getName());
+    }
+
+    /**
+     * 删除Bucket
+     * @param bucketName bucket名称
+     * */
+    public static void deleteBucket(OSSClient client, String bucketName){
+        client.deleteBucket(bucketName);
+        System.out.println("删除Bucket成功:"+bucketName);
+        //  logger.info("删除" + bucketName + "Bucket成功");
+    }
+
+    /**
+     * 向阿里云的OSS存储中存储文件  --file也可以用InputStream替代
+     * @param file 上传文件
+     * @param bucketName bucket名称
+     * @param diskName 上传文件的目录  --bucket下文件的路径
+     * @return String 唯一MD5数字签名
+     * */
+    public String uploadObject(File file, String bucketName, String diskName) {
+        String resultStr = null;
+        try {
+            OSSClient client =  getOSSClient();
+            InputStream is = new FileInputStream(file);
+            String fileName = file.getName();
+            long fileSize = file.length();
+            //创建上传Object的Metadata
+            ObjectMetadata metadata = new ObjectMetadata();
+            metadata.setContentLength(is.available());
+            metadata.setCacheControl("no-cache");
+            metadata.setHeader("Pragma", "no-cache");
+            metadata.setContentEncoding("utf-8");
+            metadata.setContentType(getContentType(fileName));
+            metadata.setContentDisposition("filename=" + fileName);
+            //上传文件
+            PutObjectResult putResult = client.putObject(bucketName, diskName + fileName, is, metadata);
+            //解析结果
+            resultStr = putResult.getETag();
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("上传阿里云OSS服务器异常:"+e.getMessage());
+            //LOG.error("上传阿里云OSS服务器异常." + e.getMessage(), e);
+        }
+        return resultStr;
+    }
+
+    /**
+     * 向阿里云的OSS存储中分片存储文件
+     * @param bucketName bucket名称
+     */
+    public String multipartUploadObject(String bucketName, String key,File partFile) {
+        String tag = null;
+        String uploadid = null;
+        int j=0;
+        // 初始化一个OSSClient
+        OSSClient client =  getOSSClient();
+        ListMultipartUploadsRequest lmur = new ListMultipartUploadsRequest(bucketName);
+        // 获取Bucket内所有上传事件
+        MultipartUploadListing listing = client.listMultipartUploads(lmur);
+        // 新建一个List保存每个分块上传后的ETag和PartNumber
+        List<PartETag> partETags = new ArrayList<PartETag>();
+        // 遍历所有上传事件  设置UploadId
+        for (MultipartUpload multipartUpload : listing.getMultipartUploads()) {
+            if (multipartUpload.getKey().equals(key)) {
+                uploadid=multipartUpload.getUploadId();
+                break;
+            }
+        }
+        if(StringUtils.isEmpty(uploadid)){
+            // 开始Multipart Upload,InitiateMultipartUploadRequest 来指定上传Object的名字和所属Bucke
+            InitiateMultipartUploadRequest initiateMultipartUploadRequest = new InitiateMultipartUploadRequest(bucketName, key);
+            InitiateMultipartUploadResult initiateMultipartUploadResult = client.initiateMultipartUpload(initiateMultipartUploadRequest);
+            uploadid=initiateMultipartUploadResult.getUploadId();
+        }else{
+            ListPartsRequest listPartsRequest = new ListPartsRequest(bucketName,key, uploadid);
+            //listParts 方法获取某个上传事件所有已上传的块
+            PartListing partListing = client.listParts(listPartsRequest);
+            // 遍历所有Part
+            for (PartSummary part : partListing.getParts()) {
+                partETags.add(new PartETag(part.getPartNumber(),part.getETag()));
+                j++;
+            }
+        }
+        // 设置每块为 5M(最小支持5M)
+        final int partSize = 1024 * 1024 * 5;
+        // 计算分块数目
+        int partCount = (int) (partFile.length() / partSize);
+        if (partFile.length() % partSize != 0) {
+            partCount++;
+        }
+        try {
+            for (int i=j ; i < partCount; i++) {
+                // 获取文件流
+                FileInputStream fis;
+                fis = new FileInputStream(partFile);
+                // 跳到每个分块的开头
+                long skipBytes = partSize * i;
+                fis.skip(skipBytes);
+                // 计算每个分块的大小
+                long size = partSize < partFile.length() - skipBytes ? partSize: partFile.length() - skipBytes;
+                // 创建UploadPartRequest,上传分块
+                UploadPartRequest uploadPartRequest = new UploadPartRequest();
+                uploadPartRequest.setBucketName(bucketName);
+                uploadPartRequest.setKey(key);
+                uploadPartRequest.setUploadId(uploadid);
+                uploadPartRequest.setInputStream(fis);
+                uploadPartRequest.setPartSize(size);
+                uploadPartRequest.setPartNumber(i + 1);
+                UploadPartResult uploadPartResult = client.uploadPart(uploadPartRequest);
+                // 将返回的PartETag保存到List中。
+                partETags.add(uploadPartResult.getPartETag());
+                // 关闭文件
+                fis.close();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        CompleteMultipartUploadRequest completeMultipartUploadRequest = new CompleteMultipartUploadRequest(bucketName, key, uploadid, partETags);
+        // 完成分块上传
+        CompleteMultipartUploadResult completeMultipartUploadResult = client.completeMultipartUpload(completeMultipartUploadRequest);
+        // 打印Object的ETag(返回的ETag不是md5.具体是什么不详)
+        tag = completeMultipartUploadResult.getETag();
+        return tag;
+    }
+
+
+
+    /**
+     * 从阿里云的OSS存储中下载文件  --file也可以用InputStream替代
+     * @param bucketName bucket名称
+     * @param diskName 上传文件的目录  --bucket下文件的路径
+     * @return String 唯一MD5数字签名
+     * */
+    public String downloadFile(String bucketName, String diskName,String filePath) {
+        String resultStr = null;
+        try {
+            OSSClient client =  getOSSClient();
+            client.getObject(new GetObjectRequest(bucketName, diskName), new File(filePath));
+            client.shutdown();
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("上传阿里云OSS服务器异常:"+e.getMessage());
+        }
+        return resultStr;
+    }
+    /**
+     * 根据key获取OSS服务器上的文件输入流
+     * @param client OSS客户端
+     * @param bucketName bucket名称
+     * @param diskName 文件路径
+     * @param key Bucket下的文件的路径名+文件名
+     */
+    public static InputStream getInputStream(OSSClient client, String bucketName, String diskName, String key){
+        OSSObject ossObj = client.getObject(bucketName, diskName + key);
+        return ossObj.getObjectContent();
+    }
+
+    /**
+     * 根据key删除OSS服务器上的文件
+     * @param bucketName bucket名称
+     * @param diskName 文件路径
+     * @param key Bucket下的文件的路径名+文件名
+     */
+    public void deleteFile( String bucketName, String diskName, String key){
+        OSSClient client =  getOSSClient();
+        client.deleteObject(bucketName, diskName + key);
+        client.shutdown();
+        System.out.println("删除" + bucketName + "下的文件" + diskName + key + "成功");
+    }
+
+    /**
+     * 通过文件名判断并获取OSS服务文件上传时文件的contentType
+     * @param fileName 文件名
+     * @return 文件的contentType
+     */
+    public static String getContentType(String fileName){
+        String fileExtension = fileName.substring(fileName.lastIndexOf(".")+1);
+        if("bmp".equalsIgnoreCase(fileExtension)){
+            return "image/bmp";
+        }
+        if("gif".equalsIgnoreCase(fileExtension)){
+            return "image/gif";
+        }
+        if("jpeg".equalsIgnoreCase(fileExtension) || "jpg".equalsIgnoreCase(fileExtension)  || "png".equalsIgnoreCase(fileExtension) ){
+            return "image/jpeg";
+        }
+        if("html".equalsIgnoreCase(fileExtension)){
+            return "text/html";
+        }
+        if("txt".equalsIgnoreCase(fileExtension)){
+            return "text/plain";
+        }
+        if("vsd".equalsIgnoreCase(fileExtension)){
+            return "application/vnd.visio";
+        }
+        if("ppt".equalsIgnoreCase(fileExtension) || "pptx".equalsIgnoreCase(fileExtension)){
+            return "application/x-ppt";
+        }
+        if("xls".equalsIgnoreCase(fileExtension) || "xlsx".equalsIgnoreCase(fileExtension)){
+            return "application/x-xls";
+        }
+        if("doc".equalsIgnoreCase(fileExtension) || "docx".equalsIgnoreCase(fileExtension)){
+            return "application/x-docx";
+        }
+        if("xml".equalsIgnoreCase(fileExtension)){
+            return "text/xml";
+        }
+        if("pdf".equalsIgnoreCase(fileExtension)){
+            return "application/pdf";
+        }
+        if("mp3".equalsIgnoreCase(fileExtension)){
+            return "audio/mp3";
+        }
+        if("mp4".equalsIgnoreCase(fileExtension)){
+            return "video/mpeg4";
+        }
+        return "text/html";
+    }
+
+}

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/util/upload/qn/MyPutRet.java

@@ -0,0 +1,11 @@
+package org.jeecg.modules.wps.util.upload.qn;
+
+public final class MyPutRet {
+
+    public String key;
+
+    public String hash;
+
+    public long fsize;
+
+}

+ 14 - 0
jeecg-boot-module-system/src/main/resources/application.yml

@@ -15,3 +15,17 @@ swagger:
     username: jeecg
     password: jeecg1314
 
+wps:
+  domain: https://wwo.wps.cn/office/
+  appid: AK20200318KOAZAO
+  appsecret: 1114ea897ee04c644e3d886c1578562b
+  download_host:
+  local_dir:
+  oss:
+    file_url_prefix: https://ctop-media.oss-cn-beijing.aliyuncs.com/
+    bucket_name: ctop-media
+    disk_name:  script-lib/wps/
+    region_id: cn-bejing
+    endpoint: http://oss-cn-beijing.aliyuncs.com
+    access_key: LTAIbNbqWzSOklQV
+    access_secret: 1rkPz7JNoXk8sJevPaeYHWqfkQXBGh

+ 2 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java

@@ -100,7 +100,7 @@ public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMap
             JSONObject input = new JSONObject();
             input.put("Location", ossLocation);
             input.put("Bucket", ossBucket);
-         //   https://ctop-media.oss-cn-beijing.aliyuncs.com/video/2020-06-03/bp%E8%95%89%E4%B8%8B%E7%9B%B4%E6%92%AD2-1591188835505.mp4
+            //   https://ctop-media.oss-cn-beijing.aliyuncs.com/video/2020-06-03/bp%E8%95%89%E4%B8%8B%E7%9B%B4%E6%92%AD2-1591188835505.mp4
             String replaceUrl = url.replace("https://ctop-media.oss-cn-beijing.aliyuncs.com/", "");
             input.put("Object", replaceUrl);
 
@@ -224,4 +224,5 @@ public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMap
     }
 
 
+
 }

+ 17 - 7
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java

@@ -27,6 +27,7 @@ import java.util.concurrent.Executors;
 /**
  * @Description: 快手-获取视频接口
  * @Author: jeecg-boot
+ *
  * @Date: 2019-07-25
  * @Version: V1.0
  */
@@ -50,6 +51,7 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
     /**
      * 获取关键帧
      *
+     *
      * @param
      */
     @Override
@@ -63,14 +65,17 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
                 return;
             }
             for (KuaiShouVideoGet videoGet : kuaiShouVideoGets) {
-                if (!Check.isNull(videoGet.getSignature())) {
-                    QueryWrapper<MaterialCutFrame> cutFrameQueryWrapper = new QueryWrapper<>();
-                    cutFrameQueryWrapper.eq("video_signature", videoGet.getSignature());
-                    cutFrameQueryWrapper.last("limit 1");
-                    MaterialCutFrame one = materialCutFrameService.getOne(cutFrameQueryWrapper);
-                    if (!Check.isNull(one)) {
-                        continue;
+                synchronized (this) {
+                    if (!Check.isNull(videoGet.getSignature())) {
+                        QueryWrapper<MaterialCutFrame> cutFrameQueryWrapper = new QueryWrapper<>();
+                        cutFrameQueryWrapper.eq("video_signature", videoGet.getSignature());
+                        cutFrameQueryWrapper.last("limit 1");
+                        MaterialCutFrame one = materialCutFrameService.getOne(cutFrameQueryWrapper);
+                        if (!Check.isNull(one)) {
+                            continue;
+                        }
                     }
+
                     executorService.submit(new Runnable() {
                         @Override
                         public void run() {
@@ -100,6 +105,11 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
                                                 e.printStackTrace();
                                                 continue;
                                             }
+                                            Map<String, Object> deleteMap = new HashMap<>();
+                                            deleteMap.put("video_signature", videoGet.getSignature());
+                                            deleteMap.put("signature", md5);
+                                            materialCutFrameService.removeByMap(deleteMap);
+
                                             MaterialCutFrame materialCutFrame = new MaterialCutFrame();
                                             materialCutFrame.setImageIndex(i);
                                             materialCutFrame.setVideoSignature(videoGet.getSignature());

+ 3 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -485,7 +485,9 @@
         event_next_day_stay_cost,
         event_next_day_stay_ratio,
         event_next_day_stay,
-        play_3s_ratio
+        play_3s_ratio,
+        @event_valid_clues,
+        @event_valid_clues_cost
         )
           set account_id = #{accountId}
     </insert>