diff --git a/.gitignore b/.gitignore index ed8368a..6a555ee 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ nbdist/ !*/build/*.java !*/build/*.html !*/build/*.xml +/d2d/ diff --git a/src/main/java/com/alihealth/d2d/provtest/controller/ProvTestServerController.java b/src/main/java/com/alihealth/d2d/provtest/controller/ProvTestServerController.java index e2c1bf2..b1ff539 100644 --- a/src/main/java/com/alihealth/d2d/provtest/controller/ProvTestServerController.java +++ b/src/main/java/com/alihealth/d2d/provtest/controller/ProvTestServerController.java @@ -6,6 +6,7 @@ import com.alihealth.d2d.provtest.enums.BuzStatusEnum; import com.alihealth.d2d.provtest.enums.EventTypeEnum; import com.alihealth.d2d.provtest.enums.SubTypeEnum; import com.alihealth.d2d.provtest.service.*; +import com.alihealth.d2d.provtest.service.impl.EventProcessingServiceImpl; import com.alihealth.d2d.provtest.utils.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,7 +37,7 @@ public class ProvTestServerController { @Autowired - private IEventProcessingService processingService; + private EventProcessingServiceImpl processingService; @RequestMapping("/receive") public @ResponseBody diff --git a/src/main/java/com/alihealth/d2d/provtest/service/AbroadPharmaBaseInfoService.java b/src/main/java/com/alihealth/d2d/provtest/service/AbroadPharmaBaseInfoService.java deleted file mode 100644 index 8b3ab35..0000000 --- a/src/main/java/com/alihealth/d2d/provtest/service/AbroadPharmaBaseInfoService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.alihealth.d2d.provtest.service; - -import com.alihealth.d2d.provtest.domain.AbroadPharmaBaseInfo; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - * 境外药品生产企业基本信息数据子集(AbroadPharmaBaseInfo)表服务接口 - * - * @author makejava - * @since 2025-06-10 14:48:29 - */ -public interface AbroadPharmaBaseInfoService extends IService { - -} - diff --git a/src/main/java/com/alihealth/d2d/provtest/service/EventProcessingService.java b/src/main/java/com/alihealth/d2d/provtest/service/EventProcessingService.java deleted file mode 100644 index 1a56343..0000000 --- a/src/main/java/com/alihealth/d2d/provtest/service/EventProcessingService.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.alihealth.d2d.provtest.service; - -import com.alihealth.d2d.provtest.domain.DomesticPharmaBaseInfo; -import com.alihealth.d2d.provtest.entity.VTTSBasic; -import com.alihealth.d2d.provtest.entity.VTTSEventS; -import com.alihealth.d2d.provtest.factory.EventHandlerFactory; -import com.alihealth.d2d.provtest.service.handle.EventDataHandler; -import com.alihealth.d2d.provtest.utils.EventPojo; -import lombok.RequiredArgsConstructor; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -/** - * @author Jason 事件主处理服务 - * @date 2025年06月05日 11:28:56 - */ -@Service -@RequiredArgsConstructor -public class EventProcessingService { - - private final XmlParserService xmlParserService; - private final EventHandlerFactory handlerFactory; - - /** - * 解析xml并处理接收的事件 - * @param eventPojo - * @param xml - * @param eventId - */ - @Async - public void processEvent(EventPojo eventPojo, String xml,String eventId) { - EventDataHandler handler = handlerFactory.getHandler(eventPojo.getSubType()); - if(eventPojo.getSubType().startsWith("20")) {//应用数据 - VTTSEventS eventS = null; - try { - eventS = xmlParserService.parseAppDataXml(xml); - } catch (Exception e) { - throw new RuntimeException(e); - } - handler.handle(eventS); - }else{ - handler.handleBase(xml,eventId); - } - - } - -} diff --git a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1011Handler.java b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1011Handler.java index a0d99d7..353e19a 100644 --- a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1011Handler.java +++ b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1011Handler.java @@ -3,7 +3,7 @@ package com.alihealth.d2d.provtest.service.handle.business; import com.alihealth.d2d.provtest.domain.DomesticPharmaBaseInfo; import com.alihealth.d2d.provtest.entity.*; import com.alihealth.d2d.provtest.service.IDomesticPharmaBaseInfoService; -import com.alihealth.d2d.provtest.service.XmlParserService; +import com.alihealth.d2d.provtest.service.impl.XmlParserServiceImpl; import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler; import com.alihealth.d2d.provtest.service.handle.EventSubType; import com.baomidou.mybatisplus.extension.service.IService; @@ -27,7 +27,7 @@ public class SubType1011Handler extends AbstractEventDataHandler getEntityClass() { @@ -51,7 +51,7 @@ public class SubType1011Handler extends AbstractEventDataHandler result = xmlParserService.parseDataXml( + VTTSBasic result = xmlParserServiceImpl.parseDataXml( xml, DomesticPharmaBaseInfo.class ); diff --git a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1012Handler.java b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1012Handler.java index 9efe345..e5647a5 100644 --- a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1012Handler.java +++ b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1012Handler.java @@ -6,7 +6,7 @@ import com.alihealth.d2d.provtest.entity.InstanceDetail; import com.alihealth.d2d.provtest.entity.ItemDetail; import com.alihealth.d2d.provtest.entity.VTTSBasic; import com.alihealth.d2d.provtest.service.IAbroadPharmaBaseInfoService; -import com.alihealth.d2d.provtest.service.XmlParserService; +import com.alihealth.d2d.provtest.service.impl.XmlParserServiceImpl; import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler; import com.alihealth.d2d.provtest.service.handle.EventSubType; import com.baomidou.mybatisplus.extension.service.IService; @@ -30,7 +30,7 @@ public class SubType1012Handler extends AbstractEventDataHandler getEntityClass() { @@ -54,7 +54,7 @@ public class SubType1012Handler extends AbstractEventDataHandler result = xmlParserService.parseDataXml( + VTTSBasic result = xmlParserServiceImpl.parseDataXml( xml, AbroadPharmaBaseInfo.class ); diff --git a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1013Handler.java b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1013Handler.java index 541bccc..2b8baae 100644 --- a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1013Handler.java +++ b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1013Handler.java @@ -6,7 +6,7 @@ import com.alihealth.d2d.provtest.entity.InstanceDetail; import com.alihealth.d2d.provtest.entity.ItemDetail; import com.alihealth.d2d.provtest.entity.VTTSBasic; import com.alihealth.d2d.provtest.service.IPharmaceuticalProductionLicenseBaseInfoService; -import com.alihealth.d2d.provtest.service.XmlParserService; +import com.alihealth.d2d.provtest.service.impl.XmlParserServiceImpl; import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler; import com.alihealth.d2d.provtest.service.handle.EventSubType; import com.baomidou.mybatisplus.extension.service.IService; @@ -30,7 +30,7 @@ public class SubType1013Handler extends AbstractEventDataHandler getEntityClass() { @@ -54,7 +54,7 @@ public class SubType1013Handler extends AbstractEventDataHandler result = xmlParserService.parseDataXml( + VTTSBasic result = xmlParserServiceImpl.parseDataXml( xml, PharmaceuticalProductionLicenseBaseInfo.class ); diff --git a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1014Handler.java b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1014Handler.java index 3b24535..a413705 100644 --- a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1014Handler.java +++ b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1014Handler.java @@ -6,7 +6,7 @@ import com.alihealth.d2d.provtest.entity.InstanceDetail; import com.alihealth.d2d.provtest.entity.ItemDetail; import com.alihealth.d2d.provtest.entity.VTTSBasic; import com.alihealth.d2d.provtest.service.IPharmaceuticalTradingEnterprisesService; -import com.alihealth.d2d.provtest.service.XmlParserService; +import com.alihealth.d2d.provtest.service.impl.XmlParserServiceImpl; import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler; import com.alihealth.d2d.provtest.service.handle.EventSubType; import com.baomidou.mybatisplus.extension.service.IService; @@ -30,7 +30,7 @@ public class SubType1014Handler extends AbstractEventDataHandler getEntityClass() { @@ -54,7 +54,7 @@ public class SubType1014Handler extends AbstractEventDataHandler result = xmlParserService.parseDataXml( + VTTSBasic result = xmlParserServiceImpl.parseDataXml( xml, PharmaceuticalTradingEnterprises.class ); diff --git a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1015Handler.java b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1015Handler.java index 469ed67..40dc007 100644 --- a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1015Handler.java +++ b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1015Handler.java @@ -6,7 +6,7 @@ import com.alihealth.d2d.provtest.entity.InstanceDetail; import com.alihealth.d2d.provtest.entity.ItemDetail; import com.alihealth.d2d.provtest.entity.VTTSBasic; import com.alihealth.d2d.provtest.service.IPharmaceuticalTradingLicenseBaseInfoService; -import com.alihealth.d2d.provtest.service.XmlParserService; +import com.alihealth.d2d.provtest.service.impl.XmlParserServiceImpl; import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler; import com.alihealth.d2d.provtest.service.handle.EventSubType; import com.baomidou.mybatisplus.extension.service.IService; @@ -30,7 +30,7 @@ public class SubType1015Handler extends AbstractEventDataHandler getEntityClass() { @@ -54,7 +54,7 @@ public class SubType1015Handler extends AbstractEventDataHandler result = xmlParserService.parseDataXml( + VTTSBasic result = xmlParserServiceImpl.parseDataXml( xml, PharmaceuticalTradingLicenseBaseInfo.class ); diff --git a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1016Handler.java b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1016Handler.java index 6b7bbca..13d8e30 100644 --- a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1016Handler.java +++ b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1016Handler.java @@ -6,7 +6,7 @@ import com.alihealth.d2d.provtest.entity.InstanceDetail; import com.alihealth.d2d.provtest.entity.ItemDetail; import com.alihealth.d2d.provtest.entity.VTTSBasic; import com.alihealth.d2d.provtest.service.IDrugDeliveryCompanyBaseInfoService; -import com.alihealth.d2d.provtest.service.XmlParserService; +import com.alihealth.d2d.provtest.service.impl.XmlParserServiceImpl; import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler; import com.alihealth.d2d.provtest.service.handle.EventSubType; import com.baomidou.mybatisplus.extension.service.IService; @@ -30,7 +30,7 @@ public class SubType1016Handler extends AbstractEventDataHandler getEntityClass() { @@ -54,7 +54,7 @@ public class SubType1016Handler extends AbstractEventDataHandler result = xmlParserService.parseDataXml( + VTTSBasic result = xmlParserServiceImpl.parseDataXml( xml, DrugDeliveryCompanyBaseInfo.class ); diff --git a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1017Handler.java b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1017Handler.java index 51ec64e..ef5d23b 100644 --- a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1017Handler.java +++ b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1017Handler.java @@ -6,7 +6,7 @@ import com.alihealth.d2d.provtest.entity.InstanceDetail; import com.alihealth.d2d.provtest.entity.ItemDetail; import com.alihealth.d2d.provtest.entity.VTTSBasic; import com.alihealth.d2d.provtest.service.IDrugUsingUnitBaseInfoService; -import com.alihealth.d2d.provtest.service.XmlParserService; +import com.alihealth.d2d.provtest.service.impl.XmlParserServiceImpl; import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler; import com.alihealth.d2d.provtest.service.handle.EventSubType; import com.baomidou.mybatisplus.extension.service.IService; @@ -30,7 +30,7 @@ public class SubType1017Handler extends AbstractEventDataHandler getEntityClass() { @@ -54,7 +54,7 @@ public class SubType1017Handler extends AbstractEventDataHandler result = xmlParserService.parseDataXml( + VTTSBasic result = xmlParserServiceImpl.parseDataXml( xml, DrugUsingUnitBaseInfo.class ); diff --git a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1018Handler.java b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1018Handler.java index 5635848..f47c9b4 100644 --- a/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1018Handler.java +++ b/src/main/java/com/alihealth/d2d/provtest/service/handle/business/SubType1018Handler.java @@ -6,7 +6,7 @@ import com.alihealth.d2d.provtest.entity.InstanceDetail; import com.alihealth.d2d.provtest.entity.ItemDetail; import com.alihealth.d2d.provtest.entity.VTTSBasic; import com.alihealth.d2d.provtest.service.IDomesticDrugBaseInfoService; -import com.alihealth.d2d.provtest.service.XmlParserService; +import com.alihealth.d2d.provtest.service.impl.XmlParserServiceImpl; import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler; import com.alihealth.d2d.provtest.service.handle.EventSubType; import com.baomidou.mybatisplus.extension.service.IService; @@ -30,7 +30,7 @@ public class SubType1018Handler extends AbstractEventDataHandler getEntityClass() { @@ -54,7 +54,7 @@ public class SubType1018Handler extends AbstractEventDataHandler result = xmlParserService.parseDataXml( + VTTSBasic result = xmlParserServiceImpl.parseDataXml( xml, DomesticDrugBaseInfo.class ); diff --git a/src/main/java/com/alihealth/d2d/provtest/service/IEventProcessingService.java b/src/main/java/com/alihealth/d2d/provtest/service/impl/EventProcessingServiceImpl.java similarity index 84% rename from src/main/java/com/alihealth/d2d/provtest/service/IEventProcessingService.java rename to src/main/java/com/alihealth/d2d/provtest/service/impl/EventProcessingServiceImpl.java index 1a0c79e..8604b9c 100644 --- a/src/main/java/com/alihealth/d2d/provtest/service/IEventProcessingService.java +++ b/src/main/java/com/alihealth/d2d/provtest/service/impl/EventProcessingServiceImpl.java @@ -1,4 +1,4 @@ -package com.alihealth.d2d.provtest.service; +package com.alihealth.d2d.provtest.service.impl; import com.alihealth.d2d.provtest.entity.VTTSEventS; import com.alihealth.d2d.provtest.factory.EventHandlerFactory; @@ -14,9 +14,9 @@ import org.springframework.stereotype.Service; */ @Service @RequiredArgsConstructor -public class IEventProcessingService { +public class EventProcessingServiceImpl { - private final XmlParserService xmlParserService; + private final XmlParserServiceImpl xmlParserServiceImpl; private final EventHandlerFactory handlerFactory; /** @@ -31,7 +31,7 @@ public class IEventProcessingService { if(eventPojo.getSubType().startsWith("20")) {//应用数据 VTTSEventS eventS = null; try { - eventS = xmlParserService.parseAppDataXml(xml); + eventS = xmlParserServiceImpl.parseAppDataXml(xml); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/src/main/java/com/alihealth/d2d/provtest/service/XmlParserService.java b/src/main/java/com/alihealth/d2d/provtest/service/impl/XmlParserServiceImpl.java similarity index 98% rename from src/main/java/com/alihealth/d2d/provtest/service/XmlParserService.java rename to src/main/java/com/alihealth/d2d/provtest/service/impl/XmlParserServiceImpl.java index 16c0a29..4276b68 100644 --- a/src/main/java/com/alihealth/d2d/provtest/service/XmlParserService.java +++ b/src/main/java/com/alihealth/d2d/provtest/service/impl/XmlParserServiceImpl.java @@ -1,4 +1,4 @@ -package com.alihealth.d2d.provtest.service; +package com.alihealth.d2d.provtest.service.impl; import com.alihealth.d2d.provtest.domain.DomesticPharmaBaseInfo; import com.alihealth.d2d.provtest.entity.VTTSBasic; @@ -26,7 +26,7 @@ import java.util.stream.Collectors; * @date 2025年05月30日 11:41:26 */ @Service -public class XmlParserService { +public class XmlParserServiceImpl { protected final Logger log = LoggerFactory.getLogger(getClass()); private static final Map, JAXBContext> CONTEXT_CACHE = new ConcurrentHashMap<>();