|
@@ -920,10 +920,6 @@ public class ExcelTabController extends BladeController {
|
|
|
return R.fail("未获取到表单信息");
|
|
|
}
|
|
|
|
|
|
- /*File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
- File file1 = ResourceUtil.getFile("D:\\develop\\1633344465559093248.html");
|
|
|
- FileInputStream fileInputStream = new FileInputStream(file1);
|
|
|
- String htmlString = IoUtil.readToString(fileInputStream);*/
|
|
|
|
|
|
// 解析 style
|
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
@@ -962,8 +958,6 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
|
|
|
private String getHtmlString(String pkeyId) throws Exception {
|
|
|
- String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>query().lambda()
|
|
|
.select(WbsTreePrivate::getHtmlUrl)
|
|
|
.eq(WbsTreePrivate::getPKeyId, pkeyId));
|
|
@@ -971,14 +965,7 @@ public class ExcelTabController extends BladeController {
|
|
|
return "";
|
|
|
}
|
|
|
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);
|
|
|
- }
|
|
|
+ InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
|
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
@@ -2301,7 +2288,7 @@ public class ExcelTabController extends BladeController {
|
|
|
})
|
|
|
public R<String> getTheLogPdInfo(String pkeyId, String nodePrimaryKeyId, String recordTime, String contractId) throws Exception {
|
|
|
//获取配置的路径
|
|
|
- String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ String file_path = "/Users/hongchuangyanfa/Desktop/" ;//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
if (StringUtils.isEmpty(recordTime)) {
|
|
|
recordTime = DateUtil.format(DateUtil.now(), "yyyy-MM-dd");
|
|
|
}
|
|
@@ -2547,7 +2534,7 @@ public class ExcelTabController extends BladeController {
|
|
|
public R<List<Map<String, Object>>> getTheLogBusinessData(String theLogId, String nodePrimaryKeyId, String recordTime, String contractId) {
|
|
|
List<Map<String, Object>> resultMapList = new ArrayList<>();
|
|
|
//数据结果
|
|
|
- Map<String, Object> reData = new HashMap<>();
|
|
|
+ String logId2 = "";
|
|
|
|
|
|
//获取对应的记录
|
|
|
String dataIds;
|
|
@@ -2562,9 +2549,9 @@ public class ExcelTabController extends BladeController {
|
|
|
} else {
|
|
|
List<ContractLog> contractLogs = this.contractLogClient.queryContractLogByPrimaryKeyIdAndRecordTimeList(nodePrimaryKeyId, recordTime, contractId);
|
|
|
if (contractLogs.size() == 0){
|
|
|
- reData.put("logId","");
|
|
|
+ logId2="";
|
|
|
}else {
|
|
|
- reData.put("logId",contractLogs.get(0).getId());
|
|
|
+ logId2=contractLogs.get(0).getId()+"";
|
|
|
}
|
|
|
dataIds = contractLogs.stream().map(ContractLog::getDataId).filter(Objects::nonNull).map(String::valueOf).collect(Collectors.joining(","));
|
|
|
}
|
|
@@ -2576,6 +2563,8 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
if (StringUtils.isNotEmpty(dataIds)) {
|
|
|
for (String dataId : dataIds.split(",")) {
|
|
|
+ Map<String, Object> reData = new HashMap<>();
|
|
|
+ reData.put("",logId2);
|
|
|
//检查实体表是否存在
|
|
|
String tabName = tableNode2.getInitTableName();
|
|
|
String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
|
|
@@ -2749,9 +2738,10 @@ public class ExcelTabController extends BladeController {
|
|
|
reData.remove("contractId");
|
|
|
reData.remove("pkeyId");
|
|
|
reData.remove("projectId");
|
|
|
- if (reData.size() > 0) {
|
|
|
- resultMapList.add(reData);
|
|
|
- }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (reData.size() > 0) {
|
|
|
+ resultMapList.add(reData);
|
|
|
}
|
|
|
} else {
|
|
|
Map<String, Object> reData2 = new HashMap<>();
|
|
@@ -3202,11 +3192,6 @@ public class ExcelTabController extends BladeController {
|
|
|
String recordTime = tableInfo1.getString("recordTime");
|
|
|
|
|
|
List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
|
|
|
-/* try {用不到
|
|
|
- this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeid), ExecuteType.FAI);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }*/
|
|
|
|
|
|
// 保存数据到数据库
|
|
|
String data= "";
|
|
@@ -3807,17 +3792,18 @@ public class ExcelTabController extends BladeController {
|
|
|
@PostMapping("/removeLogTab")
|
|
|
@ApiOperationSupport(order = 41)
|
|
|
@ApiOperation(value = "删除施工日志对应的表数据记录信息等", notes = "传入get-the-log-business-data接口返回的内部id")
|
|
|
+ @Transactional
|
|
|
public R<Object> removeLogTab(@RequestParam String id) {
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
|
- ContractLog obj = jdbcTemplate.queryForObject("select * from u_contract_log where data_id = " + id, new BeanPropertyRowMapper<>(ContractLog.class));
|
|
|
- if (obj != null) {
|
|
|
+ Map<String, Object> obj = jdbcTemplate.queryForMap("select * from u_contract_log where data_id =" + id + " ");
|
|
|
+ if (obj!=null && Func.isNotEmpty(obj)) {
|
|
|
//删除施工日志记录信息
|
|
|
jdbcTemplate.execute("delete from u_contract_log where data_id = " + id);
|
|
|
//删除关联的工序wbs信息
|
|
|
- jdbcTemplate.execute("delete from u_contract_log_wbs where business_id = " + id + " and contract_log_id = " + obj.getId());
|
|
|
+ jdbcTemplate.execute("delete from u_contract_log_wbs where business_id = " + id + " and contract_log_id = " + obj.get("id").toString());
|
|
|
|
|
|
//获取对应表信息
|
|
|
- WbsTreePrivate tableTemp = wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, obj.getTableId()));
|
|
|
+ WbsTreePrivate tableTemp = wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, obj.get("table_id")));
|
|
|
if (tableTemp != null && StringUtils.isNotEmpty(tableTemp.getInitTableName())) {
|
|
|
//删除实体表对应的数据信息
|
|
|
jdbcTemplate.execute("delete from " + tableTemp.getInitTableName() + " where id = " + id);
|