|
@@ -646,6 +646,169 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
return dataMap;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R getBussDataInfo(Long pkeyId) {
|
|
|
+
|
|
|
+ Map<String, Object> reData = new HashMap<>();
|
|
|
+
|
|
|
+ WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
+ .eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
+ if (wbsTreeContract == null) {
|
|
|
+ return R.data(reData);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wbsTreeContract.getHtmlUrl() == null) {
|
|
|
+ return R.data(reData);
|
|
|
+ }
|
|
|
+
|
|
|
+ //表单是否存储在
|
|
|
+ String tabName = wbsTreeContract.getInitTableName();
|
|
|
+ String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
|
|
|
+ List<Map<String, Object>> tabList = jdbcTemplate.queryForList(isExitSql);
|
|
|
+ if (tabList == null || tabList.size() <= 0) {
|
|
|
+ return R.fail("无实体表对应");
|
|
|
+ }
|
|
|
+
|
|
|
+ String querySql = "select * from " + wbsTreeContract.getInitTableName() + " where p_key_id=" + pkeyId;
|
|
|
+ List<Map<String, Object>> dataIn = jdbcTemplate.queryForList(querySql);
|
|
|
+
|
|
|
+ // 匹配关联
|
|
|
+ try {
|
|
|
+ File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
+ String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
+ //解析
|
|
|
+ Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
|
|
|
+ Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
|
|
|
+ Elements htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
|
|
|
+ Elements jltitle = doc.select("el-input[placeholder~=^监理单位]");
|
|
|
+ Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
|
|
|
+
|
|
|
+ // Elements title = doc.select("el-input[placeholder~=^编号]");
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 承包单位、施工单位:引用施工单位名称
|
|
|
+ * 监理单位:引用监理单位名称
|
|
|
+ * 合同段、所属建设项目(合同段):引用合同段编号
|
|
|
+ */
|
|
|
+
|
|
|
+ ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
|
|
|
+ // 施工单位名称
|
|
|
+ if (dwtitle.size() >= 1) {
|
|
|
+ reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
+ }
|
|
|
+ if (sgtitle.size() >= 1) {
|
|
|
+ reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 合同段编号
|
|
|
+ if (htdtitle.size() >= 1) {
|
|
|
+ for (Element element : htdtitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("tdindex"));
|
|
|
+ if (trindex <= 8) {
|
|
|
+ reData.put(htdtitle.attr("keyName"), contractInfo.getContractNumber());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 监理单位名称
|
|
|
+ if (jltitle.size() >= 1) {
|
|
|
+ reData.put(jltitle.attr("keyName"), contractInfo.getSupervisionUnitName());
|
|
|
+ }
|
|
|
+ // 编号
|
|
|
+ if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
|
|
|
+ reData.put(bhtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (dataIn != null && dataIn.size() >= 1) {
|
|
|
+ Map<String, Object> mysqlData = dataIn.get(0);
|
|
|
+ for (String key : mysqlData.keySet()) {
|
|
|
+ String tabVal = mysqlData.get(key) + "";
|
|
|
+ // 时间段处理
|
|
|
+ if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
|
|
|
+ if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z]") >= 0) {
|
|
|
+ String tabData[] = tabVal.split("_\\^_");
|
|
|
+
|
|
|
+ if (reData.containsKey("pickerKey")) {
|
|
|
+ String pickerKey = reData.get("pickerKey") + "," + key + "__" + tabData[1];
|
|
|
+ reData.put("pickerKey", pickerKey);
|
|
|
+ } else {
|
|
|
+ reData.put("pickerKey", key + "__" + tabData[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ String sql = tabData[0];
|
|
|
+ sql = sql.replaceAll("\\[", "['");
|
|
|
+ sql = sql.replaceAll("]", "\']");
|
|
|
+ sql = sql.replaceAll("000Z,", "000Z\',");
|
|
|
+ sql = sql.replaceAll(", 20", ", \'20");
|
|
|
+ // sql = sql.replaceAll("'", "");
|
|
|
+ if (StringUtils.isNotEmpty(tabData[0])) {
|
|
|
+ reData.put(key + "__" + tabData[1], sql);
|
|
|
+ }
|
|
|
+ } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
|
|
|
+ // 时间和字符串合作
|
|
|
+ if (tabVal.indexOf("☆") >= 0) {
|
|
|
+ String mysql[] = tabVal.split("☆");
|
|
|
+ for (String data : mysql) {
|
|
|
+ String tabData[] = data.split("_\\^_");
|
|
|
+ if (StringUtils.isNotEmpty(tabData[0])) {
|
|
|
+ reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ String tabData[] = tabVal.split("_\\^_");
|
|
|
+ if (StringUtils.isNotEmpty(tabData[0])) {
|
|
|
+ reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (tabVal.indexOf("☆") >= 0) {
|
|
|
+ String mysql[] = tabVal.split("☆");
|
|
|
+ for (String data : mysql) {
|
|
|
+ String tabData[] = data.split("_\\^_");
|
|
|
+ if (StringUtils.isNotEmpty(tabData[0])) {
|
|
|
+ reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (tabVal.indexOf("_^_") >= 0) {
|
|
|
+ String tabData[] = tabVal.split("_\\^_");
|
|
|
+ if (StringUtils.isNotEmpty(tabData[0])) {
|
|
|
+ reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ reData.put(key, tabVal);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 获取默认值
|
|
|
+ QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("type", 4);
|
|
|
+ queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
|
|
|
+ final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
+ if (!textdictInfos.isEmpty()) {
|
|
|
+ for (TextdictInfo textdictInfo : textdictInfos) {
|
|
|
+ if (reData.containsKey(textdictInfo.getColKey())) {
|
|
|
+ String keyVal = reData.get(textdictInfo.getColKey()) + "";
|
|
|
+ } else {
|
|
|
+ reData.put(textdictInfo.getColKey() + "", textdictInfo.getSigRoleName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 移除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);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public R getBussPdfInfo(Long pkeyId) throws Exception {
|
|
|
|
|
@@ -883,90 +1046,92 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R getBussDataInfo(Long pkeyId) {
|
|
|
+ public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
|
|
|
+ String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ // 获取有权限的节点信息
|
|
|
+ List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
|
|
|
+ List<String> data = new ArrayList<>();
|
|
|
+ if (wbsTreeContractList != null && wbsTreeContractList.size() >= 1) {
|
|
|
+ for (WbsTreeContract wbsInfo : wbsTreeContractList) {
|
|
|
+ // 隐藏的不生成pdf
|
|
|
+ if (wbsInfo.getIsBussShow() == null || wbsInfo.getIsBussShow() != 2) { //
|
|
|
+ if (StringUtils.isNotEmpty(wbsInfo.getPdfUrl())) {
|
|
|
+ data.add(wbsInfo.getPdfUrl());
|
|
|
+ } else {
|
|
|
+ R bussPdfInfo = this.getBussPdfInfo(wbsInfo.getPKeyId());
|
|
|
+ if (bussPdfInfo.getCode() == 200) {
|
|
|
+ data.add(bussPdfInfo.getData() + "");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- Map<String, Object> reData = new HashMap<>();
|
|
|
+ String listPdf = file_path + "pdf/" + nodeId + ".pdf";
|
|
|
+ File tabpdf2 = ResourceUtil.getFile(listPdf);
|
|
|
+ if (tabpdf2.exists()) {
|
|
|
+ tabpdf2.delete();
|
|
|
+ }
|
|
|
+ FileUtils.mergePdfPublicMethods(data, listPdf);
|
|
|
+ BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
|
|
|
|
|
|
- WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
- if (wbsTreeContract == null) {
|
|
|
+ // 合并pdf集合
|
|
|
+ String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
|
|
|
+ jdbcTemplate.execute(sql);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 试验 获取填报信息
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public R getBussDataInfoTrial(Long pkeyId) {
|
|
|
+ Map<String, Object> reData = new HashMap<>();
|
|
|
+ WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
|
|
|
+ .eq(WbsTreePrivate::getPKeyId, pkeyId));
|
|
|
+ if (wbsTreePrivate == null) {
|
|
|
return R.data(reData);
|
|
|
}
|
|
|
-
|
|
|
- if (wbsTreeContract.getHtmlUrl() == null) {
|
|
|
+ if (wbsTreePrivate.getHtmlUrl() == null) {
|
|
|
return R.data(reData);
|
|
|
}
|
|
|
|
|
|
//表单是否存储在
|
|
|
- String tabName = wbsTreeContract.getInitTableName();
|
|
|
+ String tabName = wbsTreePrivate.getInitTableName();
|
|
|
String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
|
|
|
List<Map<String, Object>> tabList = jdbcTemplate.queryForList(isExitSql);
|
|
|
if (tabList == null || tabList.size() <= 0) {
|
|
|
return R.fail("无实体表对应");
|
|
|
}
|
|
|
|
|
|
- String querySql = "select * from " + wbsTreeContract.getInitTableName() + " where p_key_id=" + pkeyId;
|
|
|
+ String querySql = "select * from " + wbsTreePrivate.getInitTableName() + " where p_key_id=" + pkeyId;
|
|
|
List<Map<String, Object>> dataIn = jdbcTemplate.queryForList(querySql);
|
|
|
|
|
|
// 匹配关联
|
|
|
try {
|
|
|
- File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
+ File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
//解析
|
|
|
- Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
|
|
|
+ /*Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
|
|
|
Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
|
|
|
Elements htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
|
|
|
Elements jltitle = doc.select("el-input[placeholder~=^监理单位]");
|
|
|
- Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
|
|
|
-
|
|
|
- // Elements title = doc.select("el-input[placeholder~=^编号]");
|
|
|
-
|
|
|
- /**
|
|
|
- * 承包单位、施工单位:引用施工单位名称
|
|
|
- * 监理单位:引用监理单位名称
|
|
|
- * 合同段、所属建设项目(合同段):引用合同段编号
|
|
|
- */
|
|
|
-
|
|
|
- ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
|
|
|
- // 施工单位名称
|
|
|
- if (dwtitle.size() >= 1) {
|
|
|
- reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
- }
|
|
|
- if (sgtitle.size() >= 1) {
|
|
|
- reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
- }
|
|
|
-
|
|
|
- // 合同段编号
|
|
|
- if (htdtitle.size() >= 1) {
|
|
|
- for (Element element : htdtitle) {
|
|
|
- int trindex = Integer.parseInt(element.attr("tdindex"));
|
|
|
- if (trindex <= 8) {
|
|
|
- reData.put(htdtitle.attr("keyName"), contractInfo.getContractNumber());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 监理单位名称
|
|
|
- if (jltitle.size() >= 1) {
|
|
|
- reData.put(jltitle.attr("keyName"), contractInfo.getSupervisionUnitName());
|
|
|
- }
|
|
|
- // 编号
|
|
|
- if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
|
|
|
- reData.put(bhtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
- }
|
|
|
+ Elements bhtitle = doc.select("el-input[placeholder~=^编号]");*/
|
|
|
|
|
|
} catch (FileNotFoundException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- if (dataIn != null && dataIn.size() >= 1) {
|
|
|
+ if (dataIn.size() >= 1) {
|
|
|
Map<String, Object> mysqlData = dataIn.get(0);
|
|
|
for (String key : mysqlData.keySet()) {
|
|
|
String tabVal = mysqlData.get(key) + "";
|
|
|
// 时间段处理
|
|
|
if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
|
|
|
- if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z]") >= 0) {
|
|
|
- String tabData[] = tabVal.split("_\\^_");
|
|
|
+ if (tabVal.contains("T") && tabVal.contains(".000Z]")) {
|
|
|
+ String[] tabData = tabVal.split("_\\^_");
|
|
|
|
|
|
if (reData.containsKey("pickerKey")) {
|
|
|
String pickerKey = reData.get("pickerKey") + "," + key + "__" + tabData[1];
|
|
@@ -984,32 +1149,32 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
if (StringUtils.isNotEmpty(tabData[0])) {
|
|
|
reData.put(key + "__" + tabData[1], sql);
|
|
|
}
|
|
|
- } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
|
|
|
+ } else if (tabVal.contains("T") && tabVal.contains(".000Z")) { //时间
|
|
|
// 时间和字符串合作
|
|
|
- if (tabVal.indexOf("☆") >= 0) {
|
|
|
- String mysql[] = tabVal.split("☆");
|
|
|
+ if (tabVal.contains("☆")) {
|
|
|
+ String[] mysql = tabVal.split("☆");
|
|
|
for (String data : mysql) {
|
|
|
- String tabData[] = data.split("_\\^_");
|
|
|
+ String[] tabData = data.split("_\\^_");
|
|
|
if (StringUtils.isNotEmpty(tabData[0])) {
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- String tabData[] = tabVal.split("_\\^_");
|
|
|
+ String[] tabData = tabVal.split("_\\^_");
|
|
|
if (StringUtils.isNotEmpty(tabData[0])) {
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
}
|
|
|
}
|
|
|
- } else if (tabVal.indexOf("☆") >= 0) {
|
|
|
- String mysql[] = tabVal.split("☆");
|
|
|
+ } else if (tabVal.contains("☆")) {
|
|
|
+ String[] mysql = tabVal.split("☆");
|
|
|
for (String data : mysql) {
|
|
|
- String tabData[] = data.split("_\\^_");
|
|
|
+ String[] tabData = data.split("_\\^_");
|
|
|
if (StringUtils.isNotEmpty(tabData[0])) {
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
}
|
|
|
}
|
|
|
- } else if (tabVal.indexOf("_^_") >= 0) {
|
|
|
- String tabData[] = tabVal.split("_\\^_");
|
|
|
+ } else if (tabVal.contains("_^_")) {
|
|
|
+ String[] tabData = tabVal.split("_\\^_");
|
|
|
if (StringUtils.isNotEmpty(tabData[0])) {
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
}
|
|
@@ -1022,10 +1187,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
// 获取默认值
|
|
|
QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("type", 4);
|
|
|
- queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
|
|
|
- final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
- if (!textdictInfos.isEmpty()) {
|
|
|
- for (TextdictInfo textdictInfo : textdictInfos) {
|
|
|
+ queryWrapper.eq("tab_id", wbsTreePrivate.getPKeyId());
|
|
|
+ final List<TextdictInfo> textDictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
+ if (!textDictInfos.isEmpty()) {
|
|
|
+ for (TextdictInfo textdictInfo : textDictInfos) {
|
|
|
if (reData.containsKey(textdictInfo.getColKey())) {
|
|
|
String keyVal = reData.get(textdictInfo.getColKey()) + "";
|
|
|
} else {
|
|
@@ -1045,41 +1210,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
return R.data(reData);
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
|
|
|
- String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- // 获取有权限的节点信息
|
|
|
- List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
|
|
|
- List<String> data = new ArrayList<>();
|
|
|
- if (wbsTreeContractList != null && wbsTreeContractList.size() >= 1) {
|
|
|
- for (WbsTreeContract wbsInfo : wbsTreeContractList) {
|
|
|
- // 隐藏的不生成pdf
|
|
|
- if (wbsInfo.getIsBussShow() == null || wbsInfo.getIsBussShow() != 2) { //
|
|
|
- if (StringUtils.isNotEmpty(wbsInfo.getPdfUrl())) {
|
|
|
- data.add(wbsInfo.getPdfUrl());
|
|
|
- } else {
|
|
|
- R bussPdfInfo = this.getBussPdfInfo(wbsInfo.getPKeyId());
|
|
|
- if (bussPdfInfo.getCode() == 200) {
|
|
|
- data.add(bussPdfInfo.getData() + "");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- String listPdf = file_path + "pdf/" + nodeId + ".pdf";
|
|
|
- File tabpdf2 = ResourceUtil.getFile(listPdf);
|
|
|
- if (tabpdf2.exists()) {
|
|
|
- tabpdf2.delete();
|
|
|
- }
|
|
|
- FileUtils.mergePdfPublicMethods(data, listPdf);
|
|
|
- BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
|
|
|
-
|
|
|
- // 合并pdf集合
|
|
|
- String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
|
|
|
- jdbcTemplate.execute(sql);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 试验 单pdf
|
|
|
*/
|
|
@@ -1109,7 +1239,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
throw new ServiceException("操作失败!");
|
|
|
}
|
|
|
|
|
|
- Map<String, Object> DataInfo = (Map<String, Object>) getBussDataInfo(pkeyId).getData();
|
|
|
+ Map<String, Object> DataInfo = (Map<String, Object>) getBussDataInfoTrial(pkeyId).getData();
|
|
|
|
|
|
// 获取excel流 和 html流
|
|
|
Workbook wb = new Workbook();
|
|
@@ -1139,17 +1269,17 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(DataInfo)) {
|
|
|
for (String val : DataInfo.keySet()) {
|
|
|
- if (val.indexOf("__") >= 0) {
|
|
|
- String DataVal[] = val.split("__");
|
|
|
+ if (val.contains("__")) {
|
|
|
+ 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) {
|
|
|
+ if (data.html().contains("x1") && data.html().contains("y1")) {
|
|
|
int x1 = 0;
|
|
|
int y1 = 0;
|
|
|
|
|
|
- if (data.html().indexOf("el-tooltip") >= 0) {
|
|
|
+ if (data.html().contains("el-tooltip")) {
|
|
|
x1 = Integer.parseInt(data.children().get(0).children().get(0).attr("x1"));
|
|
|
y1 = Integer.parseInt(data.children().get(0).children().get(0).attr("y1"));
|
|
|
} else {
|
|
@@ -1160,27 +1290,27 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
x1 = 1;
|
|
|
}
|
|
|
String myData = DataInfo.get(val) + "";
|
|
|
- if (myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) {
|
|
|
- if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
|
|
|
+ if (myData.contains("T") && myData.contains("-")) {
|
|
|
+ if (myData.contains(",") && myData.contains("]")) {
|
|
|
myData = myData.replace("[", "").replace("]", "").replaceAll("'", "");
|
|
|
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}).trim();
|
|
|
+ String[] Start_dataStr = dataVal[0].split("T")[0].split("-");
|
|
|
+ String StartDate = StringUtil.format("{}年{}月{}日", Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1).trim();
|
|
|
|
|
|
- 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}).trim();
|
|
|
+ String[] end_dataStr = dataVal[1].split("T")[0].split("-");
|
|
|
+ String endDate = StringUtil.format("{}年{}月{}日", end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1).trim();
|
|
|
if (StartDate.equals(endDate)) {
|
|
|
myData = StartDate;
|
|
|
} else {
|
|
|
myData = StartDate + "-" + endDate;
|
|
|
}
|
|
|
} else {
|
|
|
- String dataStr[] = myData.split("T")[0].split("-");
|
|
|
- myData = StringUtil.format("{}年{}月{}日", new Object[]{dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1});
|
|
|
+ String[] dataStr = myData.split("T")[0].split("-");
|
|
|
+ myData = StringUtil.format("{}年{}月{}日", 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) {
|
|
|
+ if (myData.contains("https") && myData.contains("aliyuncs")) {
|
|
|
|
|
|
BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
|
|
|
|
|
@@ -1193,9 +1323,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
String dataInfo = trs.get(y1).attr("height");
|
|
|
if (StringUtils.isEmpty(dataInfo)) {
|
|
|
Element firstTd = trs.get(y1 - 1).children().get(0);
|
|
|
- String heg[] = firstTd.attr("style").split(";");
|
|
|
+ String[] heg = firstTd.attr("style").split(";");
|
|
|
for (String str : heg) {
|
|
|
- if (str.indexOf("height:") >= 0) {
|
|
|
+ if (str.contains("height:")) {
|
|
|
picHeight = Integer.parseInt(str.split(":")[1].replaceAll("px", ""));
|
|
|
}
|
|
|
}
|
|
@@ -1245,13 +1375,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
queryWrapper.eq("type", 2);
|
|
|
queryWrapper.eq("tab_id", wbsTreePrivate.getPKeyId());
|
|
|
|
|
|
- List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
- if (textdictInfos != null && !textdictInfos.isEmpty()) {
|
|
|
- for (TextdictInfo e : textdictInfos) {
|
|
|
+ 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("_");
|
|
|
- Element data = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
|
|
|
+ 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;
|
|
@@ -1356,7 +1486,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 试验 修改信息
|
|
|
+ * 试验 保存修改信息
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -1402,4 +1532,5 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|