commit 101123bd3f868b3d7217915d84fb2cd82d122506 Author: 宇宙皮皮娃 <2964346877@qq.com> Date: Fri Nov 7 11:28:35 2025 +0800 1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a8a1e4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +docus-services/docus-services-system1/ + +### IntelliJ IDEA ### +*.log +.idea +*.iws +*.iml +*.ipr +mvnw* +*.cmd +*.mvn +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ +logs* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3cc485f --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ + +框架说明 + + +项目结构 +``` +backup --业务模块 备份 + controller --前端接口层 + param --接口参数 + vo --返回视图 + feign --服务接口层 + infrastructure --基础设施层 + cache --mybatis 和 feign 接口的缓存层 + client --访问对外接口,例如 feign ,ws 等 + dao --连接数据库 + job --xxl-job + service --业务代码 + impl --service 实现类 +inspection -- 业务模块 采集器 + controller --前端接口层 + param --接口参数 + vo --返回视图 + feign --服务接口层 + infrastructure --基础设施层 + cache --mybatis 和 feign 接口的缓存层 + client --访问对外接口,例如 feign ,ws 等 + dao --连接数据库 + job --xxl-job + service --业务代码 + impl --service 实现类 +``` + + +这个是一个模板,需要启动新项目的,复制一份,并且修改 项目名称以及修改docus-demo 跟项目名称一致即可启动。 diff --git a/WinSW.exe b/WinSW.exe new file mode 100644 index 0000000..6806bb4 Binary files /dev/null and b/WinSW.exe differ diff --git a/assembly.xml b/assembly.xml new file mode 100644 index 0000000..b6fb827 --- /dev/null +++ b/assembly.xml @@ -0,0 +1,73 @@ + + + exe + + dir + + false + + + + + /lib + ${basedir}/target/lib + + + + /config + ${basedir}/target/resources + 0755 + + *.xml + *.yml + *.properties + + + + + /dataConfig + ${basedir}/target/dataConfig + 0755 + + *.json + + + + + / + ${basedir}/target/resources/bin + 0755 + + *.bat + + + + + / + ${basedir}/target/resources/bin + 0755 + + *.xml + + + + + / + ${basedir} + 0755 + + *.exe + + + + + ${basedir}/target + / + 0755 + + ${project.build.finalName}.jar + + + + \ No newline at end of file diff --git a/dataConfig/System-Mapping.json b/dataConfig/System-Mapping.json new file mode 100644 index 0000000..cffecd5 --- /dev/null +++ b/dataConfig/System-Mapping.json @@ -0,0 +1,19 @@ +{ + "mappings": [{ + "hospital": "emr", + "wzh": "1" + }, + { + "hospital": "hl", + "wzh": "3" + }, + { + "hospital": "sy", + "wzh": "6" + }, + { + "hospital": "hz", + "wzh": "13" + } + ] +} \ No newline at end of file diff --git a/dataConfig/time.json b/dataConfig/time.json new file mode 100644 index 0000000..735081a --- /dev/null +++ b/dataConfig/time.json @@ -0,0 +1,4 @@ +{ + "startTime":"2023-02-16 00:00:00", + "pageNum":"1" +} diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..655c7d0 --- /dev/null +++ b/pom.xml @@ -0,0 +1,305 @@ + + + + com.docus + docus-bom + 1.0-SNAPSHOT + + 4.0.0 + + docus-mzzy-collector + + + com.docus + docus-knife4j-starter + + + + org.springframework.boot + spring-boot-starter-web + + + com.docus + docus-mybatisplus-starter + + + + mysql + mysql-connector-java + 8.0.28 + + + org.projectlombok + lombok + 1.18.16 + compile + + + org.projectlombok + lombok + 1.18.16 + compile + + + org.bgee.log4jdbc-log4j2 + log4jdbc-log4j2-jdbc4.1 + + + com.alibaba + druid + 1.2.4 + compile + + + com.baomidou + mybatis-plus-generator + 3.4.1 + compile + + + com.baomidou + mybatis-plus-boot-starter + 3.3.0 + + + org.apache.velocity + velocity-engine-core + 2.0 + + + com.xuxueli + xxl-job-core + + + com.docus + docus-base-starter + + + knife4j-spring-boot-autoconfigure + com.github.xiaoymin + + + + + + com.docus + docus-tool-starter + + + + com.docus + docus-shiro-starter + + + + + com.docus + docus-base-starter + + + springfox-core + io.springfox + + + springfox-schema + io.springfox + + + springfox-spi + io.springfox + + + knife4j-spring-boot-autoconfigure + com.github.xiaoymin + + + + + + com.docus + docus-http-starter + 1.0-SNAPSHOT + + + + org.springframework + spring-jms + + + + junit + junit + test + + + + + + + src/main/resources + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.4.4 + + ZIP + + + non-exists + non-exists + + + + + + + repackage + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + + target/lib + false + false + runtime + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.2.0 + + + copy-resources + package + + copy-resources + + + + + src/main/resources + + **/*.* + + + + ${project.build.directory}/resources + + + + copy-bin + package + + copy-resources + + + + + src/main/resources + true + + bin/*.xml + bin/*.bat + *.yml + + + + ${project.build.directory}/resources + + + + copy-data-config + package + + copy-resources + + + + + dataConfig + true + + + ${project.build.directory}/dataConfig + + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + **/*.yml + + + + + + maven-assembly-plugin + + + + ${project.artifactId} + false + + assembly.xml + + + make-assembly + package + + single + + + + + + + + + + + dev + + prod + + + true + + + + + + + + diff --git a/src/main/java/com/docus/server/AppRunBootstrap.java b/src/main/java/com/docus/server/AppRunBootstrap.java new file mode 100644 index 0000000..7506531 --- /dev/null +++ b/src/main/java/com/docus/server/AppRunBootstrap.java @@ -0,0 +1,21 @@ +package com.docus.server; + + + +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.jms.annotation.EnableJms; + + +@Slf4j +@SpringBootApplication(scanBasePackages ={"com.docus","com.neusoft"}) +@EnableJms +@EnableFeignClients +public class AppRunBootstrap { + public static void main(String[] args) { + System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); + SpringApplication.run(AppRunBootstrap.class,args); + } +} diff --git a/src/main/java/com/docus/server/MybatisPlusGenerator.java b/src/main/java/com/docus/server/MybatisPlusGenerator.java new file mode 100644 index 0000000..d3fe0b5 --- /dev/null +++ b/src/main/java/com/docus/server/MybatisPlusGenerator.java @@ -0,0 +1,95 @@ +package com.docus.server;//package com.docus.server.clinicqualitycontrol.all; +// +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.rules.DateType; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; + +import java.util.HashMap; +import java.util.Map; + +/** + * mybatis plus代码生成器 + */ +public class MybatisPlusGenerator { + + public static void main(String[] args) { + //获得entity目录 + String entity = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-interfaces\\src\\main\\java\\com\\docus\\services\\system\\entity\\"; + //获取mapper目录 + String mapper = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\java\\com\\docus\\services\\system\\mapper"; + //获取mapper的xml目录 + String mapperxml = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\resources\\mapper"; + //获取模块名 + //获取service目录 + String service = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-interfaces\\src\\main\\java\\com\\docus\\services\\system\\facade"; + //获得serviceimpl目录 + String serviceImpl = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\java\\com\\docus\\services\\system\\service"; + +// //获得controller目录 + String controller = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-controller\\src\\main\\java\\com\\docus\\services\\system\\controller"; + //1,代码生成器 + AutoGenerator mpg = new AutoGenerator(); + // 2、全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); //重新生成时文件是否覆盖 + + //UserServie + //gc.setServiceName("%sService"); //去掉Service接口的首字母I + gc.setAuthor("jiashi"); //自定义作者 + gc.setOpen(false); //生成后是否打开资源管理器 + gc.setIdType(IdType.INPUT); //主键策略 + gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型 + gc.setSwagger2(true);//开启Swagger2模式 + mpg.setGlobalConfig(gc); + + //数据库配置 + DataSourceConfig dataSourceConfig = new DataSourceConfig(); + dataSourceConfig.setUrl("jdbc:log4jdbc:mysql://8.134.10.251:3306/docus_inspection?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai"); + dataSourceConfig.setDriverName("net.sf.log4jdbc.sql.jdbcapi.DriverSpy"); + dataSourceConfig.setUsername("docus"); + dataSourceConfig.setPassword("docus702"); + mpg.setDataSource(dataSourceConfig); + + //包配置 + PackageConfig pc = new PackageConfig(); + //设置自定义输出目录(分布式项目使用) + Map pathInfo = new HashMap<>(); +// pathInfo.put(ConstVal.ENTITY_PATH, entity); +// pathInfo.put(ConstVal.MAPPER_PATH, mapper); +// pathInfo.put(ConstVal.XML_PATH, mapperxml); +// pathInfo.put(ConstVal.SERVICE_PATH, service); +// pathInfo.put(ConstVal.SERVICE_IMPL_PATH, serviceImpl); + pathInfo.put(ConstVal.CONTROLLER_PATH, controller); + pc.setPathInfo(pathInfo); + mpg.setPackageInfo(pc); + //设置自定义包名 + pc.setParent("com.docus.services.system"); + pc.setService("facade"); + pc.setServiceImpl("service"); + mpg.setPackageInfo(pc); + + // 5、策略配置 + StrategyConfig strategy = new StrategyConfig(); + + strategy.setInclude("inspection_status"); //要生成的表 + + strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 + strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体时去掉表前缀 + + strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 + strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 + + strategy.setRestControllerStyle(true); //restful api风格控制器 + strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符 + + mpg.setStrategy(strategy); + + + // 6、执行 + mpg.execute(); + + //7,注意的是,需将service包中生成的serviceImpl中的@Service注解改成@DubboService注解 + } +} diff --git a/src/main/java/com/docus/server/XxlJobConfig.java b/src/main/java/com/docus/server/XxlJobConfig.java new file mode 100644 index 0000000..d9edbfa --- /dev/null +++ b/src/main/java/com/docus/server/XxlJobConfig.java @@ -0,0 +1,87 @@ +package com.docus.server; +import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2021/5/7 16:23 + * @UpdateUser: 曾文和 + * @UpdateDate: 2021/5/7 16:23 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ + + + +@Configuration +public class XxlJobConfig { + private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class); + + @Value("${xxl.job.admin.addresses}") + private String adminAddresses; + + @Value("${xxl.job.accessToken}") + private String accessToken; + + @Value("${xxl.job.executor.appname}") + private String appname; + + @Value("${xxl.job.executor.address}") + private String address; + + @Value("${xxl.job.executor.ip}") + private String ip; + + @Value("${xxl.job.executor.port}") + private int port; + + @Value("${xxl.job.executor.logpath}") + private String logPath; + + @Value("${xxl.job.executor.logretentiondays}") + private int logRetentionDays; + + + @Bean + public XxlJobSpringExecutor xxlJobExecutor() { + logger.info(">>>>>>>>>>> xxl-job config init."); + XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); + xxlJobSpringExecutor.setAdminAddresses(adminAddresses); + xxlJobSpringExecutor.setAppname(appname); + xxlJobSpringExecutor.setAddress(address); + xxlJobSpringExecutor.setIp(ip); + xxlJobSpringExecutor.setPort(port); + xxlJobSpringExecutor.setAccessToken(accessToken); + xxlJobSpringExecutor.setLogPath(logPath); + xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); + + return xxlJobSpringExecutor; + } + + /** + * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP; + * + * 1、引入依赖: + * + * org.springframework.cloud + * spring-cloud-commons + * ${version} + * + * + * 2、配置文件,或者容器启动变量 + * spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.' + * + * 3、获取IP + * String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + *//* + +*/ +} diff --git a/src/main/java/com/docus/server/collection/config/DbMysqlConfig.java b/src/main/java/com/docus/server/collection/config/DbMysqlConfig.java new file mode 100644 index 0000000..0e441ff --- /dev/null +++ b/src/main/java/com/docus/server/collection/config/DbMysqlConfig.java @@ -0,0 +1,68 @@ +package com.docus.server.collection.config; + +import com.alibaba.druid.pool.DruidDataSource; +import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties; +import com.baomidou.mybatisplus.core.MybatisConfiguration; +import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; +import org.apache.ibatis.session.SqlSessionFactory; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.core.io.support.ResourcePatternResolver; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; + +import javax.sql.DataSource; + + +@Configuration +@MapperScan(basePackages = com.docus.server.collection.config.DbMysqlConfig.PACKAGE, sqlSessionFactoryRef = "dbmysqlSqlSessionFactory") +@EnableConfigurationProperties(MybatisPlusProperties.class) +public class DbMysqlConfig { + // 这里一定要指定精准 否则后果不堪设想 + static final String PACKAGE = "com.docus.server.collection.infrastructure.dao.mapper"; + static final String MAPPER_LOCATION = "classpath:mapper/*.xml"; + + @Bean(name = "dbmysqlDataSource") + @ConfigurationProperties(prefix = "spring.datasource.mysql-docus") + public DataSource secondDataSource(){ + return new DruidDataSource(); + } + + /*注入事务*/ + @Bean(name = "dbmysqlTransactionManager") + public DataSourceTransactionManager secondTransactionManager() { + return new DataSourceTransactionManager(secondDataSource()); + } + + @Bean(name = "dbmysqlSqlSessionFactory") + public SqlSessionFactory secondSqlSessionFactory(@Qualifier("dbmysqlDataSource") DataSource dataSource) + throws Exception { + //配置mybatis-plus源 + MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean(); + //添加XML目录 + ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); + bean.setMapperLocations(resolver.getResources(MAPPER_LOCATION)); + // 实体类别名 + bean.setTypeAliasesPackage("com.docus.server.collection.infrastructure.dao.entity.*"); + MybatisConfiguration configuration = new MybatisConfiguration(); + //开启下划线转驼峰 + configuration.setMapUnderscoreToCamelCase(true); + configuration.setJdbcTypeForNull(JdbcType.NULL); + bean.setDataSource(dataSource); + bean.setConfiguration(configuration); + return bean.getObject(); +// +// final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); +// sessionFactory.setDataSource(secondDataSource); +// sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver() +// .getResources(DbMysqlConfig.MAPPER_LOCATION)); +// return sessionFactory.getObject(); + } + + +} diff --git a/src/main/java/com/docus/server/collection/config/DbSqlserverConfig.java b/src/main/java/com/docus/server/collection/config/DbSqlserverConfig.java new file mode 100644 index 0000000..ee98718 --- /dev/null +++ b/src/main/java/com/docus/server/collection/config/DbSqlserverConfig.java @@ -0,0 +1,48 @@ +//package com.docus.server.collection.config; +// +//import com.alibaba.druid.pool.DruidDataSource; +//import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties; +//import org.apache.ibatis.session.SqlSessionFactory; +//import org.mybatis.spring.SqlSessionFactoryBean; +//import org.mybatis.spring.annotation.MapperScan; +//import org.springframework.beans.factory.annotation.Qualifier; +//import org.springframework.boot.context.properties.ConfigurationProperties; +//import org.springframework.boot.context.properties.EnableConfigurationProperties; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +//import org.springframework.jdbc.datasource.DataSourceTransactionManager; +// +//import javax.sql.DataSource; +// +//@Configuration +//@MapperScan(basePackages = com.docus.server.collection.config.DbSqlserverConfig.PACKAGE, sqlSessionFactoryRef = "dbsqlserverSqlSessionFactory") +//@EnableConfigurationProperties(MybatisPlusProperties.class) +//public class DbSqlserverConfig { +// // 这里一定要指定精准 否则后果不堪设想 +// static final String PACKAGE = "com.docus.server.collection.infrastructure.dao.sqlserver"; +// static final String MAPPER_LOCATION = "classpath:sqlserver/*.xml"; +// +// @Bean(name = "dbsqlserverDataSource") +// @ConfigurationProperties(prefix = "spring.datasource.sqlserver-docus") +// public DataSource secondDataSource(){ +// return new DruidDataSource(); +// } +// +// /*注入事务*/ +// @Bean(name = "dbsqlserverTransactionManager") +// public DataSourceTransactionManager secondTransactionManager() { +// return new DataSourceTransactionManager(secondDataSource()); +// } +// +// @Bean(name = "dbsqlserverSqlSessionFactory") +// public SqlSessionFactory secondSqlSessionFactory(@Qualifier("dbsqlserverDataSource") DataSource secondDataSource) +// throws Exception { +// final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); +// sessionFactory.setDataSource(secondDataSource); +// sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver() +// .getResources(com.docus.server.collection.config.DbSqlserverConfig.MAPPER_LOCATION)); +// return sessionFactory.getObject(); +// } +// +//} diff --git a/src/main/java/com/docus/server/collection/config/SystemMappingConfig.java b/src/main/java/com/docus/server/collection/config/SystemMappingConfig.java new file mode 100644 index 0000000..391af8b --- /dev/null +++ b/src/main/java/com/docus/server/collection/config/SystemMappingConfig.java @@ -0,0 +1,85 @@ +package com.docus.server.collection.config; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.docus.core.util.Func; +import com.docus.server.collection.util.TableJsonRead; +import lombok.Data; + +import java.util.List; + +/** + * 系统映射配置 + * + * @author wyb + */ +@Data +public class SystemMappingConfig { + private static final String CONFIG_FILE_PATH = "dataConfig"; + private static final String CONFIG_FILE_NAME = "System-Mapping.json"; + private static volatile boolean FLUSH; + private static volatile SystemMappingConfig INSTANCE; + private List mappings; + + @Override + public String toString() { + return "SystemMappingConfig{" + + "mappings=" + mappings + + '}'; + } + + private SystemMappingConfig() { + TableJsonRead jsonRead = new TableJsonRead(); + String readJson = jsonRead.readContent(CONFIG_FILE_PATH, CONFIG_FILE_NAME); + JSONObject jsonObject = Func.readJson(readJson, JSONObject.class); + if (jsonObject != null && jsonObject.getJSONArray("mappings") != null) { + JSONArray mappings = jsonObject.getJSONArray("mappings"); + this.mappings = Func.parseJsonArray(Func.toJson(mappings), SystemMapping.class); + } + } + + public static SystemMappingConfig getInstance() { + if (INSTANCE == null || FLUSH) { + synchronized (SystemMappingConfig.class) { + if (INSTANCE == null || FLUSH) { + INSTANCE = new SystemMappingConfig(); + } + } + } + return INSTANCE; + } + + /** + * 配置文件有更新,适用于不是程序动态改变的配置文件 + */ + public static void flush() { + FLUSH = true; + } + + + public List getMappings() { + return mappings; + } + + public static void main(String[] args) { + SystemMappingConfig instance = getInstance(); + System.out.println(instance); + SystemMappingConfig instance2 = getInstance(); + System.out.println(instance == instance2); + SystemMappingConfig.flush(); + SystemMappingConfig instance3 = getInstance(); + System.out.println(instance3 == instance2); + } + + @Data + public static class SystemMapping { + /** + * 医院系统标识 + */ + private String hospital; + /** + * 无纸化医院标识 + */ + private String wzh; + } +} diff --git a/src/main/java/com/docus/server/collection/config/UserSyncConfig.java b/src/main/java/com/docus/server/collection/config/UserSyncConfig.java new file mode 100644 index 0000000..a839af9 --- /dev/null +++ b/src/main/java/com/docus/server/collection/config/UserSyncConfig.java @@ -0,0 +1,16 @@ +package com.docus.server.collection.config; + +import lombok.Data; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +/** + * 用户同步配置 + * @author wyb + */ +@Data +@Component +public class UserSyncConfig { + @Value("${docus.user.defpwd:}") + private String password; +} diff --git a/src/main/java/com/docus/server/collection/controller/SzyZhController.java b/src/main/java/com/docus/server/collection/controller/SzyZhController.java new file mode 100644 index 0000000..ba240bc --- /dev/null +++ b/src/main/java/com/docus/server/collection/controller/SzyZhController.java @@ -0,0 +1,87 @@ +package com.docus.server.collection.controller; + +import cn.hutool.core.util.ObjectUtil; +import com.docus.infrastructure.web.api.CommonResult; +import com.docus.server.collection.dto.*; +import com.docus.server.collection.service.IPowerDeptService; +import com.docus.server.collection.service.IPowerUserService; +import com.docus.server.collection.service.ITBasicService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Api("省中医珠海分院相关接口") +@Slf4j +@RestController +@RequestMapping("/szy") +public class SzyZhController { + + @Autowired + private ITBasicService tBasicService; + + @Autowired + private IPowerDeptService powerDeptService; + + @Autowired + private IPowerUserService powerUserService; + + @ApiOperation("基础数据同步") + @PostMapping("/setRecord") + public CommonResult setRecord(@RequestBody List dtos) { + if(ObjectUtil.isEmpty(dtos)){ + return CommonResult.failed("数据为空"); + } + for (SzyTBasicDto dto : dtos) { + if(ObjectUtil.isEmpty(dto.getInpatientNo())){ + log.error("住院号为空"+dto.toString()); + return CommonResult.failed("住院号为空"); + } + if(ObjectUtil.isEmpty(dto.getJzh())){ + log.error("住院号为空"+dto.toString()); + return CommonResult.failed("住院流水号为空"); + } + } + tBasicService.setSzyTBasic(dtos); + return CommonResult.success("同步成功"); + } + + @ApiOperation("科室数据同步") + @PostMapping("/setDept") + public CommonResult setDept(@RequestBody List dtos) { + if(ObjectUtil.isEmpty(dtos)){ + return CommonResult.failed("数据为空"); + } + for (SzyDeptDto dto : dtos) { + if(ObjectUtil.isEmpty(dto.getDeptCode())){ + log.error("科室编号为空"+dto.toString()); + return CommonResult.failed("科室编号为空"); + } + if(ObjectUtil.isEmpty(dto.getDeptName())){ + log.error("科室名为空"+dto.toString()); + return CommonResult.failed("科室名为空"); + } + powerDeptService.add(dto); + } + return CommonResult.success("同步成功"); + } + + @ApiOperation("用户数据同步") + @PostMapping("/setUser") + public CommonResult setUser(@RequestBody List dtos) { + if(ObjectUtil.isEmpty(dtos)){ + return CommonResult.failed("数据为空"); + } + for (SzyUserDto dto : dtos) { + if(ObjectUtil.isEmpty(dto.getUserName())){ + log.error("用户工号为空"+dto.toString()); + return CommonResult.failed("用户工号为空"); + } + powerUserService.add(dto); + } + return CommonResult.success("同步成功"); + } +} diff --git a/src/main/java/com/docus/server/collection/dto/DeptDto.java b/src/main/java/com/docus/server/collection/dto/DeptDto.java new file mode 100644 index 0000000..74375cc --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/DeptDto.java @@ -0,0 +1,61 @@ +package com.docus.server.collection.dto; + +import lombok.Data; + +/** + * @author Fang Ruichuan + * @date 2022-11-14 19:02 + */ +@Data +public class DeptDto { + /** + * id-消息流水号 返回消息体需要 + */ + private String messageId; + /** + * 接收方 + */ + private String receiver; + + /** + * 用户操作 operateType有三种值:C 代表新增、U 代表修改、D 代表删除 + */ + private String operateType; + + /** + * 科室代码 + */ + private String deptCode; + + /** + * 科室名称 + */ + private String deptName; + + + /** + * 操作人名称 + */ + private String authorName; + + + /** + * 操作人ID + */ + private String authorId; + + + /** + * 转换用户修改对象 + * + * @return 用户修改对象 + */ + public DeptModifyParam transDeptAddParam() { + DeptModifyParam deptModifyParam = new DeptModifyParam(); + deptModifyParam.setDeptCode(this.deptCode); + deptModifyParam.setDeptName(this.getDeptName()); + deptModifyParam.setAuthorName(this.authorName); + deptModifyParam.setAuthorId(this.authorId); + return deptModifyParam; + } +} diff --git a/src/main/java/com/docus/server/collection/dto/DeptModifyParam.java b/src/main/java/com/docus/server/collection/dto/DeptModifyParam.java new file mode 100644 index 0000000..268ccb9 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/DeptModifyParam.java @@ -0,0 +1,38 @@ +package com.docus.server.collection.dto; + +import lombok.Data; + +/** + * @author wen yongbin + * @date 2023年2月26日00:21:00 + */ +@Data +public class DeptModifyParam { + + /** + * 科室主键id + */ + private Long deptId; + + /** + * 科室代码 + */ + private String deptCode; + + /** + * 科室名称 + */ + private String deptName; + + + /** + * 操作人名称 + */ + private String authorName; + + + /** + * 操作人ID + */ + private String authorId; +} diff --git a/src/main/java/com/docus/server/collection/dto/FirstPageCheckoutInDTO.java b/src/main/java/com/docus/server/collection/dto/FirstPageCheckoutInDTO.java new file mode 100644 index 0000000..bb75944 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/FirstPageCheckoutInDTO.java @@ -0,0 +1,24 @@ +package com.docus.server.collection.dto; + +import com.docus.server.collection.enums.FileSyncMethod; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author wyb + */ +@Data +@ApiModel("首页签出业务处理参数") +public class FirstPageCheckoutInDTO { + @ApiModelProperty("患者基础信息") + private PatientInfoDTO patientInfo; + + @ApiModelProperty("同步文件方式:ALL 或者 BY_SYS_ID") + private FileSyncMethod syncMethod; + + @ApiModelProperty("系统id,当同步文件方式为 BY_SYS_ID 时,此值必传") + private List sysId; +} diff --git a/src/main/java/com/docus/server/collection/dto/FirstPageCheckoutRequest.java b/src/main/java/com/docus/server/collection/dto/FirstPageCheckoutRequest.java new file mode 100644 index 0000000..205360d --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/FirstPageCheckoutRequest.java @@ -0,0 +1,26 @@ +package com.docus.server.collection.dto; + +import com.docus.server.collection.enums.FileSyncMethod; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author wyb + */ +@Data +@ApiModel("首页签出请求参数") +public class FirstPageCheckoutRequest { + + @ApiModelProperty("患者基础信息") + private PatientInfoDTO patientInfo; + + @ApiModelProperty("同步文件方式:ALL 或者 BY_SYS_ID") + private FileSyncMethod syncMethod; + + @ApiModelProperty("系统id") + private List sysId; + +} diff --git a/src/main/java/com/docus/server/collection/dto/PatientInfoDTO.java b/src/main/java/com/docus/server/collection/dto/PatientInfoDTO.java new file mode 100644 index 0000000..c59dba7 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/PatientInfoDTO.java @@ -0,0 +1,32 @@ +package com.docus.server.collection.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * + * @author 患者信息 + */ +@ApiModel("患者信息") +@Data +public class PatientInfoDTO { + + @ApiModelProperty("院方住院流水号,无纸化归档系统记账号") + private String inpatientNo; + + @ApiModelProperty("住院号") + private String patientNo; + + @ApiModelProperty("住院次数") + private Integer inTimes; + + @ApiModelProperty("患者姓名") + private String name; + + @ApiModelProperty("入院时间,格式:yyyy-MM-dd HH:mm:ss") + private String inDate; + + @ApiModelProperty("出院时间,格式:yyyy-MM-dd HH:mm:ss") + private String outDate; +} diff --git a/src/main/java/com/docus/server/collection/dto/SzyDeptDto.java b/src/main/java/com/docus/server/collection/dto/SzyDeptDto.java new file mode 100644 index 0000000..0c782a0 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/SzyDeptDto.java @@ -0,0 +1,38 @@ +package com.docus.server.collection.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author wen yongbin + * @date 2023年2月26日00:21:00 + */ +@Data +public class SzyDeptDto { + + /** + * 科室代码 + */ + @ApiModelProperty(value = "科室代码") + private String deptCode; + + /** + * 科室名称 + */ + @ApiModelProperty(value = "科室名称") + private String deptName; + + + /** + * 操作人名称 + */ + @ApiModelProperty(value = "操作人名称") + private String authorName; + + + /** + * 操作人ID + */ + @ApiModelProperty(value = "操作人ID") + private String authorId; +} diff --git a/src/main/java/com/docus/server/collection/dto/SzyTBasicDto.java b/src/main/java/com/docus/server/collection/dto/SzyTBasicDto.java new file mode 100644 index 0000000..e7464b0 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/SzyTBasicDto.java @@ -0,0 +1,82 @@ +package com.docus.server.collection.dto; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 病案基本信息 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "TBasic对象", description = "病案基本信息") +public class SzyTBasicDto implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "住院号") + private String inpatientNo; + + @ApiModelProperty(value = "住院流水号") + private String jzh; + + @ApiModelProperty(value = "住院次数") + private Integer admissTimes; + + @ApiModelProperty(value = "患者姓名") + private String name; + + @ApiModelProperty(value = "性别 1难 2女") + private String sex; + + @ApiModelProperty(value = "年龄_岁") + private Integer age; + + @ApiModelProperty(value = "身份证") + private String idCard; + + @ApiModelProperty(value = "住院日期yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date admissDate; + + @ApiModelProperty(value = "住院科室") + private String admissDept; + + @ApiModelProperty(value = "住院科室名称") + private String admissDeptName; + + @ApiModelProperty(value = "出院日期yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date disDate; + + @ApiModelProperty(value = "出院科室") + private String disDept; + + @ApiModelProperty(value = "出院科室名称") + private String disDeptName; + + @ApiModelProperty(value = "实际住院天数") + private Integer admissDays; + + @ApiModelProperty(value = "主管医生") + private String attending; + + @ApiModelProperty(value = "主管医生名称") + private String attendingName; + + @ApiModelProperty(value = "是否死亡 0否,1是") + private Integer isDead; + +} diff --git a/src/main/java/com/docus/server/collection/dto/SzyUserDto.java b/src/main/java/com/docus/server/collection/dto/SzyUserDto.java new file mode 100644 index 0000000..d560e29 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/SzyUserDto.java @@ -0,0 +1,45 @@ +package com.docus.server.collection.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author Fang Ruichuan + * @date 2022-11-14 19:02 + */ +@Data +public class SzyUserDto { + /** + * 用户姓名 + */ + @ApiModelProperty(value = "用户姓名") + private String name; + /** + * 用户工号 + */ + @ApiModelProperty(value = "用户工号") + private String userName; + /** + * 所属科室编号 + */ + @ApiModelProperty(value = "所属科室编号") + private String deptId; + /** + * 角色Id 初始 0 + */ + @ApiModelProperty(value = "角色Id 初始 0") + private Long roleId; + + /** + * 操作人名称 + */ + @ApiModelProperty(value = "操作人名称") + private String authorName; + + + /** + * 操作人ID + */ + @ApiModelProperty(value = "操作人ID") + private String authorId; +} diff --git a/src/main/java/com/docus/server/collection/dto/TBasicDto.java b/src/main/java/com/docus/server/collection/dto/TBasicDto.java new file mode 100644 index 0000000..5528eb7 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/TBasicDto.java @@ -0,0 +1,35 @@ +package com.docus.server.collection.dto; + +import lombok.Data; + +/** + * @BelongsProject: docus-webservice-sdry + * @BelongsPackage: com.docus.server.collection.webservice + * @Author: chierhao + * @CreateTime: 2023-02-25 14:44 + * @Description: TODO + * @Version: 1.0 + */ +@Data +public class TBasicDto { + private String jzh; + private String inpatientNo; + private String admissTimes; + private String name ; + private String admissDate ; + private String disDate ; + private String admissDeptName ; + private String disDeptName ; + private String attending; + private String attendingName; + private String dutyNurse; + private String age; + private String sex; + private String idCard; + private String disDept; + private String admissDept; + private String bedNum; + private String isDead; + private String admissDays; + private String motherInpatientNo; +} diff --git a/src/main/java/com/docus/server/collection/dto/UserDto.java b/src/main/java/com/docus/server/collection/dto/UserDto.java new file mode 100644 index 0000000..1d955b7 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/UserDto.java @@ -0,0 +1,74 @@ +package com.docus.server.collection.dto; + +import lombok.Data; + +/** + * @author Fang Ruichuan + * @date 2022-11-14 19:02 + */ +@Data +public class UserDto { + /** + * id-消息流水号 返回消息体需要 + */ + private String messageId; + /** + * 接收方 + */ + private String receiver; + + /** + * 用户操作 operateType有三种值:C 代表新增、U 代表修改、D 代表删除 + */ + private String operateType; + + /** + * 用户姓名 + */ + private String name; + /** + * 用户工号 + */ + private String userName; + /** + * 所属科室编号 + */ + private String deptId; + /** + * 到时同步完让实施找下不重复的导入到角色表,程序再判断职位对应角色表存角色id(roleId),初始roleId=0 + */ + private String position; + /** + * 角色Id 初始 0 + */ + private Long roleId; + + /** + * 操作人名称 + */ + private String authorName; + + + /** + * 操作人ID + */ + private String authorId; + + + /** + * 转换用户修改对象 + * + * @return 用户修改对象 + */ + public UserModifyParam transUserAddParam() { + UserModifyParam userModifyParam = new UserModifyParam(); + userModifyParam.setUserName(this.userName); + userModifyParam.setName(this.name); + userModifyParam.setPosition(this.position); + userModifyParam.setRoleId(this.roleId); + userModifyParam.setDeptId(this.deptId); + userModifyParam.setAuthorName(this.authorName); + userModifyParam.setAuthorId(this.authorId); + return userModifyParam; + } +} diff --git a/src/main/java/com/docus/server/collection/dto/UserModifyParam.java b/src/main/java/com/docus/server/collection/dto/UserModifyParam.java new file mode 100644 index 0000000..830cba3 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/UserModifyParam.java @@ -0,0 +1,50 @@ +package com.docus.server.collection.dto; + +import lombok.Data; + +/** + * @author Fang Ruichuan + * @date 2022-11-14 19:02 + */ +@Data +public class UserModifyParam { + /** + * 用户id + */ + private Long userId; + /** + * 用户姓名 + */ + private String name; + /** + * 用户工号 + */ + private String userName; + /** + * 所属科室编号 + */ + private String deptId; + /** + * 到时同步完让实施找下不重复的导入到角色表,程序再判断职位对应角色表存角色id(roleId),初始roleId=0 + */ + private String position; + /** + * 角色Id 初始 0 + */ + private Long roleId; + /** + * 用户密码 + */ + private String userPwd; + + /** + * 操作人名称 + */ + private String authorName; + + + /** + * 操作人ID + */ + private String authorId; +} diff --git a/src/main/java/com/docus/server/collection/dto/VJsjWzh7addnjreportDto.java b/src/main/java/com/docus/server/collection/dto/VJsjWzh7addnjreportDto.java new file mode 100644 index 0000000..f9ea4cf --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/VJsjWzh7addnjreportDto.java @@ -0,0 +1,28 @@ +package com.docus.server.collection.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @BelongsProject: docus-mzzy-collector + * @BelongsPackage: com.docus.server.collection.entity + * @Author: chierhao + * @CreateTime: 2024-07-31 15:47 + * @Description: TODO + * @Version: 1.0 + */ +@Data +public class VJsjWzh7addnjreportDto { + + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "住院号") + private String inpatientNo; + + @ApiModelProperty(value = "报告开始时间 格式(yyyy-MM-dd)") + private String startReportDateTime; + + @ApiModelProperty(value = "报告结束时间 格式(yyyy-MM-dd)") + private String endReportDateTime; +} diff --git a/src/main/java/com/docus/server/collection/entity/CollectSysDictionary.java b/src/main/java/com/docus/server/collection/entity/CollectSysDictionary.java new file mode 100644 index 0000000..1121cf5 --- /dev/null +++ b/src/main/java/com/docus/server/collection/entity/CollectSysDictionary.java @@ -0,0 +1,24 @@ +package com.docus.server.collection.entity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + + + +@Data + +public class CollectSysDictionary implements Serializable { + + @ApiModelProperty(value = "id 雪花算法") + private Long id; + + + @ApiModelProperty(value = "采集来源系统编号") + private String sysCode; + + @ApiModelProperty(value = "采集来源系统名称") + private String sysName; + +} diff --git a/src/main/java/com/docus/server/collection/entity/VJsjWzh7addnjreport.java b/src/main/java/com/docus/server/collection/entity/VJsjWzh7addnjreport.java new file mode 100644 index 0000000..50111f5 --- /dev/null +++ b/src/main/java/com/docus/server/collection/entity/VJsjWzh7addnjreport.java @@ -0,0 +1,48 @@ +package com.docus.server.collection.entity; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.metadata.BaseRowModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @BelongsProject: docus-mzzy-collector + * @BelongsPackage: com.docus.server.collection.entity + * @Author: chierhao + * @CreateTime: 2024-07-31 15:47 + * @Description: TODO + * @Version: 1.0 + */ +@Data +public class VJsjWzh7addnjreport extends BaseRowModel { + + @ApiModelProperty(value = "姓名") + @ExcelProperty(value = {"姓名"}, index =0 ) + private String name; + + @ApiModelProperty(value = "住院号") + @ExcelProperty(value = {"住院号"}, index =1 ) + private String inpatientNo; + + @ApiModelProperty(value = "类型") + @ExcelProperty(value = {"类型"}, index =2 ) + private String type; + + @ApiModelProperty(value = "申请科室") + @ExcelProperty(value = {"申请科室"}, index =3 ) + private String dept; + + @ApiModelProperty(value = "项目") + @ExcelProperty(value = {"项目"}, index =4 ) + private String item; + + @ApiModelProperty(value = "登记时间") + @ExcelProperty(value = {"登记时间"}, index =5 ) + private Date registDateTime; + + @ApiModelProperty(value = "报告时间") + @ExcelProperty(value = {"报告时间"}, index =6 ) + private Date reportDateTime; +} diff --git a/src/main/java/com/docus/server/collection/entity/VJsjWzh7addnjreportVo.java b/src/main/java/com/docus/server/collection/entity/VJsjWzh7addnjreportVo.java new file mode 100644 index 0000000..831073f --- /dev/null +++ b/src/main/java/com/docus/server/collection/entity/VJsjWzh7addnjreportVo.java @@ -0,0 +1,46 @@ +package com.docus.server.collection.entity; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.metadata.BaseRowModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @BelongsProject: docus-mzzy-collector + * @BelongsPackage: com.docus.server.collection.entity + * @Author: chierhao + * @CreateTime: 2024-07-31 15:47 + * @Description: TODO + * @Version: 1.0 + */ +@Data +public class VJsjWzh7addnjreportVo extends BaseRowModel { + + @ApiModelProperty(value = "姓名") + @ExcelProperty(value = {"姓名"}, index =0 ) + private String name; + + @ApiModelProperty(value = "住院号") + @ExcelProperty(value = {"住院号"}, index =1 ) + private String inpatientNo; + + @ApiModelProperty(value = "类型") + @ExcelProperty(value = {"类型"}, index =2 ) + private String type; + + @ApiModelProperty(value = "申请科室") + @ExcelProperty(value = {"申请科室"}, index =3 ) + private String dept; + + @ApiModelProperty(value = "项目") + @ExcelProperty(value = {"项目"}, index =4 ) + private String item; + + @ApiModelProperty(value = "登记时间") + @ExcelProperty(value = {"登记时间"}, index =5 ) + private String registDateTime; + + @ApiModelProperty(value = "报告时间") + @ExcelProperty(value = {"报告时间"}, index =6 ) + private String reportDateTime; +} diff --git a/src/main/java/com/docus/server/collection/enums/FileSyncMethod.java b/src/main/java/com/docus/server/collection/enums/FileSyncMethod.java new file mode 100644 index 0000000..b9f0baa --- /dev/null +++ b/src/main/java/com/docus/server/collection/enums/FileSyncMethod.java @@ -0,0 +1,17 @@ +package com.docus.server.collection.enums; + +/** + * 同步文件的方式 全部或者根据系统id同步 + * + * @author wyb + */ +public enum FileSyncMethod { + /** + * 全部同步 + */ + ALL, + /** + * 根据系统id同步 + */ + BY_SYS_ID +} \ No newline at end of file diff --git a/src/main/java/com/docus/server/collection/infrastructure/dao/entity/PowerDept.java b/src/main/java/com/docus/server/collection/infrastructure/dao/entity/PowerDept.java new file mode 100644 index 0000000..0e8cb34 --- /dev/null +++ b/src/main/java/com/docus/server/collection/infrastructure/dao/entity/PowerDept.java @@ -0,0 +1,61 @@ +package com.docus.server.collection.infrastructure.dao.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 科室 + *

+ * + * @author jiashi + * @since 2021-04-15 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "PowerDept对象", description = "科室") +public class PowerDept implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "科室id") + private Long deptId; + + @ApiModelProperty(value = "科室代码") + private String deptCode; + + @ApiModelProperty(value = "科室名称") + private String deptName; + + @ApiModelProperty(value = "字典id") + private Integer dictId; + + @ApiModelProperty(value = "是否有效") + private Integer effective; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "创建人") + private String creater; + + @ApiModelProperty(value = "更新时间") + private Date updateDate; + + @ApiModelProperty(value = "更新人") + private String updater; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "临床科室排序") + private Integer sort; + + @ApiModelProperty(value = "0:非临床科室,1:临床科室") + private Integer type; +} diff --git a/src/main/java/com/docus/server/collection/infrastructure/dao/entity/PowerUser.java b/src/main/java/com/docus/server/collection/infrastructure/dao/entity/PowerUser.java new file mode 100644 index 0000000..5823f2c --- /dev/null +++ b/src/main/java/com/docus/server/collection/infrastructure/dao/entity/PowerUser.java @@ -0,0 +1,85 @@ +package com.docus.server.collection.infrastructure.dao.entity; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="PowerUser对象", description="用户表") +public class PowerUser implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "用户id") + private Long userId; + + @ApiModelProperty(value = "登陆名") + private String userName; + + @ApiModelProperty(value = "用户密码") + private String userPwd; + + @ApiModelProperty(value = "性别 0 男 1 女") + private Integer userSex; + + @ApiModelProperty(value = "年龄") + private Integer userAge; + + @ApiModelProperty(value = "电话") + private String userTel; + + @ApiModelProperty(value = "邮箱") + private String userEmail; + + @ApiModelProperty(value = "微信信息") + private String wxBank; + + @ApiModelProperty(value = "职位") + private String userPosition; + + @ApiModelProperty(value = "角色") + private Long roleId; + + @ApiModelProperty(value = "部门id") + private String deptId; + + @ApiModelProperty(value = "是否有效") + private Integer effective; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "创建人") + private String creater; + + @ApiModelProperty(value = "更新时间") + private Date updateDate; + + @ApiModelProperty(value = "更新人") + private String updater; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "登录标志 默认为0为未登录 1登录") + private Integer loginFlag; + + @ApiModelProperty(value = "用户名称") + private String name; + + @ApiModelProperty(value = "所属科室代码 多个以,分隔") + private String deptCode; + + @ApiModelProperty(value = "权限科室 拥有对科室查阅权限") + private String powerDept; + + @ApiModelProperty(value = "权限 拥有对主管医生查阅权限") + private String powerAttending; + +} diff --git a/src/main/java/com/docus/server/collection/infrastructure/dao/entity/TBasic.java b/src/main/java/com/docus/server/collection/infrastructure/dao/entity/TBasic.java new file mode 100644 index 0000000..aaf0a3d --- /dev/null +++ b/src/main/java/com/docus/server/collection/infrastructure/dao/entity/TBasic.java @@ -0,0 +1,100 @@ +package com.docus.server.collection.infrastructure.dao.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 病案基本信息 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "TBasic对象", description = "病案基本信息") +public class TBasic implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "病案主键") + @TableId(value = "patient_id", type = IdType.ASSIGN_ID) + private Long patientId; + + @ApiModelProperty(value = "住院次数") + private Integer admissTimes; + + @ApiModelProperty(value = "病案号") + private String inpatientNo; + + @ApiModelProperty(value = "患者姓名") + private String name; + + @ApiModelProperty(value = "性别") + private String sex; + + @ApiModelProperty(value = "年龄_岁") + private Integer age; + + @ApiModelProperty(value = "身份证") + private String idCard; + + @ApiModelProperty(value = "住院日期") + private Date admissDate; + + @ApiModelProperty(value = "住院科室") + private String admissDept; + + @ApiModelProperty(value = "住院科室名称") + private String admissDeptName; + + @ApiModelProperty(value = "出院日期") + private Date disDate; + + @ApiModelProperty(value = "出院科室") + private String disDept; + + @ApiModelProperty(value = "出院科室名称") + private String disDeptName; + + @ApiModelProperty(value = "实际住院天数") + private Integer admissDays; + + @ApiModelProperty(value = "主管医生") + private String attending; + + @ApiModelProperty(value = "主管医生名称") + private String attendingName; + + @ApiModelProperty(value = "是否死亡") + private Integer isDead; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "性别名称") + private String sexName; + + @ApiModelProperty(value = "记账号") + private String jzh; + + @ApiModelProperty(value = "床位号") + private String bedNum; + + @ApiModelProperty(value = "责任护士") + private String dutyNurse; + + @ApiModelProperty(value = "是否其他数据 0否,1是婴儿,2医疗保险类别是家庭病床") + private Integer isOther; + + @ApiModelProperty(value = "婴儿母亲住院流水号") + private String motherInpatientNo; +} diff --git a/src/main/java/com/docus/server/collection/infrastructure/dao/entity/TBasicExtend.java b/src/main/java/com/docus/server/collection/infrastructure/dao/entity/TBasicExtend.java new file mode 100644 index 0000000..e584346 --- /dev/null +++ b/src/main/java/com/docus/server/collection/infrastructure/dao/entity/TBasicExtend.java @@ -0,0 +1,33 @@ +package com.docus.server.collection.infrastructure.dao.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @BelongsProject: docus-webservice-sdry + * @BelongsPackage: com.docus.server.collection.entity + * @Author: chierhao + * @CreateTime: 2023-03-07 15:29 + * @Description: TODO + * @Version: 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "tBasicExtend对象", description = "病案基本信息扩展") +public class TBasicExtend implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "病案主键") + private String patientId; + + @ApiModelProperty(value = "病区编号") + private String wardCode; + + @ApiModelProperty(value = "病区名称") + private String wardName; +} diff --git a/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/CollectSysDictionaryMapper.java b/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/CollectSysDictionaryMapper.java new file mode 100644 index 0000000..0c6fa19 --- /dev/null +++ b/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/CollectSysDictionaryMapper.java @@ -0,0 +1,23 @@ +package com.docus.server.collection.infrastructure.dao.mapper; + +import com.docus.server.collection.entity.CollectSysDictionary; + +import java.util.List; + +/** + *

+ * 采集系统字典 mapper + *

+ * + * @author wen yongbin + * @since 2023-7-26 08:45:51 + */ +public interface CollectSysDictionaryMapper { + + /** + * 查询无纸化系统所有的采集系统字典 + * @return 无纸化系统所有的采集系统字典 + */ + List findAll(); + +} diff --git a/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/PowerDeptMapper.java b/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/PowerDeptMapper.java new file mode 100644 index 0000000..5a2ba4d --- /dev/null +++ b/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/PowerDeptMapper.java @@ -0,0 +1,44 @@ +package com.docus.server.collection.infrastructure.dao.mapper; + +import com.docus.server.collection.dto.DeptModifyParam; +import com.docus.server.collection.infrastructure.dao.entity.PowerDept; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 科室表 mapper + *

+ * + * @author wen yongbin + * @since 2023年2月25日22:28:58 + */ +public interface PowerDeptMapper { + + /** + * 根据科室编码查询科室信息 + * @param deptCode 科室编码 + * @return 科室信息 + */ + PowerDept getDeptByDeptCode(@Param("deptCode") String deptCode); + + /** + * 更新用户信息 + * @param deptModifyParam 科室操作参数 + * @return 数据库更新信息 + */ + int updateDept(@Param("dept") DeptModifyParam deptModifyParam); + + /** + * 添加新科室 + * @param deptModifyParam 科室操作参数 + * @return 数据库添加信息 + */ + int addDept(@Param("dept") DeptModifyParam deptModifyParam); + + /** + * 根据科室编码删除科室信息 + * @param deptCode 科室编码 + * @return 数据库删除信息 + */ + int delDeptByDeptCode(@Param("deptCode") String deptCode); +} diff --git a/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/PowerUserMapper.java b/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/PowerUserMapper.java new file mode 100644 index 0000000..66ecfde --- /dev/null +++ b/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/PowerUserMapper.java @@ -0,0 +1,44 @@ +package com.docus.server.collection.infrastructure.dao.mapper; + +import com.docus.server.collection.dto.UserModifyParam; +import com.docus.server.collection.infrastructure.dao.entity.PowerUser; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 用户表 mapper + *

+ * + * @author wen yongbin + * @since 2023年2月25日22:28:58 + */ +public interface PowerUserMapper { + + /** + * 根据用户工号查询用户信息 + * @param userName 用户工号 + * @return 用户信息 + */ + PowerUser getUserByUserName(@Param("userName") String userName); + + /** + * 更新用户信息 + * @param userModifyParam 用户操作参数 + * @return 数据库更新信息 + */ + int updateUser(@Param("user") UserModifyParam userModifyParam); + + /** + * 添加新用户 + * @param userModifyParam 用户操作参数 + * @return 数据库添加信息 + */ + int addUser(@Param("user") UserModifyParam userModifyParam); + + /** + * 根据用户工号删除用户信息 + * @param userName 用户工号 + * @return 数据库删除信息 + */ + int delUserByUserName(@Param("userName") String userName); +} diff --git a/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/TBasicMapper.java b/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/TBasicMapper.java new file mode 100644 index 0000000..0acc74b --- /dev/null +++ b/src/main/java/com/docus/server/collection/infrastructure/dao/mapper/TBasicMapper.java @@ -0,0 +1,30 @@ +package com.docus.server.collection.infrastructure.dao.mapper; + + +import com.docus.server.collection.infrastructure.dao.entity.TBasic; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + *

+ * 病案基本信息 Mapper 接口 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +public interface TBasicMapper{ + + Integer selectOne(@Param("jzh") String jzh); + + Integer insertBatch(@Param("tBasicList") List tBasicList); + + Integer update(@Param("tBasic") TBasic tBasic); + + String getPatientIdByJzh(@Param("jzh") String jzh); + + List getPatientIdByMomJzh(@Param("momJzh") String momJzh); + + List getPid(); +} diff --git a/src/main/java/com/docus/server/collection/infrastructure/dao/sqlserver/VJsjWzh7addnjreportMapper.java b/src/main/java/com/docus/server/collection/infrastructure/dao/sqlserver/VJsjWzh7addnjreportMapper.java new file mode 100644 index 0000000..862baed --- /dev/null +++ b/src/main/java/com/docus/server/collection/infrastructure/dao/sqlserver/VJsjWzh7addnjreportMapper.java @@ -0,0 +1,21 @@ +package com.docus.server.collection.infrastructure.dao.sqlserver; + +import com.docus.server.collection.dto.VJsjWzh7addnjreportDto; +import com.docus.server.collection.entity.VJsjWzh7addnjreport; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @BelongsProject: docus-mzzy-collector + * @BelongsPackage: com.docus.server.collection.infrastructure.dao.mapper.sqlserver + * @Author: chierhao + * @CreateTime: 2024-07-31 14:31 + * @Description: TODO + * @Version: 1.0 + */ +public interface VJsjWzh7addnjreportMapper { + List getList(); + + List getReport(@Param("dto") VJsjWzh7addnjreportDto dto); +} diff --git a/src/main/java/com/docus/server/collection/service/IPowerDeptService.java b/src/main/java/com/docus/server/collection/service/IPowerDeptService.java new file mode 100644 index 0000000..ae9b4a9 --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/IPowerDeptService.java @@ -0,0 +1,33 @@ +package com.docus.server.collection.service; + +import com.docus.server.collection.dto.DeptDto; +import com.docus.server.collection.dto.SzyDeptDto; + +/** + * 用户服务 + */ +public interface IPowerDeptService { + /** + * 科室注册 + * + * @param deptDto 用户注册参数 + * @return 处理结果 + */ + boolean register(DeptDto deptDto); + + /** + * 根据科室编号删除科室 + * + * @param deptCode 科室编码 + * @return 删除结果 + */ + boolean delDeptByDeptCode(String deptCode); + + /** + * 科室注册 + * + * @param deptDto 用户注册参数 + * @return 处理结果 + */ + void add(SzyDeptDto deptDto); +} diff --git a/src/main/java/com/docus/server/collection/service/IPowerUserService.java b/src/main/java/com/docus/server/collection/service/IPowerUserService.java new file mode 100644 index 0000000..4257199 --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/IPowerUserService.java @@ -0,0 +1,27 @@ +package com.docus.server.collection.service; + +import com.docus.server.collection.dto.SzyUserDto; +import com.docus.server.collection.dto.UserDto; + +/** + * 用户服务 + */ +public interface IPowerUserService { + /** + * 用户注册 + * + * @param userDto 用户注册参数 + * @return 处理结果 + */ + boolean register(UserDto userDto); + + /** + * 根据用户工号删除用户 + * + * @param userName 用户工号 + * @return 删除结果 + */ + boolean delUserByUserName(String userName); + + void add(SzyUserDto dto); +} diff --git a/src/main/java/com/docus/server/collection/service/ITBasicService.java b/src/main/java/com/docus/server/collection/service/ITBasicService.java new file mode 100644 index 0000000..130faec --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/ITBasicService.java @@ -0,0 +1,12 @@ +package com.docus.server.collection.service; + +import com.docus.server.collection.dto.SzyTBasicDto; + +import java.io.IOException; +import java.util.List; + +public interface ITBasicService { + + void setSzyTBasic(List dtos) ; + +} diff --git a/src/main/java/com/docus/server/collection/service/impl/PowerDeptServiceImpl.java b/src/main/java/com/docus/server/collection/service/impl/PowerDeptServiceImpl.java new file mode 100644 index 0000000..138c374 --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/impl/PowerDeptServiceImpl.java @@ -0,0 +1,69 @@ +package com.docus.server.collection.service.impl; + +import com.docus.core.util.Func; +import com.docus.infrastructure.redis.service.IdService; +import com.docus.server.collection.dto.DeptDto; +import com.docus.server.collection.dto.DeptModifyParam; +import com.docus.server.collection.dto.SzyDeptDto; +import com.docus.server.collection.infrastructure.dao.entity.PowerDept; +import com.docus.server.collection.infrastructure.dao.mapper.PowerDeptMapper; +import com.docus.server.collection.service.IPowerDeptService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 科室服务实现 + * + * @author wyb + */ +@Service +public class PowerDeptServiceImpl implements IPowerDeptService { + @Resource + private PowerDeptMapper powerDeptMapper; + @Resource + private IdService idService; + + @Override + public boolean register(DeptDto deptDto) { + PowerDept powerDept = powerDeptMapper.getDeptByDeptCode(deptDto.getDeptCode()); + DeptModifyParam deptModifyParam = deptDto.transDeptAddParam(); + if (Func.isEmpty(powerDept)) { + long deptId = idService.getDateSeq(); + deptModifyParam.setDeptId(deptId); + powerDeptMapper.addDept(deptModifyParam); + return true; + } + deptModifyParam.setDeptId(powerDept.getDeptId()); + powerDeptMapper.updateDept(deptModifyParam); + return true; + } + + @Override + public boolean delDeptByDeptCode(String deptCode) { + PowerDept powerDept = powerDeptMapper.getDeptByDeptCode(deptCode); + if (Func.isEmpty(powerDept)) { + return true; + } + powerDeptMapper.delDeptByDeptCode(deptCode); + return true; + } + + @Override + public void add(SzyDeptDto deptDto) { + PowerDept powerDept = powerDeptMapper.getDeptByDeptCode(deptDto.getDeptCode()); + DeptModifyParam deptModifyParam =new DeptModifyParam(); + deptModifyParam.setAuthorId(deptDto.getAuthorId()); + deptModifyParam.setAuthorName(deptDto.getAuthorName()); + deptModifyParam.setDeptCode(deptDto.getDeptCode()); + deptModifyParam.setDeptName(deptDto.getDeptName()); + if (Func.isEmpty(powerDept)) { + long deptId = idService.getDateSeq(); + deptModifyParam.setDeptId(deptId); + powerDeptMapper.addDept(deptModifyParam); + return; + } + deptModifyParam.setDeptId(powerDept.getDeptId()); + powerDeptMapper.updateDept(deptModifyParam); + } +} diff --git a/src/main/java/com/docus/server/collection/service/impl/PowerUserServiceImpl.java b/src/main/java/com/docus/server/collection/service/impl/PowerUserServiceImpl.java new file mode 100644 index 0000000..8268c11 --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/impl/PowerUserServiceImpl.java @@ -0,0 +1,76 @@ +package com.docus.server.collection.service.impl; + +import com.docus.core.util.Func; +import com.docus.infrastructure.redis.service.IdService; +import com.docus.server.collection.config.UserSyncConfig; +import com.docus.server.collection.dto.SzyUserDto; +import com.docus.server.collection.dto.UserDto; +import com.docus.server.collection.dto.UserModifyParam; +import com.docus.server.collection.infrastructure.dao.entity.PowerUser; +import com.docus.server.collection.infrastructure.dao.mapper.PowerUserMapper; +import com.docus.server.collection.service.IPowerUserService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 用户服务实现 + * + * @author wyb + */ +@Service +public class PowerUserServiceImpl implements IPowerUserService { + @Resource + private PowerUserMapper powerUserMapper; + @Resource + private IdService idService; + @Resource + private UserSyncConfig syncConfig; + + @Override + public boolean register(UserDto userDto) { + PowerUser powerUser = powerUserMapper.getUserByUserName(userDto.getUserName()); + UserModifyParam userModifyParam = userDto.transUserAddParam(); + if (Func.isEmpty(powerUser)) { + long userId = idService.getDateSeq(); + userModifyParam.setUserId(userId); + userModifyParam.setUserPwd(syncConfig.getPassword()); + powerUserMapper.addUser(userModifyParam); + return true; + } + userModifyParam.setUserId(powerUser.getUserId()); + powerUserMapper.updateUser(userModifyParam); + return true; + } + + @Override + public boolean delUserByUserName(String userName) { + PowerUser powerUser = powerUserMapper.getUserByUserName(userName); + if (Func.isEmpty(powerUser)) { + return true; + } + powerUserMapper.delUserByUserName(userName); + return true; + } + + @Override + public void add(SzyUserDto dto) { + PowerUser powerUser = powerUserMapper.getUserByUserName(dto.getUserName()); + UserModifyParam userModifyParam = new UserModifyParam(); + userModifyParam.setAuthorId(dto.getAuthorId()); + userModifyParam.setAuthorName(dto.getAuthorName()); + userModifyParam.setDeptId(dto.getDeptId()); + userModifyParam.setName(dto.getName()); + userModifyParam.setRoleId(dto.getRoleId()); + userModifyParam.setUserName(dto.getUserName()); + if (Func.isEmpty(powerUser)) { + long userId = idService.getDateSeq(); + userModifyParam.setUserId(userId); + userModifyParam.setUserPwd(syncConfig.getPassword()); + powerUserMapper.addUser(userModifyParam); + return ; + } + userModifyParam.setUserId(powerUser.getUserId()); + powerUserMapper.updateUser(userModifyParam); + } +} diff --git a/src/main/java/com/docus/server/collection/service/impl/TBasicServiceImpl.java b/src/main/java/com/docus/server/collection/service/impl/TBasicServiceImpl.java new file mode 100644 index 0000000..786c184 --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/impl/TBasicServiceImpl.java @@ -0,0 +1,99 @@ +package com.docus.server.collection.service.impl; + +import cn.hutool.core.util.NumberUtil; +import com.docus.core.util.DateUtil; +import com.docus.core.util.Func; +import com.docus.core.util.ObjectUtil; +import com.docus.infrastructure.redis.service.IdService; +import com.docus.server.collection.dto.SzyTBasicDto; +import com.docus.server.collection.dto.TBasicDto; +import com.docus.server.collection.infrastructure.dao.entity.TBasic; +import com.docus.server.collection.infrastructure.dao.mapper.TBasicMapper; +import com.docus.server.collection.service.ITBasicService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.*; +import java.time.Duration; +import java.util.*; + +/** + * @BelongsProject: docus-webservice-sdry + * @BelongsPackage: com.docus.server.collection.service.impl + * @Author: chierhao + * @CreateTime: 2023-02-28 08:37 + * @Description: TODO + * @Version: 1.0 + */ +@Service +@Slf4j +public class TBasicServiceImpl implements ITBasicService { + + @Resource + private TBasicMapper tBasicMapper; + + @Resource + private IdService idService; + + @Override + public void setSzyTBasic(List dtos) { + //持久化对像集合转化 + List tBasicList=new ArrayList(); + for(SzyTBasicDto dto:dtos){ + //判断jzh是否重复 + Integer num = tBasicMapper.selectOne(dto.getJzh()); + + Long patientId = idService.getDateSeq(); + + String sexName=""; + if("1".equals(dto.getSex())){ + sexName="男"; + } + if("2".equals(dto.getSex())){ + sexName="女"; + } + + //组装数据 + TBasic tBasic=new TBasic(); + tBasic.setPatientId(patientId); + tBasic.setJzh(dto.getJzh()); + tBasic.setInpatientNo(dto.getInpatientNo()); + tBasic.setAdmissTimes(dto.getAdmissTimes()); + tBasic.setAdmissDays(dto.getAdmissDays()); + tBasic.setName(dto.getName()); + tBasic.setAge(dto.getAge()); + tBasic.setSexName(sexName); + tBasic.setSex(dto.getSex()); + tBasic.setIsDead(dto.getIsDead()); + tBasic.setAttendingName(dto.getAttendingName()); + tBasic.setAttending(dto.getAttending()); + tBasic.setIdCard(dto.getIdCard()); + tBasic.setAdmissDate(dto.getAdmissDate()); + tBasic.setAdmissDept(dto.getAdmissDept()); + tBasic.setAdmissDeptName(dto.getAdmissDeptName()); + tBasic.setDisDate(dto.getDisDate()); + tBasic.setDisDept(dto.getDisDept()); + tBasic.setDisDeptName(dto.getDisDeptName()); + tBasic.setCreateTime(DateUtil.now()); + if (num>0) { + log.info("更新,jzh为"+tBasic.getJzh()); + tBasicMapper.update(tBasic); + }else{ + tBasicList.add(tBasic); + } + log.info("tBasic:"+tBasic.toString()); + } + //批量插入 + if(Func.isNotEmpty(tBasicList)){ + log.info("新增"+tBasicList.size()+"条基础数据开始"); + tBasicMapper.insertBatch(tBasicList); + log.info("新增"+tBasicList.size()+"条基础数据结束"); + } + } + +} + + diff --git a/src/main/java/com/docus/server/collection/util/DateTimeUtil.java b/src/main/java/com/docus/server/collection/util/DateTimeUtil.java new file mode 100644 index 0000000..7b91b9d --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/DateTimeUtil.java @@ -0,0 +1,27 @@ +package com.docus.server.collection.util; + + +import cn.hutool.core.date.DatePattern; +import com.docus.core.util.Func; + +/** + * 日期时间的工具类 + * @author wyb + */ +public class DateTimeUtil { + + /** + * 是否是一个标准的时间格式,yyyy-MM-dd HH:mm:ss" 字符串 + * @param dateTimeStr 时间格式字符串 + * @return 能否解析成标准的时间格式 + */ + public static boolean isNormDateTime(String dateTimeStr) { + try { + Func.parseDate(dateTimeStr, DatePattern.NORM_DATETIME_PATTERN); + return true; + } catch (Exception ex) { + return false; + } + } + +} diff --git a/src/main/java/com/docus/server/collection/util/IdUtil.java b/src/main/java/com/docus/server/collection/util/IdUtil.java new file mode 100644 index 0000000..f1650f9 --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/IdUtil.java @@ -0,0 +1,19 @@ +package com.docus.server.collection.util; + +import lombok.Data; + +import java.util.UUID; +import java.util.concurrent.ThreadLocalRandom; + +@Data +public class IdUtil { + /** + * 得到一个标准的 8-4-4-4-12 UUID + * @return 标准的 8-4-4-4-12 UUID + */ + public static String standardUUID(){ + ThreadLocalRandom random = ThreadLocalRandom.current(); + return (new UUID(random.nextLong(), random.nextLong())).toString(); + } + +} diff --git a/src/main/java/com/docus/server/collection/util/PersistRequestUtil.java b/src/main/java/com/docus/server/collection/util/PersistRequestUtil.java new file mode 100644 index 0000000..b98aacd --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/PersistRequestUtil.java @@ -0,0 +1,63 @@ +package com.docus.server.collection.util; + +import com.docus.core.util.DateUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.*; +import java.util.Date; + +/** + * @author wyb + */ +public class PersistRequestUtil { + private final static Logger logger = LoggerFactory.getLogger(PersistRequestUtil.class); + + public static void persistRequest(String method, String content) { + String persistDir = currentPath() + File.separator + "persist"; + FileWriter fileWriter = null; + BufferedWriter bufferedWriter = null; + try { + File persistDirFile = new File(persistDir); + if (!persistDirFile.exists()) { + persistDirFile.mkdirs(); + } + String persistFilePath = persistDir + File.separator + method; + fileWriter = new FileWriter(persistFilePath, true); + bufferedWriter = new BufferedWriter(fileWriter); + content = "[" + DateUtil.formatDateTime(new Date()) + "] " + content + "\n"; + bufferedWriter.write(content); + } catch (Exception ex) { + logger.error(ex.getMessage(), ex); + } finally { + if (bufferedWriter != null) { + try { + bufferedWriter.close(); + } catch (Exception ex) { + } + } + if (fileWriter != null) { + try { + fileWriter.close(); + } catch (Exception ex) { + } + } + } + } + + public static void main(String[] args) { + persistRequest("test","{xxcc}"); + } + public static String currentPath() { + File dir = new File("."); + String currentpath = ""; + + try { + currentpath = dir.getCanonicalPath(); + } catch (IOException var4) { + var4.printStackTrace(); + } + + return currentpath; + } +} diff --git a/src/main/java/com/docus/server/collection/util/Result.java b/src/main/java/com/docus/server/collection/util/Result.java new file mode 100644 index 0000000..339ac64 --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/Result.java @@ -0,0 +1,98 @@ +package com.docus.server.collection.util; + +import com.docus.core.util.DateUtil; +import com.docus.core.util.Func; +import lombok.Data; + +import java.util.Date; + +/** + * @BelongsProject: docus-webservice-sdry + * @BelongsPackage: com.docus.server.collection.util + * @Author: chierhao + * @CreateTime: 2023-02-25 16:59 + * @Description: TODO + * @Version: 1.0 + */ +@Data +public class Result { + + + + public static String success(String serialId,String receive,String send){ + + String createTime= Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI); + + String message="成功"; + + return " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + } + public static String failed(String serialId,String message,String receive,String send){ + + String createTime= Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI); + + + return " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + } + +} diff --git a/src/main/java/com/docus/server/collection/util/TableJsonRead.java b/src/main/java/com/docus/server/collection/util/TableJsonRead.java new file mode 100644 index 0000000..3ee1bf1 --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/TableJsonRead.java @@ -0,0 +1,123 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.server.collection.util; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.util.StringUtils; + +import java.io.*; + +public class TableJsonRead { + public TableJsonRead() { + } + + public T Read(String path, String fileName, Class clazz) { + String currentPath = this.CurrentPath(); + path = currentPath + "\\" + path; + StringBuilder sb = new StringBuilder(); + T dto = null; + File file = new File(path + "\\" + fileName); + + try { + if (!file.exists()) { + try { + file.createNewFile(); + } catch (IOException var11) { + var11.printStackTrace(); + } + } else { + BufferedReader bufferedReader = null; + bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); + + String line; + while(!StringUtils.isEmpty(line = bufferedReader.readLine())) { + sb.append(line); + } + + if (sb.length() > 0) { + ObjectMapper objectMapper = new ObjectMapper(); + dto = objectMapper.readValue(sb.toString(), new TypeReference() { + }); + } + + bufferedReader.close(); + } + + return dto; + } catch (Exception var12) { + var12.printStackTrace(); + return null; + } + } + + + public String readContent(String path, String fileName) { + String currentPath = this.CurrentPath(); + path = currentPath + "\\" + path; + StringBuilder content = new StringBuilder(); + T dto = null; + File file = new File(path + "\\" + fileName); + + try { + if (!file.exists()) { + try { + file.createNewFile(); + } catch (IOException var11) { + var11.printStackTrace(); + } + } else { + BufferedReader bufferedReader = null; + bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); + + String line; + while((line = bufferedReader.readLine())!=null) { + content.append(line); + } + } + return content.toString(); + } catch (Exception var12) { + var12.printStackTrace(); + return null; + } + } + + private String CurrentPath() { + File dir = new File("."); + String currentpath = ""; + + try { + currentpath = dir.getCanonicalPath(); + } catch (IOException var4) { + var4.printStackTrace(); + } + + return currentpath; + } + + public void Save(String path, String fileName, String data) { + String currentPath = this.CurrentPath(); + path = currentPath + "\\" + path; + FileWriter fwriter = null; + + try { + fwriter = new FileWriter(path + "\\" + fileName); + fwriter.write(data); + } catch (IOException var15) { + var15.printStackTrace(); + } finally { + try { + fwriter.flush(); + fwriter.close(); + } catch (IOException var14) { + var14.printStackTrace(); + } + + } + + } +} diff --git a/src/main/java/com/docus/server/collection/util/XmlUtil.java b/src/main/java/com/docus/server/collection/util/XmlUtil.java new file mode 100644 index 0000000..9fe12b7 --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/XmlUtil.java @@ -0,0 +1,853 @@ +/* + * Copyright (c) 2018-2028, DreamLu All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: DreamLu 卢春梦 (596392912@qq.com) + */ +package com.docus.server.collection.util; + +import com.docus.core.util.Exceptions; +import com.docus.core.util.IoUtil; +import org.springframework.lang.Nullable; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.util.HashMap; +import java.util.Map; + +/** + * xpath解析xml + * + *
+ *     文档地址:
+ *     http://www.w3school.com.cn/xpath/index.asp
+ * 
+ * + * @author L.cm + */ +public class XmlUtil { + private final XPath path; + private final Document doc; + + private XmlUtil(InputSource inputSource) throws ParserConfigurationException, SAXException, IOException { + DocumentBuilderFactory dbf = getDocumentBuilderFactory(); + DocumentBuilder db = dbf.newDocumentBuilder(); + doc = db.parse(inputSource); + path = getXPathFactory().newXPath(); + } + + /** + * 创建工具类 + * + * @param inputSource inputSource + * @return XmlUtil + */ + private static XmlUtil create(InputSource inputSource) { + try { + return new XmlUtil(inputSource); + } catch (ParserConfigurationException | SAXException | IOException e) { + throw Exceptions.unchecked(e); + } + } + + /** + * 转换工具类 + * + * @param inputStream inputStream + * @return XmlUtil + */ + public static XmlUtil of(InputStream inputStream) { + InputSource inputSource = new InputSource(inputStream); + return create(inputSource); + } + + /** + * 转换工具类 + * + * @param xmlStr xmlStr + * @return XmlUtil + */ + public static XmlUtil of(String xmlStr) { + StringReader sr = new StringReader(xmlStr.trim()); + InputSource inputSource = new InputSource(sr); + XmlUtil xmlUtil = create(inputSource); + IoUtil.closeQuietly(sr); + return xmlUtil; + } + + /** + * 转换路径 + * + * @param expression 表达式 + * @param item 实体 + * @param returnType 返回类型 + * @return Object + */ + private Object evalXPath(String expression, @Nullable Object item, QName returnType) { + item = null == item ? doc : item; + try { + return path.evaluate(expression, item, returnType); + } catch (XPathExpressionException e) { + throw Exceptions.unchecked(e); + } + } + + /** + * 获取String + * + * @param expression 路径 + * @return {String} + */ + public String getString(String expression) { + return (String) evalXPath(expression, null, XPathConstants.STRING); + } + + /** + * 获取Boolean + * + * @param expression 路径 + * @return {String} + */ + public Boolean getBoolean(String expression) { + return (Boolean) evalXPath(expression, null, XPathConstants.BOOLEAN); + } + + /** + * 获取Number + * + * @param expression 路径 + * @return {Number} + */ + public Number getNumber(String expression) { + return (Number) evalXPath(expression, null, XPathConstants.NUMBER); + } + + /** + * 获取某个节点 + * + * @param expression 路径 + * @return {Node} + */ + public Node getNode(String expression) { + return (Node) evalXPath(expression, null, XPathConstants.NODE); + } + + /** + * 获取子节点 + * + * @param expression 路径 + * @return NodeList + */ + public NodeList getNodeList(String expression) { + return (NodeList) evalXPath(expression, null, XPathConstants.NODESET); + } + + + /** + * 获取String + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {String} + */ + public String getString(Object node, String expression) { + return (String) evalXPath(expression, node, XPathConstants.STRING); + } + + /** + * 获取 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {String} + */ + public Boolean getBoolean(Object node, String expression) { + return (Boolean) evalXPath(expression, node, XPathConstants.BOOLEAN); + } + + /** + * 获取 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {Number} + */ + public Number getNumber(Object node, String expression) { + return (Number) evalXPath(expression, node, XPathConstants.NUMBER); + } + + /** + * 获取某个节点 + * + * @param node 节点 + * @param expression 路径 + * @return {Node} + */ + public Node getNode(Object node, String expression) { + return (Node) evalXPath(expression, node, XPathConstants.NODE); + } + + /** + * 获取子节点 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return NodeList + */ + public NodeList getNodeList(Object node, String expression) { + return (NodeList) evalXPath(expression, node, XPathConstants.NODESET); + } + + /** + * 针对没有嵌套节点的简单处理 + * + * @return map集合 + */ + public Map toMap() { + Element root = doc.getDocumentElement(); + Map params = new HashMap<>(16); + + // 将节点封装成map形式 + NodeList list = root.getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if (node instanceof Element) { + params.put(node.getNodeName(), node.getTextContent()); + } + } + return params; + } + + private static volatile boolean preventedXXE = false; + + private static DocumentBuilderFactory getDocumentBuilderFactory() throws ParserConfigurationException { + DocumentBuilderFactory dbf = XmlHelperHolder.documentBuilderFactory; + if (!preventedXXE) { + preventXXE(dbf); + } + return dbf; + } + + /** + * preventXXE + * + * @param dbf + * @throws ParserConfigurationException + */ + private static void preventXXE(DocumentBuilderFactory dbf) throws ParserConfigurationException { + // This is the PRIMARY defense. If DTDs (doctypes) are disallowed, almost all XML entity attacks are prevented + // Xerces 2 only - http://xerces.apache.org/xerces2-j/features.html#disallow-doctype-decl + dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + + // If you can't completely disable DTDs, then at least do the following: + // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-general-entities + // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-general-entities + + // JDK7+ - http://xml.org/sax/features/external-general-entities + dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); + + // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-parameter-entities + // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-parameter-entities + + // JDK7+ - http://xml.org/sax/features/external-parameter-entities + dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + + // Disable external DTDs as well + dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + + // and these as well, per Timothy Morgan's 2014 paper: "XML Schema, DTD, and Entity Attacks" + dbf.setXIncludeAware(false); + dbf.setExpandEntityReferences(false); + preventedXXE = true; + } + + private static XPathFactory getXPathFactory() { + return XmlHelperHolder.xPathFactory; + } + + /** + * 内部类单例 + */ + private static class XmlHelperHolder { + private static DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + private static XPathFactory xPathFactory = XPathFactory.newInstance(); + } + private static String str; + static { + str=" \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 59 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 205室 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 耳鼻咽喉头颈外科 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 2号楼16楼西区 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 南方医科大学顺德医院 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 突发特发性听觉丧失 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 常规 \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 治愈 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 张存良 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 耳鼻咽喉头颈外科 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 突发特发性听觉丧失 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 文本 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 乳房病类 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 治愈 \n" + + " \n" + + " O \n" + + " \n" + + " 0 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 01 \n" + + " \n" + + " 出院医嘱 \n" + + " \n" + + "
\n"; + } + + public static void main(String[] args) { + XmlUtil a=XmlUtil.of(str); + Node node=null; + //id-消息流水号 + node = a.getNode("/PRPA_HIP0032/id/@extension"); + String serialId = node.toString(); + System.out.println(serialId); + //住院流水号 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/item/@extension"); + String jzh = node.toString(); + System.out.println(jzh); + //住院号标识 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/id/item/@extension"); + String inpatientNo = node.toString(); + System.out.println(inpatientNo); + //住院次数[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/lengthOfStayQuantity[@unit='次']/@value"); + String admissTimes=node.toString(); + System.out.println(admissTimes); + //姓名 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/name/item/part/@value"); + String name = node.toString(); + System.out.println(name); + //入院日期时间 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/low/@value"); + String admissDate = node.toString(); + System.out.println(admissDate); + //出院日期时间 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/high/@value"); + String disDate = node.toString(); + System.out.println(disDate); + //入院诊断科室名称[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='入院诊断']/section/entry[@displayName='入院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name"); + String admissDeptName = node.getTextContent(); + System.out.println(admissDeptName); + //出院诊断科室名称[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='出院诊断']/section/entry[@displayName='出院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name"); + String disDeptName = node.getTextContent(); + System.out.println(disDeptName); + //主治医师[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/authenticator[@displayName='主治医师']/assignedEntity/assignedPerson/name"); + String attendingName = node.getTextContent(); + System.out.println(attendingName); + } +} diff --git a/src/main/java/com/docus/server/collection/util/jobUtil.java b/src/main/java/com/docus/server/collection/util/jobUtil.java new file mode 100644 index 0000000..4ec09ae --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/jobUtil.java @@ -0,0 +1,34 @@ +package com.docus.server.collection.util; + +import com.docus.server.collection.service.ITBasicService; +import com.xxl.job.core.handler.annotation.XxlJob; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @BelongsProject: docus-mzzy-collector + * @BelongsPackage: com.docus.server.collection.util + * @Author: chierhao + * @CreateTime: 2023-03-13 11:33 + * @Description: TODO + * @Version: 1.0 + */ +@Component +@Slf4j +public class jobUtil { + + + @Autowired + private ITBasicService tBasicService; + + @XxlJob("tBasicJob") + public void tBasicJob(){ + try { + log.info("tBasicJob------开始"); + log.info("tBasicJob------结束"); + } catch (Exception e) { + log.error(e.getMessage(),e); + } + } +} diff --git a/src/main/java/com/docus/server/collection/validator/RequestValidator.java b/src/main/java/com/docus/server/collection/validator/RequestValidator.java new file mode 100644 index 0000000..21ed861 --- /dev/null +++ b/src/main/java/com/docus/server/collection/validator/RequestValidator.java @@ -0,0 +1,13 @@ +package com.docus.server.collection.validator; + +/** + * 请求参数验证 + * @author WYBDEV + */ +public interface RequestValidator { + /** + * 验证 + * @return 返回验证结果 + */ + ValidateResult validate(); +} diff --git a/src/main/java/com/docus/server/collection/validator/ValidateResult.java b/src/main/java/com/docus/server/collection/validator/ValidateResult.java new file mode 100644 index 0000000..3141e00 --- /dev/null +++ b/src/main/java/com/docus/server/collection/validator/ValidateResult.java @@ -0,0 +1,30 @@ +package com.docus.server.collection.validator; + +import com.docus.infrastructure.web.api.ResultCode; +import lombok.Data; + +/** + * @author WYBDEV + */ +@Data +public class ValidateResult { + /** + * 验证结果代码 + */ + private ResultCode resultCode; + /** + * 验证结果信息 + */ + private String msg; + public ValidateResult(ResultCode resultCode,String msg){ + this.resultCode=resultCode; + this.msg=msg; + } + public static ValidateResult success(String msg){ + return new ValidateResult(ResultCode.SUCCESS,msg); + } + + public static ValidateResult failed(String msg){ + return new ValidateResult(ResultCode.FAILED,msg); + } +} diff --git a/src/main/java/com/docus/server/collection/validator/impl/FirstPageCheckoutRequestValidator.java b/src/main/java/com/docus/server/collection/validator/impl/FirstPageCheckoutRequestValidator.java new file mode 100644 index 0000000..269a9fd --- /dev/null +++ b/src/main/java/com/docus/server/collection/validator/impl/FirstPageCheckoutRequestValidator.java @@ -0,0 +1,65 @@ +package com.docus.server.collection.validator.impl; + +import com.docus.core.util.Func; +import com.docus.server.collection.dto.FirstPageCheckoutRequest; +import com.docus.server.collection.dto.PatientInfoDTO; +import com.docus.server.collection.enums.FileSyncMethod; +import com.docus.server.collection.util.DateTimeUtil; +import com.docus.server.collection.validator.RequestValidator; +import com.docus.server.collection.validator.ValidateResult; + +import java.util.Objects; + +/** + * 首页签出请求验证者 + * + * @author wyb + */ +public class FirstPageCheckoutRequestValidator implements RequestValidator { + private final FirstPageCheckoutRequest request; + + public FirstPageCheckoutRequestValidator(FirstPageCheckoutRequest request) { + this.request = request; + } + + @Override + public ValidateResult validate() { + FirstPageCheckoutRequest request = this.request; + FileSyncMethod syncType = request.getSyncMethod(); + if (Objects.isNull(syncType)) { + return ValidateResult.failed("同步文件方式不能为空!"); + } + if (syncType == FileSyncMethod.BY_SYS_ID && Func.isEmpty(request.getSysId())) { + return ValidateResult.failed("同步类型为BY_SYS_ID,系统id不能为空!"); + } + PatientInfoDTO patientInfo = request.getPatientInfo(); + if (Objects.isNull(patientInfo)) { + return ValidateResult.failed("患者基础数据不能为空!"); + } + String jzh = patientInfo.getInpatientNo(); + String inPatientNo = patientInfo.getPatientNo(); + String name = patientInfo.getName(); + Integer inTimes = patientInfo.getInTimes(); + String inDate = patientInfo.getInDate(); + String outDate = patientInfo.getOutDate(); + if (Objects.isNull(inTimes) || inTimes <= 0) { + return ValidateResult.failed("患者基础数据住院次数不能为空,且大于0!"); + } + if (Func.isBlank(jzh)) { + return ValidateResult.failed("患者基础数据住院流水号不能为空!"); + } + if (Func.isBlank(inPatientNo)) { + return ValidateResult.failed("患者基础数据住院号不能为空!"); + } + if (Func.isBlank(name)) { + return ValidateResult.failed("患者基础数据姓名不能为空!"); + } + if (Func.isBlank(inDate) || !DateTimeUtil.isNormDateTime(inDate)) { + return ValidateResult.failed("患者基础数据入院日期不能为空且按照格式:yyyy-MM-dd HH:mm:ss"); + } + if (Func.isBlank(outDate) || !DateTimeUtil.isNormDateTime(outDate)) { + return ValidateResult.failed("患者基础数据出院日期不能为空且按照格式:yyyy-MM-dd HH:mm:ss"); + } + return ValidateResult.success("验证通过"); + } +} diff --git a/src/main/java/com/docus/server/collection/xml/parsers/MzZyParser.java b/src/main/java/com/docus/server/collection/xml/parsers/MzZyParser.java new file mode 100644 index 0000000..fe353f0 --- /dev/null +++ b/src/main/java/com/docus/server/collection/xml/parsers/MzZyParser.java @@ -0,0 +1,83 @@ +package com.docus.server.collection.xml.parsers; + +import com.docus.core.util.XmlUtil; +import com.docus.server.collection.dto.DeptDto; +import com.docus.server.collection.dto.UserDto; +import org.w3c.dom.Node; + +/** + * 梅州中医 XML 解析 + * @author jishi + */ +public class MzZyParser { + public static DeptDto parseCreateDept(String xml){ + XmlUtil xmlParseUtil = XmlUtil.of(xml); + Node deptCodeNode = xmlParseUtil.getNode("/PRPM_IN401030UV01/controlActProcess/subject/registrationRequest/subject1/assignedEntity/id/item/@extension"); + Node deptNameNode = xmlParseUtil.getNode("/PRPM_IN401030UV01/controlActProcess/subject/registrationRequest/subject1/assignedEntity/assignedPrincipalOrganization/name/item[@use='OR']/part/@value"); + Node authorIdNode = xmlParseUtil.getNode("/PRPM_IN401030UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension"); + Node authorNameNode = xmlParseUtil.getNode("/PRPM_IN401030UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value"); + + DeptDto deptDto = new DeptDto(); + deptDto.setDeptCode(deptCodeNode.getNodeValue()); + deptDto.setDeptName(deptNameNode.getNodeValue()); + deptDto.setAuthorId(authorIdNode.getNodeValue()); + deptDto.setAuthorName(authorNameNode.getNodeValue()); + return deptDto; + } + + public static DeptDto parseUpdateDept(String xml){ + XmlUtil xmlParseUtil = XmlUtil.of(xml); + Node deptCodeNode = xmlParseUtil.getNode("/PRPM_IN403010UV01/controlActProcess/subject/registrationRequest/subject1/assignedEntity/id/item/@extension"); + Node deptNameNode = xmlParseUtil.getNode("/PRPM_IN403010UV01/controlActProcess/subject/registrationRequest/subject1/assignedEntity/assignedPrincipalOrganization/name/item[@use='OR']/part/@value"); + Node authorIdNode = xmlParseUtil.getNode("/PRPM_IN403010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension"); + Node authorNameNode = xmlParseUtil.getNode("/PRPM_IN403010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value"); + + DeptDto deptDto = new DeptDto(); + deptDto.setDeptCode(deptCodeNode.getNodeValue()); + deptDto.setDeptName(deptNameNode.getNodeValue()); + deptDto.setAuthorId(authorIdNode.getNodeValue()); + deptDto.setAuthorName(authorNameNode.getNodeValue()); + return deptDto; + } + + public static UserDto parseCreateUser(String xml){ + XmlUtil xmlParseUtil = XmlUtil.of(xml); + Node employeeCodeNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/id/item/@extension"); + Node employeeNameNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/healthCarePrincipalPerson/name/item[@use='OR']/part/@value"); + Node deptCodeNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/healthCarePrincipalPerson/asAffiliate/affiliatedPrincipalOrganization/id/item/@extension"); + Node positionNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/relatedTo/assignedEntity/relatedTo/assignedEntity/code[@codeSystem='2.16.156.10011.0.9.2.3.2.122']/displayName/@value"); + Node authorIdNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension"); + Node authorNameNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value"); + + UserDto userDto = new UserDto(); + userDto.setDeptId(deptCodeNode.getNodeValue()); + userDto.setUserName(employeeCodeNode.getNodeValue()); + userDto.setName(employeeNameNode.getNodeValue()); + userDto.setPosition(positionNode.getNodeValue()); + userDto.setAuthorId(authorIdNode.getNodeValue()); + userDto.setAuthorName(authorNameNode.getNodeValue()); + userDto.setRoleId(0L); + return userDto; + } + + + public static UserDto parseUpdateUser(String xml){ + XmlUtil xmlParseUtil = XmlUtil.of(xml); + Node employeeCodeNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/id/item/@extension"); + Node employeeNameNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/healthCarePrincipalPerson/name/item[@use='OR']/part/@value"); + Node deptCodeNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/healthCarePrincipalPerson/asAffiliate/affiliatedPrincipalOrganization/id/item/@extension"); + Node positionNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/relatedTo/assignedEntity/relatedTo/assignedEntity/code[@codeSystem='2.16.156.10011.0.9.2.3.2.122']/displayName/@value"); + Node authorIdNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension"); + Node authorNameNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value"); + + UserDto userDto = new UserDto(); + userDto.setDeptId(deptCodeNode.getNodeValue()); + userDto.setUserName(employeeCodeNode.getNodeValue()); + userDto.setName(employeeNameNode.getNodeValue()); + userDto.setPosition(positionNode.getNodeValue()); + userDto.setAuthorId(authorIdNode.getNodeValue()); + userDto.setAuthorName(authorNameNode.getNodeValue()); + userDto.setRoleId(0L); + return userDto; + } +} diff --git a/src/main/resources/bin/auto.bat b/src/main/resources/bin/auto.bat new file mode 100644 index 0000000..b07af42 --- /dev/null +++ b/src/main/resources/bin/auto.bat @@ -0,0 +1,6 @@ +@echo off + + +WinSW.exe status|findstr NonExistent && winsw install + +WinSW.exe status|findstr stopped && winsw start diff --git a/src/main/resources/bin/jenkins-update.bat b/src/main/resources/bin/jenkins-update.bat new file mode 100644 index 0000000..8bf21eb --- /dev/null +++ b/src/main/resources/bin/jenkins-update.bat @@ -0,0 +1,20 @@ +@echo off + +set deployDir=%1\@project.artifactId@ +if %deployDir%=="" set deployDir=d:\webroot\@project.artifactId@ + +set curr_file=%cd% +cd /d %deployDir% +call stop.bat +sc query @project.artifactId@ |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul +cd %curr_file% +rd/s/q %deployDir%\lib +rd/s/q %deployDir%\dataConfig +rd/s/q %deployDir%\config +del /s/q %deployDir%\*.jar +xcopy /Y/E/I * %deployDir% + +cd /d %deployDir% +call auto.bat +cd %curr_file% + diff --git a/src/main/resources/bin/start.bat b/src/main/resources/bin/start.bat new file mode 100644 index 0000000..58c25cb --- /dev/null +++ b/src/main/resources/bin/start.bat @@ -0,0 +1,21 @@ +set java_opts=-Xms512m -Xmx512m +set key="java_opts" + + +rem 文件不存在,就跳过 +if not exist java-ops.ini goto end + +for /f "tokens=1,2 delims==" %%i in (java-ops.ini) do ( + if "%%i"==%key% set java_opts=%%j) +echo java_opts is : %java_opts% + +:end + +rem 启动java + +java %java_opts% -Dfile.encoding=utf-8 -jar -Dspring.profiles.active=@profile.name@ -Dloader.path=config,lib @project.build.finalName@.jar + + + + + diff --git a/src/main/resources/bin/stop.bat b/src/main/resources/bin/stop.bat new file mode 100644 index 0000000..1e224c0 --- /dev/null +++ b/src/main/resources/bin/stop.bat @@ -0,0 +1,3 @@ +@echo off + +winsw stop diff --git a/src/main/resources/bin/update.bat b/src/main/resources/bin/update.bat new file mode 100644 index 0000000..67730ec --- /dev/null +++ b/src/main/resources/bin/update.bat @@ -0,0 +1,47 @@ +@echo off + +set curr_file=%cd% + +set parentDir=%1 +if %parentDir%=="" set deployDir=d:\webroot + + +set deployDir=%parentDir%\@project.artifactId@ + +set backupDir=%parentDir%\backup + +set dateStr=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2% + + +cd /d %deployDir% + +call stop.bat +sc query @project.artifactId@ |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul + +cd /d %parentDir% + +xcopy /Y/E/I project.artifactId@\lib %backupDir%\%dateStr%\@project.artifactId@lib +xcopy /Y/E/I project.artifactId@\config %backupDir%\%dateStr%\@project.artifactId@config +xcopy /Y/E/I project.artifactId@\*.jar %backupDir%\%dateStr%\@project.artifactId@ +xcopy /Y/E/I project.artifactId@\*.bat %backupDir%\%dateStr%\@project.artifactId@ +xcopy /Y/E/I project.artifactId@\*.exe %backupDir%\%dateStr%\@project.artifactId@ +xcopy /Y/E/I project.artifactId@\*.xml %backupDir%\%dateStr%\@project.artifactId@ + + +cd %curr_file% + +rd/s/q %deployDir%\lib +rd/s/q %deployDir%\config +del /s/q %deployDir%\*.jar + + +xcopy /Y/E/I lib %deployDir%\lib +xcopy /Y/E/I config %deployDir%\config +xcopy /Y/E/I *.jar %deployDir% +xcopy /Y/E/I *.bat %deployDir% +xcopy /Y/E/I *.exe %deployDir% +xcopy /Y/E/I *.xml %deployDir% + +cd /d %deployDir% +call auto.bat +cd %curr_file% \ No newline at end of file diff --git a/src/main/resources/bin/winsw.xml b/src/main/resources/bin/winsw.xml new file mode 100644 index 0000000..810c413 --- /dev/null +++ b/src/main/resources/bin/winsw.xml @@ -0,0 +1,8 @@ + + docus-mzzy-collector + 生产-梅州中医基础数据同步 + 生产-梅州中医基础数据同步 + Automatic + %BASE%\start.bat + + diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..74118f4 --- /dev/null +++ b/src/main/resources/bootstrap.yml @@ -0,0 +1,62 @@ +server: + port: 9315 +spring: + profiles: + active: dev + application: + name: @artifactId@ + datasource: + mysql-docus: + 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: 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 + +docus: + dbtype: mysql + user: + # 用户默认密码 + defpwd: fd29cd53ec12616e5f36b77d4afffbff + url: + # 采集任务补偿地址 + compensate-task-url: http://localhost:9295/ + # 签出调用 + sign-out-url: http://localhost:9102/ + +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + call-setters-on-nulls: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + field-strategy: NOT_EMPTY + db-type: MYSQL +xxl: + job: + accessToken: + admin: + addresses: http://job.docus.cn:8180/xxl-job-admin + executor: + appname: docus-mzzy-collector + address: + ip: + port: 17781 + logretentiondays: 30 + logpath: D:/xxl-job/inspection + +TBasic: + url: http://localhost:8989/tbasic + +mzzyy: + roc-domain: WZHBA + roc-key: b91b0ac7-665f-4874-a282-2f5511a44263 + url: + roc: + curr-web: http://199.168.91.110:7800/roc/curr-web + + diff --git a/src/main/resources/log4jdbc.log4j2.properties b/src/main/resources/log4jdbc.log4j2.properties new file mode 100644 index 0000000..5cb6f99 --- /dev/null +++ b/src/main/resources/log4jdbc.log4j2.properties @@ -0,0 +1,2 @@ +# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger +log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000..2c982f3 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,95 @@ + + + docus-server-fistpage + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%contextName] [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n + + + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n + utf-8 + + + + + ${log.path}%d.%i.log + + 500MB + + 30 + + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n + utf-8 + + + + + ${log.path}external%d.%i.log + + 500MB + + 30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/CollectSysDictionaryMapper.xml b/src/main/resources/mapper/CollectSysDictionaryMapper.xml new file mode 100644 index 0000000..fd2daea --- /dev/null +++ b/src/main/resources/mapper/CollectSysDictionaryMapper.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/src/main/resources/mapper/PowerDeptMapper.xml b/src/main/resources/mapper/PowerDeptMapper.xml new file mode 100644 index 0000000..52af0fe --- /dev/null +++ b/src/main/resources/mapper/PowerDeptMapper.xml @@ -0,0 +1,31 @@ + + + + + INSERT INTO `docus_system`.`power_dept`(`dept_id`, + `dept_code`, + `dept_name`, + `create_date`, + `creater`, + `update_date`, + `updater`) + VALUES (#{dept.deptId},#{dept.deptCode},#{dept.deptName},now(),#{dept.authorName},now(),#{dept.authorName}) + + + update `docus_system`.`power_dept` set + `dept_name`=#{dept.deptName}, + `updater`=#{dept.authorName}, + `update_date`=now() + where `dept_code`=#{dept.deptCode} + + + delete from `docus_system`.`power_dept` where `dept_code` = #{deptCode} + + + + diff --git a/src/main/resources/mapper/PowerUserMapper.xml b/src/main/resources/mapper/PowerUserMapper.xml new file mode 100644 index 0000000..bcc846c --- /dev/null +++ b/src/main/resources/mapper/PowerUserMapper.xml @@ -0,0 +1,38 @@ + + + + + INSERT INTO `docus_system`.`power_user`(`user_id`, + `user_name`, + `name`, + `user_pwd`, + `user_position`, + `role_id`, + `dept_id`, + `create_date`, + `creater`, + `update_date`, + `updater`) + VALUES (#{user.userId},#{user.userName},#{user.name},#{user.userPwd},#{user.position},#{user.roleId} + ,#{user.deptId},now(),#{user.authorName},now(),#{user.authorName}) + + + update `docus_system`.`power_user` set + `updater`=#{user.authorName}, + `dept_id`=#{user.deptId}, + `user_position`=#{user.position}, + `name`=#{user.name}, + `update_date`=now() + where `user_id`=#{user.userId} + + + delete from `docus_system`.`power_user` where `user_name` = #{userName} + + + + diff --git a/src/main/resources/mapper/TBasicMapper.xml b/src/main/resources/mapper/TBasicMapper.xml new file mode 100644 index 0000000..33b0780 --- /dev/null +++ b/src/main/resources/mapper/TBasicMapper.xml @@ -0,0 +1,97 @@ + + + + + INSERT INTO `docus_medicalrecord`.`t_basic` + (`admiss_dept`, + `attending`, + `create_time`, + `admiss_days`, + `is_dead`, + `sex_name`, + `bed_num`, + `age`, + `sex`, + `id_card`, + `dis_dept`, + `patient_id`, + `admiss_times`, + `inpatient_no`, + `name`, + `admiss_date`, + `admiss_dept_name`, + `dis_date`, + `dis_dept_name`, + `attending_name`, + `jzh`, + `is_other`, + `mother_inpatient_no`) + VALUES + + (#{tBasic.admissDept}, + #{tBasic.attending}, + #{tBasic.createTime}, + #{tBasic.admissDays}, + #{tBasic.isDead}, + #{tBasic.sexName}, + #{tBasic.bedNum}, + #{tBasic.age}, + #{tBasic.sex}, + #{tBasic.idCard}, + #{tBasic.disDept}, + #{tBasic.patientId}, + #{tBasic.admissTimes}, + #{tBasic.inpatientNo}, + #{tBasic.name}, + #{tBasic.admissDate}, + #{tBasic.admissDeptName}, + #{tBasic.disDate}, + #{tBasic.disDeptName}, + #{tBasic.attendingName}, + #{tBasic.jzh}, + #{tBasic.isOther}, + #{tBasic.motherInpatientNo}) + + + + + UPDATE `docus_medicalrecord`.`t_basic` SET + `admiss_dept` = #{tBasic.admissDept}, + `attending` = #{tBasic.attending}, + `update_time` = #{tBasic.createTime}, + `admiss_days` = #{tBasic.admissDays}, + `is_dead` = #{tBasic.isDead}, + `sex_name` = #{tBasic.sexName}, + `bed_num` = #{tBasic.bedNum}, + `age` = #{tBasic.age}, + `sex` = #{tBasic.sex}, + `id_card` = #{tBasic.idCard}, + `dis_dept` = #{tBasic.disDept}, + `admiss_times` = #{tBasic.admissTimes}, + `name` = #{tBasic.name}, + `admiss_date` = #{tBasic.admissDate}, + `admiss_dept_name` = #{tBasic.admissDeptName}, + `dis_date` = #{tBasic.disDate}, + `dis_dept_name` = #{tBasic.disDeptName}, + `attending_name` = #{tBasic.attendingName}, + `is_other` = #{tBasic.isOther}, + `mother_inpatient_no`= #{tBasic.motherInpatientNo} + WHERE + `jzh` = #{tBasic.jzh} + + + + + + + diff --git a/src/test/java/com/docus/server/collection/parser/xml/test/MzZyParserTest.java b/src/test/java/com/docus/server/collection/parser/xml/test/MzZyParserTest.java new file mode 100644 index 0000000..d136da7 --- /dev/null +++ b/src/test/java/com/docus/server/collection/parser/xml/test/MzZyParserTest.java @@ -0,0 +1,1677 @@ +package com.docus.server.collection.parser.xml.test; + + +import com.docus.server.collection.dto.DeptDto; +import com.docus.server.collection.dto.UserDto; +import com.docus.server.collection.xml.parsers.MzZyParser; +import org.junit.Test; + +public class MzZyParserTest { + public String createDeptXmlTemplate="\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + public String updateDeptXmlTemplate="\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + + @Test + public void parseCreateDeptTest(){ + String deptCode="222"; + String deptName="路脑外科"; + String createDeptXml=createDeptXmlTemplate.replace("${deptCode}",deptCode) + .replace("${deptName}",deptName); + + DeptDto deptDto = MzZyParser.parseCreateDept(createDeptXml); + System.out.println(deptDto); + assert deptCode.equals(deptDto.getDeptCode()); + assert deptName.equals(deptDto.getDeptName()); + } + + @Test + public void parseUpdateDept(){ + String deptCode="221"; + String deptName="神经内科"; + String createDeptXml=updateDeptXmlTemplate.replace("${deptCode}",deptCode) + .replace("${deptName}",deptName); + + DeptDto deptDto = MzZyParser.parseUpdateDept(createDeptXml); + System.out.println(deptDto); + assert deptCode.equals(deptDto.getDeptCode()); + assert deptName.equals(deptDto.getDeptName()); + } + + + + private String createUserXmlTemplate="\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + + + + + @Test + public void parseCreateUser(){ + String userName="121"; + String name="皮皮蛙一号"; + String roleName="科主任"; + String deptId="022"; + + String createUserXml=createUserXmlTemplate.replace("${roleName}",roleName) + .replace("${userName}",userName) + .replace("${name}",name) + .replace("${deptId}",deptId); + UserDto userDto = MzZyParser.parseCreateUser(createUserXml); + System.out.println(userDto); + assert userName.equals(userDto.getUserName()); + assert name.equals(userDto.getName()); + assert roleName.equals(userDto.getPosition()); + assert deptId.equals(userDto.getDeptId()); + + } + + + private String updateUserXmlTemplate="\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + @Test + public void parseUpdateUser(){ + String userName="121"; + String name="皮皮娃二号"; + String roleName="院长"; + String deptId="032"; + + String updateUserXml=updateUserXmlTemplate.replace("${roleName}",roleName) + .replace("${userName}",userName) + .replace("${name}",name) + .replace("${deptId}",deptId); + UserDto userDto = MzZyParser.parseUpdateUser(updateUserXml); + System.out.println(userDto); + assert userName.equals(userDto.getUserName()); + assert name.equals(userDto.getName()); + assert roleName.equals(userDto.getPosition()); + assert deptId.equals(userDto.getDeptId()); + } + +}