|
|
@ -32,6 +32,7 @@ import com.elink.esua.epdc.commons.tools.redis.RedisKeys; |
|
|
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.TreeUtils; |
|
|
|
import com.elink.esua.epdc.dto.category.CategoryDTO; |
|
|
@ -334,14 +335,14 @@ public class CategoryServiceImpl extends BaseServiceImpl<CategoryDao, CategoryEn |
|
|
|
if (null != cell) { |
|
|
|
if (c == 0) { |
|
|
|
//领域列编号
|
|
|
|
String value = getCellContent(cell); |
|
|
|
String value = ExcelUtils.getCellContent(cell); |
|
|
|
if(!"".equals(value) && !firstClassInfoCode.equals(value)){ |
|
|
|
firstClassInfoCode = value; |
|
|
|
} |
|
|
|
}else if (c == 1) { |
|
|
|
//领域列
|
|
|
|
firstClassNameCurrent = ""; |
|
|
|
String value = getCellContent(cell); |
|
|
|
String value = ExcelUtils.getCellContent(cell); |
|
|
|
if(!"".equals(value) && !firstClassName.equals(value)){ |
|
|
|
firstClassName = value; |
|
|
|
firstClassNameCurrent = value; |
|
|
@ -357,14 +358,14 @@ public class CategoryServiceImpl extends BaseServiceImpl<CategoryDao, CategoryEn |
|
|
|
} |
|
|
|
}else if (c == 2) { |
|
|
|
//大类列编号
|
|
|
|
String value = getCellContent(cell); |
|
|
|
String value = ExcelUtils.getCellContent(cell); |
|
|
|
if(!"".equals(value) && !secondClassInfoCode.equals(value)){ |
|
|
|
secondClassInfoCode = value; |
|
|
|
} |
|
|
|
}else if (c == 3) { |
|
|
|
//大类列
|
|
|
|
secondClassNameCurrent = ""; |
|
|
|
String value = getCellContent(cell); |
|
|
|
String value = ExcelUtils.getCellContent(cell); |
|
|
|
if(!"".equals(value) && !secondClassName.equals(value)){ |
|
|
|
secondClassName = value; |
|
|
|
secondClassNameCurrent = value; |
|
|
@ -377,14 +378,14 @@ public class CategoryServiceImpl extends BaseServiceImpl<CategoryDao, CategoryEn |
|
|
|
} |
|
|
|
} else if (c == 4) { |
|
|
|
//小类列编号
|
|
|
|
String value = getCellContent(cell); |
|
|
|
String value = ExcelUtils.getCellContent(cell); |
|
|
|
if(!"".equals(value) && !thirdClassInfoCode.equals(value)){ |
|
|
|
thirdClassInfoCode = value; |
|
|
|
} |
|
|
|
}else if (c == 5) { |
|
|
|
//小类列
|
|
|
|
thirdClassNameCurrent = ""; |
|
|
|
String value = getCellContent(cell); |
|
|
|
String value = ExcelUtils.getCellContent(cell); |
|
|
|
if(!"".equals(value) && !thirdClassName.equals(value)){ |
|
|
|
thirdClassName = value; |
|
|
|
thirdClassNameCurrent = value; |
|
|
@ -395,14 +396,14 @@ public class CategoryServiceImpl extends BaseServiceImpl<CategoryDao, CategoryEn |
|
|
|
} |
|
|
|
}else if (c == 6) { |
|
|
|
//细类名称列编号
|
|
|
|
String value = getCellContent(cell); |
|
|
|
String value = ExcelUtils.getCellContent(cell); |
|
|
|
if(!"".equals(value) && !fourthClassInfoCode.equals(value)){ |
|
|
|
fourthClassInfoCode = value; |
|
|
|
} |
|
|
|
} else if (c == 7) { |
|
|
|
//细类名称列
|
|
|
|
fourthClassNameCurrent = ""; |
|
|
|
String value = getCellContent(cell); |
|
|
|
String value = ExcelUtils.getCellContent(cell); |
|
|
|
if(!"".equals(value) && !fourthClassName.equals(value)){ |
|
|
|
fourthClassName = value; |
|
|
|
fourthClassNameCurrent = value; |
|
|
@ -459,25 +460,6 @@ public class CategoryServiceImpl extends BaseServiceImpl<CategoryDao, CategoryEn |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取单元格内容 |
|
|
|
* @param cell |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public String getCellContent(Cell cell){ |
|
|
|
String value = ""; |
|
|
|
if (cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC) { |
|
|
|
value = String.valueOf(cell.getNumericCellValue()); |
|
|
|
} else { |
|
|
|
value = cell.getStringCellValue(); |
|
|
|
} |
|
|
|
//内容超过25个字进行长度限制,否则数据库会超限
|
|
|
|
/*if(value.length() > 25){ |
|
|
|
value = value.substring(0,25) + "..."; |
|
|
|
}*/ |
|
|
|
return value; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取19位随机数 |
|
|
|
* @return |
|
|
|