|
|
@@ -497,16 +497,14 @@ public class CostProjectTaskSurveyGenericController {
|
|
|
|
|
|
CostAuditPeriodRecord record = costAuditPeriodRecordManager.getById(id);
|
|
|
if (record != null) {
|
|
|
- record.setIsDeleted("1");
|
|
|
- costAuditPeriodRecordManager.updateById(record);
|
|
|
+ costAuditPeriodRecordManager.removeById(record);
|
|
|
|
|
|
// 同时删除该期间下的所有上传数据
|
|
|
QueryWrapper<CostSurveyTemplateUploadData> wrapper = new QueryWrapper<>();
|
|
|
wrapper.eq("period_record_id", id)
|
|
|
.eq("type", type);
|
|
|
- CostSurveyTemplateUploadData updateData = new CostSurveyTemplateUploadData();
|
|
|
- updateData.setIsDeleted("1");
|
|
|
- costSurveyTemplateUploadDataManager.update(updateData, wrapper);
|
|
|
+
|
|
|
+ costSurveyTemplateUploadDataManager.remove(wrapper);
|
|
|
}
|
|
|
|
|
|
return CommonResult.<String>ok().message("删除监审期间记录成功");
|
|
|
@@ -1062,6 +1060,9 @@ public class CostProjectTaskSurveyGenericController {
|
|
|
switch (type) {
|
|
|
// 成本调查表逻辑
|
|
|
case "1": {
|
|
|
+ CostProjectTask task = costProjectTaskManager.getById(taskId);
|
|
|
+ String auditedUnitId = task != null ? task.getAuditedUnitId() : null;
|
|
|
+
|
|
|
CostSurveyTemplate template = costSurveyTemplateManager.get(surveyTemplateId);
|
|
|
if (template == null) {
|
|
|
return CommonResult.<String>error().message("未找到指定的调查模板");
|
|
|
@@ -1198,64 +1199,76 @@ public class CostProjectTaskSurveyGenericController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 读取原有字段数据(包括空值)
|
|
|
+ // 读取原有字段数据(只保存有值的数据)
|
|
|
for (Map.Entry<Integer, CostSurveyTemplateHeaders> entry : columnIndexMap.entrySet()) {
|
|
|
Cell cell = dataRow.getCell(entry.getKey());
|
|
|
String cellValue = getCellStringValue(cell);
|
|
|
|
|
|
- // 即使是空值也要添加,保证数据完整性
|
|
|
- CostSurveyTemplateUploadData uploadData = createUploadData(
|
|
|
- surveyTemplateId, taskId, uploadId, currentRowId,
|
|
|
- entry.getValue(), cellValue != null ? cellValue : "", periodRecordId, type);
|
|
|
- uploadData.setUploadId(uploadId);
|
|
|
- uploadData.setRefId(refId);
|
|
|
- dataList.add(uploadData);
|
|
|
+ // 只保存有值的数据
|
|
|
+ if (StringUtil.isNotEmpty(cellValue)) {
|
|
|
+ CostSurveyTemplateUploadData uploadData = createUploadData(
|
|
|
+ surveyTemplateId, taskId, uploadId, currentRowId,
|
|
|
+ entry.getValue(), cellValue, periodRecordId, type);
|
|
|
+ uploadData.setUploadId(uploadId);
|
|
|
+ uploadData.setRefId(refId);
|
|
|
+ uploadData.setAuditedUnitId(auditedUnitId);
|
|
|
+ uploadData.setParentId(parentRowId);
|
|
|
+ dataList.add(uploadData);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- // 读取年限列数据(包括空值)
|
|
|
+ // 读取年限列数据(只保存有值的数据)
|
|
|
for (Map.Entry<String, Integer> periodEntry : auditPeriodColumnMap.entrySet()) {
|
|
|
String period = periodEntry.getKey();
|
|
|
Integer colIndex = periodEntry.getValue();
|
|
|
Cell cell = dataRow.getCell(colIndex);
|
|
|
String cellValue = getCellStringValue(cell);
|
|
|
|
|
|
- // 即使是空值也要添加,保证数据完整性
|
|
|
- CostSurveyTemplateUploadData periodData = new CostSurveyTemplateUploadData();
|
|
|
- periodData.setSurveyTemplateId(surveyTemplateId);
|
|
|
- periodData.setTaskId(taskId);
|
|
|
- periodData.setUploadId(uploadId);
|
|
|
- periodData.setRefId(refId);
|
|
|
- periodData.setType(type);
|
|
|
- periodData.setRowid(currentRowId);
|
|
|
- periodData.setRkey(period); // 年限,如:2024
|
|
|
- periodData.setRvalue(cellValue != null ? cellValue.trim() : "");
|
|
|
- if (StringUtil.isNotEmpty(periodRecordId)) {
|
|
|
- periodData.setPeriodRecordId(periodRecordId);
|
|
|
+ // 只保存有值的数据
|
|
|
+ if (StringUtil.isNotEmpty(cellValue)) {
|
|
|
+ CostSurveyTemplateUploadData periodData = new CostSurveyTemplateUploadData();
|
|
|
+ periodData.setSurveyTemplateId(surveyTemplateId);
|
|
|
+ periodData.setTaskId(taskId);
|
|
|
+ periodData.setUploadId(uploadId);
|
|
|
+ periodData.setRefId(refId);
|
|
|
+ periodData.setType(type);
|
|
|
+ periodData.setRowid(currentRowId);
|
|
|
+ periodData.setRkey(period); // 年限,如:2024
|
|
|
+ periodData.setRvalue(cellValue.trim());
|
|
|
+ periodData.setAuditedUnitId(auditedUnitId);
|
|
|
+ periodData.setParentId(parentRowId);
|
|
|
+ if (StringUtil.isNotEmpty(periodRecordId)) {
|
|
|
+ periodData.setPeriodRecordId(periodRecordId);
|
|
|
+ }
|
|
|
+ periodData.setIsDeleted("0");
|
|
|
+ dataList.add(periodData);
|
|
|
}
|
|
|
- periodData.setIsDeleted("0");
|
|
|
- dataList.add(periodData);
|
|
|
}
|
|
|
|
|
|
- // 读取备注列数据(包括空值)
|
|
|
+ // 读取备注列数据(只保存有值的数据)
|
|
|
if (remarkColumnIndex != null) {
|
|
|
Cell remarkCell = dataRow.getCell(remarkColumnIndex);
|
|
|
String remarkValue = getCellStringValue(remarkCell);
|
|
|
|
|
|
- // 即使是空值也要添加,保证数据完整性
|
|
|
- CostSurveyTemplateUploadData remarkData = new CostSurveyTemplateUploadData();
|
|
|
- remarkData.setSurveyTemplateId(surveyTemplateId);
|
|
|
- remarkData.setTaskId(taskId);
|
|
|
- remarkData.setRefId(refId);
|
|
|
- remarkData.setUploadId(uploadId);
|
|
|
- remarkData.setType(type);
|
|
|
- remarkData.setRowid(currentRowId);
|
|
|
- remarkData.setRkey("remark");
|
|
|
- remarkData.setRvalue(remarkValue != null ? remarkValue.trim() : "");
|
|
|
- if (StringUtil.isNotEmpty(periodRecordId)) {
|
|
|
- remarkData.setPeriodRecordId(periodRecordId);
|
|
|
+ // 只保存有值的数据
|
|
|
+ if (StringUtil.isNotEmpty(remarkValue)) {
|
|
|
+ CostSurveyTemplateUploadData remarkData = new CostSurveyTemplateUploadData();
|
|
|
+ remarkData.setSurveyTemplateId(surveyTemplateId);
|
|
|
+ remarkData.setTaskId(taskId);
|
|
|
+ remarkData.setRefId(refId);
|
|
|
+ remarkData.setUploadId(uploadId);
|
|
|
+ remarkData.setType(type);
|
|
|
+ remarkData.setRowid(currentRowId);
|
|
|
+ remarkData.setRkey("remark");
|
|
|
+ remarkData.setRvalue(remarkValue.trim());
|
|
|
+ remarkData.setAuditedUnitId(auditedUnitId);
|
|
|
+ remarkData.setParentId(parentRowId);
|
|
|
+ if (StringUtil.isNotEmpty(periodRecordId)) {
|
|
|
+ remarkData.setPeriodRecordId(periodRecordId);
|
|
|
+ }
|
|
|
+ remarkData.setIsDeleted("0");
|
|
|
+ dataList.add(remarkData);
|
|
|
}
|
|
|
- remarkData.setIsDeleted("0");
|
|
|
- dataList.add(remarkData);
|
|
|
}
|
|
|
|
|
|
dataRowCount++;
|
|
|
@@ -1291,6 +1304,9 @@ public class CostProjectTaskSurveyGenericController {
|
|
|
}
|
|
|
// 财务数据表逻辑
|
|
|
case "2": {
|
|
|
+ CostProjectTask task = costProjectTaskManager.getById(taskId);
|
|
|
+ String auditedUnitId = task != null ? task.getAuditedUnitId() : null;
|
|
|
+
|
|
|
CostSurveyFdTemplate template = costSurveyFdTemplateManager.get(surveyTemplateId);
|
|
|
if (template == null) {
|
|
|
return CommonResult.<String>error().message("未找到指定的财务数据表模板");
|
|
|
@@ -1419,64 +1435,76 @@ public class CostProjectTaskSurveyGenericController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 读取原有字段数据(包括空值)
|
|
|
+ // 读取原有字段数据(只保存有值的数据)
|
|
|
for (Map.Entry<Integer, CostSurveyFdTemplateHeaders> entry : columnIndexMap.entrySet()) {
|
|
|
Cell cell = dataRow.getCell(entry.getKey());
|
|
|
String cellValue = getCellStringValue(cell);
|
|
|
|
|
|
- // 即使是空值也要添加,保证数据完整性
|
|
|
- CostSurveyTemplateUploadData uploadData = createUploadData(
|
|
|
- surveyTemplateId, taskId, uploadId, currentRowId,
|
|
|
- entry.getValue(), cellValue != null ? cellValue : "", periodRecordId, type);
|
|
|
- uploadData.setUploadId(uploadId);
|
|
|
- uploadData.setRefId(refId);
|
|
|
- dataList.add(uploadData);
|
|
|
+ // 只保存有值的数据
|
|
|
+ if (StringUtil.isNotEmpty(cellValue)) {
|
|
|
+ CostSurveyTemplateUploadData uploadData = createUploadData(
|
|
|
+ surveyTemplateId, taskId, uploadId, currentRowId,
|
|
|
+ entry.getValue(), cellValue, periodRecordId, type);
|
|
|
+ uploadData.setUploadId(uploadId);
|
|
|
+ uploadData.setRefId(refId);
|
|
|
+ uploadData.setAuditedUnitId(auditedUnitId);
|
|
|
+ uploadData.setParentId(parentRowId);
|
|
|
+ dataList.add(uploadData);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- // 读取年限列数据(包括空值)
|
|
|
+ // 读取年限列数据(只保存有值的数据)
|
|
|
for (Map.Entry<String, Integer> periodEntry : auditPeriodColumnMap.entrySet()) {
|
|
|
String period = periodEntry.getKey();
|
|
|
Integer colIndex = periodEntry.getValue();
|
|
|
Cell cell = dataRow.getCell(colIndex);
|
|
|
String cellValue = getCellStringValue(cell);
|
|
|
|
|
|
- // 即使是空值也要添加,保证数据完整性
|
|
|
- CostSurveyTemplateUploadData periodData = new CostSurveyTemplateUploadData();
|
|
|
- periodData.setSurveyTemplateId(surveyTemplateId);
|
|
|
- periodData.setTaskId(taskId);
|
|
|
- periodData.setRefId(refId);
|
|
|
- periodData.setUploadId(uploadId);
|
|
|
- periodData.setType(type);
|
|
|
- periodData.setRowid(currentRowId);
|
|
|
- periodData.setRkey(period);
|
|
|
- periodData.setRvalue(cellValue != null ? cellValue.trim() : "");
|
|
|
- if (StringUtil.isNotEmpty(periodRecordId)) {
|
|
|
- periodData.setPeriodRecordId(periodRecordId);
|
|
|
+ // 只保存有值的数据
|
|
|
+ if (StringUtil.isNotEmpty(cellValue)) {
|
|
|
+ CostSurveyTemplateUploadData periodData = new CostSurveyTemplateUploadData();
|
|
|
+ periodData.setSurveyTemplateId(surveyTemplateId);
|
|
|
+ periodData.setTaskId(taskId);
|
|
|
+ periodData.setRefId(refId);
|
|
|
+ periodData.setUploadId(uploadId);
|
|
|
+ periodData.setType(type);
|
|
|
+ periodData.setRowid(currentRowId);
|
|
|
+ periodData.setRkey(period);
|
|
|
+ periodData.setRvalue(cellValue.trim());
|
|
|
+ periodData.setAuditedUnitId(auditedUnitId);
|
|
|
+ periodData.setParentId(parentRowId);
|
|
|
+ if (StringUtil.isNotEmpty(periodRecordId)) {
|
|
|
+ periodData.setPeriodRecordId(periodRecordId);
|
|
|
+ }
|
|
|
+ periodData.setIsDeleted("0");
|
|
|
+ dataList.add(periodData);
|
|
|
}
|
|
|
- periodData.setIsDeleted("0");
|
|
|
- dataList.add(periodData);
|
|
|
}
|
|
|
|
|
|
- // 读取备注列数据(包括空值)
|
|
|
+ // 读取备注列数据(只保存有值的数据)
|
|
|
if (remarkColumnIndex != null) {
|
|
|
Cell remarkCell = dataRow.getCell(remarkColumnIndex);
|
|
|
String remarkValue = getCellStringValue(remarkCell);
|
|
|
|
|
|
- // 即使是空值也要添加,保证数据完整性
|
|
|
- CostSurveyTemplateUploadData remarkData = new CostSurveyTemplateUploadData();
|
|
|
- remarkData.setSurveyTemplateId(surveyTemplateId);
|
|
|
- remarkData.setTaskId(taskId);
|
|
|
- remarkData.setRefId(refId);
|
|
|
- remarkData.setUploadId(uploadId);
|
|
|
- remarkData.setType(type);
|
|
|
- remarkData.setRowid(currentRowId);
|
|
|
- remarkData.setRkey("remark");
|
|
|
- remarkData.setRvalue(remarkValue != null ? remarkValue.trim() : "");
|
|
|
- if (StringUtil.isNotEmpty(periodRecordId)) {
|
|
|
- remarkData.setPeriodRecordId(periodRecordId);
|
|
|
+ // 只保存有值的数据
|
|
|
+ if (StringUtil.isNotEmpty(remarkValue)) {
|
|
|
+ CostSurveyTemplateUploadData remarkData = new CostSurveyTemplateUploadData();
|
|
|
+ remarkData.setSurveyTemplateId(surveyTemplateId);
|
|
|
+ remarkData.setTaskId(taskId);
|
|
|
+ remarkData.setRefId(refId);
|
|
|
+ remarkData.setUploadId(uploadId);
|
|
|
+ remarkData.setType(type);
|
|
|
+ remarkData.setRowid(currentRowId);
|
|
|
+ remarkData.setRkey("remark");
|
|
|
+ remarkData.setRvalue(remarkValue.trim());
|
|
|
+ remarkData.setAuditedUnitId(auditedUnitId);
|
|
|
+ remarkData.setParentId(parentRowId);
|
|
|
+ if (StringUtil.isNotEmpty(periodRecordId)) {
|
|
|
+ remarkData.setPeriodRecordId(periodRecordId);
|
|
|
+ }
|
|
|
+ remarkData.setIsDeleted("0");
|
|
|
+ dataList.add(remarkData);
|
|
|
}
|
|
|
- remarkData.setIsDeleted("0");
|
|
|
- dataList.add(remarkData);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1510,6 +1538,9 @@ public class CostProjectTaskSurveyGenericController {
|
|
|
}
|
|
|
// 核定表
|
|
|
case "3": {
|
|
|
+ CostProjectTask task = costProjectTaskManager.getById(taskId);
|
|
|
+ String auditedUnitId = task != null ? task.getAuditedUnitId() : null;
|
|
|
+
|
|
|
CostVerifyTemplate template = costVerifyTemplateManager.get(surveyTemplateId);
|
|
|
if (template == null) {
|
|
|
return CommonResult.<String>error().message("未找到核定表模板");
|
|
|
@@ -1629,6 +1660,8 @@ public class CostProjectTaskSurveyGenericController {
|
|
|
surveyTemplateId, taskId, uploadId, currentRowId,
|
|
|
entry.getValue(), cellValue, periodRecordId, type
|
|
|
);
|
|
|
+ uploadData.setAuditedUnitId(auditedUnitId);
|
|
|
+ uploadData.setParentId(parentRowId);
|
|
|
dataList.add(uploadData);
|
|
|
}
|
|
|
}
|