|
@@ -10,14 +10,14 @@ import cn.cslg.pas.common.model.vo.*;
|
|
import cn.cslg.pas.common.utils.*;
|
|
import cn.cslg.pas.common.utils.*;
|
|
import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
|
|
import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
|
|
|
|
|
|
-import cn.cslg.pas.domain.Personnel;
|
|
|
|
-import cn.cslg.pas.domain.Project;
|
|
|
|
-import cn.cslg.pas.domain.Report;
|
|
|
|
-import cn.cslg.pas.domain.Task;
|
|
|
|
|
|
+import cn.cslg.pas.domain.*;
|
|
|
|
+import cn.cslg.pas.domain.asso.AssoProductPatent;
|
|
import cn.cslg.pas.domain.asso.TaskCondition;
|
|
import cn.cslg.pas.domain.asso.TaskCondition;
|
|
import cn.cslg.pas.mapper.TaskMapper;
|
|
import cn.cslg.pas.mapper.TaskMapper;
|
|
import cn.cslg.pas.common.model.dto.UploadFileDTO;
|
|
import cn.cslg.pas.common.model.dto.UploadFileDTO;
|
|
|
|
+import cn.cslg.pas.service.asso.AssoProductPatentService;
|
|
import cn.cslg.pas.service.asso.TaskConditionService;
|
|
import cn.cslg.pas.service.asso.TaskConditionService;
|
|
|
|
+import cn.cslg.pas.service.impl.ProductServiceImpl;
|
|
import cn.cslg.pas.service.upLoadPatent.*;
|
|
import cn.cslg.pas.service.upLoadPatent.*;
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
@@ -65,6 +65,7 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> implements ITaskS
|
|
private final TaskConditionService taskConditionService;
|
|
private final TaskConditionService taskConditionService;
|
|
private final ProjectService projectService;
|
|
private final ProjectService projectService;
|
|
private final ReportService reportService;
|
|
private final ReportService reportService;
|
|
|
|
+ private final ProductServiceImpl productService;
|
|
private final JobService jobService;
|
|
private final JobService jobService;
|
|
private final TaskMapper taskMapper;
|
|
private final TaskMapper taskMapper;
|
|
|
|
|
|
@@ -136,6 +137,9 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> implements ITaskS
|
|
} else if (projectImportPatentVO.getProjectId() == null && projectImportPatentVO.getReportId() != null) {
|
|
} else if (projectImportPatentVO.getProjectId() == null && projectImportPatentVO.getReportId() != null) {
|
|
//若是和报告关联
|
|
//若是和报告关联
|
|
task.setReportId(projectImportPatentVO.getReportId());
|
|
task.setReportId(projectImportPatentVO.getReportId());
|
|
|
|
+ } else if (projectImportPatentVO.getProductId() != null) {
|
|
|
|
+ //若是和产品关联
|
|
|
|
+ task.setProductId(projectImportPatentVO.getProductId());
|
|
}
|
|
}
|
|
//文件名称
|
|
//文件名称
|
|
task.setFileName(fileDTO.getFileName());
|
|
task.setFileName(fileDTO.getFileName());
|
|
@@ -188,6 +192,9 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> implements ITaskS
|
|
} else if (taskAddNewDTO.getProjectId() == null && taskAddNewDTO.getReportId() != null) {
|
|
} else if (taskAddNewDTO.getProjectId() == null && taskAddNewDTO.getReportId() != null) {
|
|
//报告id
|
|
//报告id
|
|
task.setReportId(taskAddNewDTO.getReportId());
|
|
task.setReportId(taskAddNewDTO.getReportId());
|
|
|
|
+ } else if (taskAddNewDTO.getProductId() != null) {
|
|
|
|
+ //产品id
|
|
|
|
+ task.setProductId(taskAddNewDTO.getProductId());
|
|
}
|
|
}
|
|
//专利总数量
|
|
//专利总数量
|
|
task.setTotal(total);
|
|
task.setTotal(total);
|
|
@@ -235,6 +242,10 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> implements ITaskS
|
|
return Response.success(true);
|
|
return Response.success(true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void deleteReportTasks(Integer reportId) {
|
|
|
|
+ this.remove(new LambdaQueryWrapper<Task>().eq(Task::getReportId, reportId));
|
|
|
|
+ }
|
|
|
|
+
|
|
public void deleteTask(Integer taskId) {
|
|
public void deleteTask(Integer taskId) {
|
|
log.info("开始处理【删除任务】的业务,参数为:id={}", taskId);
|
|
log.info("开始处理【删除任务】的业务,参数为:id={}", taskId);
|
|
|
|
|
|
@@ -322,7 +333,7 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> implements ITaskS
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //装载任务名称(专利号/检索式 导入到 某某 专题库/报告中)
|
|
|
|
|
|
+ //装载任务名称(专利号/检索式 导入到 某某 专题库/报告中/产品)
|
|
if (queryTaskDTO.getProjectId() != null) { //若当前查询是查询所有导入专题库的任务,则装载专题库名称
|
|
if (queryTaskDTO.getProjectId() != null) { //若当前查询是查询所有导入专题库的任务,则装载专题库名称
|
|
List<Integer> projectIds = tasks.stream().map(QueryTaskVO::getProjectId).collect(Collectors.toList());
|
|
List<Integer> projectIds = tasks.stream().map(QueryTaskVO::getProjectId).collect(Collectors.toList());
|
|
List<Project> projects = projectService.list(new LambdaQueryWrapper<Project>().in(Project::getId, projectIds));
|
|
List<Project> projects = projectService.list(new LambdaQueryWrapper<Project>().in(Project::getId, projectIds));
|
|
@@ -345,6 +356,16 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> implements ITaskS
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ } else if (queryTaskDTO.getProductId() != null) { //若当前查询是查询所有导入产品的任务,则装载报告名称
|
|
|
|
+ List<Integer> productIds = tasks.stream().map(QueryTaskVO::getProductId).collect(Collectors.toList());
|
|
|
|
+ List<Product> products = productService.list(new LambdaQueryWrapper<Product>().in(Product::getId, productIds));
|
|
|
|
+ tasks.forEach(task -> {
|
|
|
|
+ products.forEach(product -> {
|
|
|
|
+ if (task.getProductId().equals(product.getId())) {
|
|
|
|
+ task.setProductName(product.getProductName());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
for (QueryTaskVO task : tasks) {
|
|
for (QueryTaskVO task : tasks) {
|
|
@@ -365,6 +386,9 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> implements ITaskS
|
|
} else if (task.getReportName() != null) {
|
|
} else if (task.getReportName() != null) {
|
|
to = "报告";
|
|
to = "报告";
|
|
toName = task.getReportName();
|
|
toName = task.getReportName();
|
|
|
|
+ } else if (task.getProductName() != null) {
|
|
|
|
+ to = "产品";
|
|
|
|
+ toName = task.getProductName();
|
|
}
|
|
}
|
|
if (task.getType().equals(2)) { //导出任务
|
|
if (task.getType().equals(2)) { //导出任务
|
|
taskName = to + "【" + toName + "】导出 - " + task.getCreateName();
|
|
taskName = to + "【" + toName + "】导出 - " + task.getCreateName();
|
|
@@ -372,28 +396,6 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> implements ITaskS
|
|
taskName = type + "导入到" + to + "【" + toName + "】 - " + task.getCreateName();
|
|
taskName = type + "导入到" + to + "【" + toName + "】 - " + task.getCreateName();
|
|
}
|
|
}
|
|
task.setTaskName(taskName);
|
|
task.setTaskName(taskName);
|
|
-// if (task.getType().equals(5)) { //若是专利号导入任务
|
|
|
|
-// if (task.getProjectName() != null) { //专题库
|
|
|
|
-// taskName = "专利号导入到专题库【" + task.getProjectName() + "】中 - " + task.getCreateName();
|
|
|
|
-// } else if (task.getReportName() != null) { //报告
|
|
|
|
-// taskName = "专利号导入到报告【" + task.getReportName() + "】中 - " + task.getCreateName();
|
|
|
|
-// }
|
|
|
|
-// task.setTaskName(taskName);
|
|
|
|
-// } else if (task.getType().equals(3) || task.getType().equals(4)) { //若是检索式导入(欧专局或专利之星)
|
|
|
|
-// if (task.getProjectName() != null) {
|
|
|
|
-// taskName = "检索式导入到专题库【" + task.getProjectName() + "】中 - " + task.getCreateName();
|
|
|
|
-// } else if (task.getReportName() != null) {
|
|
|
|
-// taskName = "检索式导入到报告【" + task.getReportName() + "】中 - " + task.getCreateName();
|
|
|
|
-// }
|
|
|
|
-// task.setTaskName(taskName);
|
|
|
|
-// } else if (task.getType().equals(2)) { //若是导出
|
|
|
|
-// if (task.getProjectName() != null) {
|
|
|
|
-// taskName = "专题库【" + task.getProjectName() + "】导出 - " + task.getCreateName();
|
|
|
|
-// } else if (task.getReportName() != null) {
|
|
|
|
-// taskName = "报告【" + task.getReportName() + "】导出 - " + task.getCreateName();
|
|
|
|
-// }
|
|
|
|
-// task.setTaskName(taskName);
|
|
|
|
-// }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|