Browse Source

调整导入的逻辑

yuj 7 years ago
parent
commit
99223c97d0

+ 2 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -657,8 +657,8 @@ public class ReleaseProductByBatch implements Serializable {
 			int compareTo = reserve.compareTo(DoubleConstant.maxReserve);
 			if (compareTo > 0) {
 				reserve = DoubleConstant.maxReserve;
-			} else if (NumberUtil.compare(reserve, DoubleConstant.zero) < 1) {
-				reserve = DoubleConstant.minReserve;
+			} else if (reserve.compareTo(DoubleConstant.zero) == -1) {
+				reserve = DoubleConstant.zero;
 			}
 			setReserve(reserve);
 		}

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -241,7 +241,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			}
 		} else if ((isPcb && colNum != UploadConstant.TOTAL_COLUMN_PCB && colNum != UploadConstant.MAX_TOTAL_COLUMN_PCB) || (!isPcb && colNum != UploadConstant.TOTAL_COLUMN && colNum != UploadConstant.MAX_TOTAL_COLUMN)) {
 				throw new IllegalOperatorException("表格模板不正确!请重新下载最新模板");
-			}
+		}
 		int rowNum = SheetUtil.getSheetLastNum(sheet, isPcb ? UploadConstant.MAX_TOTAL_COLUMN_PCB : UploadConstant.MAX_TOTAL_COLUMN);
 		if (rowNum > 2002) {
 			throw new IllegalOperatorException ("您上传的信息超过2000条,请拆分成2000以下再上传");