|
@@ -94,19 +94,31 @@ public class ExcelServiceImpl implements IExcelService {
|
|
|
for (HashMap<Integer, String> map : excelRowList) {
|
|
|
index ++;
|
|
|
if(type == 0){ //入库
|
|
|
+ if(!map.get(0).equals("设备入库模板")){
|
|
|
+ throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
|
|
|
+ }
|
|
|
+ if(index <4){ //从第四行开始
|
|
|
+ continue;
|
|
|
+ }
|
|
|
String wifiName = map.get(0);
|
|
|
if(StringUtils.isBlank(wifiName)){
|
|
|
- errorIndex.add(index);
|
|
|
+ errorIndex.add(index -3);
|
|
|
}
|
|
|
wifiNameList.add(wifiName);
|
|
|
}else if(type == 1){ //出库
|
|
|
+ if(!map.get(0).equals("设备出库模板")){
|
|
|
+ throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
|
|
|
+ }
|
|
|
+ if(index <4){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
String snCode = map.get(0);
|
|
|
String outTypeString = map.get(1);
|
|
|
String companyName = map.get(2);
|
|
|
String orderSn = map.get(3);
|
|
|
CameraOutTypeEnum outTypeEnum = CameraOutTypeEnum.getByMsg(outTypeString);
|
|
|
if(outTypeEnum == null || StringUtils.isBlank(snCode)){
|
|
|
- errorIndex.add(index );
|
|
|
+ errorIndex.add(index -3);
|
|
|
}
|
|
|
int outType = outTypeEnum.getCode();
|
|
|
CameraInOutParam param = new CameraInOutParam();
|
|
@@ -116,11 +128,17 @@ public class ExcelServiceImpl implements IExcelService {
|
|
|
param.setSnCode(snCode);
|
|
|
params.add(param);
|
|
|
}else if(type == 2){ //关联客户
|
|
|
+ if(!map.get(0).equals("客户关联模板")){
|
|
|
+ throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
|
|
|
+ }
|
|
|
+ if(index <4){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
CameraInOutParam param = new CameraInOutParam();
|
|
|
param.setCompanyName(map.get(0));
|
|
|
param.setSnCode(map.get(1));
|
|
|
if(StringUtils.isBlank(param.getSnCode()) || StringUtils.isBlank(param.getCompanyName())){
|
|
|
- errorIndex.add(index );
|
|
|
+ errorIndex.add(index -3 );
|
|
|
}
|
|
|
companyParams.add(param);
|
|
|
}
|