Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ public static MonthlyStatisticEntity create(
);
}

public void update(Integer totalCarCount, Integer nonOperatingCarCount, Double avgOperationRate, Long totalDriveSec,
public void update(LocalDate date, Integer totalCarCount, Integer nonOperatingCarCount, Double avgOperationRate,
Long totalDriveSec,
Integer totalDriveCount, Double totalDriveDistance) {
this.date = date;
this.totalCarCount = totalCarCount;
this.nonOperatingCarCount = nonOperatingCarCount;
this.avgOperationRate = avgOperationRate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public List<MdnBizResponse> getAvailableMdnAndBizId() {
public int createEmulator(List<String> mdnList) {
this.instances = multiCarInstanceFactory.createCarInstances(mdnList);
log.info("multiCarInstanceFactory가 {}개의 인스턴스 생성 완료", instances.size());

return instances.size();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public void saveMonthlyStatistic(List<MonthlyStatisticEntity> resultEntities) {

for (MonthlyStatisticEntity entity : resultEntities) {
MonthlyStatisticEntity existEntity = monthlyStatisticRepository.findByBizIdAndDate(
entity.getBizId(), entity.getDate().minusDays(1));
entity.getBizId(), entity.getDate());

if (existEntity != null) {
existEntity.update(entity.getTotalCarCount(), entity.getNonOperatingCarCount(),
existEntity.update(entity.getDate(), entity.getTotalCarCount(), entity.getNonOperatingCarCount(),
entity.getAvgOperationRate(), entity.getTotalDriveSec(), entity.getTotalDriveCount(),
entity.getTotalDriveDistance());
} else {
Expand Down