|
@@ -687,21 +687,7 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static void main11(String[] args) throws Exception {
|
|
|
|
|
|
- String thmlUrl = "/Users/hongchuangyanfa/Desktop/1574226461517152256.html";
|
|
|
-
|
|
|
- String osUrl = "https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220926/255f87504cd9f4ba61d888d044d1342c.xlsx";
|
|
|
- InputStream redio = CommonUtil.getOSSInputStream(osUrl);
|
|
|
- Workbook wb = new Workbook();
|
|
|
- wb.loadFromMHtml(redio);
|
|
|
- //获取工作表
|
|
|
- Worksheet sheet = wb.getWorksheets().get(0);
|
|
|
-
|
|
|
- sheet.saveToHtml(thmlUrl);
|
|
|
-
|
|
|
- // expailHtmlInfo(thmlUrl,1L);
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
@@ -976,7 +962,6 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (inputText != null && inputText != "" && inputText.indexOf("_") >= 0) {
|
|
|
inputText = inputText.substring(0, inputText.lastIndexOf("_"));
|
|
|
}
|
|
@@ -2300,15 +2285,25 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
public R getFirstExcelHtml() throws Exception {
|
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- String sql ="SELECT n.p_key_id,excelId from (SELECT p_key_id,(SELECT id from m_excel_tab x where x.alias like '%1542045893564796930%' and parent_id='1559347745306148865' and is_deleted=0 and x.name =m.full_name) as excelId from m_wbs_tree_private m where m.project_id = '1578599210897772545' and m.type='2' ) n where excelId is not null and p_key_id!='1578599433161932807' ";
|
|
|
+ String sql ="SELECT * from m_excel_tab x where x.alias like '%1579401528622919682%' and parent_id in ('1582212216210829314','1582211923960115201') and is_deleted=0 and file_type=3 ";
|
|
|
List<Map<String, Object>> dataInof = jdbcTemplate.queryForList(sql);
|
|
|
System.out.println(dataInof.size());
|
|
|
for (int i = 0; i < dataInof.size(); i++) {
|
|
|
- String p_key_id = dataInof.get(i).get("p_key_id") + "";
|
|
|
- Long excelId = Long.parseLong(dataInof.get(i).get("excelId") + "");
|
|
|
- System.out.println(p_key_id+"__"+excelId);
|
|
|
- this.saveLinkeTab(excelId, Long.valueOf(p_key_id));
|
|
|
- // this.saveLinkeTab(, excelId);
|
|
|
+ String file_url = dataInof.get(i).get("file_url") + "";
|
|
|
+ Long p_key_id = Long.parseLong(dataInof.get(i).get("id") + "");
|
|
|
+ String html_url = dataInof.get(i).get("html_url")+"";
|
|
|
+
|
|
|
+ ExcelTab detail = excelTabService.getById(p_key_id);
|
|
|
+ // 解析excel
|
|
|
+ Workbook wb = new Workbook();
|
|
|
+ wb.loadFromMHtml(CommonUtil.getOSSInputStream(file_url));
|
|
|
+ //
|
|
|
+ HTMLOptions options = new HTMLOptions();
|
|
|
+ options.setImageEmbedded(true);
|
|
|
+ //获取工作表
|
|
|
+ Worksheet sheet = wb.getWorksheets().get(0);
|
|
|
+ sheet.saveToHtml(html_url, options);
|
|
|
+ this.expailHtmlInfo(html_url,p_key_id);
|
|
|
System.out.println(i);
|
|
|
}
|
|
|
|