|
@@ -726,7 +726,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
int status = callback.getStatus();
|
|
|
int saved = 0;
|
|
|
//status=6,表示点击保存按钮 2 关闭保存
|
|
|
- if (status == 3 || status == 6) //MustSave, Corrupted
|
|
|
+ /*if (status == 3 || status == 6) //MustSave, Corrupted
|
|
|
{
|
|
|
//获取url
|
|
|
String downloadUri = callback.getUrl();
|
|
@@ -775,7 +775,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
editCallback.setError(1);
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
return editCallback;
|
|
|
}
|
|
|
|
|
@@ -1336,14 +1336,14 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
// 施工单位名称
|
|
|
if (dwtitle.size() >= 1) {
|
|
|
int y = Integer.parseInt(dwtitle.attr("trindex"));
|
|
|
- if (y <= 10) {
|
|
|
+ if (y <= 20) {
|
|
|
reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
if (sgtitle.size() >= 1) {
|
|
|
int y = Integer.parseInt(sgtitle.attr("trindex"));
|
|
|
- if (y <= 10) {
|
|
|
+ if (y <= 20) {
|
|
|
reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
}
|
|
|
}
|
|
@@ -1359,10 +1359,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
// 监理单位名称
|
|
|
if (jltitle.size() >= 1) {
|
|
|
-
|
|
|
for (Element element : jltitle) {
|
|
|
int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trindex <= 10) {
|
|
|
+ String placeholderxx = element.attr("placeholder");
|
|
|
+
|
|
|
+ if (trindex < 10 || placeholderxx.equals("监理单位")) {
|
|
|
reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
|
|
|
}
|
|
|
}
|
|
@@ -1406,7 +1407,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
//电签默认值
|
|
|
if (defText.size() >= 1) {
|
|
|
for (Element element : defText) {
|
|
|
- reData.put(element.attr("id"), element.attr("defText"));
|
|
|
+ reData.put(element.attr("keyName"), element.attr("defText"));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1677,7 +1678,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
//电签默认值
|
|
|
if (defText.size() >= 1) {
|
|
|
for (Element element : defText) {
|
|
|
- reData.put(element.attr("id"), element.attr("defText"));
|
|
|
+ reData.put(element.attr("keyName"), element.attr("defText"));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1853,7 +1854,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
int all = 0;
|
|
|
- for (int i = 0; i < 10; i++) {
|
|
|
+ List<CellRangeAddress> mergedRegions = sheet.getMergedRegions();
|
|
|
+ int xle = 10;
|
|
|
+ if(mergedRegions.size()<=10){
|
|
|
+ xle = mergedRegions.size();
|
|
|
+ }
|
|
|
+ for (int i = 0; i < xle; i++) {
|
|
|
CellRangeAddress mergedCell = sheet.getMergedRegion(i);
|
|
|
int xx = mergedCell.getNumberOfCells();
|
|
|
if (xx >= all) {
|
|
@@ -1861,7 +1867,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < 10; i++) {
|
|
|
+ for (int i = 0; i < xle; i++) {
|
|
|
CellRangeAddress mergedCell = sheet.getMergedRegion(i);
|
|
|
int xx = mergedCell.getNumberOfCells() + 2;
|
|
|
if (xx >= all) {
|
|
@@ -1955,7 +1961,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
String myData = DataInfo.get(val) + "";
|
|
|
- if ((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0)) {
|
|
|
+ System.out.println(data.attr("type").indexOf("date")>=0);
|
|
|
+ if (data.attr("type").indexOf("date")>=0 && (myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) ) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
|
|
sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
|
|
|
SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
|
|
@@ -2245,20 +2252,22 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
JSONObject dataInfo2 = dataArray.getJSONObject(m);
|
|
|
tableInfo.setPkeyId(dataInfo2.getString("pkeyId"));
|
|
|
tableInfo.setToBeUpdated(true);
|
|
|
- if (!tabIds.contains(tableInfo.getPkeyId())) {
|
|
|
- //隐藏表不做处理
|
|
|
- continue;
|
|
|
- }
|
|
|
|
|
|
+ // entrustInfo = 为 委托单信息
|
|
|
+ if(!tabIds.equals("entrustInfo")){
|
|
|
+ if (!tabIds.contains(tableInfo.getPkeyId())) {
|
|
|
+ //隐藏表不做处理
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ tableInfo.setProjectId(dataInfo2.getString("projectId"));
|
|
|
+ //填报的类型,施工或监理
|
|
|
+ tableInfo.setClassify(dataInfo2.getString("classify"));
|
|
|
+ //设置首件信息
|
|
|
+ this.setFirstData(dataInfo2, tableInfo);
|
|
|
+ //设置日志信息
|
|
|
+ this.setTheLogData(dataInfo2, tableInfo);
|
|
|
+ }
|
|
|
tableInfo.setContractId(dataInfo2.getString("contractId"));
|
|
|
- tableInfo.setProjectId(dataInfo2.getString("projectId"));
|
|
|
-
|
|
|
- //填报的类型,施工或监理
|
|
|
- tableInfo.setClassify(dataInfo2.getString("classify"));
|
|
|
- //设置首件信息
|
|
|
- this.setFirstData(dataInfo2, tableInfo);
|
|
|
- //设置日志信息
|
|
|
- this.setTheLogData(dataInfo2, tableInfo);
|
|
|
|
|
|
dataInfo2.fluentRemove("contractId")
|
|
|
.fluentRemove("pkeyId")
|
|
@@ -3775,4 +3784,299 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
return R.data(PdfAddimgUtil.getNetUrl(pdfPath));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 试验 委托单 单pdf
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String getEntrustPDFTrial(Long pkeyId, String contractId, Long groupId) throws Exception {
|
|
|
+ String file_path = FileUtils.getSysLocalFileUrl();//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
|
+ WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
|
|
|
+ .eq(WbsTreePrivate::getPKeyId, pkeyId));
|
|
|
+ if (wbsTreePrivate == null) {
|
|
|
+ throw new ServiceException("该数据下无此节点!");
|
|
|
+ }
|
|
|
+ if (wbsTreePrivate.getHtmlUrl() == null) {
|
|
|
+ throw new ServiceException("请关联清表!");
|
|
|
+ }
|
|
|
+
|
|
|
+ String pdfPath = file_path + "/pdf//" + pkeyId + ".pdf";
|
|
|
+ String excelPath = file_path + "/pdf//" + pkeyId + ".xlsx";
|
|
|
+
|
|
|
+ File tabPdf = ResourceUtil.getFile(pdfPath);
|
|
|
+ if (tabPdf.exists()) {
|
|
|
+ tabPdf.delete();
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取清表信息
|
|
|
+ ExcelTab excelTab = this.getById(wbsTreePrivate.getExcelId());
|
|
|
+
|
|
|
+ if (excelTab == null) {
|
|
|
+ throw new ServiceException("操作失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取数据信息info
|
|
|
+ List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(groupId, pkeyId, Long.parseLong(contractId));
|
|
|
+ Map<String, Object> DataInfo = new HashMap<>();
|
|
|
+ if (bussDataInfoTrial.size() > 0) {
|
|
|
+ DataInfo.putAll(bussDataInfoTrial.stream().findAny().orElse(null));
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取清表excel文件
|
|
|
+ org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(Objects.requireNonNull(CommonUtil.getOSSInputStreamTow(excelTab.getFileUrl())));
|
|
|
+ Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ sheet.setForceFormulaRecalculation(true);
|
|
|
+
|
|
|
+ //标题Title
|
|
|
+ ProjectInfo projectInfo = projectInfoService.getById(wbsTreePrivate.getProjectId());
|
|
|
+ int all = sheet.getRow(0).getLastCellNum();
|
|
|
+ int mergedCellCnt = sheet.getNumMergedRegions();
|
|
|
+ for (
|
|
|
+ int i = 0;
|
|
|
+ i < mergedCellCnt - 1; i++) {
|
|
|
+ CellRangeAddress mergedCell = sheet.getMergedRegion(i);
|
|
|
+ int xx = mergedCell.getNumberOfCells();
|
|
|
+ if (xx <= all) {
|
|
|
+ int fisRow = mergedCell.getFirstRow();
|
|
|
+ int firstCol = mergedCell.getFirstColumn();
|
|
|
+ Cell cell = sheet.getRow(fisRow).getCell(firstCol);
|
|
|
+ short fontIndex = cell.getCellStyle().getFontIndex();
|
|
|
+ Font oldFontAt = workbook.getFontAt(fontIndex);
|
|
|
+ Font redFont = workbook.createFont();
|
|
|
+ redFont.setFontHeightInPoints(oldFontAt.getFontHeightInPoints());//设置字体大小
|
|
|
+ redFont.setFontName(oldFontAt.getFontName());//设置字体
|
|
|
+ CellStyle newStyle = workbook.createCellStyle();//创建单元格样式
|
|
|
+ newStyle.cloneStyleFrom(cell.getCellStyle());
|
|
|
+ short fontHeightInPoints = redFont.getFontHeightInPoints();
|
|
|
+ if (fontHeightInPoints >= 14 && StringUtils.isEmpty(cell.getStringCellValue()) && fisRow <= 8) {
|
|
|
+ String title = projectInfo.getProjectName();
|
|
|
+ if (title.length() >= 30) {
|
|
|
+ sheet.getRow(fisRow).setHeight((short) 900);
|
|
|
+ newStyle.setWrapText(true);
|
|
|
+ }
|
|
|
+ redFont.setBold(true);
|
|
|
+ newStyle.setFont(redFont);
|
|
|
+ cell.setCellStyle(newStyle);
|
|
|
+ cell.setCellValue(title);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //数据不为空,构造数据
|
|
|
+ String fileUrl = wbsTreePrivate.getHtmlUrl();
|
|
|
+ File file1 = ResourceUtil.getFile(fileUrl);
|
|
|
+ InputStream fileInputStream;
|
|
|
+ if (file1.exists()) {
|
|
|
+ fileInputStream = new FileInputStream(file1);
|
|
|
+ } else {
|
|
|
+ String path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path, "");
|
|
|
+ fileInputStream = CommonUtil.getOSSInputStream(path);
|
|
|
+ }
|
|
|
+
|
|
|
+ String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
+ htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
|
+ htmlString = htmlString.replaceAll("title", "titlexx");
|
|
|
+
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
+ Element table = doc.select("table").first();
|
|
|
+ Elements trs = table.select("tr");
|
|
|
+
|
|
|
+ if (ObjectUtil.isNotEmpty(DataInfo)) {
|
|
|
+ for (String val : Objects.requireNonNull(DataInfo).keySet()) {
|
|
|
+ if (val.contains("__")) {
|
|
|
+ String[] DataVal = val.split("__");
|
|
|
+ String[] xy = DataVal[1].split("_");
|
|
|
+ if (Integer.parseInt(xy[0]) < trs.size()) {
|
|
|
+ Element ytzData = trs.get(Integer.parseInt(xy[0]));
|
|
|
+ if (ytzData != null) {
|
|
|
+ Elements tdsx = ytzData.select("td");
|
|
|
+ if (Integer.parseInt(xy[1]) < tdsx.size()) {
|
|
|
+ Element data = ytzData.select("td").get(Integer.parseInt(xy[1]));
|
|
|
+ if (data != null) {
|
|
|
+ if (data.html().contains("x1") && data.html().contains("y1")) {
|
|
|
+ int x1 = 0;
|
|
|
+ int x2 = 0;
|
|
|
+ int y1 = 0;
|
|
|
+ int y2 = 0;
|
|
|
+ if (data.html().contains("el-tooltip")) {
|
|
|
+ x1 = Integer.parseInt(data.children().get(0).children().get(0).attr("x1"));
|
|
|
+ x2 = Integer.parseInt(data.children().get(0).children().get(0).attr("x2"));
|
|
|
+ y1 = Integer.parseInt(data.children().get(0).children().get(0).attr("y1"));
|
|
|
+ } else {
|
|
|
+ x1 = Integer.parseInt(data.children().get(0).attr("x1"));
|
|
|
+ y1 = Integer.parseInt(data.children().get(0).attr("y1"));
|
|
|
+ }
|
|
|
+ if (x1 == 0) {
|
|
|
+ x1 = 1;
|
|
|
+ }
|
|
|
+ String myData = DataInfo.get(val) + "";
|
|
|
+ if (myData.contains("T") && myData.contains("-") && myData.contains(":")) {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
|
|
+ sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
|
|
|
+ SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
+ if (myData.contains(",") && myData.contains("]")) {
|
|
|
+
|
|
|
+ myData = myData.replace("[", "").replace("]", "").replaceAll("'", "");
|
|
|
+ String[] dataVal = myData.split(",");
|
|
|
+
|
|
|
+ Date Start_dataStr = sdf.parse(dataVal[0]);
|
|
|
+ Date end_dataStr = sdf.parse(dataVal[1]);
|
|
|
+ String StartDate = formatStr.format(Start_dataStr);
|
|
|
+ String endDate = formatStr.format(end_dataStr);
|
|
|
+ if (StartDate.equals(endDate)) {
|
|
|
+ myData = StartDate;
|
|
|
+ } else {
|
|
|
+ myData = StartDate + "-" + endDate;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ String[] dataStr = myData.split("T")[0].split("-");
|
|
|
+ myData = StringUtil.format("{}年{}月{}日", dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (myData.contains("lang.String")) {
|
|
|
+ Object obj = DataInfo.get(val);
|
|
|
+ if (obj instanceof String[]) {
|
|
|
+ String[] dataDate = (String[]) obj;
|
|
|
+ myData = dataDate[0].trim() + "-" + dataDate[1].trim();
|
|
|
+ if (dataDate[0].trim().equals(dataDate[1].trim())) {
|
|
|
+ myData = dataDate[0];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (myData.contains("http") && myData.contains("aliyuncs")) {
|
|
|
+ InputStream imageIn = CommonUtil.getOSSInputStream(myData);
|
|
|
+ byte[] byteNew = new byte[0];
|
|
|
+ if (imageIn != null) {
|
|
|
+ byteNew = IOUtils.toByteArray(imageIn);
|
|
|
+ }
|
|
|
+
|
|
|
+ byte[] bytes = CommonUtil.compressImage(byteNew);
|
|
|
+
|
|
|
+ CreationHelper helper = workbook.getCreationHelper();
|
|
|
+ ClientAnchor anchor = helper.createClientAnchor();
|
|
|
+ anchor.setCol1(x1); // param1是列号
|
|
|
+ anchor.setCol2(x2);
|
|
|
+ anchor.setRow1(y1); // param2是行号
|
|
|
+ anchor.setRow2(y2); // param2是行号
|
|
|
+
|
|
|
+ Drawing<?> drawing = sheet.createDrawingPatriarch();
|
|
|
+ anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
|
|
|
+ // 插入图片
|
|
|
+ Picture picture = drawing.createPicture(anchor, workbook.addPicture(bytes, Workbook.PICTURE_TYPE_PNG));
|
|
|
+ picture.resize(1, 1);
|
|
|
+ FileUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
|
|
|
+
|
|
|
+ } else if (myData.equals("1") && data.html().contains("hc-form-checkbox-group")) {
|
|
|
+ Row row = sheet.getRow(y1 - 1);
|
|
|
+ if (row != null) {
|
|
|
+ Cell cell = row.getCell(x1 - 1);
|
|
|
+ if (cell != null) {
|
|
|
+ String exceVal = cell.getStringCellValue().replaceAll(" ", "");
|
|
|
+ short fontIndex = cell.getCellStyle().getFontIndex();
|
|
|
+ Font fontAt = workbook.getFontAt(fontIndex);
|
|
|
+ fontAt.setFontName("EUDC");
|
|
|
+ cell.setCellValue(exceVal.replace("□", "\u2611"));
|
|
|
+ } else {
|
|
|
+ ObjectUtils.isNotEmpty(cell);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Row row = sheet.getRow(y1 - 1);
|
|
|
+ if (row != null) {
|
|
|
+ Cell cell = row.getCell(x1 - 1);
|
|
|
+ if (cell != null) {
|
|
|
+ cell.setCellValue(myData);
|
|
|
+ } else {
|
|
|
+ ObjectUtils.isNotEmpty(cell);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 组装电签设置
|
|
|
+ QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.select("col_key", "id");
|
|
|
+ queryWrapper.in("type", 2, 6);
|
|
|
+ queryWrapper.eq("tab_id", wbsTreePrivate.getPKeyId());
|
|
|
+
|
|
|
+ List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
+ if (textdictInfos != null && !textdictInfos.isEmpty()) {
|
|
|
+ for (TextdictInfo e : textdictInfos) {
|
|
|
+ String key = e.getColKey();
|
|
|
+ String[] keys = key.split("__");
|
|
|
+ String[] trtd = keys[1].split("_");
|
|
|
+ if (Integer.parseInt(trtd[0]) < trs.size()) {
|
|
|
+ Element ytzData = trs.get(Integer.parseInt(trtd[0]));
|
|
|
+ if (ytzData != null) {
|
|
|
+ Elements tdsx = ytzData.select("td");
|
|
|
+ if (Integer.parseInt(trtd[1]) < tdsx.size()) {
|
|
|
+ Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
|
|
|
+ if (data.html().contains("el-tooltip")) {
|
|
|
+ data = data.children().get(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
|
|
|
+ if (x1 == 0) {
|
|
|
+ x1 = 1;
|
|
|
+ }
|
|
|
+ int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
|
|
|
+
|
|
|
+ Row row = sheet.getRow(y1 - 1);
|
|
|
+ if (row != null) {
|
|
|
+ Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
|
|
|
+ if (cell != null) {
|
|
|
+ short fontIndex = cell.getCellStyle().getFontIndex();
|
|
|
+ Font oldfontAt = workbook.getFontAt(fontIndex);
|
|
|
+
|
|
|
+ Font redFont = workbook.createFont();
|
|
|
+ redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
|
|
|
+ redFont.setFontHeightInPoints(oldfontAt.getFontHeightInPoints());//设置字体大小
|
|
|
+ redFont.setFontName(oldfontAt.getFontName());//设置字体
|
|
|
+
|
|
|
+ CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
|
|
|
+ newStyle.cloneStyleFrom(cell.getCellStyle());
|
|
|
+ newStyle.setFont(redFont);
|
|
|
+ cell.setCellStyle(newStyle);
|
|
|
+ cell.setCellValue(e.getId() + "");
|
|
|
+ } else {
|
|
|
+ ObjectUtils.isNotEmpty(cell);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //输出流
|
|
|
+ FileOutputStream outputStream = new FileOutputStream(excelPath);
|
|
|
+ workbook.write(outputStream);
|
|
|
+ FileUtils.setExcelScaleToPdf(excelPath, pdfPath);
|
|
|
+ BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
|
|
|
+
|
|
|
+ if (bladeFile != null) {
|
|
|
+ String pdfUrl = bladeFile.getLink();
|
|
|
+ jdbcTemplate.update("update u_entrust_info set entrust_pdf = '"+pdfUrl+"' where id='"+groupId+"' ");
|
|
|
+ List<InformationQuery> query2 = jdbcTemplate.query("select id from u_information_query where classify = 1 and wbs_id ='" + groupId + "' and contract_id ='" + contractId + "'", new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
|
+ if (query2.size() > 0) {
|
|
|
+ jdbcTemplate.execute("update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='委托单' where classify='1' and wbs_id='" + groupId + "' and contract_id ='" + contractId + "'");
|
|
|
+ } else {
|
|
|
+ informationQueryClient.saveData(groupId.toString(), projectInfo.getId().toString(), contractId, "1", bladeFile.getLink(), "委托单");
|
|
|
+ }
|
|
|
+ return bladeFile.getLink();
|
|
|
+ }
|
|
|
+ return "操作失败";
|
|
|
+ }
|
|
|
+
|
|
|
}
|