Commit 78addc81 by Ren Ping

Merge remote-tracking branch 'origin/develop' into develop

2 parents 0132d400 e89c42fb
...@@ -151,7 +151,8 @@ public class CalcOrgCapacityScheduler { ...@@ -151,7 +151,8 @@ public class CalcOrgCapacityScheduler {
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), dto.getLayer()); addCapacityMsg("", "", groupId, LocalDate.parse(date, DateUtil.DATE_FORMATTER),
dto.getLayer(), dto.getLayerId());
} }
} }
...@@ -196,14 +197,15 @@ public class CalcOrgCapacityScheduler { ...@@ -196,14 +197,15 @@ public class CalcOrgCapacityScheduler {
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) {
addCapacityMsg("", branchId, "", LocalDate.parse(date, DateUtil.DATE_FORMATTER), dto.getLayer()); addCapacityMsg("", branchId, "", LocalDate.parse(date, DateUtil.DATE_FORMATTER),
dto.getLayer(), dto.getLayerId());
} }
} }
} }
private void addCapacityMsg(String clusterId, String branchId, String groupId, private void addCapacityMsg(String clusterId, String branchId, String groupId,
LocalDate targetDate, String layer) { LocalDate targetDate, String layer, String layerId) {
MsgDTO msgDTO = new MsgDTO(); MsgDTO msgDTO = new MsgDTO();
msgDTO.setType(2); msgDTO.setType(2);
...@@ -225,10 +227,19 @@ public class CalcOrgCapacityScheduler { ...@@ -225,10 +227,19 @@ public class CalcOrgCapacityScheduler {
msgBrand = group.getGroupName(); msgBrand = group.getGroupName();
msgDTO.setGroupId(groupId); msgDTO.setGroupId(groupId);
} }
msg = MessageFormat.format(msg, msgBrand, layer, DateTimeUtil.formatDate(targetDate)); final String capacityDate = DateTimeUtil.formatDate(targetDate);
msg = MessageFormat.format(msg, msgBrand, layer, capacityDate);
msgDTO.setContent(msg); msgDTO.setContent(msg);
msgDTO.setTag(1); msgDTO.setTag(1);
msgService.add(msgDTO);
msgDTO.setCapacityLayerId(layerId);
msgDTO.setCapacityDate(capacityDate);
try {
msgService.add(msgDTO);
} catch (Exception ex) {
log.error("[addCapacityMsg] {}容量消息发送失败, 失败原因:{}", msgBrand, ex.getMessage(), ex);
}
} }
private void calcAllTeamByDays(String bdate, String edate) { private void calcAllTeamByDays(String bdate, String edate) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!