|
|
@@ -0,0 +1,94 @@
|
|
|
+package cn.cslg.pas.service.quartzService;
|
|
|
+
|
|
|
+import cn.cslg.pas.common.core.base.Cycle;
|
|
|
+import cn.cslg.pas.common.model.report.QueryMatchCasePersonDTO;
|
|
|
+import cn.cslg.pas.common.model.report.QueryMatchCasePersonVO;
|
|
|
+import cn.cslg.pas.common.utils.DateUtils2;
|
|
|
+import cn.cslg.pas.common.utils.utilVO.CheckDateConditionVO;
|
|
|
+import cn.cslg.pas.domain.business.ImportTaskCondition;
|
|
|
+import cn.cslg.pas.domain.business.PatentProject;
|
|
|
+import cn.cslg.pas.domain.business.ReportAffair;
|
|
|
+import cn.cslg.pas.domain.business.ReportProject;
|
|
|
+import cn.cslg.pas.domain.report.MatchCasePerson;
|
|
|
+import cn.cslg.pas.mapper.ReportAffairMapper;
|
|
|
+import cn.cslg.pas.service.MailSendService;
|
|
|
+import cn.cslg.pas.service.business.ImportTaskConditionService;
|
|
|
+import cn.cslg.pas.service.business.ImportTaskService;
|
|
|
+import cn.cslg.pas.service.business.PatentProjectService;
|
|
|
+import cn.cslg.pas.service.business.ReportProjectService;
|
|
|
+import cn.cslg.pas.service.report.MatchCasePersonService;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.quartz.DisallowConcurrentExecution;
|
|
|
+import org.quartz.JobExecutionContext;
|
|
|
+import org.quartz.JobExecutionException;
|
|
|
+import org.springframework.scheduling.quartz.QuartzJobBean;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+
|
|
|
+@DisallowConcurrentExecution
|
|
|
+@RequiredArgsConstructor
|
|
|
+@Service
|
|
|
+public class SysReportNoticeJobService extends QuartzJobBean {
|
|
|
+ private final ImportTaskConditionService importTaskConditionService;
|
|
|
+ private final ImportTaskService importTaskService;
|
|
|
+ private final PatentProjectService patentProjectService;
|
|
|
+ private final MailSendService mailSendService;
|
|
|
+ private final ReportProjectService reportProjectService;
|
|
|
+ private final ReportAffairMapper reportAffairMapper;
|
|
|
+ private final MatchCasePersonService matchCasePersonService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void executeInternal(JobExecutionContext context) throws JobExecutionException {
|
|
|
+
|
|
|
+ mailSendService.sendSysCycleStartEmail("报告节点监控开始");
|
|
|
+ System.out.println("task start");
|
|
|
+ this.reportNotice();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void reportNotice() {
|
|
|
+ Long current = 1l;
|
|
|
+ Long size = 0l;
|
|
|
+ IPage<ReportProject> reportProjectIPage = reportProjectService.page(new Page<>(1, 10));
|
|
|
+ Long total = reportProjectIPage.getTotal();
|
|
|
+ Long page = total / size;
|
|
|
+ if (page % size != 0) {
|
|
|
+ page += 1;
|
|
|
+ }
|
|
|
+ while (current <= page) {
|
|
|
+ try {
|
|
|
+ IPage<ReportProject> reportProjectIPage1 = reportProjectService.page(new Page<>(1, 10));
|
|
|
+ List<ReportProject> reportProjects = reportProjectIPage1.getRecords();
|
|
|
+ for (ReportProject reportProject : reportProjects) {
|
|
|
+
|
|
|
+ Integer projectId = reportProject.getProjectId();
|
|
|
+ List<ReportAffair> reportAffairs = reportAffairMapper.queryShouldNoticeAffair(projectId);
|
|
|
+ if (reportAffairs != null && reportAffairs.size() > 0) {
|
|
|
+ ReportAffair reportAffair = reportAffairs.get(0);
|
|
|
+ QueryMatchCasePersonDTO queryMatchCasePersonDTO = new QueryMatchCasePersonDTO();
|
|
|
+ queryMatchCasePersonDTO.setReportId(projectId);
|
|
|
+ List<QueryMatchCasePersonVO> queryMatchCasePersonVOS = matchCasePersonService.getReportMatchCasePerson(queryMatchCasePersonDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ current += 1;
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void sendEmail(Integer project,ReportAffair reportAffair, List<QueryMatchCasePersonVO> queryMatchCasePersonVOS){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|