Jelajahi Sumber

集成邮件发送

lwhhszx 1 tahun lalu
induk
melakukan
44c19a2d2e

+ 4 - 2
pom.xml

@@ -235,10 +235,12 @@
             <groupId>org.springframework</groupId>
             <artifactId>spring-test</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
     </dependencies>
 
-
-
     <build>
         <finalName>PAS_PROD2.0</finalName>
         <plugins>

+ 27 - 0
src/main/java/cn/cslg/pas/common/config/MailConstants.java

@@ -0,0 +1,27 @@
+package cn.cslg.pas.common.config;
+
+public class MailConstants {
+    //消息投递中
+    public static final Integer DELIVERING = 0;
+
+    //消息投成功
+    public static final Integer SUCCESS = 1;
+
+    //消息投递失败
+    public static final Integer FAILURE = 2;
+
+    //最大重试次数
+    public static final Integer MAX_TRY_COUNT = 2;
+
+    //消息超时时间
+    public static final Integer MSG_TIMEOUT = 1;
+
+    //队列
+
+    //交换机
+    public static final String MAIL_EXCHANGE_NAME = "mail.exchange";
+
+    //路由键
+    public static final String MAIL_ROUTING_KEY_NAME = "mail.routing.key";
+
+}

+ 71 - 0
src/main/java/cn/cslg/pas/common/config/RabbitMQConfig.java

@@ -0,0 +1,71 @@
+package cn.cslg.pas.common.config;
+
+import org.springframework.amqp.core.*;
+import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
+import org.springframework.amqp.rabbit.connection.CorrelationData;
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RabbitMQConfig {
+//    private static final Logger LOGGER= LoggerFactory.getLogger(RabbitMQConfig.class);
+@Value("${queueName}")
+private String queueName;
+    @Autowired
+    private CachingConnectionFactory cachingConnectionFactory;
+
+//    @Autowired
+//    private IMailLogService mailLogService;
+
+    @Bean
+    public RabbitTemplate rabbitTemplate() {
+        RabbitTemplate rabbitTemplate = new RabbitTemplate(cachingConnectionFactory);
+        rabbitTemplate.setConfirmCallback(new RabbitTemplate.ConfirmCallback() {
+            /**
+             * 消息确认回调
+             * @param data 消息唯一标识
+             * @param ack  确认结果
+             * @param cause  失败原因
+             */
+            @Override
+            public void confirm(CorrelationData data, boolean ack, String cause) {
+                String msgId = data.getId();
+                if (ack) {
+//                    LOGGER.info("{}======>消息发送成功",msgId);
+//                    mailLogService.update(new UpdateWrapper<MailLog>()
+//                            .set("status",MailConstants.SUCCESS)
+//                            .eq("msgId",msgId));
+                } else {
+//                    LOGGER.error("{}======>消息发送失败",msgId);
+                }
+            }
+        });
+        rabbitTemplate.setReturnsCallback(new RabbitTemplate.ReturnsCallback() {
+
+            @Override
+            public void returnedMessage(ReturnedMessage returnedMessage) {
+//                LOGGER.error("{}======>消息发送queue时失败",message.getBody());
+            }
+        });
+        return rabbitTemplate;
+    }
+
+
+    @Bean
+    public Queue queue() {
+        return new Queue(queueName);
+    }
+
+    @Bean
+    public DirectExchange directExchange() {
+        return new DirectExchange(MailConstants.MAIL_EXCHANGE_NAME);
+    }
+
+    @Bean
+    public Binding binding() {
+        return BindingBuilder.bind(queue()).to(directExchange()).with(MailConstants.MAIL_ROUTING_KEY_NAME);
+    }
+}

+ 27 - 8
src/main/java/cn/cslg/pas/common/dto/PatentColumnDTO.java

@@ -1,6 +1,8 @@
 package cn.cslg.pas.common.dto;
 
+import cn.cslg.pas.common.vo.ContentVO;
 import cn.cslg.pas.domain.es.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -20,8 +22,7 @@ public class PatentColumnDTO {
     /**
      * 标题
      */
-    private String title;
-    private String titleOut;
+    private ContentVO title;
 
     /**
      * 公开说明书文本
@@ -33,11 +34,10 @@ public class PatentColumnDTO {
      */
     private List<Text> grantFullText;
 
-
     /**
      * 摘要
      */
-    private List<Text> abstractStr;
+    private ContentVO abstractStr;
 
     /**
      * 申请人地址
@@ -48,6 +48,7 @@ public class PatentColumnDTO {
      * 权利人地址
      */
     private PersonAddress rightHolderAddr;
+
     /**
      * 审查员
      */
@@ -61,7 +62,11 @@ public class PatentColumnDTO {
     /**
      * 实审日
      */
-    private Integer examinationDate;
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
+    private Date examinationDate;
 
     /**
      * 公开号
@@ -71,6 +76,10 @@ public class PatentColumnDTO {
     /**
      * 公开日
      */
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
     private Date publicDate;
 
     /**
@@ -81,6 +90,10 @@ public class PatentColumnDTO {
     /**
      * 申请日
      */
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
     private Date appDate;
 
     /**
@@ -91,6 +104,10 @@ public class PatentColumnDTO {
     /**
      * 授权日
      */
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
     private Date grantDate;
 
     /**
@@ -210,7 +227,7 @@ public class PatentColumnDTO {
     /**
      * 申请人
      */
-    private List<PatentPerson> applicant;
+    private List<String> applicant;
 
     /**
      * 标准申请人
@@ -230,7 +247,7 @@ public class PatentColumnDTO {
     /**
      * 权利人
      */
-    private List<PatentPerson> rightHolder;
+    private List<String> rightHolder;
     /**
      * 标准权利人
      */
@@ -249,7 +266,7 @@ public class PatentColumnDTO {
     /**
      * 发明人
      */
-    private List<PatentPerson> inventor;
+    private List<String> inventor;
     /**
      * 合并发明人
      */
@@ -348,4 +365,6 @@ public class PatentColumnDTO {
     List<Marking> markings;
 
     PatentJoin patentJoin;
+
+   private String pictureGuid;
 }

+ 26 - 0
src/main/java/cn/cslg/pas/common/utils/RabbitMQUtils.java

@@ -0,0 +1,26 @@
+package cn.cslg.pas.common.utils;
+
+import cn.cslg.pas.common.config.MailConstants;
+import org.springframework.amqp.rabbit.connection.CorrelationData;
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+@Component
+public class RabbitMQUtils {
+    @Autowired
+    private RabbitTemplate rabbitTemplate;
+    @Value("${queueName}")
+     private String queueName;
+    /**
+     * 向用户邮箱发送短信
+     *
+     * @param map 所需参数
+     */
+    public void sendEmailMessage(Map<String, Object> map) {
+        rabbitTemplate.convertAndSend(MailConstants.MAIL_EXCHANGE_NAME, MailConstants.MAIL_ROUTING_KEY_NAME, map, new CorrelationData("1"));
+    }
+}

+ 9 - 0
src/main/java/cn/cslg/pas/common/vo/ContentVO.java

@@ -0,0 +1,9 @@
+package cn.cslg.pas.common.vo;
+
+import lombok.Data;
+
+@Data
+public class ContentVO {
+    private String content;
+    private String contentOut;
+}

+ 1 - 1
src/main/java/cn/cslg/pas/service/business/ImportTaskService.java

@@ -194,7 +194,7 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
                         .setCurrentQuery(importTaskCondition.getSearchCondition())
                         .setOrderBy(importTaskCondition.getOrderBy())
                         .setOrderByType(importTaskCondition.getOrderByType())
-                        .setPageNum(0)
+                        .setPageNum(1)
                         .setRowCount(50)
                         .setDBType(importTaskCondition.getDbType());
 

+ 13 - 134
src/main/java/cn/cslg/pas/service/business/ProjectTaskService.java

@@ -264,140 +264,6 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
         }
     }
 
-//    /**
-//     * 根据任务id查询任务详情以及处理结果以及审核历史
-//     * @param taskId
-//     * @return
-//     */
-//    public TaskDetailsVO queryAuditHistory(Integer taskId) throws IOException {
-//        //新建返回VO类
-//        TaskDetailsVO taskDetailsVO = new TaskDetailsVO();
-//        List<HandleResultFileVO> handleResultFileVOS = new ArrayList<>();
-//        List<AuditHistoryVO> auditHistoryVOS = new ArrayList<>();
-//        //根据taskId查询此条任务详情
-//        ProjectTask currentTask = this.getById(taskId);
-//        //根据此条任务详情获取assoTaskId
-//        Integer assoTaskId = currentTask.getAssoTaskId();
-//        List<ProjectTask> allProjectTasks = new ArrayList<>();
-//        if (assoTaskId != null) {
-//            //根据assoTaskId获取最初任务的详情
-//            LambdaQueryWrapper<ProjectTask> assoTaskWrapper = new LambdaQueryWrapper<>();
-//            assoTaskWrapper.eq(ProjectTask::getId, assoTaskId);
-//            ProjectTaskVO projectTaskVO = new ProjectTaskVO();
-//            ProjectTask assoTask = this.list(assoTaskWrapper).get(0);
-//            if (assoTask != null) {
-//                //装载最初任务详情
-//                BeanUtils.copyProperties(assoTask, projectTaskVO);
-//                taskDetailsVO.setProjectTaskVO(projectTaskVO);
-//                if (assoTask.getType() == 7) {
-//                    //专利挖掘文件任务
-//                    LambdaQueryWrapper<PatentDigProjectFiles> queryWrapper = new LambdaQueryWrapper<>();
-//                    queryWrapper.eq(PatentDigProjectFiles::getTaskId, assoTask.getId());
-//                    List<PatentDigProjectFiles> patentDigProjectFiles = patentDigProjectFilesService.list(queryWrapper);
-//                    List<String> fileGuids = new ArrayList<>();
-//                    List<SystemFile> systemFiles = new ArrayList<>();
-//                    if (!patentDigProjectFiles.isEmpty()) {
-//                        fileGuids = patentDigProjectFiles.stream().map(PatentDigProjectFiles::getFileGuid).collect(Collectors.toList());
-//                    }
-//                    //调用文件系统查询文件信息接口
-//                    if (!fileGuids.isEmpty()) {
-//                        String res = fileManagerService.getSystemFileFromFMS(fileGuids);
-//                        systemFiles = JSONObject.parseArray(res, SystemFile.class);
-//                    }
-//                    if (!systemFiles.isEmpty()) {
-//                        for (PatentDigProjectFiles patentDigProjectFiles1 : patentDigProjectFiles) {
-//                            HandleResultFileVO handleResultFileVO = new HandleResultFileVO();
-//                            //装载文件信息
-//                            SystemFile systemFile = systemFiles.stream().filter(item -> item.getGuid().equals(patentDigProjectFiles1.getFileGuid())).findFirst().orElse(null);
-//                            if (systemFile != null) {
-//                                BeanUtils.copyProperties(patentDigProjectFiles1, handleResultFileVO);
-//                                handleResultFileVO.setGuid(patentDigProjectFiles1.getFileGuid());
-//                                handleResultFileVO.setType(systemFile.getType());
-//                                handleResultFileVO.setOriginalName(systemFile.getOriginalName());
-//                            }
-//                            handleResultFileVOS.add(handleResultFileVO);
-//                        }
-//                    }
-//                }
-//                //根据assoTaskId查询所有任务的id
-//                LambdaQueryWrapper<ProjectTask> allTaskWrapper = new LambdaQueryWrapper<>();
-//                allTaskWrapper.eq(ProjectTask::getAssoTaskId, assoTaskId);
-//                allProjectTasks = this.list(allTaskWrapper);
-//            }
-//        }
-//        //审核历史返回VO以及集合
-//        if (allProjectTasks != null) {
-//           for (ProjectTask item : allProjectTasks) {
-//               if (item != null) {
-//                   if (item.getId() != item.getAssoTaskId()) {
-//                       AuditHistoryVO auditHistoryVO = new AuditHistoryVO();
-//                       //任务详情VO
-//                       ProjectTaskVO auditHistoryTaskVO = new ProjectTaskVO();
-//                       BeanUtils.copyProperties(item, auditHistoryTaskVO);
-//                       //处理结果VO
-//                       TaskHandleResultVO taskHandleResultVO = new TaskHandleResultVO();
-//                       LambdaQueryWrapper<TaskHandleResult> queryWrapper = new LambdaQueryWrapper<>();
-//                       queryWrapper.eq(TaskHandleResult::getTaskId, item.getId());
-//                       List<TaskHandleResult> taskHandleResults = taskHandleResultService.list(queryWrapper);
-//                       if (taskHandleResults.size() != 0) {
-//                           TaskHandleResult taskHandleResult = taskHandleResults.get(0);
-//                           if (taskHandleResult != null) {
-//                               BeanUtils.copyProperties(taskHandleResult, taskHandleResultVO);
-//                               auditHistoryVO.setProjectTaskVO(auditHistoryTaskVO);
-//                               auditHistoryVO.setTaskHandleResultVO(taskHandleResultVO);
-//                           }
-//                       }
-//                       auditHistoryVOS.add(auditHistoryVO);
-//                   }
-//               }
-//            }
-//            taskDetailsVO.setAuditHistoryVOS(auditHistoryVOS);
-//        }
-//        //全部的文件信息(获取所有的任务的id,查出所有的结果id)
-//        List<Integer> allTaskIds = allProjectTasks.stream().map(ProjectTask::getId).collect(Collectors.toList());
-//        LambdaQueryWrapper<TaskHandleResult> queryWrapper = new LambdaQueryWrapper<>();
-//        queryWrapper.in(TaskHandleResult::getTaskId, allTaskIds);
-//        List<TaskHandleResult> taskHandleResults = taskHandleResultService.list(queryWrapper);
-//        List<Integer> resultIds = new ArrayList<>();
-//        if (taskHandleResults != null && !taskHandleResults.isEmpty()) {
-//            resultIds = taskHandleResults.stream().map(TaskHandleResult::getId).collect(Collectors.toList());
-//        }
-//        //根据所有的结果ids查询所有fileGuids
-//        if (resultIds != null && !resultIds.isEmpty()) {
-//            LambdaQueryWrapper<AssoHandleResultFile> allGuidsWrapper = new LambdaQueryWrapper<>();
-//            allGuidsWrapper.in(AssoHandleResultFile::getTaskHandleResultId, resultIds);
-//            List<AssoHandleResultFile> assoHandleResultFiles = assoHandleResultFileService.list(allGuidsWrapper);
-//            List<String> fileGuids = new ArrayList<>();
-//            List<SystemFile> systemFiles = new ArrayList<>();
-//            if (!assoHandleResultFiles.isEmpty()) {
-//                fileGuids = assoHandleResultFiles.stream().map(AssoHandleResultFile::getFileGuid).collect(Collectors.toList());
-//            }
-//            //调用文件系统查询文件信息接口
-//            if (!fileGuids.isEmpty()) {
-//                String res = fileManagerService.getSystemFileFromFMS(fileGuids);
-//                systemFiles = JSONObject.parseArray(res, SystemFile.class);
-//            }
-//            if (!systemFiles.isEmpty()) {
-//                for (AssoHandleResultFile assoHandleResultFile : assoHandleResultFiles) {
-//                    HandleResultFileVO handleResultFileVO = new HandleResultFileVO();
-//                    //装载文件信息
-//                    SystemFile systemFile = systemFiles.stream().filter(item -> item.getGuid().equals(assoHandleResultFile.getFileGuid())).findFirst().orElse(null);
-//                    if (systemFile != null) {
-//                        BeanUtils.copyProperties(assoHandleResultFile, handleResultFileVO);
-//                        handleResultFileVO.setGuid(assoHandleResultFile.getFileGuid());
-//                        handleResultFileVO.setType(systemFile.getType());
-//                        handleResultFileVO.setOriginalName(systemFile.getOriginalName());
-//                    }
-//                    handleResultFileVOS.add(handleResultFileVO);
-//                }
-//            }
-//        }
-//        taskDetailsVO.setSystemFileList(handleResultFileVOS);
-//        //装载名称
-//        this.loadTaskDetails(taskDetailsVO);
-//        return taskDetailsVO;
-//    }
-
 
     /**
      * 根据任务id查询任务详情以及处理结果以及审核历史
@@ -792,4 +658,17 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
         }
         return projects;
     }
+
+    /**
+     * TODO 添加侵权分析审核任务
+     */
+
+    public void addTortTask(){
+        //1.保存任务信息 project_task表
+        //2.保存任务和人员关联表信息
+        //3.从侵权分析中获得对比结果,并复制保存
+        //4.发送邮件通知协同人和抄送人
+
+    }
+
 }

+ 15 - 0
src/main/java/cn/cslg/pas/service/business/es/EsService.java

@@ -12,6 +12,7 @@ import cn.cslg.pas.common.model.request.MapRequest;
 import cn.cslg.pas.common.model.request.OrderDTO;
 import cn.cslg.pas.common.model.request.QueryRequest;
 import cn.cslg.pas.common.model.request.StringRequest;
+import cn.cslg.pas.common.utils.FormatUtil;
 import cn.cslg.pas.common.utils.parseQueryToTree.expressManager;
 import cn.cslg.pas.common.utils.parseQueryToTree.operateNode;
 import cn.cslg.pas.common.utils.parseQueryToTree.treeNode;
@@ -204,7 +205,9 @@ public class EsService {
 //            columnDTO.setPatentNo(esMess.getPatentNo());
             BeanUtils.copyProperties(esMess, columnDTO);
             list.add(columnDTO);
+
         }
+        this.loadCoulumnDTO(list);
         dto.setTotal(total);
         dto.setPatents(list);
         dto.setPageNum(current);
@@ -777,6 +780,18 @@ public class EsService {
         }
         return dto;
     }
+
+public List<PatentColumnDTO> loadCoulumnDTO(List<PatentColumnDTO> patentColumnDTOS){
+        patentColumnDTOS.forEach(item->{
+            item.setPictureGuid(FormatUtil.getPictureFormat(item.getAppNo()));
+
+        });
+
+return patentColumnDTOS;
+}
+
+
+
 }
 
 

+ 55 - 147
src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java

@@ -9,9 +9,11 @@ import cn.cslg.pas.common.model.cronModel.PersonnelVO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.model.importTaskModel.PatentApplicant;
 import cn.cslg.pas.common.utils.*;
+import cn.cslg.pas.common.vo.ContentVO;
 import cn.cslg.pas.common.vo.StarPatentVO;
 import cn.cslg.pas.domain.WebLoginConfig;
 import cn.cslg.pas.domain.business.RetrieveRecord;
+import cn.cslg.pas.domain.es.PatentPerson;
 import cn.cslg.pas.service.WebLoginConfigService;
 
 import cn.cslg.pas.service.query.FormatQueryService;
@@ -58,142 +60,6 @@ public class PatentStarApiService {
     private WebLoginConfigService webLoginConfigService;
     @Autowired
     private FormatQueryService formatQueryService;
-//
-//    //装载专利信息
-//    public void loadStarPatentVOS(List<StarPatentVO> starPatentVOS, JSONObject Data) {
-//        String aa = Data.toString();
-//        starPatentVOS.forEach(item -> {
-//            //专利类型
-//            Integer patentType = item.getPatentType();
-//            if (patentType != null) {
-//                if (patentType.equals(2) || patentType.equals(9)) {
-//                    item.setType("实用新型");
-//                } else if (patentType.equals(1) || patentType.equals(8)) {
-//                    item.setType("发明");
-//                } else if (patentType.equals(3)) {
-//                    item.setType("外观设计");
-//                }
-//            }
-//
-//            //如果有公开号,则将公开号作为专利号
-//            if (item.getApplicationNo() != null && !item.getApplicationNo().equals("") && item.getApplicationNo().contains("CN")) {
-//                item.setPatentNo(item.getApplicationNo());
-//            } else if (item.getPublicNo() != null && !item.getPublicNo().equals("")) {
-//                item.setPatentNo(item.getPublicNo());
-//                //如果没有公开号,但是有公告号,则将公告号作为公开号和专利号
-//            }
-//            if (item.getPublicAccreditNo() != null && !item.getPublicAccreditNo().equals("")) {
-//                if (item.getPublicNo() == null || item.getPublicNo().equals("")) {
-//                    item.setPublicNo(item.getPublicAccreditNo());
-//                }
-//                if (item.getPatentNo() == null) {
-//                    item.setPatentNo(item.getPublicAccreditNo());
-//                }
-//            } else {
-//                System.out.println("");
-//
-//            }
-//
-//            //如果没有公开日就将公告日作为公开日
-//            if (item.getPublicDate() == null || item.getPublicDate().equals("")) {
-//                item.setPublicDate(item.getPublicAccreditDate());
-//            }
-//            item.setApplicant(new ArrayList<>());
-//            item.setAgent(new ArrayList<>());
-//            item.setIpcList(Arrays.asList(item.getIpcListStr().split(";")));
-//            if (item.getApplicationAddress() == null) {
-//                item.setApplicationAddress("");
-//            }
-//
-//            List<String> applicationAddress = Arrays.asList(item.getApplicationAddress().split(";"));
-//            List<String> applicants = Arrays.asList(item.getApplicantStr().split(";"));
-//            //装载申请人
-//            for (int i = 0; i < applicants.size(); i++) {
-//                PatentApplicant patentApplicant = new PatentApplicant();
-//                patentApplicant.setType(2);
-//                patentApplicant.setDataType(2);
-//                patentApplicant.setName(applicants.get(i));
-//                if (applicationAddress.size() > i) {
-//                    patentApplicant.setAddressStr(applicationAddress.get(i));
-//                }
-//                item.getApplicant().add(patentApplicant);
-//            }
-//
-//            //装载权利人
-//            if (item.getCurrentApplicantStr() != null && !item.getCurrentApplicantStr().equals("")) {
-//                List<String> cApplicants = Arrays.asList(item.getCurrentApplicantStr().split(";"));
-//                cApplicants.forEach(
-//                        tem -> {
-//                            PatentApplicant patentApplicant = new PatentApplicant();
-//                            patentApplicant.setType(2);
-//                            patentApplicant.setDataType(1);
-//                            patentApplicant.setName(tem);
-//                            item.getApplicant().add(patentApplicant);
-//                        }
-//                );
-//            }
-//
-//            //优先权
-//            if (item.getPriorityNo() != null && !item.getPriorityNo().equals("")) {
-//
-//            }
-//
-//            //代理机构
-//            if (item.getAgencyStr() != null && !item.getAgencyStr().equals("")) {
-//                PatentAgency patentAgency = new PatentAgency();
-//                patentAgency.setName(item.getAgencyStr().split(" ")[0]);
-//                item.setAgency(patentAgency);
-//            }
-//
-//            //发明人
-//            if (item.getInventorStr() != null && !item.getInventorStr().equals("")) {
-//                item.setInventor(new ArrayList<>());
-//                List<String> inventors = Arrays.asList(item.getInventorStr().split(";"));
-//                inventors.forEach(
-//                        tem -> {
-//                            PatentInventor patentInventor = new PatentInventor();
-//                            patentInventor.setName(tem);
-//                            item.getInventor().add(patentInventor);
-//                            ;
-//                        }
-//                );
-//            }
-//
-//            //代理人
-//            if (item.getAgentStr() != null && !item.getAgentStr().equals("")) {
-//                List<String> agent = Arrays.asList(item.getAgentStr().split(";"));
-//                agent.forEach(
-//                        tem -> {
-//                            PatentAgent patentAgent = new PatentAgent();
-//                            patentAgent.setName(tem);
-//                            item.getAgent().add(patentAgent);
-//                        }
-//                );
-//            }
-//            //TODO 此处不调用取附图接口,(遍历调接口效率太低)  提出者:罗总
-//            //附图
-////            if (item.getApplicationNo() != null && item.getApplicationNo() != "") {
-////                String apN = item.getApplicationNo().replace(".", "");
-////
-////                //String path = this.getPictureApi(apN.substring(2));
-////                //item.setAbstractPath(path);
-////            }
-//            if (item.getLG() != null) {
-//                switch (item.getLG()) {
-//                    case 1:
-//                        item.setSimpleStatus("有效");
-//                        break;
-//                    case 2:
-//                        item.setSimpleStatus("失效");
-//                        break;
-//                    case 3:
-//                        item.setSimpleStatus("审中");
-//                        break;
-//                }
-//            }
-//            //法律状态
-//        });
-//    }
 
     public Records patentStarSearchLocal(PatentStarListDTO patentStarListDTO) throws IOException {
         RetrieveRecord retrieveRecord = new RetrieveRecord();
@@ -290,9 +156,6 @@ public class PatentStarApiService {
                 }
                 JSONObject Data = (JSONObject) jsonObject.get("Data");
                 List<StarPatentVO> starPatentVOS = JSONArray.parseArray(Data.get("List").toString(), StarPatentVO.class);
-//                this.loadStarPatentVOS(starPatentVOS, Data);
-                // 打印服务端返回结果
-                //  return Objects.requireNonNull(response.body()).string();
                 Map<String, Object> reMap = new HashMap<>();
                 reMap.put("size", PatentStarListDTO.getRowCount());
                 reMap.put("current", PatentStarListDTO.getPageNum());
@@ -891,7 +754,10 @@ public class PatentStarApiService {
             PatentColumnDTO patentColumnDTO = new PatentColumnDTO();
             //申请号
             patentColumnDTO.setAppNo(item.getApplicationNo());
-            patentColumnDTOS.add(patentColumnDTO);
+            //装载公开号
+            patentColumnDTO.setPublicNo(item.getPublicNo());
+            //装载公告号
+            patentColumnDTO.setGrantNo(item.getPublicAccreditNo());
             //装载专利号
             if (patentColumnDTO.getAppNo() != null) {
                 if (patentColumnDTO.getAppNo().trim().startsWith("CN")) {
@@ -899,24 +765,66 @@ public class PatentStarApiService {
                 } else {
                     if (patentColumnDTO.getPublicNo() != null) {
                         patentColumnDTO.setPatentNo(patentColumnDTO.getPublicNo());
-                    }
-                    else if(patentColumnDTO.getAgencyNo()!=null){
-                        patentColumnDTO.setPatentNo(patentColumnDTO.getAgencyNo());
-                    }
-                    else {
+                    } else if (patentColumnDTO.getGrantNo() != null) {
+                        patentColumnDTO.setPatentNo(patentColumnDTO.getGrantNo());
+                    } else {
                         patentColumnDTO.setPatentNo(patentColumnDTO.getAppNo());
                     }
                 }
 
             }
             //装载申请日
-            if(item.getApplicationDate()!=null&&item.getApplicationDate().trim().equals("")) {
+            if (item.getApplicationDate() != null && !item.getApplicationDate().trim().equals("")) {
                 patentColumnDTO.setAppDate(DateUtils.strToDate(item.getApplicationDate()));
             }
             //装载公开日
-            if(item.getPublicDate()!=null&&item.getPublicDate().trim().equals("")){
+            if (item.getPublicDate() != null && !item.getPublicDate().trim().equals("")) {
                 patentColumnDTO.setPublicDate(DateUtils.strToDate(item.getPublicDate()));
             }
+            //装载申请人
+            if (item.getApplicantStr() != null && !item.getApplicantStr().trim().equals("")) {
+                List<String> names = Arrays.asList(item.getApplicantStr().split(";"));
+                patentColumnDTO.setApplicant(names);
+
+            }
+            //装载发明人
+            if (item.getInventorStr() != null && !item.getInventorStr().trim().equals("")) {
+                List<String> names = Arrays.asList(item.getInventorStr().split(";"));
+                patentColumnDTO.setInventor(names);
+            }
+
+            //装载标题
+            if(item.getName()!=null){
+                ContentVO contentVO =new ContentVO();
+                contentVO.setContent(item.getName());
+                patentColumnDTO.setTitle(contentVO);
+            }
+
+            //装载权利人
+            if (item.getCurrentApplicantStr() != null && !item.getCurrentApplicantStr().trim().equals("")) {
+                List<String> names = Arrays.asList(item.getCurrentApplicantStr().split(";"));
+                patentColumnDTO.setRightHolder(names);
+            }
+
+            //装载摘要
+            if (item.getAbstractStr() != null && !item.getAbstractStr().trim().equals("")) {
+                ContentVO contentVO =new ContentVO();
+                contentVO.setContent(item.getAbstractStr());
+                patentColumnDTO.setAbstractStr(contentVO);
+            }
+
+            //装载代理人
+            if (item.getAgentStr() != null && !item.getAgentStr().trim().equals("")) {
+                List<String> names = Arrays.asList(item.getAgentStr().split(";"));
+                patentColumnDTO.setAgent(names);
+            }
+            //装载代理机构
+            if (item.getAgencyStr() != null && !item.getAgencyStr() .trim().equals("")) {
+                patentColumnDTO.setAgency(item.getAgencyStr() );
+            }
+
+
+            patentColumnDTOS.add(patentColumnDTO);
         });
 
         return patentColumnDTOS;

+ 5 - 0
src/main/resources/application-dev.yml

@@ -1,4 +1,9 @@
 spring:
+  rabbitmq:
+    host: 192.168.1.24
+    port: 5672
+    username: admin
+    password: 123456
   data:
    redis:
      host: 192.168.1.24

+ 1 - 1
src/main/resources/application.yml

@@ -44,4 +44,4 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
   mapper-locations: classpath:mapper/*.xml
-
+queueName: emailProd.queue

+ 38 - 62
src/main/resources/jsons/patent.json

@@ -38,7 +38,7 @@
   {
     "name": "授权号",
     "type": "String",
-    "value": "GN",
+    "value": "grantNo",
     "field": "GN",
     "esField": "grant_no",
     "esClass": "wildcardQueryBuilder",
@@ -49,8 +49,8 @@
   },
   {
     "name": "公开日",
-    "type": "String",
-    "value": "PD",
+    "type": "Date",
+    "value": "publicDate",
     "field": "PD",
     "esField": "public_date",
     "esClass": "dateQueryBuilder",
@@ -62,7 +62,7 @@
   {
     "name": "申请日",
     "type": "String",
-    "value": "AD",
+    "value": "appDate",
     "field": "AD",
     "esField": "app_date",
     "esClass": "dateQueryBuilder",
@@ -74,7 +74,7 @@
   {
     "name": "授权日",
     "type": "String",
-    "value": "GD",
+    "value": "grantDate",
     "field": "GD",
     "esField": "grant_date",
     "esClass": "dateQueryBuilder",
@@ -109,44 +109,20 @@
   },
   {
     "name": "摘要",
-    "type": "String",
-    "value": "TX",
-    "field": "abstractStr",
-    "esField": "abstract_str",
-    "esClass": "matchQueryBuilder",
-    "ifSearch": "false",
-    "ifGroup": "false",
-    "ifShow": "false",
-    "ifAsCondition": "true"
-  },
-  {
-    "name": "摘要内容",
-    "type": "String",
-    "value": "AB",
+    "type": "Object",
+    "value": "abstractStr",
     "field": "AB",
     "esField": "abstract_str.text_content",
     "esClass": "matchQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "false",
+    "ifShow": "true",
     "ifAsCondition": "true"
   },
   {
     "name": "标题",
-    "type": "String",
-    "value": "TX",
-    "field": "TX",
-    "esField": "title",
-    "esClass": "matchQueryBuilder",
-    "ifSearch": "false",
-    "ifGroup": "false",
-    "ifShow": "false",
-    "ifAsCondition": "true"
-  },
-  {
-    "name": "标题内容",
-    "type": "String",
-    "value": "TI",
+    "type": "Object",
+    "value": "title",
     "field": "TI",
     "esField": "title.text_content",
     "esClass": "matchQueryBuilder",
@@ -169,8 +145,8 @@
   },
   {
     "name": "申请人",
-    "type": "String",
-    "value": "PA",
+    "type": "Array",
+    "value": "applicant",
     "field": "PA",
     "esField": "applicant.name",
     "esClass": "nestedQueryBuilder",
@@ -181,8 +157,8 @@
   },
   {
     "name": "发明人",
-    "type": "String",
-    "value": "IN",
+    "type": "Array",
+    "value": "inventor",
     "field": "IN",
     "esField": "inventor.name",
     "esClass": "nestedQueryBuilder",
@@ -193,8 +169,8 @@
   },
   {
     "name": "权利人",
-    "type": "String",
-    "value": "PE",
+    "type": "Array",
+    "value": "rightHolder",
     "field": "PE",
     "esField": "right_holder.name",
     "esClass": "nestedQueryBuilder",
@@ -212,7 +188,7 @@
     "esClass": "matchQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -224,13 +200,13 @@
     "esClass": "matchQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
     "name": "代理机构",
     "type": "String",
-    "value": "AGN",
+    "value": "agency",
     "field": "AGN",
     "esField": "agency",
     "esClass": "matchQueryBuilder",
@@ -241,7 +217,7 @@
   },
   {
     "name": "代理人名称",
-    "type": "String",
+    "type": "Array",
     "value": "agent",
     "field": "agent",
     "esField": "agent",
@@ -284,7 +260,7 @@
     "esClass": "matchQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -296,7 +272,7 @@
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -308,7 +284,7 @@
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -320,7 +296,7 @@
     "esClass": "prefixQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -332,7 +308,7 @@
     "esClass": "prefixQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -344,7 +320,7 @@
     "esClass": "prefixQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -356,7 +332,7 @@
     "esClass": "matchQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -368,7 +344,7 @@
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -380,7 +356,7 @@
     "esClass": "prefixQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -392,7 +368,7 @@
     "esClass": "prefixQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -404,7 +380,7 @@
     "esClass": "prefixQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -428,7 +404,7 @@
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -440,7 +416,7 @@
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -452,7 +428,7 @@
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -464,7 +440,7 @@
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -476,7 +452,7 @@
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -488,7 +464,7 @@
     "esClass": "matchQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -500,7 +476,7 @@
     "esClass": "matchQueryBuilder",
     "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow": "true",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {

+ 17 - 1
src/test/java/cn/cslg/pas/service/CommonServiceTests.java

@@ -5,6 +5,7 @@ import cn.cslg.pas.common.model.request.QueryRequest;
 import cn.cslg.pas.common.model.request.StringRequest;
 import cn.cslg.pas.common.utils.FormatUtil;
 import cn.cslg.pas.common.utils.MathUtils;
+import cn.cslg.pas.common.utils.RabbitMQUtils;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.common.utils.esDataForm.AddressSplitter;
 import cn.cslg.pas.common.vo.DepartmentVO;
@@ -28,6 +29,7 @@ import org.springframework.boot.test.context.SpringBootTest;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -48,7 +50,8 @@ public class CommonServiceTests {
     private FormatQueryService formatQueryService;
     @Autowired
     private FileManagerService fileManagerService;
-
+    @Autowired
+    private RabbitMQUtils rabbitMQUtils;
     @Test
     void test() throws Exception {
         String aa = permissionService.getPersonIdByNamePCS("朱", false);
@@ -130,4 +133,17 @@ public class CommonServiceTests {
         System.out.println(personAddress);
     }
 
+    @Test
+    public void testEmail() throws Exception{
+
+        Map<String, Object> map = new LinkedHashMap<>();
+        map.put("title", "任务通知");
+        map.put("template", "mail/eTaskConfirm.html");
+        map.put("img", "\\src\\main\\resources\\mail\\logo.png");
+        map.put("value1", "李仁杰");
+        map.put("value2", "任务1");
+        map.put("email", "2232623707@qq.com");
+        rabbitMQUtils.sendEmailMessage(map);
+Thread.sleep(10000);
+    }
     }