初始化模板
commit
f864ece658
@ -0,0 +1,130 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.1.1.RELEASE</version>
|
||||||
|
</parent>
|
||||||
|
<groupId>com.example</groupId>
|
||||||
|
<artifactId>LianzhongCollect</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<name>springbootDemo</name>
|
||||||
|
<description>springbootDemo</description>
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<!-- Apache Commons Lang -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>3.12.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Apache HttpClient -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
<version>4.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- swaggerui相关依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
|
<version>2.0.9</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- oracle -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.database.jdbc</groupId>
|
||||||
|
<artifactId>ojdbc6</artifactId>
|
||||||
|
<version>11.2.0.4</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Apache PDFBox的依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.pdfbox</groupId>
|
||||||
|
<artifactId>pdfbox</artifactId>
|
||||||
|
<version>2.0.27</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-collections4</artifactId>
|
||||||
|
<version>4.4</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.plugin</groupId>
|
||||||
|
<artifactId>spring-plugin-core</artifactId>
|
||||||
|
<version>2.0.0.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.plugin</groupId>
|
||||||
|
<artifactId>spring-plugin-metadata</artifactId>
|
||||||
|
<version>2.0.0.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>3.3.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-quartz</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- sqlserver相关依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.microsoft.sqlserver</groupId>
|
||||||
|
<artifactId>sqljdbc4</artifactId>
|
||||||
|
<version>4.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- Jackson Json处理工具包 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>2.0.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.example;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author potter.fu
|
||||||
|
* @date 2018-12-07 15:40
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class MainApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
SpringApplication.run(MainApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.example.config;
|
||||||
|
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||||
|
import org.mybatis.spring.SqlSessionTemplate;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||||
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@MapperScan(basePackages = "com.example.db1.dao", sqlSessionTemplateRef = "db1SqlSessionTemplate")
|
||||||
|
public class DataSource1Config {
|
||||||
|
/**
|
||||||
|
* 生成数据源. @Primary 注解声明为默认数据源
|
||||||
|
*/
|
||||||
|
@Bean(name = "db1DataSource")
|
||||||
|
@ConfigurationProperties(prefix = "spring.datasource.hikari.db1")
|
||||||
|
@Primary
|
||||||
|
public DataSource testDataSource() {
|
||||||
|
return DataSourceBuilder.create().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建 SqlSessionFactory
|
||||||
|
*/
|
||||||
|
@Bean(name = "db1SqlSessionFactory")
|
||||||
|
@Primary
|
||||||
|
public SqlSessionFactory testSqlSessionFactory(@Qualifier("db1DataSource") DataSource dataSource) throws Exception {
|
||||||
|
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
|
||||||
|
bean.setDataSource(dataSource);
|
||||||
|
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/db1/*.xml"));
|
||||||
|
return bean.getObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置事务管理
|
||||||
|
*/
|
||||||
|
@Bean(name = "db1TransactionManager")
|
||||||
|
@Primary
|
||||||
|
public DataSourceTransactionManager testTransactionManager(@Qualifier("db1DataSource") DataSource dataSource) {
|
||||||
|
return new DataSourceTransactionManager(dataSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(name = "db1SqlSessionTemplate")
|
||||||
|
@Primary
|
||||||
|
public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("db1SqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
|
||||||
|
return new SqlSessionTemplate(sqlSessionFactory);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package com.example.config;
|
||||||
|
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||||
|
import org.mybatis.spring.SqlSessionTemplate;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||||
|
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.example.db2.dao", sqlSessionTemplateRef = "db2SqlSessionTemplate")
|
||||||
|
public class DataSource2Config {
|
||||||
|
|
||||||
|
@Bean(name = "db2DataSource")
|
||||||
|
@ConfigurationProperties(prefix = "spring.datasource.hikari.db2")
|
||||||
|
public DataSource testDataSource() {
|
||||||
|
return DataSourceBuilder.create().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(name = "db2SqlSessionFactory")
|
||||||
|
public SqlSessionFactory testSqlSessionFactory(@Qualifier("db2DataSource") DataSource dataSource) throws Exception {
|
||||||
|
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
|
||||||
|
bean.setDataSource(dataSource);
|
||||||
|
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/db2/*.xml"));
|
||||||
|
return bean.getObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(name = "db2TransactionManager")
|
||||||
|
public DataSourceTransactionManager testTransactionManager(@Qualifier("db2DataSource") DataSource dataSource) {
|
||||||
|
return new DataSourceTransactionManager(dataSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(name = "db2SqlSessionTemplate")
|
||||||
|
public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("db2SqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
|
||||||
|
return new SqlSessionTemplate(sqlSessionFactory);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package com.example.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
|
import springfox.documentation.builders.ParameterBuilder;
|
||||||
|
import springfox.documentation.builders.PathSelectors;
|
||||||
|
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||||
|
import springfox.documentation.schema.ModelRef;
|
||||||
|
import springfox.documentation.service.Parameter;
|
||||||
|
import springfox.documentation.spi.DocumentationType;
|
||||||
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
|
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableSwagger2WebMvc
|
||||||
|
public class Knife4jConfiguration {
|
||||||
|
/**
|
||||||
|
* 需要配置controller层包名
|
||||||
|
*/
|
||||||
|
String controllerPackagePath = "com.example";
|
||||||
|
@Bean(value = "defaultApi2")
|
||||||
|
public Docket defaultApi2() {
|
||||||
|
List<Parameter> pars = new ArrayList<>();
|
||||||
|
ParameterBuilder tokenPar = new ParameterBuilder();
|
||||||
|
tokenPar.name("token")
|
||||||
|
.description("用户token")
|
||||||
|
.defaultValue("")
|
||||||
|
.modelRef(new ModelRef("string"))
|
||||||
|
.parameterType("header")
|
||||||
|
.required(false)
|
||||||
|
.build();
|
||||||
|
pars.add(tokenPar.build());
|
||||||
|
//添加head参数end
|
||||||
|
|
||||||
|
Docket docket=new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.apiInfo(new ApiInfoBuilder()
|
||||||
|
//.title("swagger-bootstrap-ui-demo RESTful APIs")
|
||||||
|
.description("# swagger-bootstrap-ui-demo RESTful APIs")
|
||||||
|
.termsOfServiceUrl("www.codeleader.top")
|
||||||
|
.version("1.0")
|
||||||
|
.build())
|
||||||
|
.globalOperationParameters(pars)
|
||||||
|
//分组名称
|
||||||
|
.groupName("2.X版本")
|
||||||
|
.select()
|
||||||
|
//这里指定Controller扫描包路径
|
||||||
|
.apis(RequestHandlerSelectors.basePackage(controllerPackagePath))
|
||||||
|
.paths(PathSelectors.any())
|
||||||
|
.build();
|
||||||
|
return docket;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.example.config;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@MapperScan(basePackages = "com.example.mapper.db1", sqlSessionFactoryRef = "sqlSessionFactoryDb1")
|
||||||
|
@MapperScan(basePackages = "com.example.mapper.db2", sqlSessionFactoryRef = "sqlSessionFactoryDb2")
|
||||||
|
public class MyBatisPlusConfig {
|
||||||
|
|
||||||
|
@Bean(name = "sqlSessionFactoryDb1")
|
||||||
|
public SqlSessionFactory sqlSessionFactoryDb1(@Qualifier("db1DataSource") DataSource dataSource) throws Exception {
|
||||||
|
MybatisSqlSessionFactoryBean factoryBean = new MybatisSqlSessionFactoryBean();
|
||||||
|
factoryBean.setDataSource(dataSource);
|
||||||
|
factoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
|
||||||
|
.getResources("classpath:mapper/db1/*.xml"));
|
||||||
|
return factoryBean.getObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(name = "sqlSessionFactoryDb2")
|
||||||
|
public SqlSessionFactory sqlSessionFactoryDb2(@Qualifier("db2DataSource") DataSource dataSource) throws Exception {
|
||||||
|
MybatisSqlSessionFactoryBean factoryBean = new MybatisSqlSessionFactoryBean();
|
||||||
|
factoryBean.setDataSource(dataSource);
|
||||||
|
factoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
|
||||||
|
.getResources("classpath:mapper/db2/*.xml"));
|
||||||
|
return factoryBean.getObject();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.example.controller;
|
||||||
|
|
||||||
|
import com.example.service.CollectService;
|
||||||
|
import com.example.util.CommonResult;
|
||||||
|
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.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName MedRecordController
|
||||||
|
* @Description 重耗材采集器接口
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2025/3/25 16:45
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/task")
|
||||||
|
@Api(value = "重耗材任务接口", tags = "重耗材任务对外接口")
|
||||||
|
@Slf4j
|
||||||
|
public class MedRecordController {
|
||||||
|
@Autowired
|
||||||
|
private CollectService collectService;
|
||||||
|
|
||||||
|
@PostMapping("/getTask")
|
||||||
|
@ApiOperation("获取任务接口")
|
||||||
|
@ResponseBody
|
||||||
|
public CommonResult<?> GetTask() {
|
||||||
|
collectService.LianZhongConllect();
|
||||||
|
return CommonResult.success("1");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.example.db1.dao;
|
||||||
|
|
||||||
|
import com.example.db2.dao.LianZhongDao;
|
||||||
|
import com.example.dto.TscanAssortDto;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @InterfaceName Tscan_assort
|
||||||
|
* @Description 文件表接口
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2025/6/5 10:25
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TscanAssortDao {
|
||||||
|
/**
|
||||||
|
* @description: 批量增加
|
||||||
|
* @params: TscanAssortDto
|
||||||
|
* @return: boolean
|
||||||
|
* @author linjj
|
||||||
|
* @date: 2025/6/5 10:28
|
||||||
|
*/
|
||||||
|
boolean addTscanAssortDto(@Param("list") List<TscanAssortDto> list);
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.example.db2.dao;
|
||||||
|
|
||||||
|
import com.example.vo.CardInfoVo;
|
||||||
|
import com.example.vo.Picture;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @InterfaceName LianZhongDao
|
||||||
|
* @Description 联众dao层
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2025/6/4 13:15
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface LianZhongDao {
|
||||||
|
/**
|
||||||
|
* @description: 查询有多少条为采集记录
|
||||||
|
* @params: state
|
||||||
|
* @return: Integer
|
||||||
|
* @author linjj
|
||||||
|
* @date: 2025/6/4 13:17
|
||||||
|
*/
|
||||||
|
Integer getCollectNum(Integer state);
|
||||||
|
/**
|
||||||
|
* @description: 根据范围查询1000条记录
|
||||||
|
* @params: start end
|
||||||
|
* @return: CardInfoVo
|
||||||
|
* @author linjj
|
||||||
|
* @date: 2025/6/4 14:55
|
||||||
|
*/
|
||||||
|
List<CardInfoVo>getCardInfoVo(@Param("start") Integer start, @Param("end") Integer end);
|
||||||
|
/**
|
||||||
|
* @description: 跟换患者id查询患者信息
|
||||||
|
* @params: fileid
|
||||||
|
* @return: Picture
|
||||||
|
* @author linjj
|
||||||
|
* @date: 2025/6/4 15:25
|
||||||
|
*/
|
||||||
|
List<Picture>getPicture(String fileid);
|
||||||
|
/**
|
||||||
|
* @description: 修改病例状态
|
||||||
|
* @params:
|
||||||
|
* @return:
|
||||||
|
* @author linjj
|
||||||
|
* @date: 2025/6/5 10:32
|
||||||
|
*/
|
||||||
|
Boolean updateState(@Param("id") String id,@Param("state") Integer state);
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.example.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName TscanAssort
|
||||||
|
* @Description 文件表实体类
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2025/6/5 10:12
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TscanAssortDto {
|
||||||
|
//病案id
|
||||||
|
private String patientId;
|
||||||
|
//分段id
|
||||||
|
private String assortId;
|
||||||
|
//文件名
|
||||||
|
private String scanPage;
|
||||||
|
//来源
|
||||||
|
private String source;
|
||||||
|
//是否删除0否
|
||||||
|
private String isDel;
|
||||||
|
//来源标识
|
||||||
|
private String sourceFlag;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.example.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @InterfaceName CollectService
|
||||||
|
* @Description 同步联众数据接口
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2025/6/4 13:11
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface CollectService {
|
||||||
|
/**
|
||||||
|
* @description: 同步联众数据
|
||||||
|
* @author linjj
|
||||||
|
* @date: 2025/6/4 13:13
|
||||||
|
*/
|
||||||
|
void LianZhongConllect();
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.example.text;
|
||||||
|
|
||||||
|
import com.example.MainApplication;
|
||||||
|
|
||||||
|
import com.example.service.CollectService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName test
|
||||||
|
* @Description 测试类
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2024/1/18 9:54
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@SpringBootTest(classes = MainApplication.class)
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@Slf4j
|
||||||
|
public class test {
|
||||||
|
|
||||||
|
@Value("${savePath}")
|
||||||
|
private String savePath;
|
||||||
|
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(test.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CollectService collectService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDemo() {
|
||||||
|
collectService.LianZhongConllect();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.example.util;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 自定义的异常类
|
||||||
|
* @author: ChenJ
|
||||||
|
* @date: 2022/5/9 17:29
|
||||||
|
* @param:
|
||||||
|
* @return:
|
||||||
|
**/
|
||||||
|
public class BusinessException extends Exception {
|
||||||
|
/**
|
||||||
|
* 枚举类型,内含状态码code和信息msg
|
||||||
|
*/
|
||||||
|
private final ExceptionCode exceptionCode;
|
||||||
|
|
||||||
|
public ExceptionCode getExceptionCode() {
|
||||||
|
return exceptionCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BusinessException(ExceptionCode exceptionCode) {
|
||||||
|
super(exceptionCode.getMessage());
|
||||||
|
this.exceptionCode = exceptionCode;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,152 @@
|
|||||||
|
package com.example.util;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author docus
|
||||||
|
* @date 2020/3/28 16:23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("响应")
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CommonResult<T> {
|
||||||
|
@ApiModelProperty("响应码")
|
||||||
|
private Integer code;
|
||||||
|
@ApiModelProperty("响应消息")
|
||||||
|
private String msg;
|
||||||
|
@ApiModelProperty("响应实体")
|
||||||
|
private T data;
|
||||||
|
|
||||||
|
public CommonResult(Integer code, String msg) {
|
||||||
|
this.code = code;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功返回结果
|
||||||
|
*
|
||||||
|
* @param data 获取的数据
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> success(T data) {
|
||||||
|
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMessage(), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功返回结果
|
||||||
|
*
|
||||||
|
* @param data 获取的数据
|
||||||
|
* @param message 提示信息
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> success(T data, String message) {
|
||||||
|
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), message, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败返回结果
|
||||||
|
*
|
||||||
|
* @param errorCode 错误码
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> failed(IErrorCode errorCode) {
|
||||||
|
return new CommonResult<T>(errorCode.getCode(), errorCode.getMessage(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败返回结果
|
||||||
|
*
|
||||||
|
* @param errorCode 错误码
|
||||||
|
* @param message 提示信息
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> failed(IErrorCode errorCode, String message) {
|
||||||
|
return new CommonResult<T>(errorCode.getCode(), message, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败返回结果
|
||||||
|
*
|
||||||
|
* @param message 提示信息
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> failed(String message) {
|
||||||
|
return new CommonResult<T>(ResultCode.FAILED.getCode(), message, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败返回结果
|
||||||
|
*
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> failed() {
|
||||||
|
return failed(ResultCode.FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数验证失败返回结果
|
||||||
|
*
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> validateFailed() {
|
||||||
|
return failed(ResultCode.VALIDATE_FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提示信息
|
||||||
|
*
|
||||||
|
* @param message 提示信息
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> validateFailed(String message) {
|
||||||
|
return new CommonResult<T>(ResultCode.VALIDATE_FAILED.getCode(), message, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未登录返回结果
|
||||||
|
*
|
||||||
|
* @param data 获取的数据
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> unauthorized(T data) {
|
||||||
|
return new CommonResult<T>(ResultCode.UNAUTHORIZED.getCode(), ResultCode.UNAUTHORIZED.getMessage(), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重防及重复请求
|
||||||
|
*
|
||||||
|
* @param data 获取的数据
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> preventreplay(T data) {
|
||||||
|
return new CommonResult<T>(ResultCode.PREVENT_REPLAY.getCode(), ResultCode.PREVENT_REPLAY.getMessage(), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未授权返回结果
|
||||||
|
*
|
||||||
|
* @param data 获取的数据
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> CommonResult<T> forbidden(T data) {
|
||||||
|
return new CommonResult<T>(ResultCode.FORBIDDEN.getCode(), ResultCode.FORBIDDEN.getMessage(), data);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.example.util;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 封装API的错误码
|
||||||
|
* @Author JacksonTu
|
||||||
|
* @Date 2020/3/28 16:26
|
||||||
|
*/
|
||||||
|
public interface IErrorCode {
|
||||||
|
Integer getCode();
|
||||||
|
|
||||||
|
String getMessage();
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.example.util;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 这是一个给fastJSON/jackson准备的一个对象
|
||||||
|
*/
|
||||||
|
public class JsonResult implements Serializable {
|
||||||
|
private Map<String, Object> dataMap = new HashMap<>(3);
|
||||||
|
|
||||||
|
public JsonResult() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return dataMap.get("code").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.dataMap.put("code", code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return dataMap.get("msg").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.dataMap.put("msg", msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getData() {
|
||||||
|
return dataMap.get("data");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(Object data) {
|
||||||
|
this.dataMap.put("data", data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getDataMap() {
|
||||||
|
return dataMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataMap(Map<String, Object> dataMap) {
|
||||||
|
this.dataMap = dataMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void put(String name, Object value) {
|
||||||
|
this.dataMap.put(name, value);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.example.util;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>Title:Msg </p>
|
||||||
|
* <p>Description:common return class </p>
|
||||||
|
* <p>Company: </p>
|
||||||
|
* @author hu
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
public class Msg {
|
||||||
|
//state:100-success 200-fail
|
||||||
|
private int code;
|
||||||
|
//提示信息
|
||||||
|
private String msg;
|
||||||
|
//用户要返回给浏览器的数据
|
||||||
|
private Map<String,Object> extend=new HashMap<String,Object>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static Msg fail(String msg){
|
||||||
|
Msg result=new Msg();
|
||||||
|
result.setCode(100);
|
||||||
|
result.setMsg(msg);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Msg success(String msg){
|
||||||
|
Msg result=new Msg();
|
||||||
|
result.setCode(200);
|
||||||
|
result.setMsg(msg);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Msg add(String key, Object value){
|
||||||
|
this.getExtend().put(key, value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getExtend() {
|
||||||
|
return extend;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend(Map<String, Object> extend) {
|
||||||
|
this.extend = extend;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package com.example.util;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 枚举一些常用API操作码
|
||||||
|
* @Author JacksonTu
|
||||||
|
* @Date 2020/3/28 16:26
|
||||||
|
*/
|
||||||
|
public enum ResultCode implements IErrorCode {
|
||||||
|
|
||||||
|
SUCCESS(0, "操作成功"),
|
||||||
|
FAILED(500, "操作失败"),
|
||||||
|
VALIDATE_FAILED(404, "参数检验失败"),
|
||||||
|
UNAUTHORIZED(401, "暂未登录或token已经过期"),
|
||||||
|
FORBIDDEN(403, "没有相关权限"),
|
||||||
|
PREVENT_REPLAY(405,"重复请求"),
|
||||||
|
NOT_EXIST(601,"数据不存在"),
|
||||||
|
NOT_ENABLE(600,"数据未启用");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
private ResultCode(Integer code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.example.vo;
|
||||||
|
|
||||||
|
import com.example.util.MyDateUtil;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName CardInfo
|
||||||
|
* @Description 联众信息表
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2025/6/4 15:05
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CardInfoVo {
|
||||||
|
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
//住院号
|
||||||
|
private String patno;
|
||||||
|
//患者姓名
|
||||||
|
private String patname;
|
||||||
|
//出院时间
|
||||||
|
private Date outdate;
|
||||||
|
//出院科室
|
||||||
|
private String outdeptname;
|
||||||
|
//性别
|
||||||
|
private String patsex;
|
||||||
|
//住院时间
|
||||||
|
private Date indate;
|
||||||
|
//住院科室
|
||||||
|
private String indeptname;
|
||||||
|
//同步状态0未开始 2完成 3失败 5缺失
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
public String getOutdateStr(){
|
||||||
|
return MyDateUtil.dateToString(this.outdate,"yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOutdateStr2(){
|
||||||
|
return MyDateUtil.dateToString(this.outdate,"yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getIndateStr(){
|
||||||
|
return MyDateUtil.dateToString(this.indate,"yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.example.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Picture {
|
||||||
|
//文件id
|
||||||
|
private String picid;
|
||||||
|
//文件名
|
||||||
|
private String picname;
|
||||||
|
//患者id
|
||||||
|
private String fileid;
|
||||||
|
//工具要用的参数 旋转角度
|
||||||
|
private Double rotatedegree;
|
||||||
|
//分段id
|
||||||
|
private String pickind;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
server.port=7998
|
||||||
|
# SQL Server
|
||||||
|
spring.datasource.hikari.db1.jdbc-url=jdbc:sqlserver://10.1.1.147:1433;DatabaseName=csssemrrcord
|
||||||
|
spring.datasource.hikari.db1.username=sa
|
||||||
|
spring.datasource.hikari.db1.password=xjgs+docus911
|
||||||
|
spring.datasource.hikari.db1.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
|
||||||
|
#SQL Server
|
||||||
|
spring.datasource.hikari.db2.jdbc-url=jdbc:sqlserver://10.1.1.128:1433;DatabaseName=u_medrecord
|
||||||
|
spring.datasource.hikari.db2.username=sa
|
||||||
|
spring.datasource.hikari.db2.password=17931
|
||||||
|
spring.datasource.hikari.db2.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
|
||||||
|
# MyBatis-Plus ??
|
||||||
|
mybatis-plus.configuration.map-underscore-to-camel=true
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
#文件保存路径
|
||||||
|
savePath: Z:\pic
|
||||||
|
#文件保存路径
|
||||||
|
collectFlag: 6
|
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.example.db1.dao.TscanAssortDao">
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="addTscanAssortDto">
|
||||||
|
insert into
|
||||||
|
t_scan_assort(patient_id,assort_id,scan_page,source,is_del,source_flag)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.patientId},#{item.assortId},#{item.scanPage},#{item.source},#{item.isDel},
|
||||||
|
#{item.sourceFlag})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.example.db2.dao.LianZhongDao">
|
||||||
|
<update id="updateState">
|
||||||
|
UPDATE t_card_info_upload SET state=#{state} WHERE id=#{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getCollectNum" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(*) FROM t_card_info_upload WHERE state!=#{state}
|
||||||
|
</select>
|
||||||
|
<select id="getCardInfoVo" resultType="com.example.vo.CardInfoVo">
|
||||||
|
WITH CTE AS (
|
||||||
|
SELECT *,
|
||||||
|
ROW_NUMBER() OVER (ORDER BY id) AS RowNum
|
||||||
|
FROM t_card_info_upload
|
||||||
|
)
|
||||||
|
SELECT *
|
||||||
|
FROM CTE
|
||||||
|
WHERE RowNum BETWEEN #{start} AND #{end} AND state!=5
|
||||||
|
</select>
|
||||||
|
<select id="getPicture" resultType="com.example.vo.Picture">
|
||||||
|
SELECT * FROM T_picture WHERE FileId=#{fileid}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue