瀏覽代碼

Merge branch 'release-201821-wangcz'

suntg 7 年之前
父節點
當前提交
604d036ecc

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

@@ -205,9 +205,12 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				throw new IllegalOperatorException("表格模板不正确!请重新下载最新模板");
 			}
 		int rowNum = SheetUtil.getSheetLastNum(sheet, isPcb ? UploadConstant.MAX_TOTAL_COLUMN_PCB : UploadConstant.MAX_TOTAL_COLUMN);
-		if (rowNum > 2000) {
+		if (rowNum > 2002) {
 			throw new IllegalOperatorException ("您上传的信息超过2000条,请拆分成2000以下再上传");
 		}
+		if (rowNum < 3) {
+			throw new IllegalOperatorException ("请填写上传信息");
+		}
 		List<ReleaseProductByBatch> releaseProductByBatchs = new ArrayList<>(rowNum);
 		String batch = createNumberService.getTimeNumber("product$goods", 8, rowNum);
 		StoreIn storeIn = getStoreInfo(selfSale);

+ 3 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/util/SheetUtil.java

@@ -37,6 +37,9 @@ public class SheetUtil {
                 if (flag) {
                     --lastRowNum;
                 }
+                if (lastRowNum < 1) {
+                    flag = false;
+                }
             }
             return lastRowNum;
         }