parent
d776d99a58
commit
2232763f8b
|
@ -35,7 +35,6 @@ public class ProvTestServerController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IReceiveDataLogService receiveDataLogService;
|
private IReceiveDataLogService receiveDataLogService;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EventProcessingServiceImpl processingService;
|
private EventProcessingServiceImpl processingService;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package com.alihealth.d2d.provtest.domain;
|
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.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
|
@ -15,7 +16,7 @@ import java.util.Date;
|
||||||
@TableName("receive_data_log")
|
@TableName("receive_data_log")
|
||||||
public class ReceiveDataLog {
|
public class ReceiveDataLog {
|
||||||
|
|
||||||
@Column(name = "event_id", unique = true)
|
@TableId(value = "event_id", type = IdType.AUTO)
|
||||||
private String eventId;
|
private String eventId;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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> {
|
||||||
|
}
|
|
@ -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> {
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package com.alihealth.d2d.provtest.service.handle;
|
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.EventBody;
|
||||||
import com.alihealth.d2d.provtest.entity.InstanceDetail;
|
import com.alihealth.d2d.provtest.entity.InstanceDetail;
|
||||||
import com.alihealth.d2d.provtest.entity.ItemDetail;
|
import com.alihealth.d2d.provtest.entity.ItemDetail;
|
||||||
|
@ -31,23 +30,25 @@ public abstract class AbstractEventDataHandler<T> implements EventDataHandler {
|
||||||
List<T> entities = new ArrayList<>();
|
List<T> entities = new ArrayList<>();
|
||||||
|
|
||||||
for (EventBody eventBody : eventS.getVttsEvent().getEventBodyList()) {
|
for (EventBody eventBody : eventS.getVttsEvent().getEventBodyList()) {
|
||||||
for (ItemDetail item : eventBody.getItemList()) {
|
if (eventBody.getItemList() != null) {
|
||||||
if (item.getInstanceList() != null) {
|
for (ItemDetail item : eventBody.getItemList()) {
|
||||||
for (InstanceDetail instance : item.getInstanceList()) {
|
if (item.getInstanceList() != null) {
|
||||||
|
for (InstanceDetail instance : item.getInstanceList()) {
|
||||||
|
try {
|
||||||
|
entities.add(convertToEntity(eventBody, item, instance));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("转换实体失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
entities.add(convertToEntity(eventBody, item, instance));
|
entities.add(convertToEntity(eventBody, item, null));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("转换实体失败", e);
|
log.error("转换实体失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
entities.add(convertToEntity(eventBody, item, null));
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("转换实体失败", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @since 2025-06-06
|
* @since 2025-06-06
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("abroadPharmaBaseInfoService")
|
||||||
public class AbroadPharmaBaseInfoServiceImpl extends ServiceImpl<AbroadPharmaBaseInfoMapper, AbroadPharmaBaseInfo> implements IAbroadPharmaBaseInfoService {
|
public class AbroadPharmaBaseInfoServiceImpl extends ServiceImpl<AbroadPharmaBaseInfoMapper, AbroadPharmaBaseInfo> implements IAbroadPharmaBaseInfoService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @since 2025-06-06
|
* @since 2025-06-06
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("domesticDrugBaseInfoService")
|
||||||
public class DomesticDrugBaseInfoServiceImpl extends ServiceImpl<DomesticDrugBaseInfoMapper, DomesticDrugBaseInfo> implements IDomesticDrugBaseInfoService {
|
public class DomesticDrugBaseInfoServiceImpl extends ServiceImpl<DomesticDrugBaseInfoMapper, DomesticDrugBaseInfo> implements IDomesticDrugBaseInfoService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
package com.alihealth.d2d.provtest.service.impl;
|
package com.alihealth.d2d.provtest.service.impl;
|
||||||
|
|
||||||
import com.alihealth.d2d.provtest.domain.DomesticDrugProductionApplyInfo;
|
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.DomesticDrugProductionApplyInfoMapper;
|
||||||
import com.alihealth.d2d.provtest.mapper.DomesticPharmaBaseInfoMapper;
|
|
||||||
import com.alihealth.d2d.provtest.service.IDomesticDrugProductionApplyInfoService;
|
import com.alihealth.d2d.provtest.service.IDomesticDrugProductionApplyInfoService;
|
||||||
import com.alihealth.d2d.provtest.service.IDomesticPharmaBaseInfoService;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -13,7 +10,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @date 2025年06月04日 17:19:17
|
* @date 2025年06月04日 17:19:17
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("domesticDrugProductionApplyInfoService")
|
||||||
public class DomesticDrugProductionApplyInfoServiceImpl extends ServiceImpl<DomesticDrugProductionApplyInfoMapper, DomesticDrugProductionApplyInfo> implements IDomesticDrugProductionApplyInfoService {
|
public class DomesticDrugProductionApplyInfoServiceImpl extends ServiceImpl<DomesticDrugProductionApplyInfoMapper, DomesticDrugProductionApplyInfo> implements IDomesticDrugProductionApplyInfoService {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @date 2025年05月29日 16:07:26
|
* @date 2025年05月29日 16:07:26
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("domesticPharmaBaseInfoService")
|
||||||
public class DomesticPharmaBaseInfoServiceImpl extends ServiceImpl<DomesticPharmaBaseInfoMapper, DomesticPharmaBaseInfo> implements IDomesticPharmaBaseInfoService {
|
public class DomesticPharmaBaseInfoServiceImpl extends ServiceImpl<DomesticPharmaBaseInfoMapper, DomesticPharmaBaseInfo> implements IDomesticPharmaBaseInfoService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @since 2025-06-06
|
* @since 2025-06-06
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("drugDeliveryCompanyBaseInfoService")
|
||||||
public class DrugDeliveryCompanyBaseInfoServiceImpl extends ServiceImpl<DrugDeliveryCompanyBaseInfoMapper, DrugDeliveryCompanyBaseInfo> implements IDrugDeliveryCompanyBaseInfoService {
|
public class DrugDeliveryCompanyBaseInfoServiceImpl extends ServiceImpl<DrugDeliveryCompanyBaseInfoMapper, DrugDeliveryCompanyBaseInfo> implements IDrugDeliveryCompanyBaseInfoService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @since 2025-06-06
|
* @since 2025-06-06
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("drugUsingUnitBaseInfoService")
|
||||||
public class DrugUsingUnitBaseInfoServiceImpl extends ServiceImpl<DrugUsingUnitBaseInfoMapper, DrugUsingUnitBaseInfo> implements IDrugUsingUnitBaseInfoService {
|
public class DrugUsingUnitBaseInfoServiceImpl extends ServiceImpl<DrugUsingUnitBaseInfoMapper, DrugUsingUnitBaseInfo> implements IDrugUsingUnitBaseInfoService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason 事件主处理服务
|
* @author Jason 事件主处理服务
|
||||||
* @date 2025年06月05日 11:28:56
|
* @date 2025年06月05日 11:28:56
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("eventProcessingService")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class EventProcessingServiceImpl {
|
public class EventProcessingServiceImpl {
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
||||||
|
}
|
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @since 2025-06-06
|
* @since 2025-06-06
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("pharmaceuticalProductionLicenseBaseInfoService")
|
||||||
public class PharmaceuticalProductionLicenseBaseInfoServiceImpl extends ServiceImpl<PharmaceuticalProductionLicenseBaseInfoMapper, PharmaceuticalProductionLicenseBaseInfo> implements IPharmaceuticalProductionLicenseBaseInfoService {
|
public class PharmaceuticalProductionLicenseBaseInfoServiceImpl extends ServiceImpl<PharmaceuticalProductionLicenseBaseInfoMapper, PharmaceuticalProductionLicenseBaseInfo> implements IPharmaceuticalProductionLicenseBaseInfoService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @since 2025-06-06
|
* @since 2025-06-06
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("pharmaceuticalTradingEnterprisesService")
|
||||||
public class PharmaceuticalTradingEnterprisesServiceImpl extends ServiceImpl<PharmaceuticalTradingEnterprisesMapper, PharmaceuticalTradingEnterprises> implements IPharmaceuticalTradingEnterprisesService {
|
public class PharmaceuticalTradingEnterprisesServiceImpl extends ServiceImpl<PharmaceuticalTradingEnterprisesMapper, PharmaceuticalTradingEnterprises> implements IPharmaceuticalTradingEnterprisesService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @since 2025-06-06
|
* @since 2025-06-06
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("pharmaceuticalTradingLicenseBaseInfoService")
|
||||||
public class PharmaceuticalTradingLicenseBaseInfoServiceImpl extends ServiceImpl<PharmaceuticalTradingLicenseBaseInfoMapper, PharmaceuticalTradingLicenseBaseInfo> implements IPharmaceuticalTradingLicenseBaseInfoService {
|
public class PharmaceuticalTradingLicenseBaseInfoServiceImpl extends ServiceImpl<PharmaceuticalTradingLicenseBaseInfoMapper, PharmaceuticalTradingLicenseBaseInfo> implements IPharmaceuticalTradingLicenseBaseInfoService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,6 @@ import org.springframework.stereotype.Service;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @date 2025年06月03日 15:37:17
|
* @date 2025年06月03日 15:37:17
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("receiveDataLogService")
|
||||||
public class ReceiveDataLogServiceImpl extends ServiceImpl<ReceiveDataLogMapper, ReceiveDataLog> implements IReceiveDataLogService {
|
public class ReceiveDataLogServiceImpl extends ServiceImpl<ReceiveDataLogMapper, ReceiveDataLog> implements IReceiveDataLogService {
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.util.stream.Collectors;
|
||||||
* @author Jason
|
* @author Jason
|
||||||
* @date 2025年05月30日 11:41:26
|
* @date 2025年05月30日 11:41:26
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("xmlParserService")
|
||||||
public class XmlParserServiceImpl {
|
public class XmlParserServiceImpl {
|
||||||
protected final Logger log = LoggerFactory.getLogger(getClass());
|
protected final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue