修改代码
This commit is contained in:
parent
f2a86383cf
commit
56a9a2463d
|
@ -45,3 +45,4 @@ nbdist/
|
|||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
!*/build/*.xml
|
||||
/d2d/
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<AbroadPharmaBaseInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -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<DomesticPharmaB
|
|||
private IDomesticPharmaBaseInfoService service;
|
||||
|
||||
@Autowired
|
||||
private XmlParserService xmlParserService;
|
||||
private XmlParserServiceImpl xmlParserServiceImpl;
|
||||
|
||||
@Override
|
||||
protected Class<DomesticPharmaBaseInfo> getEntityClass() {
|
||||
|
@ -51,7 +51,7 @@ public class SubType1011Handler extends AbstractEventDataHandler<DomesticPharmaB
|
|||
|
||||
@Override
|
||||
public void handleBase(String xml,String eventId) {
|
||||
VTTSBasic<DomesticPharmaBaseInfo> result = xmlParserService.parseDataXml(
|
||||
VTTSBasic<DomesticPharmaBaseInfo> result = xmlParserServiceImpl.parseDataXml(
|
||||
xml,
|
||||
DomesticPharmaBaseInfo.class
|
||||
);
|
||||
|
|
|
@ -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<AbroadPharmaBas
|
|||
private IAbroadPharmaBaseInfoService service;
|
||||
|
||||
@Autowired
|
||||
private XmlParserService xmlParserService;
|
||||
private XmlParserServiceImpl xmlParserServiceImpl;
|
||||
|
||||
@Override
|
||||
protected Class<AbroadPharmaBaseInfo> getEntityClass() {
|
||||
|
@ -54,7 +54,7 @@ public class SubType1012Handler extends AbstractEventDataHandler<AbroadPharmaBas
|
|||
|
||||
@Override
|
||||
public void handleBase(String xml,String eventId) {
|
||||
VTTSBasic<AbroadPharmaBaseInfo> result = xmlParserService.parseDataXml(
|
||||
VTTSBasic<AbroadPharmaBaseInfo> result = xmlParserServiceImpl.parseDataXml(
|
||||
xml,
|
||||
AbroadPharmaBaseInfo.class
|
||||
);
|
||||
|
|
|
@ -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<PharmaceuticalP
|
|||
private IPharmaceuticalProductionLicenseBaseInfoService service;
|
||||
|
||||
@Autowired
|
||||
private XmlParserService xmlParserService;
|
||||
private XmlParserServiceImpl xmlParserServiceImpl;
|
||||
|
||||
@Override
|
||||
protected Class<PharmaceuticalProductionLicenseBaseInfo> getEntityClass() {
|
||||
|
@ -54,7 +54,7 @@ public class SubType1013Handler extends AbstractEventDataHandler<PharmaceuticalP
|
|||
|
||||
@Override
|
||||
public void handleBase(String xml,String eventId) {
|
||||
VTTSBasic<PharmaceuticalProductionLicenseBaseInfo> result = xmlParserService.parseDataXml(
|
||||
VTTSBasic<PharmaceuticalProductionLicenseBaseInfo> result = xmlParserServiceImpl.parseDataXml(
|
||||
xml,
|
||||
PharmaceuticalProductionLicenseBaseInfo.class
|
||||
);
|
||||
|
|
|
@ -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<PharmaceuticalT
|
|||
private IPharmaceuticalTradingEnterprisesService service;
|
||||
|
||||
@Autowired
|
||||
private XmlParserService xmlParserService;
|
||||
private XmlParserServiceImpl xmlParserServiceImpl;
|
||||
|
||||
@Override
|
||||
protected Class<PharmaceuticalTradingEnterprises> getEntityClass() {
|
||||
|
@ -54,7 +54,7 @@ public class SubType1014Handler extends AbstractEventDataHandler<PharmaceuticalT
|
|||
|
||||
@Override
|
||||
public void handleBase(String xml,String eventId) {
|
||||
VTTSBasic<PharmaceuticalTradingEnterprises> result = xmlParserService.parseDataXml(
|
||||
VTTSBasic<PharmaceuticalTradingEnterprises> result = xmlParserServiceImpl.parseDataXml(
|
||||
xml,
|
||||
PharmaceuticalTradingEnterprises.class
|
||||
);
|
||||
|
|
|
@ -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<PharmaceuticalT
|
|||
private IPharmaceuticalTradingLicenseBaseInfoService service;
|
||||
|
||||
@Autowired
|
||||
private XmlParserService xmlParserService;
|
||||
private XmlParserServiceImpl xmlParserServiceImpl;
|
||||
|
||||
@Override
|
||||
protected Class<PharmaceuticalTradingLicenseBaseInfo> getEntityClass() {
|
||||
|
@ -54,7 +54,7 @@ public class SubType1015Handler extends AbstractEventDataHandler<PharmaceuticalT
|
|||
|
||||
@Override
|
||||
public void handleBase(String xml,String eventId) {
|
||||
VTTSBasic<PharmaceuticalTradingLicenseBaseInfo> result = xmlParserService.parseDataXml(
|
||||
VTTSBasic<PharmaceuticalTradingLicenseBaseInfo> result = xmlParserServiceImpl.parseDataXml(
|
||||
xml,
|
||||
PharmaceuticalTradingLicenseBaseInfo.class
|
||||
);
|
||||
|
|
|
@ -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<DrugDeliveryCom
|
|||
private IDrugDeliveryCompanyBaseInfoService service;
|
||||
|
||||
@Autowired
|
||||
private XmlParserService xmlParserService;
|
||||
private XmlParserServiceImpl xmlParserServiceImpl;
|
||||
|
||||
@Override
|
||||
protected Class<DrugDeliveryCompanyBaseInfo> getEntityClass() {
|
||||
|
@ -54,7 +54,7 @@ public class SubType1016Handler extends AbstractEventDataHandler<DrugDeliveryCom
|
|||
|
||||
@Override
|
||||
public void handleBase(String xml,String eventId) {
|
||||
VTTSBasic<DrugDeliveryCompanyBaseInfo> result = xmlParserService.parseDataXml(
|
||||
VTTSBasic<DrugDeliveryCompanyBaseInfo> result = xmlParserServiceImpl.parseDataXml(
|
||||
xml,
|
||||
DrugDeliveryCompanyBaseInfo.class
|
||||
);
|
||||
|
|
|
@ -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<DrugUsingUnitBa
|
|||
private IDrugUsingUnitBaseInfoService service;
|
||||
|
||||
@Autowired
|
||||
private XmlParserService xmlParserService;
|
||||
private XmlParserServiceImpl xmlParserServiceImpl;
|
||||
|
||||
@Override
|
||||
protected Class<DrugUsingUnitBaseInfo> getEntityClass() {
|
||||
|
@ -54,7 +54,7 @@ public class SubType1017Handler extends AbstractEventDataHandler<DrugUsingUnitBa
|
|||
|
||||
@Override
|
||||
public void handleBase(String xml,String eventId) {
|
||||
VTTSBasic<DrugUsingUnitBaseInfo> result = xmlParserService.parseDataXml(
|
||||
VTTSBasic<DrugUsingUnitBaseInfo> result = xmlParserServiceImpl.parseDataXml(
|
||||
xml,
|
||||
DrugUsingUnitBaseInfo.class
|
||||
);
|
||||
|
|
|
@ -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<DomesticDrugBas
|
|||
private IDomesticDrugBaseInfoService service;
|
||||
|
||||
@Autowired
|
||||
private XmlParserService xmlParserService;
|
||||
private XmlParserServiceImpl xmlParserServiceImpl;
|
||||
|
||||
@Override
|
||||
protected Class<DomesticDrugBaseInfo> getEntityClass() {
|
||||
|
@ -54,7 +54,7 @@ public class SubType1018Handler extends AbstractEventDataHandler<DomesticDrugBas
|
|||
|
||||
@Override
|
||||
public void handleBase(String xml,String eventId) {
|
||||
VTTSBasic<DomesticDrugBaseInfo> result = xmlParserService.parseDataXml(
|
||||
VTTSBasic<DomesticDrugBaseInfo> result = xmlParserServiceImpl.parseDataXml(
|
||||
xml,
|
||||
DomesticDrugBaseInfo.class
|
||||
);
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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<Class<?>, JAXBContext> CONTEXT_CACHE = new ConcurrentHashMap<>();
|
Loading…
Reference in New Issue