|
@@ -61,7 +61,9 @@ import org.springblade.resource.feign.IOSSClient;
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
import org.springblade.resource.vo.NewBladeFile;
|
|
import org.springblade.resource.vo.NewBladeFile;
|
|
import org.springblade.system.cache.ParamCache;
|
|
import org.springblade.system.cache.ParamCache;
|
|
|
|
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
@@ -299,14 +301,10 @@ public class ExcelTabController extends BladeController {
|
|
String filecode = SnowFlakeUtil.getId() + "";
|
|
String filecode = SnowFlakeUtil.getId() + "";
|
|
String thmlUrl = file_path + filecode + ".html";
|
|
String thmlUrl = file_path + filecode + ".html";
|
|
String exceUrl = file_path + filecode + "123.xlsx";
|
|
String exceUrl = file_path + filecode + "123.xlsx";
|
|
- //ExcelInfoUtils.excelInfo(file.getInputStream(),exceUrl,thmlUrl,"1");
|
|
|
|
|
|
+ ExcelInfoUtils.excelInfo(file.getInputStream(),exceUrl,thmlUrl,"1");
|
|
// 上传excel文件
|
|
// 上传excel文件
|
|
- // BladeFile bladeFile = newIOSSClient.uploadFile(file.getOriginalFilename(),exceUrl);
|
|
|
|
|
|
+ BladeFile bladeFile = newIOSSClient.uploadFile(file.getOriginalFilename(),exceUrl);
|
|
// 解析原始excel
|
|
// 解析原始excel
|
|
- Workbook wb = new Workbook();
|
|
|
|
- wb.loadFromMHtml(file.getInputStream());
|
|
|
|
- Worksheet sheet = wb.getWorksheets().get(0);
|
|
|
|
- sheet.saveToHtml(thmlUrl);
|
|
|
|
|
|
|
|
BladeFile bladeFileR = newIOSSClient.uploadFileByInputStream(file);
|
|
BladeFile bladeFileR = newIOSSClient.uploadFileByInputStream(file);
|
|
detail.setExtension(file.getOriginalFilename());
|
|
detail.setExtension(file.getOriginalFilename());
|
|
@@ -632,6 +630,7 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
String fileUrl = wbsTreeContract.getHtmlUrl();
|
|
String fileUrl = wbsTreeContract.getHtmlUrl();
|
|
InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
|
|
InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
|
|
|
|
+
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
htmlString = htmlString.replaceAll("title", "titlexx");
|
|
htmlString = htmlString.replaceAll("title", "titlexx");
|
|
@@ -1964,13 +1963,17 @@ public class ExcelTabController extends BladeController {
|
|
@ApiImplicitParam(name = "pkeyId", value = "主键id", required = true),
|
|
@ApiImplicitParam(name = "pkeyId", value = "主键id", required = true),
|
|
@ApiImplicitParam(name = "status", value = "状态(1显示 2隐藏)", required = true)
|
|
@ApiImplicitParam(name = "status", value = "状态(1显示 2隐藏)", required = true)
|
|
})
|
|
})
|
|
- public R showBussTab(Long pkeyId, int status) throws FileNotFoundException {
|
|
|
|
|
|
+ @Transactional
|
|
|
|
+ public R showBussTab(Long pkeyId, int status,String nodeId,String classify) throws Exception {
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
|
|
updateWrapper.in("p_key_id", pkeyId);
|
|
updateWrapper.in("p_key_id", pkeyId);
|
|
updateWrapper.set("is_buss_show", status);
|
|
updateWrapper.set("is_buss_show", status);
|
|
wbsTreeContractService.update(updateWrapper);
|
|
wbsTreeContractService.update(updateWrapper);
|
|
|
|
+ excelTabService.getBussPdfInfo(pkeyId);
|
|
|
|
+ //重新生成PDF修改queryInfo
|
|
|
|
+ excelTabService.getBussPdfs(nodeId, classify, wbsTreeContract.getContractId(), wbsTreeContract.getProjectId());
|
|
return R.data("成功");
|
|
return R.data("成功");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1983,7 +1986,25 @@ public class ExcelTabController extends BladeController {
|
|
@ApiImplicitParam(name = "contractId", value = "合同段Id", required = true)
|
|
@ApiImplicitParam(name = "contractId", value = "合同段Id", required = true)
|
|
})
|
|
})
|
|
public R getPdfS(String nodeId, String classify, String contractId) throws FileNotFoundException {
|
|
public R getPdfS(String nodeId, String classify, String contractId) throws FileNotFoundException {
|
|
- String sql = "select pdf_url,e_visa_pdf_url,pdf_trial_url,pdf_trial_url_position from u_information_query where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id='" + contractId + "'";
|
|
|
|
|
|
+ //获取节点下的所有表单,和附件,如果表单全是隐藏的,并且没有附件,则提示暂无数据
|
|
|
|
+// WbsTreeContract node = wbsTreeContractService.getOne(new LambdaQueryWrapper<WbsTreeContract>().eq(WbsTreeContract::getPKeyId,nodeId));
|
|
|
|
+// List<WbsTreeContract> list = wbsTreeContractService.list(new LambdaQueryWrapper<WbsTreeContract>().eq(WbsTreeContract::getParentId, node.getId()).eq(WbsTreeContract::getContractId, contractId));
|
|
|
|
+// tableInfoService.list(new LambdaQueryWrapper<ta>())
|
|
|
|
+// if (list != null && list.size() > 0){
|
|
|
|
+// Boolean isShow = true;
|
|
|
|
+// for (WbsTreeContract contract : list) {
|
|
|
|
+// if (contract.getIsBussShow() == 1){
|
|
|
|
+// isShow = false;
|
|
|
|
+// break;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// if (isShow){
|
|
|
|
+// return R.fail("无历史数据预览,请保存数据");
|
|
|
|
+// }
|
|
|
|
+// }else {
|
|
|
|
+// return R.fail("无历史数据预览,请保存数据");
|
|
|
|
+// }
|
|
|
|
+ String sql = "select pdf_url,e_visa_pdf_url,pdf_trial_url,pdf_trial_url_position,status from u_information_query where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id='" + contractId + "'";
|
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
|
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
|
|
if (maps.size() >= 1) {
|
|
if (maps.size() >= 1) {
|
|
Map<String, Object> stringObjectMap = maps.get(0);
|
|
Map<String, Object> stringObjectMap = maps.get(0);
|
|
@@ -1999,7 +2020,7 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
if (StringUtils.isEmpty(pdfUrl) || pdfUrl.equals("null")) {
|
|
if (StringUtils.isEmpty(pdfUrl) || pdfUrl.equals("null")) {
|
|
- return R.fail("获取PDF失败");
|
|
|
|
|
|
+ return R.fail("暂无PDF数据");
|
|
} else {
|
|
} else {
|
|
return R.data(pdfUrl);
|
|
return R.data(pdfUrl);
|
|
}
|
|
}
|
|
@@ -2100,8 +2121,10 @@ public class ExcelTabController extends BladeController {
|
|
R bussDataInfo = this.excelTabService.getBussDataInfo(pk, 1);
|
|
R bussDataInfo = this.excelTabService.getBussDataInfo(pk, 1);
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
Map<String, Object> jo = (Map<String, Object>) bussDataInfo.getData();
|
|
Map<String, Object> jo = (Map<String, Object>) bussDataInfo.getData();
|
|
- jo.put("pkeyId", pk);
|
|
|
|
- extra.add(jo);
|
|
|
|
|
|
+ if(jo!=null && ObjectUtils.isNotEmpty(jo)){
|
|
|
|
+ jo.put("pkeyId", pk);
|
|
|
|
+ extra.add(jo);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
List<TableInfo> tableInfoExtra = this.excelTabService.getTableInfoList(extra);
|
|
List<TableInfo> tableInfoExtra = this.excelTabService.getTableInfoList(extra);
|
|
@@ -2432,7 +2455,8 @@ public class ExcelTabController extends BladeController {
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(name = "theLogId", value = "日志记录的ids,可能为空(多张表)"),
|
|
@ApiImplicitParam(name = "theLogId", value = "日志记录的ids,可能为空(多张表)"),
|
|
@ApiImplicitParam(name = "nodePrimaryKeyId", value = "当前操作的日志类型ID,即左侧列表的节点primaryKeyId"),
|
|
@ApiImplicitParam(name = "nodePrimaryKeyId", value = "当前操作的日志类型ID,即左侧列表的节点primaryKeyId"),
|
|
- @ApiImplicitParam(name = "recordTime", value = "当前选择的填写日期,即右侧日期控件所选日期,格式为 yyyy-MM-dd")
|
|
|
|
|
|
+ @ApiImplicitParam(name = "recordTime", value = "当前选择的填写日期,即右侧日期控件所选日期,格式为 yyyy-MM-dd"),
|
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段id")
|
|
})
|
|
})
|
|
public R<List<Map<String, Object>>> getTheLogBusinessData(String theLogId, String nodePrimaryKeyId, String recordTime, String contractId) {
|
|
public R<List<Map<String, Object>>> getTheLogBusinessData(String theLogId, String nodePrimaryKeyId, String recordTime, String contractId) {
|
|
List<Map<String, Object>> resultMapList = new ArrayList<>();
|
|
List<Map<String, Object>> resultMapList = new ArrayList<>();
|
|
@@ -2615,9 +2639,9 @@ public class ExcelTabController extends BladeController {
|
|
QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("type", 4);
|
|
queryWrapper.eq("type", 4);
|
|
queryWrapper.eq("tab_id", node.getPKeyId());
|
|
queryWrapper.eq("tab_id", node.getPKeyId());
|
|
- final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
|
- if (!textdictInfos.isEmpty()) {
|
|
|
|
- for (TextdictInfo textdictInfo : textdictInfos) {
|
|
|
|
|
|
+ final List<TextdictInfo> textDictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
|
+ if (!textDictInfos.isEmpty()) {
|
|
|
|
+ for (TextdictInfo textdictInfo : textDictInfos) {
|
|
if (reData.containsKey(textdictInfo.getColKey())) {
|
|
if (reData.containsKey(textdictInfo.getColKey())) {
|
|
String keyVal = reData.get(textdictInfo.getColKey()) + "";
|
|
String keyVal = reData.get(textdictInfo.getColKey()) + "";
|
|
} else {
|
|
} else {
|
|
@@ -2625,33 +2649,34 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 移除Id 和 p_key_id
|
|
|
|
|
|
+ //移除id和p_key_id
|
|
reData.remove("p_key_id");
|
|
reData.remove("p_key_id");
|
|
reData.remove("classify");
|
|
reData.remove("classify");
|
|
reData.remove("contractId");
|
|
reData.remove("contractId");
|
|
reData.remove("pkeyId");
|
|
reData.remove("pkeyId");
|
|
reData.remove("projectId");
|
|
reData.remove("projectId");
|
|
- resultMapList.add(reData);
|
|
|
|
|
|
+ if (reData.size() > 0) {
|
|
|
|
+ resultMapList.add(reData);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- resultMapList.add(reData);
|
|
|
|
Map<String, Object> reData2 = new HashMap<>();
|
|
Map<String, Object> reData2 = new HashMap<>();
|
|
- // 获取默认值
|
|
|
|
|
|
+ //获取默认值
|
|
QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("type", 4);
|
|
queryWrapper.eq("type", 4);
|
|
queryWrapper.eq("tab_id", tableNode2.getPKeyId());
|
|
queryWrapper.eq("tab_id", tableNode2.getPKeyId());
|
|
- final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
|
- if (!textdictInfos.isEmpty()) {
|
|
|
|
- for (TextdictInfo textdictInfo : textdictInfos) {
|
|
|
|
|
|
+ final List<TextdictInfo> textDictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
|
+ if (!textDictInfos.isEmpty()) {
|
|
|
|
+ for (TextdictInfo textdictInfo : textDictInfos) {
|
|
reData2.put(textdictInfo.getColKey() + "", textdictInfo.getSigRoleName());
|
|
reData2.put(textdictInfo.getColKey() + "", textdictInfo.getSigRoleName());
|
|
}
|
|
}
|
|
- resultMapList.add(reData2);
|
|
|
|
|
|
+ if (reData2.size() > 0) {
|
|
|
|
+ resultMapList.add(reData2);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
return R.data(resultMapList);
|
|
return R.data(resultMapList);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2669,51 +2694,41 @@ public class ExcelTabController extends BladeController {
|
|
})
|
|
})
|
|
public R<List<Map<String, Object>>> copyTheLogBusinessData(@RequestParam String theLogId, @RequestParam String nodePrimaryKeyId, @RequestParam String currentTime, @RequestParam String contractId) {
|
|
public R<List<Map<String, Object>>> copyTheLogBusinessData(@RequestParam String theLogId, @RequestParam String nodePrimaryKeyId, @RequestParam String currentTime, @RequestParam String contractId) {
|
|
if (StringUtils.isNotEmpty(theLogId) && StringUtils.isNotEmpty(currentTime)) {
|
|
if (StringUtils.isNotEmpty(theLogId) && StringUtils.isNotEmpty(currentTime)) {
|
|
-
|
|
|
|
- //检查当前日期下是否存在数据
|
|
|
|
- JSONObject currentJson = this.contractLogClient.queryContractLogByPrimaryKeyIdAndRecordTime(nodePrimaryKeyId, currentTime, contractId);
|
|
|
|
- String businessId = SnowFlakeUtil.getId().toString();
|
|
|
|
- boolean isNew = true;
|
|
|
|
- if (currentJson != null) {
|
|
|
|
- //使用原本的数据ID
|
|
|
|
- businessId = currentJson.getString("dataId");
|
|
|
|
- isNew = false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //新增的SQL集合
|
|
|
|
|
|
+ //复制出来的新日志记录logIds
|
|
|
|
+ List<String> logIds = new ArrayList<>();
|
|
|
|
+ //复制出来的新增表的实体表SQL集合
|
|
List<String> insertSqlList = new ArrayList<>();
|
|
List<String> insertSqlList = new ArrayList<>();
|
|
- //关联集合
|
|
|
|
|
|
+ //复制出来的新增表关联工序节点集合
|
|
List<JSONObject> logWbsList = new ArrayList<>();
|
|
List<JSONObject> logWbsList = new ArrayList<>();
|
|
//记录第一组
|
|
//记录第一组
|
|
List<JSONObject> oneGroupLogWbsList = new ArrayList<>();
|
|
List<JSONObject> oneGroupLogWbsList = new ArrayList<>();
|
|
|
|
|
|
- List<JSONObject> targetJsonList = this.contractLogClient.queryContractLogByIds(Func.toStrList(theLogId));
|
|
|
|
- if (targetJsonList == null || targetJsonList.size() <= 0) {
|
|
|
|
- return R.fail("目标日期下未找到当前用户填报的数据,请重新选择");
|
|
|
|
|
|
+ //获取所有选择的日志表的数据信息
|
|
|
|
+ List<ContractLog> contractLogList = jdbcTemplate.query("select * from u_contract_log where id in(" + theLogId + ")", new BeanPropertyRowMapper<>(ContractLog.class));
|
|
|
|
+ if (contractLogList.size() <= 0) {
|
|
|
|
+ return R.fail("未获取到选择日志填报信息");
|
|
}
|
|
}
|
|
-
|
|
|
|
- for (JSONObject targetJson : targetJsonList) {
|
|
|
|
-
|
|
|
|
- //获取目标数据所在数据表
|
|
|
|
- WbsTreePrivate table = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, targetJson.getString("tableId")));
|
|
|
|
-
|
|
|
|
|
|
+ Long tabId = contractLogList.stream().map(ContractLog::getTableId).collect(Collectors.toSet()).stream().findAny().orElse(null);
|
|
|
|
+ //获取目标数据所在数据表
|
|
|
|
+ WbsTreePrivate tableTemp = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, tabId));
|
|
|
|
+ boolean var = true;
|
|
|
|
+ for (ContractLog objLog : contractLogList) {
|
|
|
|
+ long dataId = 0;
|
|
//获取目标数据
|
|
//获取目标数据
|
|
- String queryTargetDataSql = "SELECT * FROM " + table.getInitTableName() + " WHERE group_id = " + targetJson.getString("dataId");
|
|
|
|
- List<Map<String, Object>> targetDatas = this.jdbcTemplate.queryForList(queryTargetDataSql);
|
|
|
|
|
|
+ String queryTargetDataSql = "SELECT * FROM " + tableTemp.getInitTableName() + " WHERE id = " + objLog.getDataId();
|
|
|
|
+ List<Map<String, Object>> targetData = this.jdbcTemplate.queryForList(queryTargetDataSql);
|
|
|
|
|
|
//只需要替换group_id和id即可
|
|
//只需要替换group_id和id即可
|
|
- for (Map<String, Object> dataMap : targetDatas) {
|
|
|
|
- StringBuilder insertSql = new StringBuilder("INSERT INTO " + table.getInitTableName()), keySql = new StringBuilder(), valueSql = new StringBuilder();
|
|
|
|
|
|
+ for (Map<String, Object> dataMap : targetData) {
|
|
|
|
+ StringBuilder insertSql = new StringBuilder("INSERT INTO " + tableTemp.getInitTableName()), keySql = new StringBuilder(), valueSql = new StringBuilder();
|
|
for (Map.Entry<String, Object> mapEntry : dataMap.entrySet()) {
|
|
for (Map.Entry<String, Object> mapEntry : dataMap.entrySet()) {
|
|
String key = mapEntry.getKey();
|
|
String key = mapEntry.getKey();
|
|
Object value = mapEntry.getValue();
|
|
Object value = mapEntry.getValue();
|
|
|
|
|
|
|
|
+ //重构id相关
|
|
if ("id".equals(key)) {
|
|
if ("id".equals(key)) {
|
|
- //查询是否有关联记录
|
|
|
|
//查询是否存在关联工序的数据
|
|
//查询是否存在关联工序的数据
|
|
List<JSONObject> wbsJsonList = this.contractLogClient.queryContractLogWbsByBusinessId(value.toString());
|
|
List<JSONObject> wbsJsonList = this.contractLogClient.queryContractLogWbsByBusinessId(value.toString());
|
|
- //重置业务ID
|
|
|
|
- value = SnowFlakeUtil.getId();
|
|
|
|
if (wbsJsonList != null && wbsJsonList.size() > 0) {
|
|
if (wbsJsonList != null && wbsJsonList.size() > 0) {
|
|
if (oneGroupLogWbsList.size() == 0) {
|
|
if (oneGroupLogWbsList.size() == 0) {
|
|
oneGroupLogWbsList.addAll(wbsJsonList);
|
|
oneGroupLogWbsList.addAll(wbsJsonList);
|
|
@@ -2721,14 +2736,25 @@ public class ExcelTabController extends BladeController {
|
|
} else {
|
|
} else {
|
|
wbsJsonList = new ArrayList<>(oneGroupLogWbsList);
|
|
wbsJsonList = new ArrayList<>(oneGroupLogWbsList);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //重构实体表的id对应log的dataId
|
|
|
|
+ value = SnowFlakeUtil.getId();
|
|
|
|
+
|
|
|
|
+ //赋值给log的dataId,也就是businessId要与实体表数据id对应
|
|
|
|
+ dataId = Long.parseLong(String.valueOf(value));
|
|
|
|
+
|
|
|
|
+ //后续关联工序节点businessId赋值,businessId=实体表数据的id
|
|
for (JSONObject json : wbsJsonList) {
|
|
for (JSONObject json : wbsJsonList) {
|
|
- json.put("businessId", value);
|
|
|
|
|
|
+ json.put("businessId", dataId);
|
|
}
|
|
}
|
|
-
|
|
|
|
logWbsList.addAll(wbsJsonList);
|
|
logWbsList.addAll(wbsJsonList);
|
|
- } else if ("group_id".equals(key)) {
|
|
|
|
- value = businessId;
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //重构实体表数据的pKeyId分组
|
|
|
|
+ if ("group_id".equals(key)) {
|
|
|
|
+ value = tableTemp.getPKeyId();
|
|
|
|
+ }
|
|
|
|
+
|
|
//设置参数
|
|
//设置参数
|
|
keySql.append(",").append(key);
|
|
keySql.append(",").append(key);
|
|
if (value != null && StringUtils.isNotEmpty(String.valueOf(value))) {
|
|
if (value != null && StringUtils.isNotEmpty(String.valueOf(value))) {
|
|
@@ -2737,36 +2763,45 @@ public class ExcelTabController extends BladeController {
|
|
valueSql.append(",").append(value);
|
|
valueSql.append(",").append(value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //组装SQL
|
|
|
|
|
|
+ //组装实体表数据SQL
|
|
insertSql.append(" (").append(keySql.substring(1)).append(") ");
|
|
insertSql.append(" (").append(keySql.substring(1)).append(") ");
|
|
insertSql.append(" VALUES(").append(valueSql.substring(1)).append(")");
|
|
insertSql.append(" VALUES(").append(valueSql.substring(1)).append(")");
|
|
-
|
|
|
|
insertSqlList.add(insertSql.toString());
|
|
insertSqlList.add(insertSql.toString());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (dataId != 0) {
|
|
|
|
+ //处理log当前表的记录数据
|
|
|
|
+ String id = this.contractLogClient.saveContractLog(new SaveContractLogVO(
|
|
|
|
+ dataId,
|
|
|
|
+ String.valueOf(objLog.getProjectId()),
|
|
|
|
+ String.valueOf(objLog.getContractId()),
|
|
|
|
+ objLog.getWbsNodeId(),
|
|
|
|
+ objLog.getTableId(),
|
|
|
|
+ objLog.getWbsNodeType(),
|
|
|
|
+ currentTime,
|
|
|
|
+ logWbsList
|
|
|
|
+ ));
|
|
|
|
+ //log记录id
|
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
|
+ logIds.add(id);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ var = false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- if (insertSqlList.size() > 0) {
|
|
|
|
- //新增数据
|
|
|
|
|
|
+ if (insertSqlList.size() > 0 && var) {
|
|
|
|
+ //新增实体表数据
|
|
for (String insertSql : insertSqlList) {
|
|
for (String insertSql : insertSqlList) {
|
|
this.jdbcTemplate.execute(insertSql);
|
|
this.jdbcTemplate.execute(insertSql);
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ throw new ServiceException("数据构造失败");
|
|
}
|
|
}
|
|
- //处理数据
|
|
|
|
- this.contractLogClient.saveContractLog(new SaveContractLogVO(
|
|
|
|
- Long.parseLong(businessId),
|
|
|
|
- targetJsonList.get(0).getString("projectId"),
|
|
|
|
- targetJsonList.get(0).getString("contractId"),
|
|
|
|
- Long.parseLong(targetJsonList.get(0).getString("wbsNodeId")),
|
|
|
|
- Long.parseLong(targetJsonList.get(0).getString("tableId")),
|
|
|
|
- Integer.parseInt(targetJsonList.get(0).getString("wbsNodeType")),
|
|
|
|
- currentTime,
|
|
|
|
- logWbsList
|
|
|
|
- ));
|
|
|
|
-
|
|
|
|
- //返回当前的新数据
|
|
|
|
- return this.getTheLogBusinessData(!isNew ? currentJson.getString("id") : null, nodePrimaryKeyId, currentTime, contractId);
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
+ //返回当前复制的表数据
|
|
|
|
+ return this.getTheLogBusinessData(StringUtils.join(logIds, ","), nodePrimaryKeyId, currentTime, contractId);
|
|
|
|
+ }
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3652,7 +3687,7 @@ public class ExcelTabController extends BladeController {
|
|
* 编辑元素,提示未匹配元素
|
|
* 编辑元素,提示未匹配元素
|
|
*/
|
|
*/
|
|
@GetMapping("/getUnMatchField")
|
|
@GetMapping("/getUnMatchField")
|
|
- @ApiOperationSupport(order = 20)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 40)
|
|
@ApiOperation(value = "编辑元素,提示未匹配元素", notes = "返回未匹配元素数组")
|
|
@ApiOperation(value = "编辑元素,提示未匹配元素", notes = "返回未匹配元素数组")
|
|
@ApiImplicitParams(value = {
|
|
@ApiImplicitParams(value = {
|
|
@ApiImplicitParam(name = "pkeyId", value = "WBS私有库的pkeyId", required = true),
|
|
@ApiImplicitParam(name = "pkeyId", value = "WBS私有库的pkeyId", required = true),
|
|
@@ -3662,4 +3697,29 @@ public class ExcelTabController extends BladeController {
|
|
return R.data(excelTabService.getUnMatchField(pkeyId, tabId));
|
|
return R.data(excelTabService.getUnMatchField(pkeyId, tabId));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @PostMapping("/removeLogTab")
|
|
|
|
+ @ApiOperationSupport(order = 41)
|
|
|
|
+ @ApiOperation(value = "删除施工日志对应的表数据记录信息等", notes = "传入get-the-log-business-data接口返回的内部id")
|
|
|
|
+ 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) {
|
|
|
|
+ //删除施工日志记录信息
|
|
|
|
+ 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());
|
|
|
|
+
|
|
|
|
+ //获取对应表信息
|
|
|
|
+ WbsTreePrivate tableTemp = wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, obj.getTableId()));
|
|
|
|
+ if (tableTemp != null && StringUtils.isNotEmpty(tableTemp.getInitTableName())) {
|
|
|
|
+ //删除实体表对应的数据信息
|
|
|
|
+ jdbcTemplate.execute("delete from " + tableTemp.getInitTableName() + " where id = " + id);
|
|
|
|
+ }
|
|
|
|
+ return R.success("操作成功");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return R.fail("操作失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|