|
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.mixsmart.utils.FormulaUtils;
|
|
|
import com.mixsmart.utils.ListUtils;
|
|
|
import com.mixsmart.utils.RegexUtils;
|
|
|
+import com.spire.xls.FileFormat;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
@@ -1329,7 +1330,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
//获取excel流 和 html流
|
|
|
InputStream exceInp = CommonUtil.getOSSInputStream(excelTab.getFileUrl());
|
|
|
- org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(exceInp);
|
|
|
+ Workbook workbook = WorkbookFactory.create(exceInp);
|
|
|
|
|
|
//获取工作表
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
@@ -1377,9 +1378,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(pkeyId == 1644218999589830668L){
|
|
|
- // System.out.println("12321");
|
|
|
- }
|
|
|
+
|
|
|
//数据不为空
|
|
|
if (StringUtils.isNotEmpty(wbsTreeContract.getHtmlUrl())) {
|
|
|
InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(wbsTreeContract.getHtmlUrl());
|
|
@@ -1395,7 +1394,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
Elements datas = doc.getElementsByAttributeValue("keyname", val);
|
|
|
Element data = null;
|
|
|
if(val.equals("key_12__25_0")){
|
|
|
- //System.out.println("1231");
|
|
|
+ System.out.println("1231");
|
|
|
}
|
|
|
if (datas.size() >= 1) {
|
|
|
data = datas.get(0);
|
|
@@ -1491,9 +1490,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
if(StringUtils.isNotEmpty(dataJson)){
|
|
|
JSONArray jsonArray = JSONArray.parseArray(dataJson);
|
|
|
List<Integer> idList = Func.toIntList(myData);
|
|
|
- String dataInfo = jsonArray.getJSONObject(idList.get(0)).getString("name");
|
|
|
+ String dataInfo = jsonArray.getJSONObject(idList.get(0)-1).getString("name");
|
|
|
for(int inx=1 ; inx<idList.size() ; inx++){
|
|
|
- dataInfo = dataInfo+","+jsonArray.getJSONObject(inx).getString("name");
|
|
|
+ int valIndex = idList.get(inx)-1;
|
|
|
+ dataInfo = dataInfo+","+jsonArray.getJSONObject(valIndex).getString("name");
|
|
|
}
|
|
|
cell.setCellValue(dataInfo);
|
|
|
}
|
|
@@ -1513,7 +1513,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if(pkeyId == 1688448159421825025L){
|
|
|
+ System.out.println("12321");
|
|
|
+ }
|
|
|
// 组装电签设置
|
|
|
QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.in("type", 2, 6);
|
|
@@ -1544,6 +1546,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
Row row = sheet.getRow(y1 - 1);
|
|
|
if (row != null) {
|
|
|
+
|
|
|
Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
|
|
|
if (cell != null || ObjectUtils.isNotEmpty(cell)) {
|
|
|
short fontIndex = cell.getCellStyle().getFontIndex();
|
|
@@ -1571,9 +1574,17 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
FileOutputStream outputStream = new FileOutputStream(excelPath);
|
|
|
workbook.write(outputStream);
|
|
|
- FileUtils.setExcelScaleToPdf(excelPath, pdfPath);
|
|
|
|
|
|
- BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
|
|
|
+ com.spire.xls.Workbook workbook2 = new com.spire.xls.Workbook();
|
|
|
+ workbook2.loadFromFile(excelPath);
|
|
|
+
|
|
|
+ //设置转换后的PDF页面高宽适应工作表的内容大小
|
|
|
+ workbook2.getConverterSetting().setSheetFitToPage(true);
|
|
|
+ workbook2.getConverterSetting().setSheetFitToWidth(true);
|
|
|
+ workbook2.saveToFile(pdfPath, FileFormat.PDF);
|
|
|
+ // FileUtils.setExcelScaleToPdf(excelPath, pdfPath);
|
|
|
+
|
|
|
+/* BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
|
|
|
|
|
|
//附件
|
|
|
TableFile tableFile1 = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getType, 1)).stream().findAny().orElse(null);
|
|
@@ -1619,8 +1630,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
if (exceInp != null) {
|
|
|
IoUtil.closeQuietly(exceInp);
|
|
|
}
|
|
|
- return R.data(bladeFile2.getLink());
|
|
|
-
|
|
|
+ return R.data(bladeFile2.getLink());*/
|
|
|
+ return R.data("");
|
|
|
}
|
|
|
|
|
|
@Override
|