|
|
@ -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)); |
|
|
|