Browse Source

bug修复 文件上传率

master
gjh 1 month ago
parent
commit
07160e90c0
  1. 13
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouPlaninfofileServiceImpl.java

13
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouPlaninfofileServiceImpl.java

@ -801,11 +801,22 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil
Date now = new Date(); Date now = new Date();
double rate =0.0; double rate =0.0;
int totalFileCount = 0; int totalFileCount = 0;
// 不能定义为0
int unFinishFileCount = 0; int unFinishFileCount = 0;
int currentNeedFileCount = 0; int currentNeedFileCount = 0;
List<HuzhouPlaninfo> planInfoList = planinfoService.getListByProjectId(projectId); List<HuzhouPlaninfo> planInfoList = planinfoService.getListByProjectId(projectId);
List<HuzhouPlaninfo> filteredPlanInfoList = planInfoList.stream()
.filter(item -> "0".equals(item.getIsfinish()))
.collect(Collectors.toList());
for (HuzhouPlaninfo planInfo : filteredPlanInfoList) {
String taskFile = planInfo.getTaskFile();
// 当且节点未上传的文件数量
unFinishFileCount += countFiles(taskFile);
}
if (CollectionUtil.isNotEmpty(planInfoList)) { if (CollectionUtil.isNotEmpty(planInfoList)) {
for (HuzhouPlaninfo planInfo : planInfoList) { for (HuzhouPlaninfo planInfo : planInfoList) {
String taskFile = planInfo.getTaskFile(); String taskFile = planInfo.getTaskFile();
@ -822,7 +833,7 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil
currentNeedFileCount += countFiles(taskFile); currentNeedFileCount += countFiles(taskFile);
} }
} }
// 当且节点已经上传文件数量 // 当且节点已经上传文件数量 总的-未完成 = 已上传
int uploadFileCount = totalFileCount - unFinishFileCount; int uploadFileCount = totalFileCount - unFinishFileCount;
List<HuzhouPlaninfo> currentPlanInfo = planInfoList.stream() List<HuzhouPlaninfo> currentPlanInfo = planInfoList.stream()

Loading…
Cancel
Save