|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.controller; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.dto.extract.form.ExtractFormDTO; |
|
|
@ -7,6 +8,7 @@ import com.epmet.service.evaluationindex.extract.FactOriginExtractService; |
|
|
|
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; |
|
|
|
import com.epmet.service.evaluationindex.extract.IssueExtractService; |
|
|
|
import com.epmet.service.evaluationindex.extract.ProjectExtractService; |
|
|
|
import com.epmet.util.DimIdGenerator; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
@ -14,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 原始数据清洗 |
|
|
@ -41,7 +45,18 @@ public class FactOriginController { |
|
|
|
*/ |
|
|
|
@PostMapping("extractall") |
|
|
|
public Result extractAll(@RequestBody ExtractFormDTO extractFormDTO) { |
|
|
|
if (StringUtils.isNotBlank(extractFormDTO.getStartDate()) && StringUtils.isNotBlank(extractFormDTO.getEndDate())) { |
|
|
|
Date startDate = DateUtils.stringToDate(extractFormDTO.getStartDate(), "yyyyMMdd"); |
|
|
|
Date endDate = DateUtils.stringToDate(extractFormDTO.getEndDate(), "yyyyMMdd"); |
|
|
|
do { |
|
|
|
String dateDimId = DimIdGenerator.getDateDimId(startDate); |
|
|
|
extractFormDTO.setDateId(dateDimId); |
|
|
|
factOriginExtractService.extractAll(extractFormDTO); |
|
|
|
startDate = DateUtils.addDateDays(DateUtils.stringToDate(extractFormDTO.getStartDate(), "yyyyMMdd"), 1); |
|
|
|
} while (endDate.compareTo(startDate) >= 0); |
|
|
|
} else { |
|
|
|
factOriginExtractService.extractAll(extractFormDTO); |
|
|
|
} |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|