|
@@ -3,6 +3,7 @@ package org.springblade.manager.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -12,11 +13,11 @@ import com.itextpdf.html2pdf.resolver.font.DefaultFontProvider;
|
|
|
import com.itextpdf.io.font.FontProgram;
|
|
|
import com.itextpdf.io.font.FontProgramFactory;
|
|
|
import com.itextpdf.layout.font.FontProvider;
|
|
|
-import com.spire.xls.ExcelPicture;
|
|
|
-import com.spire.xls.ExcelVersion;
|
|
|
-import com.spire.xls.Workbook;
|
|
|
-import com.spire.xls.Worksheet;
|
|
|
+import com.spire.xls.*;
|
|
|
+import com.spire.xls.core.IStyle;
|
|
|
import com.spire.xls.core.spreadsheet.HTMLOptions;
|
|
|
+import com.spire.xls.core.spreadsheet.pivottables.PivotStyle;
|
|
|
+import com.spire.xls.core.spreadsheet.shapes.XlsTextBoxShape;
|
|
|
import io.swagger.annotations.*;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.SneakyThrows;
|
|
@@ -25,8 +26,6 @@ import org.jsoup.Jsoup;
|
|
|
import org.jsoup.nodes.Document;
|
|
|
import org.jsoup.nodes.Element;
|
|
|
import org.jsoup.select.Elements;
|
|
|
-import org.springblade.business.feign.FileUtilsClient;
|
|
|
-import org.springblade.business.feign.InformationQueryClient;
|
|
|
import org.springblade.common.constant.CommonConstant;
|
|
|
import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.MathUtil;
|
|
@@ -59,16 +58,21 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
|
import javax.validation.Valid;
|
|
|
+import java.awt.*;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
import java.io.File;
|
|
|
import java.io.FileInputStream;
|
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
+import java.util.List;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static com.baomidou.mybatisplus.core.toolkit.Wrappers.lambdaQuery;
|
|
|
+import static com.baomidou.mybatisplus.core.toolkit.Wrappers.query;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 清表基础数据表 控制器
|
|
@@ -96,9 +100,6 @@ public class ExcelTabController extends BladeController {
|
|
|
// 私有项目wbs
|
|
|
private final IWbsTreePrivateService wbsTreePrivateService;
|
|
|
|
|
|
- // 清表表格解析信息
|
|
|
- //private final ILinkdataInfoService linkdataInfoService;
|
|
|
-
|
|
|
// 元素信息表-
|
|
|
private final IWbsFormElementService wbsFormElementService;
|
|
|
|
|
@@ -109,8 +110,6 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
- //客户端资料查询接口
|
|
|
- private final InformationQueryClient informationQueryClient;
|
|
|
|
|
|
// 表单附件信息
|
|
|
private final ITableFileService tableFileService;
|
|
@@ -118,8 +117,8 @@ public class ExcelTabController extends BladeController {
|
|
|
// pdf转换
|
|
|
private final CommonFileClient commonFileClient;
|
|
|
|
|
|
-
|
|
|
- private final IWbsParamService wbsParamService;
|
|
|
+ // 表单字典信息表
|
|
|
+ private final ITextdictInfoService textdictInfoService;
|
|
|
|
|
|
/**
|
|
|
* 详情
|
|
@@ -402,7 +401,6 @@ public class ExcelTabController extends BladeController {
|
|
|
updateWrapper.set("excel_id", excelTab.getId());
|
|
|
|
|
|
wbsTreePrivateService.update(updateWrapper);
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -434,7 +432,7 @@ public class ExcelTabController extends BladeController {
|
|
|
})
|
|
|
public R<List<ExceTabTreVO>> saveLinkeTab(Long exceTabId, Long tabId) throws IOException {
|
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- // 查询私有项目信息
|
|
|
+ // 关联 私有项目 wbs 数据信息
|
|
|
WbsTreePrivate wbsTree = new WbsTreePrivate();
|
|
|
wbsTree.setPKeyId(tabId);
|
|
|
WbsTreePrivate aPrivate = wbsTreePrivateService.getOne(Condition.getQueryWrapper(wbsTree));
|
|
@@ -516,9 +514,17 @@ public class ExcelTabController extends BladeController {
|
|
|
FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
|
|
|
|
|
|
- //日志表单关联解决
|
|
|
+ //由于日志无法拿到基本节点,将 关联html的id 放入在父节点excelId 处理
|
|
|
if (aPrivate.getWbsType().equals("4")) {
|
|
|
- updateWrapper.set("excel_id", aPrivate.getPKeyId());
|
|
|
+ WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
|
|
|
+ .eq(WbsTreePrivate::getId, aPrivate.getParentId()) // 获取父节点Id
|
|
|
+ .eq(WbsTreePrivate::getWbsType, "4") // 内型为4
|
|
|
+ .eq(WbsTreePrivate::getProjectId, aPrivate.getProjectId())); // 项目Id
|
|
|
+
|
|
|
+ UpdateWrapper<WbsTreePrivate> pupdate = new UpdateWrapper<>();
|
|
|
+ pupdate.in("p_key_id", wbsTreePrivate.getPKeyId());
|
|
|
+ pupdate.set("excel_id", aPrivate.getPKeyId());
|
|
|
+ wbsTreePrivateService.update(pupdate);
|
|
|
}
|
|
|
wbsTreePrivateService.update(updateWrapper);
|
|
|
//关联项目下所有的合同段
|
|
@@ -630,158 +636,6 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 保存用户填报数据接口
|
|
|
- */
|
|
|
- @PostMapping("/save_buss_data_bak")
|
|
|
- @ApiOperationSupport(order = 13)
|
|
|
- @ApiOperation(value = "填报页面数据保存", notes = "填报页面数据保存")
|
|
|
- public R<String> saveBussData(@Valid @RequestBody JSONObject dataInfo, BladeUser bladeUser) throws IOException {
|
|
|
-
|
|
|
- JSONArray dataArray = new JSONArray();
|
|
|
- if (dataInfo.containsKey("dataInfo")) { // 节点保存
|
|
|
- JSONObject jsonObject = dataInfo.getJSONObject("dataInfo");
|
|
|
- dataArray = jsonObject.getJSONArray("orderList");
|
|
|
- } else { // 单个保存
|
|
|
- dataArray.add(dataInfo);
|
|
|
- }
|
|
|
-
|
|
|
- for (int m = 0; m < dataArray.size(); m++) {
|
|
|
- JSONObject dataInfo2 = dataArray.getJSONObject(m);
|
|
|
- //
|
|
|
- String contractId = dataInfo2.getString("contractId");
|
|
|
- String pkeyId = dataInfo2.getString("pkeyId");
|
|
|
- String projectId = dataInfo2.getString("projectId");
|
|
|
- //huangjn 填报的类型,施工或监理
|
|
|
- String classify = dataInfo2.getString("classify");
|
|
|
-
|
|
|
- //huangjn 填报的类型,施工或监理
|
|
|
- // 去掉
|
|
|
- dataInfo2.remove("contractId");
|
|
|
- dataInfo2.remove("pkeyId");
|
|
|
- dataInfo2.remove("p_key_id");
|
|
|
- dataInfo2.remove("projectId");
|
|
|
- dataInfo2.remove("classify");
|
|
|
- dataInfo2.remove("pickerKey");
|
|
|
- dataInfo2.remove("id");
|
|
|
- dataInfo2.remove("");
|
|
|
-
|
|
|
- // 计算数据
|
|
|
- Map<String, String> dataMap = new HashMap<>();
|
|
|
- for (String k : dataInfo2.keySet()) {
|
|
|
- if (k.indexOf("__") >= 0) {
|
|
|
- String key = k.split("__")[0];
|
|
|
- if (dataMap.containsKey(key)) {
|
|
|
- dataMap.put(key, dataMap.get(key) + "," + k);
|
|
|
- } else {
|
|
|
- dataMap.put(key, k);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, String> dataMap2 = new HashMap<>();
|
|
|
-
|
|
|
-
|
|
|
- // 字段组合
|
|
|
- for (String k : dataMap.keySet()) {
|
|
|
- if (dataMap.get(k).indexOf(",") >= 0 && dataMap.get(k).indexOf("000Z") < 0) {
|
|
|
- String[] ziduan = dataMap.get(k).split(",");
|
|
|
- String temp = "";
|
|
|
- for (int i = 0; i < ziduan.length - 1; i++) {
|
|
|
- for (int j = 0; j < ziduan.length - i - 1; j++) {
|
|
|
- Integer tr = Integer.parseInt((ziduan[j].split("__")[1]).split("_")[0]);
|
|
|
- Integer td = Integer.parseInt(ziduan[j].split("__")[1].split("_")[1]);
|
|
|
-
|
|
|
- Integer tr_1 = Integer.parseInt(ziduan[j + 1].split("__")[1].split("_")[0]);
|
|
|
- Integer td_1 = Integer.parseInt(ziduan[j + 1].split("__")[1].split("_")[1]);
|
|
|
-
|
|
|
- if (tr > tr_1 && td == td_1) { //纵向排序
|
|
|
- temp = ziduan[j];
|
|
|
- ziduan[j] = ziduan[j + 1];
|
|
|
- ziduan[j + 1] = temp;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- String lastStr = dataInfo2.getString(ziduan[0]) + "__" + ziduan[0].split("__")[1];
|
|
|
- for (int i = 1; i < ziduan.length; i++) {
|
|
|
- String keyData = dataInfo2.getString(ziduan[i]);
|
|
|
- if (!keyData.equals("")) {
|
|
|
- lastStr += "," + dataInfo2.getString(ziduan[i]) + "__" + ziduan[i].split("__")[1];
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- dataMap2.put(k, lastStr);
|
|
|
- } else {
|
|
|
- String dataVal = dataInfo2.getString(dataMap.get(k));
|
|
|
- if (!dataVal.equals("") || !dataVal.equals("[]")) {
|
|
|
- System.out.println(k + "__" + dataMap.get(k));
|
|
|
- dataMap2.put(k, dataVal + "__" + dataMap.get(k).split("__")[1]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- dataMap2.put("p_key_id", pkeyId);
|
|
|
-
|
|
|
- WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
- if (wbsTreeContract == null) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- String tabName = wbsTreeContract.getInitTableName();
|
|
|
-
|
|
|
- // 判读修改还是 添加
|
|
|
- // String querySql = "select * from "+tabName+" where p_key_id="+pkeyId ;
|
|
|
- // List<Map<String, Object>> dataIn = jdbcTemplate.queryForList(querySql);
|
|
|
-
|
|
|
- String delSql = "delete from " + tabName + " where p_key_id=" + pkeyId;
|
|
|
- ;
|
|
|
-
|
|
|
- String sqlInfo = "";
|
|
|
-
|
|
|
- // if(dataIn.isEmpty()){ //插入
|
|
|
- sqlInfo = "INSERT INTO " + tabName + " ( ";
|
|
|
- String keyStr = "id,";
|
|
|
- String valStr = SnowFlakeUtil.getId() + ",";
|
|
|
- for (String keys : dataMap2.keySet()) {
|
|
|
- keyStr += keys + ",";
|
|
|
- valStr += "'" + dataMap2.get(keys) + "',";
|
|
|
- }
|
|
|
- keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
|
|
|
- valStr = valStr.substring(0, valStr.lastIndexOf(","));
|
|
|
- sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
|
|
|
-
|
|
|
-
|
|
|
- WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, contractId));
|
|
|
-
|
|
|
- //处理文件提名
|
|
|
- String fileName = this.wbsParamService.createFileTitle(Func.isNotEmpty(wbsTreeContractByP.getOldId())? Long.valueOf(wbsTreeContractByP.getOldId()) :wbsTreeContractByP.getId(), Long.parseLong(wbsTreeContractByP.getContractId()));
|
|
|
- fileName = StringUtils.isNotEmpty(fileName) ? fileName : "缺少文件提名配置";
|
|
|
-
|
|
|
- //huangjn 保存成功后调用生成资料查询列表数据
|
|
|
- this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(classify), 2, "是否是首件(临时,暂时没用到)");
|
|
|
-/* }else{ //更新
|
|
|
- sqlInfo = "update "+tabName+" set ";
|
|
|
- for (String keys : dataMap2.keySet()){
|
|
|
- sqlInfo += keys+"='"+dataMap2.get(keys)+"',";
|
|
|
- }
|
|
|
- sqlInfo=sqlInfo.substring(0,sqlInfo.lastIndexOf(","));
|
|
|
- sqlInfo = sqlInfo + " where p_key_id="+pkeyId;
|
|
|
- }*/
|
|
|
-
|
|
|
- UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.in("p_key_id", pkeyId);
|
|
|
- updateWrapper.set("is_tab_pdf", 2);
|
|
|
- wbsTreeContractService.update(updateWrapper);
|
|
|
-
|
|
|
- jdbcTemplate.execute(sqlInfo);
|
|
|
- // this.getBussPdfInfo(Long.parseLong(pkeyId));
|
|
|
- }
|
|
|
- return R.success("1");
|
|
|
- }
|
|
|
-
|
|
|
// 上传解析 html
|
|
|
public void expailHtmlInfo(String thmlUrl, Long excelId) throws FileNotFoundException {
|
|
|
|
|
@@ -807,7 +661,6 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
// 获取图片信息
|
|
|
Elements imgs = doc.select("img");
|
|
|
- System.out.println(imgs.get(0));
|
|
|
int imgIndex = 0;
|
|
|
|
|
|
|
|
@@ -816,7 +669,7 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
// 获取总行列数
|
|
|
int maxCol = doc.select("Col").size();
|
|
|
- String[] rowData = new String[trs.size() + 1];
|
|
|
+ String[] rowData = new String[trs.size() + 5]; //本来加一的 害怕出现特殊情况 故意 加 5
|
|
|
|
|
|
// 行的状态
|
|
|
boolean index_state = false;
|
|
@@ -1010,10 +863,11 @@ public class ExcelTabController extends BladeController {
|
|
|
colTitle.add(exctabCell);
|
|
|
data.attr("title", "签字时间");
|
|
|
|
|
|
- }else if(trHtml.indexOf("Important")>=0){ // 图片处理方式
|
|
|
- data.empty().append(imgs.get(imgIndex)+"");
|
|
|
- imgIndex = imgIndex+1;
|
|
|
- } else {
|
|
|
+ }//else if(trHtml.indexOf("Important")>=0){ // 图片处理方式
|
|
|
+ // data.empty().append(imgs.get(imgIndex)+"");
|
|
|
+ // imgIndex = imgIndex+1;
|
|
|
+ // }
|
|
|
+ else {
|
|
|
if (index_state) {
|
|
|
if (rowspan >= 1) {
|
|
|
data.empty().append("<el-input type='textarea' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
|
|
@@ -1211,6 +1065,14 @@ public class ExcelTabController extends BladeController {
|
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
|
|
|
+ QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("type", 4);
|
|
|
+ queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
|
|
|
+
|
|
|
+ // 获取默认值
|
|
|
+ final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
+
|
|
|
+
|
|
|
if (wbsTreeContract == null) {
|
|
|
return R.data(reData);
|
|
|
}
|
|
@@ -1275,6 +1137,13 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 移除Id 和 p_key_id
|
|
|
+ reData.remove("id");
|
|
|
+ reData.remove("p_key_id");
|
|
|
+ reData.remove("classify");
|
|
|
+ reData.remove("contractId");
|
|
|
+ reData.remove("pkeyId");
|
|
|
+ reData.remove("projectId");
|
|
|
return R.data(reData);
|
|
|
}
|
|
|
|
|
@@ -1292,6 +1161,8 @@ public class ExcelTabController extends BladeController {
|
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
|
|
|
+
|
|
|
+
|
|
|
if (wbsTreeContract == null) {
|
|
|
return R.fail("该数据下无此节点!");
|
|
|
}
|
|
@@ -1322,72 +1193,103 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
|
|
|
// 数据不为空 &&
|
|
|
- if (ObjectUtil.isNotEmpty(DataInfo) && StringUtils.isNotEmpty(wbsTreeContract.getHtmlUrl())) {
|
|
|
+ if (StringUtils.isNotEmpty(wbsTreeContract.getHtmlUrl())) {
|
|
|
File htmlFile = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
if (htmlFile.exists()) {
|
|
|
-
|
|
|
String htmlString = IoUtil.readToString(new FileInputStream(htmlFile));
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
Element table = doc.select("table").first();
|
|
|
Elements trs = table.select("tr");
|
|
|
|
|
|
- for (String val : DataInfo.keySet()) {
|
|
|
- if (val.indexOf("__") >= 0) {
|
|
|
- String DataVal[] = val.split("__");
|
|
|
- String[] xy = DataVal[1].split("_");
|
|
|
- Element data = trs.get(Integer.parseInt(xy[0])).select("td").get(Integer.parseInt(xy[1]));
|
|
|
- if (data.html().indexOf("x1") >= 0 && data.html().indexOf("y1") >= 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"));
|
|
|
- String myData = DataInfo.get(val) + "";
|
|
|
- if (myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) {
|
|
|
- if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
|
|
|
- myData = myData.replace("[", "").replace("]", "");
|
|
|
- String[] dataVal = myData.split(",");
|
|
|
- String Start_dataStr[] = dataVal[0].split("T")[0].split("-");
|
|
|
- String StartDate = StringUtil.format("{}年{}月{}日", new Object[]{Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1});
|
|
|
-
|
|
|
- String end_dataStr[] = dataVal[1].split("T")[0].split("-");
|
|
|
- String endDate = StringUtil.format("{}年{}月{}日", new Object[]{end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1});
|
|
|
-
|
|
|
- if (StartDate.equals(endDate)) {
|
|
|
- myData = StartDate;
|
|
|
+ if(ObjectUtil.isNotEmpty(DataInfo)) {
|
|
|
+ for (String val : DataInfo.keySet()) {
|
|
|
+ if (val.indexOf("__") >= 0) {
|
|
|
+ String DataVal[] = val.split("__");
|
|
|
+ String[] xy = DataVal[1].split("_");
|
|
|
+ Element data = trs.get(Integer.parseInt(xy[0])).select("td").get(Integer.parseInt(xy[1]));
|
|
|
+ if (data.html().indexOf("x1") >= 0 && data.html().indexOf("y1") >= 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"));
|
|
|
+ String myData = DataInfo.get(val) + "";
|
|
|
+ if (myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) {
|
|
|
+ if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
|
|
|
+ myData = myData.replace("[", "").replace("]", "");
|
|
|
+ String[] dataVal = myData.split(",");
|
|
|
+ String Start_dataStr[] = dataVal[0].split("T")[0].split("-");
|
|
|
+ String StartDate = StringUtil.format("{}年{}月{}日", new Object[]{Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1});
|
|
|
+
|
|
|
+ String end_dataStr[] = dataVal[1].split("T")[0].split("-");
|
|
|
+ String endDate = StringUtil.format("{}年{}月{}日", new Object[]{end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1});
|
|
|
+
|
|
|
+ if (StartDate.equals(endDate)) {
|
|
|
+ myData = StartDate;
|
|
|
+ } else {
|
|
|
+ myData = StartDate + "-" + endDate;
|
|
|
+ }
|
|
|
} else {
|
|
|
- myData = StartDate + "-" + endDate;
|
|
|
+ String dataStr[] = myData.split("T")[0].split("-");
|
|
|
+ myData = StringUtil.format("{}年{}月{}日", new Object[]{dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1});
|
|
|
}
|
|
|
- } else {
|
|
|
- String dataStr[] = myData.split("T")[0].split("-");
|
|
|
- myData = StringUtil.format("{}年{}月{}日", new Object[]{dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1});
|
|
|
}
|
|
|
- }
|
|
|
- //https:bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220819/b53cb6700db369381e3b03d7737bcdec.jpg__16_1
|
|
|
- if (myData.indexOf("https") >= 0 && myData.indexOf("aliyuncs") >= 0) {
|
|
|
- Element element = trs.get(y1).select("td").get(x1);
|
|
|
- String styles[] = element.attr("style").split(";");
|
|
|
- int Height = 0;
|
|
|
- for (String sty : styles) {
|
|
|
- if (sty.indexOf("height:") >= 0) {
|
|
|
- Height = Integer.parseInt(sty.replace("height:", "").replace("px", ""));
|
|
|
+ //https:bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220819/b53cb6700db369381e3b03d7737bcdec.jpg__16_1
|
|
|
+ if (myData.indexOf("https") >= 0 && myData.indexOf("aliyuncs") >= 0) {
|
|
|
+ Element element = trs.get(y1).select("td").get(x1);
|
|
|
+ String styles[] = element.attr("style").split(";");
|
|
|
+ int Height = 0;
|
|
|
+ for (String sty : styles) {
|
|
|
+ if (sty.indexOf("height:") >= 0) {
|
|
|
+ Height = Integer.parseInt(sty.replace("height:", "").replace("px", ""));
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
|
|
|
- ExcelPicture pic = sheet.getPictures().add(y1, x1, image);
|
|
|
- pic.setHeight(Height);
|
|
|
- sheet.getCellRange(y1, x1).getStyle().setShrinkToFit(true);
|
|
|
+ BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
|
|
|
+ ExcelPicture pic = sheet.getPictures().add(y1, x1, image);
|
|
|
+ pic.setHeight(Height);
|
|
|
+ sheet.getCellRange(y1, x1).getStyle().setShrinkToFit(true);
|
|
|
|
|
|
- } else {
|
|
|
- sheet.getCellRange(y1, x1).setText(myData);
|
|
|
+ } else {
|
|
|
+ final CellRange cellRange = sheet.getCellRange(y1, x1);
|
|
|
+ cellRange.setText(myData);
|
|
|
+ cellRange.getCellStyle().setHorizontalAlignment(HorizontalAlignType.Left);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 组装电签设置
|
|
|
+ QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("type", 2);
|
|
|
+ queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
|
|
|
+
|
|
|
+ final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
+ if(textdictInfos!=null && !textdictInfos.isEmpty()){
|
|
|
+ textdictInfos.forEach(e->{
|
|
|
+ String key = e.getColKey();
|
|
|
+ String keys[] = key.split("__");
|
|
|
+ String[] trtd = keys[1].split("_");
|
|
|
+ Element data = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
|
|
|
+ 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"));
|
|
|
+
|
|
|
+ final CellRange cellRange = sheet.getCellRange(y1, x1);
|
|
|
+ cellRange.setText(e.getId()+"");
|
|
|
+ cellRange.getCellStyle().getFont().setColor(Color.white);
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
sheet.saveToPdf(pdfPath);
|
|
|
|
|
|
BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
|
|
@@ -1740,4 +1642,7 @@ public class ExcelTabController extends BladeController {
|
|
|
// expailHtmlInfo(thmlUrl, detail.getId());
|
|
|
return R.success("上传成功");
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|