Commit 4315a6f4 by 刘鑫

fix: 容量统计排除未绑定工作队的人员

1 parent f335a65c
...@@ -148,13 +148,14 @@ public class CalcOrgCapacityScheduler { ...@@ -148,13 +148,14 @@ public class CalcOrgCapacityScheduler {
entity.setUpdateTime(LocalDateTime.now()); entity.setUpdateTime(LocalDateTime.now());
// todo entity.setOrderCount(); // todo entity.setOrderCount();
capacityOrgStatDao.save(entity); capacityOrgStatDao.save(entity);
if (dto.getCapTotal() > 0) {
double usedPercentage = (double) dto.getCapUsed() / dto.getCapTotal(); double usedPercentage = (double) dto.getCapUsed() / dto.getCapTotal();
log.info("[calcOneBranch] {}小组容量已使用占比{}", groupId, usedPercentage); log.info("[calcOneBranch] {}小组容量已使用占比{}", groupId, usedPercentage);
if (BigDecimal.valueOf(usedPercentage).compareTo(new BigDecimal("0.8")) >= 0) { if (BigDecimal.valueOf(usedPercentage).compareTo(new BigDecimal("0.8")) >= 0) {
addCapacityMsg("", "", groupId, LocalDate.parse(date, DateUtil.DATE_FORMATTER), addCapacityMsg("", "", groupId, LocalDate.parse(date, DateUtil.DATE_FORMATTER),
dto.getLayer(), dto.getLayerId()); dto.getLayer(), dto.getLayerId());
} }
}
} }
} }
...@@ -193,7 +194,7 @@ public class CalcOrgCapacityScheduler { ...@@ -193,7 +194,7 @@ public class CalcOrgCapacityScheduler {
entity.setUpdateTime(LocalDateTime.now()); entity.setUpdateTime(LocalDateTime.now());
// todo entity.setOrderCount(); // todo entity.setOrderCount();
capacityOrgStatDao.save(entity); capacityOrgStatDao.save(entity);
if (dto.getCapTotal() > 0) {
double usedPercentage = (double) dto.getCapUsed() / dto.getCapTotal(); double usedPercentage = (double) dto.getCapUsed() / dto.getCapTotal();
log.info("[calcOneBranch] {}分部容量已使用占比{}", branchId, usedPercentage); log.info("[calcOneBranch] {}分部容量已使用占比{}", branchId, usedPercentage);
if (BigDecimal.valueOf(usedPercentage).compareTo(new BigDecimal("0.8")) >= 0) { if (BigDecimal.valueOf(usedPercentage).compareTo(new BigDecimal("0.8")) >= 0) {
...@@ -202,6 +203,7 @@ public class CalcOrgCapacityScheduler { ...@@ -202,6 +203,7 @@ public class CalcOrgCapacityScheduler {
} }
} }
} }
}
private void addCapacityMsg(String clusterId, String branchId, String groupId, private void addCapacityMsg(String clusterId, String branchId, String groupId,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!