|
@@ -38,18 +38,18 @@ public class DrugTest10 {
|
|
|
@Autowired
|
|
|
EntityService entityService;
|
|
|
private static int maxCount= -1;
|
|
|
- private static String drugExcelPath = "C:\\Users\\17664\\Desktop\\药品说明书-部分字段-部分内容.xlsx";
|
|
|
+ private static String drugExcelPath = "C:\\Users\\dell\\Desktop\\图谱\\药品说明书测试.xlsx";
|
|
|
static HSSFWorkbook workbook;
|
|
|
static String startLabel = "药品";
|
|
|
@Test
|
|
|
public void writeNeo4j() throws Exception {
|
|
|
|
|
|
- String propertys = "商品名称,成分";
|
|
|
+ String propertys = "英文名称,商品名称,成份,性状,适应症,不良反应";
|
|
|
workbook = new HSSFWorkbook();//这里也可以设置sheet的Name
|
|
|
String accessToken = BaidubceUtil.getAccessToken();
|
|
|
InputStream drugFis = new FileInputStream(drugExcelPath);
|
|
|
Workbook drugWorkbook = new XSSFWorkbook(drugFis);
|
|
|
- Sheet drugSheet = drugWorkbook.getSheetAt(2);
|
|
|
+ Sheet drugSheet = drugWorkbook.getSheetAt(0);
|
|
|
String[] split = propertys.split(",");
|
|
|
for(String property:split) {
|
|
|
HSSFSheet sheet = workbook.createSheet(property);
|
|
@@ -211,7 +211,7 @@ public class DrugTest10 {
|
|
|
|
|
|
private static synchronized void save(String fileName) {
|
|
|
try {
|
|
|
- fileName="C:\\Users\\17664\\Desktop\\"+fileName+System.currentTimeMillis()+".xlsx";
|
|
|
+ fileName="D:\\测试文件夹\\"+fileName+System.currentTimeMillis()+".xlsx";
|
|
|
//文档输出
|
|
|
FileOutputStream out = new FileOutputStream(new File(fileName));
|
|
|
workbook.write(out);
|