|
|
@ -50,6 +50,7 @@ import com.epmet.service.org.CustomerGridService; |
|
|
|
import com.epmet.service.stats.DimAgencyService; |
|
|
|
import com.epmet.service.stats.DimCustomerPartymemberService; |
|
|
|
import com.epmet.service.stats.DimCustomerService; |
|
|
|
import com.epmet.util.DimIdGenerator; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -59,6 +60,8 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
@ -695,10 +698,22 @@ public class DemoController { |
|
|
|
|
|
|
|
@PostMapping("governRankDaily") |
|
|
|
public Result governRankDaily(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ |
|
|
|
governRankDataExtractService.extractGridDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); |
|
|
|
governRankDataExtractService.extractCommunityDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); |
|
|
|
governRankDataExtractService.extractStreetDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); |
|
|
|
governRankDataExtractService.extractDistrictDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); |
|
|
|
List<String> dateIds = new ArrayList<>(); |
|
|
|
if ((StringUtils.isBlank(formDTO.getStartDate()) && StringUtils.isBlank(formDTO.getEndDate()))){ |
|
|
|
if (StringUtils.isNotBlank(formDTO.getDateId())){ |
|
|
|
dateIds.add(formDTO.getDateId()); |
|
|
|
}else { |
|
|
|
dateIds.add(DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1))); |
|
|
|
} |
|
|
|
}else { |
|
|
|
dateIds = DateUtils.getDaysBetween(formDTO.getStartDate(), formDTO.getEndDate()); |
|
|
|
} |
|
|
|
dateIds.forEach(dateId -> { |
|
|
|
governRankDataExtractService.extractGridDataDaily(formDTO.getCustomerId(), dateId); |
|
|
|
governRankDataExtractService.extractCommunityDataDaily(formDTO.getCustomerId(), dateId); |
|
|
|
governRankDataExtractService.extractStreetDataDaily(formDTO.getCustomerId(), dateId); |
|
|
|
governRankDataExtractService.extractDistrictDataDaily(formDTO.getCustomerId(), dateId); |
|
|
|
}); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|