o2sword 5 лет назад
Родитель
Сommit
9a87a4ed47

+ 4 - 2
o2server/x_file_assemble_control/src/main/java/com/x/file/assemble/control/jaxrs/recycle/ActionResume.java

@@ -38,7 +38,8 @@ class ActionResume extends BaseAction {
 					usedSize = usedSize + att.getLength();
 					int vResult = business.verifyConstraint(effectivePerson.getDistinguishedName(), usedSize);
 					if(vResult > 0){
-						throw new ExceptionCapacityOut(usedSize, vResult);
+						long usedCapacity = usedSize / (1024 * 1024);
+						throw new ExceptionCapacityOut(usedCapacity, vResult);
 					}
 					EntityManager aem = emc.beginTransaction(Attachment2.class);
 					att.setStatus(FileStatus.VALID.getName());
@@ -62,7 +63,8 @@ class ActionResume extends BaseAction {
 							usedSize = usedSize + att.getLength();
 							int vResult = business.verifyConstraint(effectivePerson.getDistinguishedName(), usedSize);
 							if(vResult > 0){
-								throw new ExceptionCapacityOut(usedSize, vResult);
+								long usedCapacity = usedSize / (1024 * 1024);
+								throw new ExceptionCapacityOut(usedCapacity, vResult);
 							}
 							EntityManager aem = emc.beginTransaction(Attachment2.class);
 							att.setStatus(FileStatus.VALID.getName());

+ 4 - 2
o2server/x_file_assemble_control/src/main/java/com/x/file/assemble/control/jaxrs/share/ActionSaveToFolder.java

@@ -63,7 +63,8 @@ class ActionSaveToFolder extends BaseAction {
 					usedSize = usedSize + att.getLength();
 					int vResult = business.verifyConstraint(effectivePerson.getDistinguishedName(), usedSize);
 					if(vResult > 0){
-						throw new ExceptionCapacityOut(usedSize, vResult);
+						long usedCapacity = usedSize / (1024 * 1024);
+						throw new ExceptionCapacityOut(usedCapacity, vResult);
 					}
 					Attachment2 newAtt = new Attachment2(att.getName(), effectivePerson.getDistinguishedName(),
 							folderId, att.getOriginFile(), att.getLength(), att.getType());
@@ -91,7 +92,8 @@ class ActionSaveToFolder extends BaseAction {
 						usedSize = usedSize + att.getLength();
 						int vResult = business.verifyConstraint(effectivePerson.getDistinguishedName(), usedSize);
 						if(vResult > 0){
-							throw new ExceptionCapacityOut(usedSize, vResult);
+							long usedCapacity = usedSize / (1024 * 1024);
+							throw new ExceptionCapacityOut(usedCapacity, vResult);
 						}
 						Attachment2 newAtt = new Attachment2(att.getName(), effectivePerson.getDistinguishedName(),
 								folderId, att.getOriginFile(), att.getLength(), att.getType());