2020 数据集测试成功;

代码解析模块调整
This commit is contained in:
daichao 2025-06-13 10:16:04 +08:00
parent d776d99a58
commit 2232763f8b
20 changed files with 132 additions and 30 deletions

View File

@ -35,7 +35,6 @@ public class ProvTestServerController {
@Autowired
private IReceiveDataLogService receiveDataLogService;
@Autowired
private EventProcessingServiceImpl processingService;

View File

@ -1,7 +1,8 @@
package com.alihealth.d2d.provtest.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import lombok.Data;
import javax.persistence.Column;
@ -15,7 +16,7 @@ import java.util.Date;
@TableName("receive_data_log")
public class ReceiveDataLog {
@Column(name = "event_id", unique = true)
@TableId(value = "event_id", type = IdType.AUTO)
private String eventId;

View File

@ -0,0 +1,7 @@
package com.alihealth.d2d.provtest.mapper;
import com.alihealth.d2d.provtest.domain.RevocationOrderApplyInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface RevocationOrderApplyInfoMapper extends BaseMapper<RevocationOrderApplyInfo> {
}

View File

@ -0,0 +1,7 @@
package com.alihealth.d2d.provtest.service;
import com.alihealth.d2d.provtest.domain.RevocationOrderApplyInfo;
import com.baomidou.mybatisplus.extension.service.IService;
public interface IRevocationOrderApplyInfoService extends IService<RevocationOrderApplyInfo> {
}

View File

@ -1,6 +1,5 @@
package com.alihealth.d2d.provtest.service.handle;
import com.alihealth.d2d.provtest.domain.DomesticPharmaBaseInfo;
import com.alihealth.d2d.provtest.entity.EventBody;
import com.alihealth.d2d.provtest.entity.InstanceDetail;
import com.alihealth.d2d.provtest.entity.ItemDetail;
@ -31,23 +30,25 @@ public abstract class AbstractEventDataHandler<T> implements EventDataHandler {
List<T> entities = new ArrayList<>();
for (EventBody eventBody : eventS.getVttsEvent().getEventBodyList()) {
for (ItemDetail item : eventBody.getItemList()) {
if (item.getInstanceList() != null) {
for (InstanceDetail instance : item.getInstanceList()) {
if (eventBody.getItemList() != null) {
for (ItemDetail item : eventBody.getItemList()) {
if (item.getInstanceList() != null) {
for (InstanceDetail instance : item.getInstanceList()) {
try {
entities.add(convertToEntity(eventBody, item, instance));
} catch (Exception e) {
log.error("转换实体失败", e);
}
}
} else {
try {
entities.add(convertToEntity(eventBody, item, instance));
entities.add(convertToEntity(eventBody, item, null));
} catch (Exception e) {
log.error("转换实体失败", e);
}
}
} else {
try {
entities.add(convertToEntity(eventBody, item, null));
} catch (Exception e) {
log.error("转换实体失败", e);
}
}
}
}
}

View File

@ -0,0 +1,70 @@
package com.alihealth.d2d.provtest.service.handle.business;
import com.alihealth.d2d.provtest.domain.RevocationOrderApplyInfo;
import com.alihealth.d2d.provtest.entity.EventBasic;
import com.alihealth.d2d.provtest.entity.EventBody;
import com.alihealth.d2d.provtest.entity.InstanceDetail;
import com.alihealth.d2d.provtest.entity.ItemDetail;
import com.alihealth.d2d.provtest.service.IRevocationOrderApplyInfoService;
import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler;
import com.alihealth.d2d.provtest.service.handle.EventSubType;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@Service
@EventSubType("2020")
public class SubType2020Handler extends AbstractEventDataHandler<RevocationOrderApplyInfo> {
@Autowired
private IRevocationOrderApplyInfoService service;
@Override
protected Class<RevocationOrderApplyInfo> getEntityClass() {
return RevocationOrderApplyInfo.class;
}
@Override
protected IService<RevocationOrderApplyInfo> getService() {
return service;
}
@Override
protected RevocationOrderApplyInfo convertToEntity(EventBody eventBody, ItemDetail item, InstanceDetail instance) {
EventBasic evtBasic = eventBody.getEvtBasic();
//时间格式
SimpleDateFormat formatterDatetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//日期格式
SimpleDateFormat formatterDate = new SimpleDateFormat("yyyyMMdd");
try {
return RevocationOrderApplyInfo.builder()
.eventId(eventBody.getEventID())
.recTime(formatterDatetime.parse(eventBody.getRecTime()))
.ysddjh(evtBasic.getString("YSDDJH"))
.cxyy(evtBasic.getString("CXYY"))
.cxsj(formatterDatetime.parse(evtBasic.getString("CXSJ")))
.ysdlsh(evtBasic.getString("YSDLSH"))
.djlx(evtBasic.getString("DJLX"))
.gjypbsm(evtBasic.getString("GJYPBSM"))
.build();
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
@Override
public String getSubType() {
return "2020";
}
@Override
public void handleBase(String xml, String eventId) {
}
}

View File

@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
* @author Jason
* @since 2025-06-06
*/
@Service
@Service("abroadPharmaBaseInfoService")
public class AbroadPharmaBaseInfoServiceImpl extends ServiceImpl<AbroadPharmaBaseInfoMapper, AbroadPharmaBaseInfo> implements IAbroadPharmaBaseInfoService {
}

View File

@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
* @author Jason
* @since 2025-06-06
*/
@Service
@Service("domesticDrugBaseInfoService")
public class DomesticDrugBaseInfoServiceImpl extends ServiceImpl<DomesticDrugBaseInfoMapper, DomesticDrugBaseInfo> implements IDomesticDrugBaseInfoService {
}

View File

@ -1,11 +1,8 @@
package com.alihealth.d2d.provtest.service.impl;
import com.alihealth.d2d.provtest.domain.DomesticDrugProductionApplyInfo;
import com.alihealth.d2d.provtest.domain.DomesticPharmaBaseInfo;
import com.alihealth.d2d.provtest.mapper.DomesticDrugProductionApplyInfoMapper;
import com.alihealth.d2d.provtest.mapper.DomesticPharmaBaseInfoMapper;
import com.alihealth.d2d.provtest.service.IDomesticDrugProductionApplyInfoService;
import com.alihealth.d2d.provtest.service.IDomesticPharmaBaseInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@ -13,7 +10,7 @@ import org.springframework.stereotype.Service;
* @author Jason
* @date 2025年06月04日 17:19:17
*/
@Service
@Service("domesticDrugProductionApplyInfoService")
public class DomesticDrugProductionApplyInfoServiceImpl extends ServiceImpl<DomesticDrugProductionApplyInfoMapper, DomesticDrugProductionApplyInfo> implements IDomesticDrugProductionApplyInfoService {

View File

@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
* @author Jason
* @date 2025年05月29日 16:07:26
*/
@Service
@Service("domesticPharmaBaseInfoService")
public class DomesticPharmaBaseInfoServiceImpl extends ServiceImpl<DomesticPharmaBaseInfoMapper, DomesticPharmaBaseInfo> implements IDomesticPharmaBaseInfoService {
}

View File

@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
* @author Jason
* @since 2025-06-06
*/
@Service
@Service("drugDeliveryCompanyBaseInfoService")
public class DrugDeliveryCompanyBaseInfoServiceImpl extends ServiceImpl<DrugDeliveryCompanyBaseInfoMapper, DrugDeliveryCompanyBaseInfo> implements IDrugDeliveryCompanyBaseInfoService {
}

View File

@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
* @author Jason
* @since 2025-06-06
*/
@Service
@Service("drugUsingUnitBaseInfoService")
public class DrugUsingUnitBaseInfoServiceImpl extends ServiceImpl<DrugUsingUnitBaseInfoMapper, DrugUsingUnitBaseInfo> implements IDrugUsingUnitBaseInfoService {
}

View File

@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
* @author Jason 事件主处理服务
* @date 2025年06月05日 11:28:56
*/
@Service
@Service("eventProcessingService")
@RequiredArgsConstructor
public class EventProcessingServiceImpl {

View File

@ -0,0 +1,12 @@
package com.alihealth.d2d.provtest.service.impl;
import com.alihealth.d2d.provtest.domain.RevocationOrderApplyInfo;
import com.alihealth.d2d.provtest.mapper.RevocationOrderApplyInfoMapper;
import com.alihealth.d2d.provtest.service.IRevocationOrderApplyInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service("revocationOrderApplyInfoService")
public class IRevocationOrderApplyInfoServiceImpl extends ServiceImpl<RevocationOrderApplyInfoMapper, RevocationOrderApplyInfo> implements IRevocationOrderApplyInfoService {
}

View File

@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
* @author Jason
* @since 2025-06-06
*/
@Service
@Service("pharmaceuticalProductionLicenseBaseInfoService")
public class PharmaceuticalProductionLicenseBaseInfoServiceImpl extends ServiceImpl<PharmaceuticalProductionLicenseBaseInfoMapper, PharmaceuticalProductionLicenseBaseInfo> implements IPharmaceuticalProductionLicenseBaseInfoService {
}

View File

@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
* @author Jason
* @since 2025-06-06
*/
@Service
@Service("pharmaceuticalTradingEnterprisesService")
public class PharmaceuticalTradingEnterprisesServiceImpl extends ServiceImpl<PharmaceuticalTradingEnterprisesMapper, PharmaceuticalTradingEnterprises> implements IPharmaceuticalTradingEnterprisesService {
}

View File

@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
* @author Jason
* @since 2025-06-06
*/
@Service
@Service("pharmaceuticalTradingLicenseBaseInfoService")
public class PharmaceuticalTradingLicenseBaseInfoServiceImpl extends ServiceImpl<PharmaceuticalTradingLicenseBaseInfoMapper, PharmaceuticalTradingLicenseBaseInfo> implements IPharmaceuticalTradingLicenseBaseInfoService {
}

View File

@ -10,6 +10,6 @@ import org.springframework.stereotype.Service;
* @author Jason
* @date 2025年06月03日 15:37:17
*/
@Service
@Service("receiveDataLogService")
public class ReceiveDataLogServiceImpl extends ServiceImpl<ReceiveDataLogMapper, ReceiveDataLog> implements IReceiveDataLogService {
}

View File

@ -25,7 +25,7 @@ import java.util.stream.Collectors;
* @author Jason
* @date 2025年05月30日 11:41:26
*/
@Service
@Service("xmlParserService")
public class XmlParserServiceImpl {
protected final Logger log = LoggerFactory.getLogger(getClass());

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.alihealth.d2d.provtest.mapper.RevocationOrderApplyInfoMapper">
</mapper>