Browse Source

论文专利药物疫苗数据入库

main
zhicheng.zhang 3 weeks ago
parent
commit
811a2b753c
  1. 6
      src/main/java/com/zyzs/otherdatasave/bean/Drug.java
  2. 29
      src/main/java/com/zyzs/otherdatasave/service/QueryDrug.java

6
src/main/java/com/zyzs/otherdatasave/bean/Drug.java

@ -22,8 +22,8 @@ public class Drug {
private String accessionDate;
private String storageConditions;
private List drugInteractions;
private List attachmentInstructions;
private List attachmentInstructionsfilePath;
private String attachmentInstructions;
private String attachmentInstructionsfilePath;
private String submission;
private String actionType;
private String submissionClassification;
@ -31,7 +31,7 @@ public class Drug {
private String lettersReviewsLabels;
private String notes ;
private String structure;
private List structurefilePath;
private String structurefilePath;
private long createTime;
private String createTimeStr;
private long crawlTime;

29
src/main/java/com/zyzs/otherdatasave/service/QueryDrug.java

@ -5,6 +5,7 @@ import com.bfd.crawler.elasti.ElastiProducerHigh;
import com.bfd.crawler.utils.JsonUtils;
import com.zyzs.otherdatasave.bean.Drug;
import com.zyzs.otherdatasave.cache.Constants;
import com.zyzs.otherdatasave.util.AllLIst;
import com.zyzs.otherdatasave.util.DataCheckUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -45,18 +46,21 @@ public class QueryDrug {
dru.setDrugInteractions((List) messageMap.get("drugInteractions"));
} finally {
}
List attachmentInstructions=new ArrayList();
String attachmentInstructionsa= messageMap.get("attachmentInstructions").toString();
if(attachmentInstructionsa.length()>5){
attachmentInstructions.add(messageMap.get("attachmentInstructions").toString());
dru.setAttachmentInstructions(messageMap.get("attachmentInstructions").toString());
}
dru.setAttachmentInstructions(attachmentInstructions);
List attachmentInstructionsPath=new ArrayList();
String attachmentInstructionsfilePath = (String) messageMap.get("attachmentInstructionsfilePath");
if (attachmentInstructionsfilePath.length()>5){
attachmentInstructionsPath.add((String) messageMap.get("attachmentInstructionsfilePath"));
dru.setAttachmentInstructions(messageMap.get("attachmentInstructionsfilePath").toString());
}
String structurefilePath = (String) messageMap.get("structurefilePath");
if (structurefilePath.length()>5){
dru.setStructure(messageMap.get("structurefilePath").toString());
}
dru.setAttachmentInstructions(attachmentInstructionsPath);
dru.setSubmission((String) messageMap.get("submission"));
dru.setActionType((String) messageMap.get("actionType"));
dru.setSubmissionClassification((String) messageMap.get("submissionClassification"));
@ -72,14 +76,17 @@ public class QueryDrug {
dru.setWeight((String) messageMap.get("weight"));
dru.setChemicalFormula((String) messageMap.get("chemicalFormula"));
dru.setCrawlUrl((String) messageMap.get("crawlUrl"));
String docid = GetMD5Code((String) messageMap.get("drugName")+(String) messageMap.get("strength"));
String docid = GetMD5Code((String) messageMap.get("drugName")+(String) messageMap.get("strength")+(String) messageMap.get("keywords"));
dru.setDocId(docid);
dru.setDataId(docid);
dru.set_id_(docid);
dru.setIsShow("20250512");
LOGGER.info("Parse QueryDrug={}", JSONObject.toJSON(dru));
ElastiProducerHigh elastiProducer = ElastiProducerHigh.getInstance(1, 3, "cl_special_1.0_drug_crb","_doc" );
elastiProducer.sendMessageToEs(JsonUtils.toJSONString(dru));
dru.setIsShow("2025029");
if (AllLIst.getMap().contains(messageMap.get("keywords"))){
LOGGER.info("Parse QueryDrug={}", JSONObject.toJSON(dru));
ElastiProducerHigh elastiProducer = ElastiProducerHigh.getInstance(1, 3, "cl_special_1.0_drug_crb","_doc" );
elastiProducer.sendMessageToEs(JsonUtils.toJSONString(dru));
}
} catch (Exception e) {
LOGGER.error("ERROR QueryDrug={}", JSONObject.toJSON(messageMap));

Loading…
Cancel
Save