|
|
@@ -27,6 +27,7 @@ import java.time.LocalDateTime;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import com.hotent.base.util.BeanUtils;
|
|
|
@@ -83,9 +84,13 @@ public class CostDocumentTemplateFileManagerImpl extends BaseManagerImpl<CostDoc
|
|
|
String tableName = costProjectDocumentFile.getTableName();
|
|
|
List<CostProjectTask> taskByProjectId = costProjectTaskManager.findTaskByProjectId(whereValue,unitId);
|
|
|
if (taskByProjectId!=null && !taskByProjectId.isEmpty()) {
|
|
|
- String replace = tableName.replace("?", "'" + taskByProjectId.get(0).getId() + "'");
|
|
|
- String colValue= costTemplateFileManager.getColValue2(replace);
|
|
|
- costProjectDocumentFile.setDataValue(CostDataUtil.convertToChineseDate(colValue));
|
|
|
+ List<CostProjectTask> projectTasks = taskByProjectId.stream().filter(t -> !t.getPid().equals("0") && t.getAuditedUnitId().equals(unitId)).collect(Collectors.toList());
|
|
|
+ if ( !projectTasks.isEmpty()) {
|
|
|
+ String replace = tableName.replace("?", "'" + projectTasks.get(0).getId() + "'");
|
|
|
+ String colValue= costTemplateFileManager.getColValue2(replace);
|
|
|
+ costProjectDocumentFile.setDataValue(CostDataUtil.convertToChineseDate(colValue));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}else if (StringUtil.isNotEmpty(costProjectDocumentFile.getTableName())
|