chenc 3 年之前
父節點
當前提交
8c0387f61c

+ 13 - 1
jeecg-boot/jeecg-boot-base-common/src/main/java/org/jeecg/common/api/vo/Result.java

@@ -1,6 +1,8 @@
 package org.jeecg.common.api.vo;
 
 import java.io.Serializable;
+import java.util.Map;
+
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import org.jeecg.common.constant.CommonConstant;
@@ -35,7 +37,17 @@ public class Result<T> implements Serializable {
 	 */
 	@ApiModelProperty(value = "返回代码")
 	private Integer code = 0;
-	
+
+	private Map<String,Object> data;
+
+	public Map<String, Object> getData() {
+		return data;
+	}
+
+	public void setData(Map<String, Object> data) {
+		this.data = data;
+	}
+
 	/**
 	 * 返回数据对象 data
 	 */

+ 13 - 8
jeecg-boot/jeecg-boot-base-common/src/main/java/org/jeecg/common/system/controller/CommonController.java

@@ -74,18 +74,21 @@ public class CommonController {
 	 * @return
 	 */
 	@PostMapping(value = "/upload")
-	public Map<String,Object> upload(HttpServletRequest request, HttpServletResponse response) {
+	public Result<?> upload(HttpServletRequest request, HttpServletResponse response) {
 		Map<String,Object> map=new HashMap<>();
 		Result<?> result = new Result<>();
 		String savePath = "";
 		String bizPath = request.getParameter("biz");
 		MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
 		MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象
+		if(file==null){
+			file = multipartRequest.getFile("image");// 获取上传文件对象
+		}
 		if(oConvertUtils.isEmpty(bizPath)){
 			if(CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)){
 				result.setMessage("使用阿里云文件上传时,必须添加目录!");
 				result.setSuccess(false);
-				return map;
+//				return map;
 			}else{
 				bizPath = "";
 			}
@@ -102,11 +105,11 @@ public class CommonController {
 			result.setMessage("上传失败!");
 			result.setSuccess(false);
 		}
-		map.put("code",0);
-		Map<String,Object> map1=new HashMap<>();
-		map1.put("url","http://localhost:3000/jeecg-boot/sys/common/upload/");
-		map.put("data",map1);
-		return map;
+//		map.put("code",0);
+//		Map<String,Object> map1=new HashMap<>();
+//		map1.put("url","http://localhost:3000/jeecg-boot/sys/common/upload/");
+//		map.put("data",map1);
+		return result;
 	}
 
 	/**
@@ -470,6 +473,7 @@ public class CommonController {
 //			map1.put("url","http://localhost:3000/jeecg-boot/sys/common/downloadFile/"+dbpath);
 			map1.put("url","http://oa.cuidiansoft.com/jeecg-boot/sys/common/downloadFile/"+dbpath);
 			map.put("data",map1);
+			result.setData(map1);
 		} catch (IOException e) {
 			map.put("success",false);
 			map.put("message",e.getMessage());
@@ -477,6 +481,7 @@ public class CommonController {
 			result.setMessage(e.getMessage());
 			e.printStackTrace();
 		}
-		return map;
+
+		return result;
 	}
 }

+ 5 - 3
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActProcessInsController.java

@@ -157,9 +157,11 @@ public class ActProcessInsController {
             // 关联业务状态结束
             ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(id).singleResult();
             ActBusiness actBusiness = actBusinessService.getById(pi.getBusinessKey());
-            actBusiness.setStatus(ActivitiConstant.STATUS_TO_APPLY);
-            actBusiness.setResult(ActivitiConstant.RESULT_TO_SUBMIT);
-            actBusinessService.updateById(actBusiness);
+            if(actBusiness!=null){
+                actBusiness.setStatus(ActivitiConstant.STATUS_TO_APPLY);
+                actBusiness.setResult(ActivitiConstant.RESULT_TO_SUBMIT);
+                actBusinessService.updateById(actBusiness);
+            }
             runtimeService.deleteProcessInstance(id, ActivitiConstant.DELETE_PRE+reason);
         }
         return Result.ok("删除成功");

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

@@ -89,6 +89,7 @@ public class ShiroConfig {
 		filterChainDefinitionMap.put("/sys/common/download/**", "anon");//文件下载不限制token
 		filterChainDefinitionMap.put("/sys/common/uploadFile/**", "anon");//文件预览不受限制
 		filterChainDefinitionMap.put("/sys/common/uploadFile2/**", "anon");//文件预览不受限制
+		filterChainDefinitionMap.put("/sys/common/downloadFile/**", "anon");//文件预览不受限制
 		filterChainDefinitionMap.put("/sys/common/upload/**", "anon");//文件预览不受限制
 		filterChainDefinitionMap.put("/sys/common/pdf/**", "anon");//pdf预览
 		filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件