|
@@ -88,6 +88,7 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
|
|
|
private MailSendService mailSendService;
|
|
|
@Autowired
|
|
|
private PatentProjectService patentProjectService;
|
|
|
+
|
|
|
@Override
|
|
|
public Object queryMessage(QueryRequest queryRequest) throws Exception {
|
|
|
List<String> sqls = formatQueryService.reSqls(queryRequest, "importTask");
|
|
@@ -556,10 +557,10 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
|
|
|
return importTask.getId();
|
|
|
}
|
|
|
|
|
|
- public void addImportTaskByCondition(ImportTaskCondition importTaskCondition,PatentProject project) {
|
|
|
+ public void addImportTaskByCondition(ImportTaskCondition importTaskCondition, PatentProject project) {
|
|
|
String condition = importTaskCondition.getSearchCondition();
|
|
|
String updateCycle = project.getUpdateCycle();
|
|
|
-
|
|
|
+ String dbType = importTaskCondition.getDbType();
|
|
|
if (updateCycle == null) {
|
|
|
return;
|
|
|
}
|
|
@@ -567,19 +568,40 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
|
|
|
List<String> dateRange = new ArrayList<>();
|
|
|
switch (updateCycle) {
|
|
|
case Cycle.WEEK:
|
|
|
- LocalDate localDateWeek = localDate.minusWeeks(2);
|
|
|
+ LocalDate localDateWeek = null;
|
|
|
+ if (dbType != null && dbType.equals("CN")) {
|
|
|
+ localDateWeek = localDate.minusMonths(1).minusWeeks(1);
|
|
|
+ } else {
|
|
|
+ localDateWeek = localDate.minusWeeks(1);
|
|
|
+
|
|
|
+ }
|
|
|
dateRange = DateUtils2.getWeekRange(localDateWeek);
|
|
|
break;
|
|
|
case Cycle.MONTH:
|
|
|
- LocalDate localDateMonth = localDate.minusMonths(1);
|
|
|
+ LocalDate localDateMonth = null;
|
|
|
+ if (dbType != null && dbType.equals("CN")) {
|
|
|
+ localDateMonth = localDate.minusMonths(1);
|
|
|
+ } else {
|
|
|
+ localDateMonth = localDate.minusMonths(2);
|
|
|
+ }
|
|
|
dateRange = DateUtils2.getMonthRange(localDateMonth);
|
|
|
break;
|
|
|
case Cycle.QUARTER:
|
|
|
- LocalDate localDateQuartz = localDate.minusMonths(4);
|
|
|
+ LocalDate localDateQuartz = null;
|
|
|
+ if (dbType != null && dbType.equals("CN")) {
|
|
|
+ localDateQuartz = localDate.minusMonths(4);
|
|
|
+ } else {
|
|
|
+ localDateQuartz = localDate.minusMonths(5);
|
|
|
+ }
|
|
|
dateRange = DateUtils2.getQuartzRange(localDateQuartz);
|
|
|
break;
|
|
|
case Cycle.YEAR:
|
|
|
- LocalDate localYear = localDate.minusYears(1);
|
|
|
+ LocalDate localYear = null;
|
|
|
+ if (dbType != null && dbType.equals("CN")) {
|
|
|
+ localYear = localDate.minusMonths(1).minusYears(1);
|
|
|
+ } else {
|
|
|
+ localYear= localDate.minusYears(1);
|
|
|
+ }
|
|
|
dateRange = DateUtils2.getYearRange(localYear);
|
|
|
break;
|
|
|
}
|
|
@@ -599,11 +621,15 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
|
|
|
ImportTask importTask = new ImportTask();
|
|
|
|
|
|
|
|
|
- String fromDateStr = DateUtils2.dateTimeToPatentStr(start);
|
|
|
- String todateStr = DateUtils2.dateTimeToPatentStr(end);
|
|
|
- importTask.setLastUpdateToDate(start);
|
|
|
- importTask.setUpdateToDate(end);
|
|
|
+ String fromDateStr = DateUtils2.dateTimeToPatentStr(start);
|
|
|
+ String todateStr = DateUtils2.dateTimeToPatentStr(end);
|
|
|
+ importTask.setLastUpdateToDate(start);
|
|
|
+ importTask.setUpdateToDate(end);
|
|
|
+ if (dbType != null && dbType.equals("CN")) {
|
|
|
condition = condition + " and (PD=" + fromDateStr + "~" + todateStr + " or GD=" + fromDateStr + "~" + todateStr + ")";
|
|
|
+ } else {
|
|
|
+ condition = condition + " and (PD=" + fromDateStr + "~" + todateStr + " or GD=" + fromDateStr + "~" + todateStr + ")";
|
|
|
+ }
|
|
|
|
|
|
PatentStarListDTO patentStarListDto = new PatentStarListDTO()
|
|
|
.setCurrentQuery(condition)
|