diff --git a/collect-sdry/src/main/java/com/docus/server/AppRunBootstrap.java b/collect-sdry/src/main/java/com/docus/server/AppRunBootstrap.java index c70225e..6cd683b 100644 --- a/collect-sdry/src/main/java/com/docus/server/AppRunBootstrap.java +++ b/collect-sdry/src/main/java/com/docus/server/AppRunBootstrap.java @@ -5,11 +5,12 @@ import com.docus.log.EnableTrackGroup; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.retry.annotation.EnableRetry; @Slf4j -//@EnableFeignClients(basePackages = ("com.feign")) +@EnableFeignClients(basePackages = ("com.docus.core.excel.feign")) //@EnableHystrix //@MapperScan("com.docus.server.**.mapper") @SpringBootApplication(scanBasePackages = {"com.docus"}) diff --git a/collect-sdry/src/main/resources/bootstrap.yml b/collect-sdry/src/main/resources/bootstrap.yml index 11b0e85..e625b8c 100644 --- a/collect-sdry/src/main/resources/bootstrap.yml +++ b/collect-sdry/src/main/resources/bootstrap.yml @@ -12,21 +12,21 @@ spring: datasource: master: url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai - username: root - password: root + username: docus + password: docus702 driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy type: com.alibaba.druid.pool.DruidDataSource his: url: jdbc:log4jdbc:mysql://db.docus.cn:3306/his?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai - username: root - password: root + username: docus + password: docus702 driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy type: com.alibaba.druid.pool.DruidDataSource redis: host: redis.docus.cn - # password: JSdocus@702 + password: JSdocus@702 cloud: nacos: discovery: @@ -39,12 +39,12 @@ spring: shared-configs: - comm.${spring.cloud.nacos.config.file-extension} - docus: dbtype: mysql user: # 用户默认密码 defpwd: fd29cd53ec12616e5f36b77d4afffbff + mybatis-plus: configuration: map-underscore-to-camel-case: true @@ -80,4 +80,4 @@ xxl: # replica: # queueManager: MqManager02 # channel: chl_server02 -# connName: 10.222.23.131(1414) +# connName: 10.222.23.131(1414) \ No newline at end of file diff --git a/common-collect/src/main/java/com/docus/server/tool/SpringUtils.java b/common-collect/src/main/java/com/docus/server/tool/SpringUtils.java index 59cba3e..029ea19 100644 --- a/common-collect/src/main/java/com/docus/server/tool/SpringUtils.java +++ b/common-collect/src/main/java/com/docus/server/tool/SpringUtils.java @@ -1,12 +1,19 @@ package com.docus.server.tool; import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.AutowireCapableBeanFactory; +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.config.SingletonBeanRegistry; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.annotation.Configuration; import org.springframework.util.ReflectionUtils; import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; import java.util.Map; /** @@ -65,6 +72,39 @@ public class SpringUtils implements ApplicationContextAware { return applicationContext.getBeansOfType(type); } + public static T getBean(String beanName, Class beanClass) { + return applicationContext.getBean(beanName, beanClass); + } + + public static T createBean(Class beanClass) { + return applicationContext.getAutowireCapableBeanFactory().createBean(beanClass); + } + + + public static List getBeans(Class beanClass) { + return new ArrayList<>(applicationContext.getBeansOfType(beanClass).values()); + } + + @SuppressWarnings("unchecked") + public static T initializeBean(T bean) { + AutowireCapableBeanFactory beanFactory = applicationContext.getAutowireCapableBeanFactory(); + beanFactory.autowireBean(bean); + return (T) beanFactory.initializeBean(bean, bean.getClass().getName()); + } + + public static void registerSingletonBean(String beanName, Class beanClass) { + GenericBeanDefinition definition = new GenericBeanDefinition(); + definition.setBeanClass(beanClass); + definition.setScope(BeanDefinition.SCOPE_SINGLETON); + BeanDefinitionRegistry registry = (BeanDefinitionRegistry) applicationContext.getAutowireCapableBeanFactory(); + registry.registerBeanDefinition(beanName, definition); + } + + public static void registerSingletonBean(String beanName, Object bean) { + SingletonBeanRegistry registry = (SingletonBeanRegistry) applicationContext.getAutowireCapableBeanFactory(); + registry.registerSingleton(beanName, bean); + } + public static Object invokeMethod(Class requiredType, String methodName, Object[] params) { Object service = getBean(requiredType); Class[] paramClass = null; diff --git a/common-collect/src/main/java/com/docus/server/ws/impl/BasicServiceImpl.java b/common-collect/src/main/java/com/docus/server/ws/impl/BasicServiceImpl.java index 000e65a..9c9c71e 100644 --- a/common-collect/src/main/java/com/docus/server/ws/impl/BasicServiceImpl.java +++ b/common-collect/src/main/java/com/docus/server/ws/impl/BasicServiceImpl.java @@ -13,12 +13,12 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; /** - * @BelongsProject: docus-webservice-sdry - * @BelongsPackage: com.docus.server.collection.webservice - * @Author: chierhao - * @CreateTime: 2023-02-25 14:52 - * @Description: TODO - * @Version: 1.0 + * @author wen yongbin + * @date 2023年2月25日21:56:33 + * @see com.docus.server.collect.infrastructure.dao.CollectTypeEnum 枚举 + * @see com.docus.server.ws.convert.IConverter 通用转化器 + * @see com.docus.server.ws.IWsResult 通用返回结果 + * @see VisitorProcessor 通用处理器 */ @Service @Slf4j @@ -37,13 +37,6 @@ public class BasicServiceImpl implements IBasicService { return null; } - /** - * @param message 原始报文 - * @see com.docus.server.collect.infrastructure.dao.CollectTypeEnum 枚举 - * @see com.docus.server.ws.convert.IConverter 通用转化器 - * @see com.docus.server.ws.IWsResult 通用返回结果 - * @see VisitorProcessor 通用处理器 - */ @Override @TrackGroup( group = "WEBSERVICE_XML_BASIC", diff --git a/common-collect/src/main/java/com/docus/server/ws/impl/DeptServerImpl.java b/common-collect/src/main/java/com/docus/server/ws/impl/DeptServerImpl.java index 28c1104..0299f0a 100644 --- a/common-collect/src/main/java/com/docus/server/ws/impl/DeptServerImpl.java +++ b/common-collect/src/main/java/com/docus/server/ws/impl/DeptServerImpl.java @@ -15,6 +15,10 @@ import javax.annotation.Resource; /** * @author wen yongbin * @date 2023年2月25日21:56:33 + * @see com.docus.server.collect.infrastructure.dao.CollectTypeEnum 枚举 + * @see com.docus.server.ws.convert.IConverter 通用转化器 + * @see com.docus.server.ws.IWsResult 通用返回结果 + * @see VisitorProcessor 通用处理器 */ @Service @Slf4j @@ -22,13 +26,6 @@ public class DeptServerImpl implements IDeptServer { @Resource private CollectService collectService; - /** - * @param message 原始报文 - * @see com.docus.server.collect.infrastructure.dao.CollectTypeEnum 枚举 - * @see com.docus.server.ws.convert.IConverter 通用转化器 - * @see com.docus.server.ws.IWsResult 通用返回结果 - * @see VisitorProcessor 通用处理器 - */ @Override @TrackGroup( group = "WEBSERVICE_XML_DEPT", diff --git a/common-collect/src/main/java/com/docus/server/ws/impl/ReportServerImpl.java b/common-collect/src/main/java/com/docus/server/ws/impl/ReportServerImpl.java index 2845195..6880d46 100644 --- a/common-collect/src/main/java/com/docus/server/ws/impl/ReportServerImpl.java +++ b/common-collect/src/main/java/com/docus/server/ws/impl/ReportServerImpl.java @@ -15,6 +15,10 @@ import javax.annotation.Resource; /** * @author wyb * @date 2023年3月3日13:42:36 + * @see com.docus.server.collect.infrastructure.dao.CollectTypeEnum 枚举 + * @see com.docus.server.ws.convert.IConverter 通用转化器 + * @see com.docus.server.ws.IWsResult 通用返回结果 + * @see VisitorProcessor 通用处理器 */ @Service @Slf4j diff --git a/common-collect/src/main/java/com/docus/server/ws/impl/UserServerImpl.java b/common-collect/src/main/java/com/docus/server/ws/impl/UserServerImpl.java index 24e4f4b..a557860 100644 --- a/common-collect/src/main/java/com/docus/server/ws/impl/UserServerImpl.java +++ b/common-collect/src/main/java/com/docus/server/ws/impl/UserServerImpl.java @@ -15,6 +15,10 @@ import javax.annotation.Resource; /** * @author wen yongbin * @date 2023年2月25日21:56:33 + * @see com.docus.server.collect.infrastructure.dao.CollectTypeEnum 枚举 + * @see com.docus.server.ws.convert.IConverter 通用转化器 + * @see com.docus.server.ws.IWsResult 通用返回结果 + * @see VisitorProcessor 通用处理器 */ @Service @Slf4j @@ -23,11 +27,10 @@ public class UserServerImpl implements IUserServer { private CollectService collectService; /** - * @param message 原始报文 - * @see com.docus.server.collect.infrastructure.dao.CollectTypeEnum 枚举 - * @see com.docus.server.ws.convert.IConverter 通用转化器 - * @see com.docus.server.ws.IWsResult 通用返回结果 - * @see VisitorProcessor 通用处理器 + * 用户信息接收,进行操作 + * + * @param message 接收到的用户参数 + * @return 返回结果 */ @Override @TrackGroup( diff --git a/data-config/js-report-config.xml b/data-config/js-report-config.xml new file mode 100644 index 0000000..d74c2a3 --- /dev/null +++ b/data-config/js-report-config.xml @@ -0,0 +1,25 @@ + + + + /Request/Msg/INHOSP_INDEX_NO + + /Request/Msg/INHOSP_NO + + /Request/Msg/INHOSP_NUM + + /Request/Msg/UNIQUE_FILE + + /Request/Msg/FILE_NAME + + /Request/Msg/PDF_PATH + + /Request/Msg/TABLE_TYPE + + + + /Request/Msg/TABLE_TYPE + + + + + \ No newline at end of file diff --git a/data-config/js-table-type.json b/data-config/js-table-type.json new file mode 100644 index 0000000..58c9f99 --- /dev/null +++ b/data-config/js-table-type.json @@ -0,0 +1,6 @@ +{ + "icu": "重症文件分段id", + "sa": "手麻文件分段id", + "examination": "检验报告文件分段id", + "other": "其他文件分段id" +} \ No newline at end of file diff --git a/data-config/js-webservice-template-request.xml b/data-config/js-webservice-template-request.xml new file mode 100644 index 0000000..0d32ef2 --- /dev/null +++ b/data-config/js-webservice-template-request.xml @@ -0,0 +1,25 @@ + + + + + 123456 + + 012345 + + 012345 + + 2 + + icu + + 20220303111800 + + 20220303111801 + + http://192.168.1.108:9012/file/0123_01.pdf + + 0123_01 + + AESHASHMD5DEFIND + + diff --git a/data-config/js-webservice-template-response.xml b/data-config/js-webservice-template-response.xml new file mode 100644 index 0000000..8ceb826 --- /dev/null +++ b/data-config/js-webservice-template-response.xml @@ -0,0 +1,11 @@ + + + + + 0 + + 123456 + + 成功! + + \ No newline at end of file