lyhzzz před 2 roky
rodič
revize
e75f7a3c0e

+ 3 - 3
src/main/java/com/fdkankan/manage/service/impl/ExcelServiceImpl.java

@@ -94,7 +94,7 @@ public class ExcelServiceImpl implements IExcelService {
         for (HashMap<Integer, String> map : excelRowList) {
             index ++;
             if(type == 0){      //入库
-                if(!map.get(0).equals("设备入库模板")){
+                if(index == 0 && !map.get(0).equals("设备入库模板")){
                     throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
                 }
                 if(index <4){   //从第四行开始
@@ -106,7 +106,7 @@ public class ExcelServiceImpl implements IExcelService {
                 }
                 wifiNameList.add(wifiName);
             }else if(type == 1){    //出库
-                if(!map.get(0).equals("设备出库模板")){
+                if(index == 0 && !map.get(0).equals("设备出库模板")){
                     throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
                 }
                 if(index <4){
@@ -128,7 +128,7 @@ public class ExcelServiceImpl implements IExcelService {
                 param.setSnCode(snCode);
                 params.add(param);
             }else if(type == 2){   //关联客户
-                if(!map.get(0).equals("客户关联模板")){
+                if(index == 0 && !map.get(0).equals("客户关联模板")){
                     throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
                 }
                 if(index <4){