Ver Fonte

修改返回code

humuyu há 3 anos atrás
pai
commit
f7b90b09cd

+ 8 - 8
eladmin-system/src/main/java/me/zhengjie/appapi/entity/response/BaseResponse.java

@@ -24,7 +24,7 @@ public class BaseResponse<T> implements Serializable {
 	/**
 	 * 响应码
 	 */
-	private String code = ResultCode.SUCCESS.code() + "";
+	private int code = ResultCode.SUCCESS.code() ;
 
 	/**
 	 * 响应状态
@@ -42,11 +42,11 @@ public class BaseResponse<T> implements Serializable {
 
 	}
 
-	public BaseResponse(String code) {
+	public BaseResponse(int code) {
 		this.code = code;
 	}
 
-	public BaseResponse(String code, String msg) {
+	public BaseResponse(int code, String msg) {
 		this.code = code;
 		this.msg = msg;
 	}
@@ -56,12 +56,12 @@ public class BaseResponse<T> implements Serializable {
 	}
 
 	public BaseResponse(ResultCode result) {
-		this.code = String.valueOf(result.code());
+		this.code = result.code();
 		this.msg = result.message();
 	}
 
 	public void success(String msg) {
-		this.code = ResultCode.SUCCESS.code() + "";
+		this.code = ResultCode.SUCCESS.code();
 		this.msg = msg;
 	}
 
@@ -78,18 +78,18 @@ public class BaseResponse<T> implements Serializable {
 		return new BaseResponse<>(result);
 	}
 
-	public void fail(String code, String msg) {
+	public void fail(int code, String msg) {
 		this.code = code;
 		this.msg = msg;
 	}
 
 	public void fail(ResultCode ResultCode) {
-		this.code = ResultCode.code() + "";
+		this.code = ResultCode.code();
 		this.msg = ResultCode.message();
 	}
 
 	public void fail(OrderBizCodeMessage orderBizCodeMessage) {
-		this.code = orderBizCodeMessage.getCode() + "";
+		this.code = orderBizCodeMessage.getCode();
 		this.msg = orderBizCodeMessage.getMessage();
 	}
 

+ 8 - 1
eladmin-system/src/main/java/me/zhengjie/appapi/util/FileUploadUtil.java

@@ -248,7 +248,14 @@ public class FileUploadUtil {
 		String suffix = uploadFileName.substring(index);
 		String fileName = uuid + "_" + file.getFileType() + suffix;
 		file.setFileName(fileName);
-		String imagePath = filePath + "/" + fileName;
+		//判断是否有斜线 /结尾
+		String imagePath; 
+		if(filePath.endsWith("/")) {
+			imagePath= filePath +  fileName;
+		}else {
+			imagePath = filePath + "/" + fileName;
+		}
+		
 		try {
 			FileHandleVo fileHandlevo = new FileHandleVo();
 			fileHandlevo.setFilePath(imagePath);

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/NotaryOrderController.java

@@ -196,7 +196,7 @@ public class NotaryOrderController {
     }
 
     @AnonymousPostMapping("/uploadNotarization")
-    public BaseResponse uploadNotarization(FileVo file) {
+    public BaseResponse uploadNotarization(@RequestBody FileVo file) {
         return notaryOrderService.uploadNotarization(file);
     }
 

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/NotaryOrderServiceImpl.java

@@ -681,7 +681,7 @@ public class NotaryOrderServiceImpl extends ServiceImpl<NotaryOrderMapper, Notar
 		notaryOrderFile.setCreatorId(SecurityUtils.getCurrentUserId());
 		orderFileMapper.insert(notaryOrderFile);
 
-		updateStatusPass(file.getContractId(), file.getBusinessNo());
+//		updateStatusPass(file.getContractId(), file.getBusinessNo());
 		return response;
 	}
 

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/OfficeXbankServiceImpl.java

@@ -89,7 +89,7 @@ public class OfficeXbankServiceImpl implements OfficeXbankService {
                     for (NotaryOrderEntity orderEntity : orderList) {
                         bankNames.add(orderEntity.getBankName());
                     }
-                    response.fail(String.valueOf(ResultCode.UNFINISHED_ORDER_FAIL.code()), bankNames.toString().concat("尚有未完成订单,不能解绑!"));
+                    response.fail(ResultCode.UNFINISHED_ORDER_FAIL.code(), bankNames.toString().concat("尚有未完成订单,不能解绑!"));
                     return response;
                 }
             }