first commit
This commit is contained in:
commit
4f3d1693b4
57
.gitignore
vendored
Normal file
57
.gitignore
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
HELP.md
|
||||
target/
|
||||
|
||||
velocity.log
|
||||
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
.DS_Store
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
/logs
|
||||
*.log
|
||||
*.class
|
||||
*.ctxt
|
||||
.mtj.tmp/
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
*.vue
|
||||
*.js
|
||||
*.ts
|
||||
41
Dockerfile
Normal file
41
Dockerfile
Normal file
@ -0,0 +1,41 @@
|
||||
# 第一阶段:使用 Maven + Java8 构建 JAR 包
|
||||
FROM maven:3.9.2-eclipse-temurin-8-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 添加国内 Maven 镜像源
|
||||
RUN mkdir -p /root/.m2 && \
|
||||
echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" \
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 \
|
||||
https://maven.apache.org/xsd/settings-1.0.0.xsd"> \
|
||||
<mirrors> \
|
||||
<mirror> \
|
||||
<id>aliyun</id> \
|
||||
<mirrorOf>*</mirrorOf> \
|
||||
<name>aliyun maven</name> \
|
||||
<url>https://maven.aliyun.com/repository/public</url> \
|
||||
</mirror> \
|
||||
</mirrors> \
|
||||
</settings>' > /root/.m2/settings.xml
|
||||
|
||||
# 复制项目代码
|
||||
COPY pom.xml .
|
||||
COPY src ./src
|
||||
|
||||
# 构建项目
|
||||
RUN mvn clean package -DskipTests
|
||||
|
||||
# 第二阶段:使用更小的 Java8 JDK 镜像运行
|
||||
FROM eclipse-temurin:8-jdk-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 复制构建产物
|
||||
COPY --from=builder /app/target/*.jar app.jar
|
||||
|
||||
# 暴露端口(请替换成你实际应用端口)
|
||||
EXPOSE 5477
|
||||
|
||||
# 启动应用
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||
390
pom.xml
Normal file
390
pom.xml
Normal file
@ -0,0 +1,390 @@
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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>
|
||||
|
||||
<groupId>net.1024lab</groupId>
|
||||
<artifactId>sa-parent</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>sa-parent</name>
|
||||
<description>SmartAdmin project</description>
|
||||
|
||||
<modules>
|
||||
<module>sa-common</module>
|
||||
<module>sa-admin</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<springboot.version>2.7.5</springboot.version>
|
||||
<spring-mock.version>2.0.8</spring-mock.version>
|
||||
<mybatis-plus.version>3.5.2</mybatis-plus.version>
|
||||
<p6spy.version>3.8.6</p6spy.version>
|
||||
<swagger.version>2.7.0</swagger.version>
|
||||
<fastjson.version>2.0.16</fastjson.version>
|
||||
<druid.version>1.2.14</druid.version>
|
||||
<google-linkedhashmap.version>1.4.2</google-linkedhashmap.version>
|
||||
<google-guava.version>20.0</google-guava.version>
|
||||
<user-agent-utils.version>1.21</user-agent-utils.version>
|
||||
<kaptcha.version>2.3.2</kaptcha.version>
|
||||
<reflections.version>0.9.11</reflections.version>
|
||||
<commons-io.version>2.6</commons-io.version>
|
||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||
<commons-collections4.version>4.4</commons-collections4.version>
|
||||
<commons-codec.version>1.13</commons-codec.version>
|
||||
<easypoi.version>4.2.0</easypoi.version>
|
||||
<xerces.version>2.12.0</xerces.version>
|
||||
<poi-scratchpad.version>4.1.1</poi-scratchpad.version>
|
||||
<poi-ooxml-schemas.version>1.3</poi-ooxml-schemas.version>
|
||||
<aws-java-sdk.version>1.11.842</aws-java-sdk.version>
|
||||
<log4j-spring-boot.version>2.17.2</log4j-spring-boot.version>
|
||||
<hutool.version>5.7.22</hutool.version>
|
||||
<velocity-engine-core.version>2.3</velocity-engine-core.version>
|
||||
<jjwt.version>0.9.1</jjwt.version>
|
||||
<jwks-rsa.version>0.9.0</jwks-rsa.version>
|
||||
<velocity-tools.version>3.1</velocity-tools.version>
|
||||
<easyexcel.version>3.3.3</easyexcel.version>
|
||||
<aliyun-sdk-oss.version>3.15.1</aliyun-sdk-oss.version>
|
||||
<weixin-java-miniapp.version>4.6.0</weixin-java-miniapp.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
<!--BOM begin-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>${springboot.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<!--BOM end-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-mock</artifactId>
|
||||
<version>${spring-mock.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<groupId>commons-logging</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>p6spy</groupId>
|
||||
<artifactId>p6spy</artifactId>
|
||||
<version>${p6spy.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
|
||||
<artifactId>concurrentlinkedhashmap-lru</artifactId>
|
||||
<version>${google-linkedhashmap.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>${google-guava.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>eu.bitwalker</groupId>
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
<version>${user-agent-utils.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.penggle</groupId>
|
||||
<artifactId>kaptcha</artifactId>
|
||||
<version>${kaptcha.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
<version>${reflections.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${commons-io.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>${commons-lang3.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
<version>${commons-collections4.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<groupId>commons-codec</groupId>
|
||||
<version>${commons-codec.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- poi start -->
|
||||
<dependency>
|
||||
<groupId>cn.afterturn</groupId>
|
||||
<artifactId>easypoi-spring-boot-starter</artifactId>
|
||||
<version>${easypoi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.afterturn</groupId>
|
||||
<artifactId>easypoi-web</artifactId>
|
||||
<version>${easypoi.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>javassist</artifactId>
|
||||
<groupId>org.javassist</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- sax 读取时候用到的 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>xerces</groupId>-->
|
||||
<!-- <artifactId>xercesImpl</artifactId>-->
|
||||
<!-- <version>${xerces.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-scratchpad</artifactId>
|
||||
<version>${poi-scratchpad.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Word 需要使用 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>ooxml-schemas</artifactId>
|
||||
<version>${poi-ooxml-schemas.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.amazonaws</groupId>
|
||||
<artifactId>aws-java-sdk-s3</artifactId>
|
||||
<version>${aws-java-sdk.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<groupId>commons-logging</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-spring-boot</artifactId>
|
||||
<version>${log4j-spring-boot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>${jjwt.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>jwks-rsa</artifactId>
|
||||
<version>${jwks-rsa.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--velocity begin-->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>${velocity-engine-core.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity.tools</groupId>
|
||||
<artifactId>velocity-tools-generic</artifactId>
|
||||
<version>${velocity-tools.version}</version>
|
||||
</dependency>
|
||||
<!--velocity end-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>${easyexcel.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
<version>${aliyun-sdk-oss.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-miniapp</artifactId>
|
||||
<version>${weixin-java-miniapp.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<finalName>${profiles.active}-${project.name}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<filtering>false</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>dev/*</exclude>
|
||||
<exclude>test/*</exclude>
|
||||
<exclude>pre/*</exclude>
|
||||
<exclude>prod/*</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
|
||||
<resource>
|
||||
<directory>src/main/resources/${profiles.active}</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>*.yaml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
|
||||
<resource>
|
||||
<directory>src/main/resources/${profiles.active}</directory>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>*.*</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.2</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<testFailureIgnore>true</testFailureIgnore>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${springboot.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<!--开发环境-->
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
<profiles.active>dev</profiles.active>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
<!--测试环境-->
|
||||
<profile>
|
||||
<id>test</id>
|
||||
<properties>
|
||||
<profiles.active>test</profiles.active>
|
||||
</properties>
|
||||
</profile>
|
||||
<!--预发布环境-->
|
||||
<profile>
|
||||
<id>pre</id>
|
||||
<properties>
|
||||
<profiles.active>pre</profiles.active>
|
||||
</properties>
|
||||
</profile>
|
||||
<!--生产环境-->
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
<properties>
|
||||
<profiles.active>prod</profiles.active>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
57
sa-admin/pom.xml
Normal file
57
sa-admin/pom.xml
Normal file
@ -0,0 +1,57 @@
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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>net.1024lab</groupId>
|
||||
<artifactId>sa-parent</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>sa-case-admin</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>sa-case-admin</name>
|
||||
<description>sa-case-admin project</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.1024lab</groupId>
|
||||
<artifactId>sa-case-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-miniapp</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>net.lab1024.sa.admin.SmartAdminApplication</mainClass>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,33 @@
|
||||
package net.lab1024.sa.admin;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* SmartAdmin 项目启动类
|
||||
*
|
||||
* @Author 1024创新实验室-主任:卓大
|
||||
* @Date 2022-08-29 21:00:58
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022
|
||||
*/
|
||||
@EnableCaching
|
||||
@EnableScheduling
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
|
||||
@ComponentScan(basePackages = {"net.lab1024.sa"})
|
||||
@MapperScan(value = "net.lab1024.sa", annotationClass = Mapper.class)
|
||||
@SpringBootApplication(exclude = {UserDetailsServiceAutoConfiguration.class })
|
||||
public class SmartAdminApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SmartAdminApplication.class, args);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package net.lab1024.sa.admin.common;
|
||||
|
||||
/**
|
||||
* admin 相关的父类
|
||||
*
|
||||
* @Author 1024创新实验室-主任:卓大
|
||||
* @Date 2022-06-10 21:00:58
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022
|
||||
*/
|
||||
public class AdminBaseController {
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package net.lab1024.sa.admin.config;
|
||||
|
||||
import net.lab1024.sa.common.common.domain.RequestUser;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import net.lab1024.sa.common.module.support.jwe.JweAspect;
|
||||
import net.lab1024.sa.common.module.support.jwe.JweUserKey;
|
||||
import net.lab1024.sa.common.module.support.operatelog.core.OperateLogAspect;
|
||||
import net.lab1024.sa.common.module.support.operatelog.core.OperateLogConfig;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 操作日志切面 配置
|
||||
*
|
||||
* @Author 1024创新实验室: 罗伊
|
||||
* @Date 2022-05-30 21:22:12
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net )
|
||||
*/
|
||||
@Configuration
|
||||
public class JweAspectConfig {
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
*/
|
||||
@Bean
|
||||
public JweAspect jweConfig() {
|
||||
return new JweAspect((request -> {
|
||||
RequestUser requestUser = SmartRequestUtil.getRequestUser();
|
||||
JweUserKey userKey = new JweUserKey();
|
||||
userKey.setUserId(requestUser.getUserId());
|
||||
userKey.setUserName(requestUser.getUserName());
|
||||
userKey.setExtData(requestUser.getUserType().getValue().toString());
|
||||
return userKey;
|
||||
}));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package net.lab1024.sa.admin.config;
|
||||
|
||||
import net.lab1024.sa.common.common.domain.RequestUser;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import net.lab1024.sa.common.module.support.operatelog.core.OperateLogAspect;
|
||||
import net.lab1024.sa.common.module.support.operatelog.core.OperateLogConfig;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 操作日志切面 配置
|
||||
*
|
||||
* @Author 1024创新实验室: 罗伊
|
||||
* @Date 2022-05-30 21:22:12
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net )
|
||||
*/
|
||||
@Configuration
|
||||
public class OperateLogAspectConfig extends OperateLogAspect{
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public OperateLogConfig getOperateLogConfig() {
|
||||
OperateLogConfig config = OperateLogConfig.builder().corePoolSize(4).queueCapacity(1000).build();
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package net.lab1024.sa.admin.config;
|
||||
|
||||
import net.lab1024.sa.admin.module.system.login.service.LoginService;
|
||||
import net.lab1024.sa.common.common.security.AbstractSecurityConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* 权限配置
|
||||
*
|
||||
* @Author 1024创新实验室: 罗伊
|
||||
* @Date 2022-05-30 21:22:12
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net )
|
||||
*/
|
||||
@Configuration
|
||||
public class SecurityConfig extends AbstractSecurityConfig {
|
||||
/**
|
||||
* 获取TOKEN 解析类
|
||||
*/
|
||||
@Autowired
|
||||
private LoginService loginService;
|
||||
|
||||
@Override
|
||||
protected BiFunction<String, HttpServletRequest, UserDetails> userFunction() {
|
||||
return (token, request) -> loginService.getLoginUserDetail(token, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getAuthenticatedUrlPatterns() {
|
||||
return new String[]{"/**"};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package net.lab1024.sa.admin.config;
|
||||
|
||||
import net.lab1024.sa.admin.module.system.login.domain.LoginEmployeeDetail;
|
||||
import net.lab1024.sa.common.common.annoation.SaAuth;
|
||||
import net.lab1024.sa.common.common.security.SecurityMethodSource;
|
||||
import net.lab1024.sa.common.common.security.SecurityPermissionCheckService;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.security.access.expression.method.ExpressionBasedAnnotationAttributeFactory;
|
||||
import org.springframework.security.access.method.MethodSecurityMetadataSource;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||
import org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration;
|
||||
import org.springframework.security.core.Authentication;
|
||||
|
||||
/**
|
||||
* 1、以类名加方法名为权限字符串的校验模式 <br>
|
||||
* 2、重写MethodSecurityMetadataSource将优化security配置,只需在方法上加上@saAuth注解,方法上就会存在权限(权限字符串为类名加方法名),而无需另外手动设置,减轻后端开发成本<br>
|
||||
* 3、security将不再依据权限字符串进行权限控制,<br>
|
||||
* 4、security将依据对应权限字符串下的接口权限进行控制 <br>
|
||||
* 5、采用此配置原@PreAuthorize依然有效 <br>
|
||||
* 6、如若无需此配置,需将@EnableGlobalMethodSecurity注解添加至SecurityConfig类上
|
||||
*
|
||||
* @Author 1024创新实验室: 罗伊
|
||||
* @Date 2021-08-31 0:01
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net )
|
||||
*/
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
public class SecurityMethodConfig extends GlobalMethodSecurityConfiguration {
|
||||
|
||||
@Bean(SaAuth.saAuth)
|
||||
public SecurityPermissionCheckService securityPermissionCheckService() {
|
||||
return new SecurityPermissionCheckService() {
|
||||
@Override
|
||||
public boolean checkPermission(Authentication authentication, String permission) {
|
||||
LoginEmployeeDetail loginEmployeeDetail = (LoginEmployeeDetail) authentication.getPrincipal();
|
||||
if (loginEmployeeDetail.getAdministratorFlag()) {
|
||||
return true;
|
||||
}
|
||||
return super.permissionJudge(loginEmployeeDetail, permission);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodSecurityMetadataSource customMethodSecurityMetadataSource() {
|
||||
ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(this.getExpressionHandler());
|
||||
return new SecurityMethodSource(attributeFactory, SaAuth.saAuth);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package net.lab1024.sa.admin.constant;
|
||||
|
||||
import net.lab1024.sa.common.constant.CacheKeyConst;
|
||||
|
||||
/**
|
||||
* 缓存 key
|
||||
*
|
||||
* @Author 1024创新实验室-主任:卓大
|
||||
* @Date 2022-01-07 18:59:22
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022
|
||||
*/
|
||||
public class AdminCacheConst extends CacheKeyConst {
|
||||
|
||||
public static class Department {
|
||||
|
||||
/**
|
||||
* 部门列表
|
||||
*/
|
||||
public static final String DEPARTMENT_LIST_CACHE = "department_list_cache";
|
||||
|
||||
/**
|
||||
* 部门map
|
||||
*/
|
||||
public static final String DEPARTMENT_MAP_CACHE = "department_map_cache";
|
||||
|
||||
/**
|
||||
* 部门树
|
||||
*/
|
||||
public static final String DEPARTMENT_TREE_CACHE = "department_tree_cache";
|
||||
|
||||
/**
|
||||
* 某个部门以及下级的id列表
|
||||
*/
|
||||
public static final String DEPARTMENT_SELF_CHILDREN_CACHE = "department_self_children_cache";
|
||||
|
||||
/**
|
||||
* 部门路径 缓存
|
||||
*/
|
||||
public static final String DEPARTMENT_PATH_CACHE = "department_path_cache";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类相关缓存
|
||||
*/
|
||||
public static class CATEGORY {
|
||||
|
||||
public static final String CATEGORY_ENTITY = "category_cache";
|
||||
|
||||
public static final String CATEGORY_SUB = "category_sub_cache";
|
||||
|
||||
public static final String CATEGORY_TREE = "category_tree_cache";
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package net.lab1024.sa.admin.constant;
|
||||
|
||||
import net.lab1024.sa.common.constant.RedisKeyConst;
|
||||
|
||||
/**
|
||||
* redis key 常量类
|
||||
*
|
||||
* @Author 1024创新实验室-主任:卓大
|
||||
* @Date 2022-01-07 18:59:22
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022
|
||||
*/
|
||||
public class AdminRedisKeyConst extends RedisKeyConst {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package net.lab1024.sa.admin.constant;
|
||||
|
||||
import net.lab1024.sa.common.constant.SwaggerTagConst;
|
||||
|
||||
/**
|
||||
* swagger
|
||||
*
|
||||
* @Author 1024创新实验室:罗伊
|
||||
* @Date 2022-01-07 18:59:22
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022
|
||||
*/
|
||||
public class AdminSwaggerTagConst extends SwaggerTagConst {
|
||||
|
||||
public static class Business {
|
||||
public static final String MANAGER_CATEGORY = "ERP进销存-分类管理";
|
||||
|
||||
public static final String MANAGER_GOODS = "ERP进销存-商品管理";
|
||||
|
||||
public static final String OA_BANK = "OA办公-银行卡信息";
|
||||
|
||||
public static final String OA_ENTERPRISE = "OA办公-企业";
|
||||
|
||||
public static final String OA_INVOICE = "OA办公-发票信息";
|
||||
|
||||
public static final String OA_NOTICE = "OA办公-通知公告";
|
||||
}
|
||||
|
||||
|
||||
public static class System {
|
||||
|
||||
public static final String SYSTEM_LOGIN = "系统-员工登录";
|
||||
|
||||
public static final String SYSTEM_EMPLOYEE = "系统-员工管理";
|
||||
|
||||
public static final String SYSTEM_DEPARTMENT = "系统-部门管理";
|
||||
|
||||
public static final String SYSTEM_MENU = "系统-菜单";
|
||||
|
||||
public static final String SYSTEM_DATA_SCOPE = "系统-系统-数据范围";
|
||||
|
||||
public static final String SYSTEM_ROLE = "系统-角色";
|
||||
|
||||
public static final String SYSTEM_ROLE_DATA_SCOPE = "系统-角色-数据范围";
|
||||
|
||||
public static final String SYSTEM_ROLE_EMPLOYEE = "系统-角色-员工";
|
||||
|
||||
public static final String SYSTEM_ROLE_MENU = "系统-角色-菜单";
|
||||
public static final String SYSTEM_ROLE_PROV = "系统-角色-省份";
|
||||
|
||||
public static final String SYSTEM_DATA_TRACER = "系统-";
|
||||
}
|
||||
|
||||
|
||||
public static class App {
|
||||
|
||||
public static final String MedicalRecord = "前端-病历";
|
||||
|
||||
public static final String Expert = "前端-登录、注册、首页";
|
||||
public static final String ExpertSign = "前端-医生签名";
|
||||
|
||||
public static final String OSS = "前端-oss";
|
||||
public static final String WX_MINI = "前端-微信小程序";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package net.lab1024.sa.admin.listener;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.lab1024.sa.common.common.code.ErrorCodeRegister;
|
||||
import net.lab1024.sa.common.config.ScheduleConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* admin 应用启动加载
|
||||
*
|
||||
* @Author 1024创新实验室-主任:卓大
|
||||
* @Date 2021-08-26 18:46:32
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class AdminStartupRunner implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private ScheduleConfig scheduleConfig;
|
||||
|
||||
@Override
|
||||
public void run(String... args) {
|
||||
|
||||
// 初始化状态码
|
||||
int codeCount = ErrorCodeRegister.initialize();
|
||||
|
||||
//TODO <卓大> :根据实际情况来决定是否开启定时任务
|
||||
String destroySchedules = "Spring 定时任务 @Schedule 已启动";
|
||||
// destroySchedules = scheduleConfig.destroy();
|
||||
|
||||
log.info("\n ---------------【1024创新实验室 温馨提示:】 ErrorCode 共计完成初始化: {}个!---------------" +
|
||||
"\n ---------------【1024创新实验室 温馨提示:】 {}---------------\n", codeCount, destroySchedules);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ExpertBankVerify {
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
@NotBlank(message = "姓名 不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("身份证")
|
||||
@NotBlank(message = "身份证 不能为空")
|
||||
private String idCardNo;
|
||||
|
||||
@ApiModelProperty("银行卡")
|
||||
@NotBlank(message = "银行卡 不能为空")
|
||||
private String bankCardNo;
|
||||
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.system.login.domain.LoginEmployeeDetail;
|
||||
import net.lab1024.sa.common.common.domain.RequestUser;
|
||||
import net.lab1024.sa.common.common.enumeration.UserTypeEnum;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
@Data
|
||||
@TableName("t_caseplatform_expert")
|
||||
public class ExpertEntity implements UserDetails, RequestUser {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String uuid;
|
||||
private String mobile;
|
||||
private String name;
|
||||
private String photo;
|
||||
private String hospitalUuid;
|
||||
private String hospitalName;
|
||||
private String token;
|
||||
private String ip;
|
||||
private Integer provId;
|
||||
private Integer countyId;
|
||||
private Integer cityId;
|
||||
|
||||
/**
|
||||
* security 权限串
|
||||
*/
|
||||
private Set<? extends GrantedAuthority> authorities;
|
||||
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
return authorities;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
public String getPassword() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return this.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonLocked() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getUserId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserTypeEnum getUserType() {
|
||||
return UserTypeEnum.EXPERT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIp() {
|
||||
return this.ip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserAgent() {
|
||||
return "wx";
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ExpertLoginVO {
|
||||
@ApiModelProperty(value = "专家ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "专家UUID")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty(value = "专家姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "专家头像")
|
||||
private String photo;
|
||||
|
||||
@ApiModelProperty(value = "专家医院名称")
|
||||
private String hospitalName;
|
||||
|
||||
@ApiModelProperty(value = "token")
|
||||
private String token;
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ExpertModifyForm {
|
||||
|
||||
@ApiModelProperty("UUID")
|
||||
@NotBlank(message = "UUID 不能为空")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
@NotBlank(message = "姓名 不能为空")
|
||||
@Length(max = 20, message = "姓名最多20字符")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("医院UUID")
|
||||
@NotBlank(message = "医院UUID 不能为空")
|
||||
@Length(max = 32, message = "医院UUID最多32字符")
|
||||
private String hospital_uuid;
|
||||
|
||||
@ApiModelProperty("医院名称")
|
||||
@NotBlank(message = "医院名称 不能为空")
|
||||
@Length(max = 50, message = "医院名称最多50字符")
|
||||
private String hospital_name;
|
||||
|
||||
@ApiModelProperty("科室UUID")
|
||||
@NotBlank(message = "科室UUID 不能为空")
|
||||
@Length(max = 32, message = "科室UUID最多32字符")
|
||||
private String office_uuid;
|
||||
|
||||
@ApiModelProperty("科室名称")
|
||||
@NotBlank(message = "科室名称 不能为空")
|
||||
@Length(max = 20, message = "科室名称最多20字符")
|
||||
private String office_name;
|
||||
|
||||
@ApiModelProperty("职称UUID")
|
||||
@NotBlank(message = "职称UUID 不能为空")
|
||||
@Length(max = 32, message = "职称UUID最多32字符")
|
||||
private String position_uuid;
|
||||
|
||||
@ApiModelProperty("执业证号")
|
||||
private String certificate;
|
||||
|
||||
@ApiModelProperty("执业医师资格证或工作胸牌")
|
||||
@NotBlank(message = "执业医师资格证或工作胸牌 不能为空")
|
||||
private String certificate_img;
|
||||
|
||||
@ApiModelProperty("地区ID")
|
||||
@NotBlank(message = "地区ID 不能为空")
|
||||
private String county_id;
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ExpertModifyVO {
|
||||
|
||||
@ApiModelProperty("UUID")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("医院UUID")
|
||||
private String hospital_uuid;
|
||||
|
||||
@ApiModelProperty("医院名称")
|
||||
private String hospital_name;
|
||||
|
||||
@ApiModelProperty("科室UUID")
|
||||
private String office_uuid;
|
||||
|
||||
@ApiModelProperty("科室名称")
|
||||
private String office_name;
|
||||
|
||||
@ApiModelProperty("职称UUID")
|
||||
private String position_uuid;
|
||||
|
||||
@ApiModelProperty("执业证号")
|
||||
private String certificate;
|
||||
|
||||
@ApiModelProperty("执业医师资格证或工作胸牌")
|
||||
private String certificate_img;
|
||||
|
||||
@ApiModelProperty("地区ID")
|
||||
private Integer county_id;
|
||||
|
||||
@ApiModelProperty("省份ID")
|
||||
private Integer prov_id;
|
||||
|
||||
@ApiModelProperty("城市ID")
|
||||
private Integer city_id;
|
||||
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ExpertRegisterForm {
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
@NotBlank(message = "手机号 不能为空")
|
||||
@Length(max = 11, message = "手机号最多11字符")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("短信验证码")
|
||||
@NotBlank(message = "短信验证码 不能为空")
|
||||
@Length(max = 6, message = "短信验证码最多6字符")
|
||||
private String sms;
|
||||
|
||||
@ApiModelProperty("密码")
|
||||
@NotBlank(message = "密码 不能为空")
|
||||
@Length(max = 32, message = "密码最多32字符")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
@NotBlank(message = "姓名 不能为空")
|
||||
@Length(max = 20, message = "姓名最多20字符")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("医院UUID")
|
||||
@NotBlank(message = "医院UUID 不能为空")
|
||||
@Length(max = 32, message = "医院UUID最多32字符")
|
||||
private String hospital_uuid;
|
||||
|
||||
@ApiModelProperty("医院名称")
|
||||
@NotBlank(message = "医院名称 不能为空")
|
||||
@Length(max = 50, message = "医院名称最多50字符")
|
||||
private String hospital_name;
|
||||
|
||||
@ApiModelProperty("科室UUID")
|
||||
@NotBlank(message = "科室UUID 不能为空")
|
||||
@Length(max = 32, message = "科室UUID最多32字符")
|
||||
private String office_uuid;
|
||||
|
||||
@ApiModelProperty("科室名称")
|
||||
@NotBlank(message = "科室名称 不能为空")
|
||||
@Length(max = 20, message = "科室名称最多20字符")
|
||||
private String office_name;
|
||||
|
||||
@ApiModelProperty("职称UUID")
|
||||
@NotBlank(message = "职称UUID 不能为空")
|
||||
@Length(max = 32, message = "职称UUID最多32字符")
|
||||
private String position_uuid;
|
||||
|
||||
@ApiModelProperty("执业证号")
|
||||
private String certificate;
|
||||
|
||||
@ApiModelProperty("执业医师资格证或工作胸牌")
|
||||
@NotBlank(message = "执业医师资格证或工作胸牌 不能为空")
|
||||
private String certificate_img;
|
||||
|
||||
@ApiModelProperty("地区ID")
|
||||
@NotBlank(message = "地区ID 不能为空")
|
||||
private String county_id;
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ExpertSignAddForm {
|
||||
|
||||
@ApiModelProperty(value = "签名图片")
|
||||
@NotNull(message = "签名图片 不能为空")
|
||||
private String signImg;
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ExpertSignVO {
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "专家ID")
|
||||
private String expertId;
|
||||
|
||||
@ApiModelProperty(value = "签名图片地址")
|
||||
private String signImg;
|
||||
|
||||
@ApiModelProperty(value = "专家姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "专家手机")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "专家银行卡号")
|
||||
private String bankCardNo;
|
||||
|
||||
@ApiModelProperty(value = "开户行", required = true)
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty(value = "身份证号", required = true)
|
||||
private String idCardNo;
|
||||
|
||||
@ApiModelProperty(value = "签名日期")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ExpertVO {
|
||||
|
||||
@ApiModelProperty(value = "专家ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "专家UUID")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty(value = "专家姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "专家头像")
|
||||
private String photo;
|
||||
|
||||
@ApiModelProperty(value = "专家医院名称")
|
||||
private String hospitalName;
|
||||
|
||||
@ApiModelProperty(value = "专家通过数量")
|
||||
private Integer passNum;
|
||||
|
||||
@ApiModelProperty(value = "专家待审核数量")
|
||||
private Integer waitNum;
|
||||
|
||||
@ApiModelProperty(value = "专家待修改数量")
|
||||
private Integer refuseNum;
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 专家表-白名单实体类
|
||||
*/
|
||||
@TableName("`t_caseplatform_expert_white`") // 指定数据库表名
|
||||
public class ExpertWhiteEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@TableField("mobile")
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@TableField("photo")
|
||||
private String photo;
|
||||
|
||||
/**
|
||||
* 医院uuid
|
||||
*/
|
||||
@TableField("hospital_uuid")
|
||||
private String hospitalUuid;
|
||||
|
||||
/**
|
||||
* 医院名称
|
||||
*/
|
||||
@TableField("hospital_name")
|
||||
private String hospitalName;
|
||||
|
||||
/**
|
||||
* 省ID
|
||||
*/
|
||||
@TableField("prov_id")
|
||||
private Integer provinceId;
|
||||
|
||||
/**
|
||||
* 市ID
|
||||
*/
|
||||
@TableField("city_id")
|
||||
private Integer cityId;
|
||||
|
||||
/**
|
||||
* 区ID
|
||||
*/
|
||||
@TableField("county_id")
|
||||
private Integer countyId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.app.expert.constan.SmsTypeEnum;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
import net.lab1024.sa.common.common.util.SmartVerificationUtil;
|
||||
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
|
||||
import net.lab1024.sa.common.module.support.captcha.domain.CaptchaForm;
|
||||
import net.lab1024.sa.common.module.support.token.LoginDeviceEnum;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 员工登录
|
||||
*
|
||||
* @Author 1024创新实验室: 开云
|
||||
* @Date 2021-12-19 11:49:45
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022
|
||||
*/
|
||||
@Data
|
||||
public class LoginForm extends CaptchaForm {
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
@NotBlank(message = "手机号 不能为空")
|
||||
@Length(max = 11, message = "登录账号最多11字符")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "登录终端")
|
||||
@ApiModelPropertyEnum(LoginDeviceEnum.class)
|
||||
@CheckEnum(value = LoginDeviceEnum.class, required = true, message = "此终端不允许登录")
|
||||
private Integer loginDevice;
|
||||
|
||||
@ApiModelProperty(value = "短信类型")
|
||||
@ApiModelPropertyEnum(SmsTypeEnum.class)
|
||||
@CheckEnum(value = SmsTypeEnum.class, required = true, message = "短信类型错误")
|
||||
private Integer smsType;
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.app.expert.constan.SmsTypeEnum;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
import net.lab1024.sa.common.common.util.SmartVerificationUtil;
|
||||
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
|
||||
import net.lab1024.sa.common.module.support.captcha.domain.CaptchaForm;
|
||||
import net.lab1024.sa.common.module.support.token.LoginDeviceEnum;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 手机号 密码登录
|
||||
*
|
||||
* @Author 1024创新实验室: 开云
|
||||
* @Date 2021-12-19 11:49:45
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022
|
||||
*/
|
||||
@Data
|
||||
public class PWDLoginForm extends CaptchaForm {
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
@NotBlank(message = "手机号 不能为空")
|
||||
@Length(max = 11, message = "登录账号最多11字符")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "登录终端")
|
||||
@ApiModelPropertyEnum(LoginDeviceEnum.class)
|
||||
@CheckEnum(value = LoginDeviceEnum.class, required = true, message = "此终端不允许登录")
|
||||
private Integer loginDevice;
|
||||
|
||||
@ApiModelProperty(value = "密码")
|
||||
@NotBlank(message = "密码 不能为空")
|
||||
private String pwd;
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.app.expert.constan.SmsTypeEnum;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
|
||||
import net.lab1024.sa.common.module.support.captcha.domain.CaptchaForm;
|
||||
import net.lab1024.sa.common.module.support.token.LoginDeviceEnum;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 短信验证码登录
|
||||
*
|
||||
* @Author 1024创新实验室: 开云
|
||||
* @Date 2021-12-19 11:49:45
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022
|
||||
*/
|
||||
@Data
|
||||
public class SmsLoginForm {
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
@NotBlank(message = "手机号 不能为空")
|
||||
@Length(max = 11, message = "登录账号最多11字符")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("短信验证码")
|
||||
@NotBlank(message = "短信验证码 不能为空")
|
||||
@Length(max = 6, message = "短信验证码最多6字符")
|
||||
private String sms;
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.constan;
|
||||
|
||||
public enum ImageType {
|
||||
JPG("jpg"),
|
||||
JPEG("jpeg"),
|
||||
PNG("png"),
|
||||
GIF("gif");
|
||||
|
||||
private final String fileExtension;
|
||||
|
||||
ImageType(String fileExtension) {
|
||||
this.fileExtension = fileExtension;
|
||||
}
|
||||
|
||||
public String getFileExtension() {
|
||||
return fileExtension;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.constan;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import net.lab1024.sa.common.common.enumeration.BaseEnum;
|
||||
|
||||
/**
|
||||
* 病历类型
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11T15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum SmsTypeEnum implements BaseEnum {
|
||||
register(1, "短信注册"),
|
||||
login(2, "短信登录"),
|
||||
;
|
||||
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
public static SmsTypeEnum getByVal(int val){
|
||||
for (SmsTypeEnum type: SmsTypeEnum.values()){
|
||||
if(type.getValue() == val){
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,588 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.*;
|
||||
import net.lab1024.sa.admin.module.app.expert.service.ExpertService;
|
||||
import net.lab1024.sa.admin.module.app.expert.service.ExpertWhiteEntityService;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.dao.MedicalRecorDao;
|
||||
import net.lab1024.sa.admin.module.business.area.domain.vo.ProvVO;
|
||||
import net.lab1024.sa.admin.module.business.area.service.AreaService;
|
||||
import net.lab1024.sa.admin.module.business.captcha.service.CaptchaService;
|
||||
import net.lab1024.sa.admin.module.system.login.service.LoginService;
|
||||
import net.lab1024.sa.common.common.annoation.NoNeedLogin;
|
||||
import net.lab1024.sa.common.common.constant.RequestHeaderConst;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.util.Sha256Util;
|
||||
import net.lab1024.sa.common.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import net.lab1024.sa.common.module.support.captcha.domain.CaptchaVO;
|
||||
import net.lab1024.sa.common.module.support.config.ConfigKeyEnum;
|
||||
import net.lab1024.sa.common.module.support.config.ConfigService;
|
||||
import net.lab1024.sa.common.module.support.config.domain.ConfigVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static net.lab1024.sa.common.common.code.UserErrorCode.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = {AdminSwaggerTagConst.App.Expert})
|
||||
public class ExpertController {
|
||||
|
||||
//发送验证码
|
||||
private final String SENDSMS_URL = "hcp/sendSms";
|
||||
|
||||
//短信登录
|
||||
private final String SMSLOGIN_URL = "hcp/smsLogin";
|
||||
|
||||
//短信注册
|
||||
private final String SMSREGISTER_URL = "hcp/smsRegister";
|
||||
|
||||
private final String UOLOADIMGV2_URL = "hcp/uoloadImgV2";
|
||||
|
||||
//科室列表
|
||||
private final String OFFICELIST_URL = "hcp/officeList";
|
||||
|
||||
//职称列表
|
||||
private final String POSITIONLIST_URL = "hcp/positionList";
|
||||
|
||||
//医院列表
|
||||
private final String HOSPITALLIST_URL = "hcp/hospitalList";
|
||||
|
||||
//获取HCP详情
|
||||
private final String GETINFO_URL = "hcp/getInfo";
|
||||
|
||||
//修改HCP资料
|
||||
private final String MODIFY_URL = "hcp/modify";
|
||||
|
||||
//账户密码登录
|
||||
private final String PWDLOGIN_URL = "hcp/PwdLogin";
|
||||
|
||||
@Value("${igandan.doc.host}")
|
||||
private String IGANDAN_DOC_HOST;
|
||||
|
||||
@Value("${igandan.wx.host}")
|
||||
private String IGANDAN_WX_HOST;
|
||||
|
||||
@Value("${igandan.wx.platform}")
|
||||
private String IGANDAN_WX_PLATFORM;
|
||||
|
||||
@Value("${igandan.wx.token}")
|
||||
private String IGANDAN_WX_token;
|
||||
|
||||
@Autowired
|
||||
private CaptchaService captchaService;
|
||||
|
||||
@Autowired
|
||||
private ExpertService expertService;
|
||||
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private AreaService areaService;
|
||||
|
||||
@Autowired
|
||||
private LoginService loginService;
|
||||
|
||||
@Autowired
|
||||
private MedicalRecorDao medicalRecorDao;
|
||||
|
||||
@Autowired
|
||||
private ExpertWhiteEntityService expertWhiteEntityService;
|
||||
|
||||
@ApiOperation("获取验证码")
|
||||
@GetMapping("/user/getCaptcha")
|
||||
@NoNeedLogin
|
||||
public ResponseDTO<CaptchaVO> getCaptcha() {
|
||||
return ResponseDTO.app_ok(captchaService.generateCaptcha());
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
* @return
|
||||
*/
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "发送验证码", notes = "")
|
||||
@PostMapping("/user/sendSms")
|
||||
public ResponseDTO<String> sendSms(@RequestBody @Valid LoginForm loginForm) {
|
||||
|
||||
ResponseDTO<String> checkCaptcha = captchaService.checkCaptcha(loginForm);
|
||||
if(!checkCaptcha.getOk()){
|
||||
return checkCaptcha;
|
||||
}
|
||||
|
||||
Integer smsType = loginForm.getSmsType();
|
||||
String mobile = loginForm.getMobile();
|
||||
Map<String, Object> params = new HashMap<>(8);
|
||||
params.put("type", smsType);
|
||||
params.put("mobile", mobile);
|
||||
params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
params.put("timestamp", System.currentTimeMillis()/1000);
|
||||
String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
params.put("signature", signature);
|
||||
|
||||
String result = HttpUtil.post(IGANDAN_WX_HOST + SENDSMS_URL, params);
|
||||
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
return responseDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信注册
|
||||
* @return
|
||||
*/
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "短信注册")
|
||||
@PostMapping("/user/smsRegister")
|
||||
public ResponseDTO smsRegister(@RequestBody @Valid ExpertRegisterForm form) {
|
||||
|
||||
String mobile = form.getMobile();
|
||||
String sms = form.getSms();
|
||||
String password = form.getPassword();
|
||||
String name = form.getName();
|
||||
String hospital_uuid = form.getHospital_uuid();
|
||||
String hospital_name = form.getHospital_name();
|
||||
String office_uuid = form.getOffice_uuid();
|
||||
String office_name = form.getOffice_name();
|
||||
String position_uuid = form.getPosition_uuid();
|
||||
String certificate = form.getCertificate();
|
||||
String certificate_img = form.getCertificate_img();
|
||||
String county_id = form.getCounty_id();
|
||||
Map<String, Object> params = new HashMap<>(16);
|
||||
params.put("mobile", mobile);
|
||||
params.put("sms", sms);
|
||||
params.put("password", password);
|
||||
params.put("name", name);
|
||||
params.put("hospital_uuid", hospital_uuid);
|
||||
params.put("hospital_name", hospital_name);
|
||||
params.put("office_uuid", office_uuid);
|
||||
params.put("office_name", office_name);
|
||||
params.put("position_uuid", position_uuid);
|
||||
params.put("certificate", certificate);
|
||||
params.put("certificate_img", certificate_img);
|
||||
params.put("county_id", county_id);
|
||||
|
||||
params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
params.put("timestamp", System.currentTimeMillis()/1000);
|
||||
String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
params.put("signature", signature);
|
||||
|
||||
String result = HttpUtil.post(IGANDAN_WX_HOST + SMSREGISTER_URL, params);
|
||||
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
return responseDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信登录
|
||||
* @return
|
||||
*/
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "短信登录")
|
||||
@PostMapping("/user/smsLogin")
|
||||
public ResponseDTO smsLogin(@RequestBody @Valid SmsLoginForm form) {
|
||||
Map<String, Object> params = new HashMap<>(8);
|
||||
String mobile = form.getMobile();
|
||||
params.put("mobile", mobile);
|
||||
params.put("sms", form.getSms());
|
||||
params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
params.put("timestamp", System.currentTimeMillis()/1000);
|
||||
String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
params.put("signature", signature);
|
||||
|
||||
String result = HttpUtil.post(IGANDAN_WX_HOST + SMSLOGIN_URL, params);
|
||||
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
if(responseDTO.getCode() == 200){
|
||||
Map data = (Map) responseDTO.getData();
|
||||
String uuid = (String) data.get("uuid");
|
||||
String name = (String) data.get("name");
|
||||
String photo = (String) data.get("photo");
|
||||
String hospital_uuid = (String) data.get("hospital_uuid");
|
||||
String hospital_name = (String) data.get("hospital_name");
|
||||
Integer prov_id = (Integer) data.get("prov_id");
|
||||
Integer county_id = (Integer) data.get("county_id");
|
||||
Integer city_id = (Integer) data.get("city_id");
|
||||
|
||||
// 获取白名单用户-姓名、医院名称
|
||||
ExpertWhiteEntity expertWhiteEntity = expertWhiteEntityService.getExpertWhiteEntityByNameAndHospitalName(name,hospital_name);
|
||||
if (expertWhiteEntity == null) {
|
||||
responseDTO.setMsg("暂无登录权限");
|
||||
return responseDTO;
|
||||
}
|
||||
|
||||
ExpertEntity expert = new ExpertEntity();
|
||||
expert.setName(name);
|
||||
if(StrUtil.isBlank(photo)){
|
||||
expert.setPhoto("");
|
||||
}else{
|
||||
expert.setPhoto(IGANDAN_DOC_HOST+photo);
|
||||
}
|
||||
expert.setUuid(uuid);
|
||||
expert.setHospitalName(hospital_name);
|
||||
expert.setHospitalUuid(hospital_uuid);
|
||||
expert.setProvId(prov_id);
|
||||
expert.setCityId(city_id);
|
||||
expert.setCountyId(county_id);
|
||||
expert.setMobile(mobile);
|
||||
ExpertEntity expertVO = expertService.addExpert(expert);
|
||||
ExpertLoginVO expertLoginVO = SmartBeanUtil.copy(expertVO, ExpertLoginVO.class);
|
||||
return ResponseDTO.app_ok(expertLoginVO);
|
||||
}else{
|
||||
responseDTO.setMsg("账号未注册,请您注册后登陆");
|
||||
return responseDTO;
|
||||
}
|
||||
}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation("获取省市区")
|
||||
@GetMapping("/user/areaList")
|
||||
public ResponseDTO<List<ProvVO>> areaList(Long parent) {
|
||||
return ResponseDTO.app_ok(areaService.areaList(parent));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "退出登录")
|
||||
@GetMapping("/user/logOut")
|
||||
public ResponseDTO<String> logOut(@RequestHeader(value = RequestHeaderConst.TOKEN, required = false) String token) {
|
||||
return loginService.appLogout(token, SmartRequestUtil.getRequestUser());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "个人中心")
|
||||
@GetMapping("/user/getInfo")
|
||||
public ResponseDTO<ExpertVO> getInfo() {
|
||||
return ResponseDTO.app_ok(expertService.getInfo());
|
||||
}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "项目协议")
|
||||
@GetMapping("/user/getDeal")
|
||||
public ResponseDTO<String> getDeal() {
|
||||
ConfigVO config = configService.getConfig(ConfigKeyEnum.DEAL);
|
||||
return ResponseDTO.app_ok(config.getConfigValue());
|
||||
}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "隐私协议")
|
||||
@GetMapping("/user/getPrivacy")
|
||||
public ResponseDTO<String> getPrivacy() {
|
||||
ConfigVO config = configService.getConfig(ConfigKeyEnum.PRIVACY);
|
||||
return ResponseDTO.app_ok(config.getConfigValue());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目状态")
|
||||
@GetMapping("/user/getProjectStatus")
|
||||
public ResponseDTO<String> getCaseNum() {
|
||||
ConfigVO CaseSwitch = configService.getConfig(ConfigKeyEnum.CaseSwitch);
|
||||
if(CaseSwitch.getConfigValue().equals("false")){
|
||||
return ResponseDTO.error(PROJECT_CLOSE);
|
||||
}
|
||||
|
||||
ConfigVO CaseNum = configService.getConfig(ConfigKeyEnum.CaseNum);
|
||||
int total = medicalRecorDao.getTotal();
|
||||
if(Integer.parseInt(CaseNum.getConfigValue()) <= total){
|
||||
return ResponseDTO.error(PROJECT_CLOSE);
|
||||
}
|
||||
|
||||
return ResponseDTO.app_ok();
|
||||
}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "操作说明")
|
||||
@GetMapping("/user/getRubric")
|
||||
public ResponseDTO<String> getRubric() {
|
||||
ConfigVO config = configService.getConfig(ConfigKeyEnum.RUBRIC);
|
||||
return ResponseDTO.app_ok(config.getConfigValue());
|
||||
}
|
||||
|
||||
//@NoNeedLogin
|
||||
//@ApiOperation(value = "上传图片", notes = "仅在上传执业医师资格证使用")
|
||||
//@PostMapping("/user/uoloadImg")
|
||||
//public ResponseDTO<String> uoloadImg(@RequestParam("file") MultipartFile file) throws IOException {
|
||||
// HashMap<String, Object> params = new HashMap<>();
|
||||
// //文件上传只需将参数中的键指定(默认file),值设为文件对象即可,对于使用者来说,文件上传与普通表单提交并无区别
|
||||
// byte[] fileBytes = file.getBytes();
|
||||
// String base64String = Base64.getEncoder().encodeToString(fileBytes);
|
||||
//
|
||||
// String originalFilename = file.getOriginalFilename();
|
||||
// String fileExtension = FilenameUtils.getExtension(originalFilename);
|
||||
// ImageType imageType = ImageType.valueOf(fileExtension.toUpperCase());
|
||||
//
|
||||
// long timestamp = System.currentTimeMillis() / 1000;
|
||||
// params.put("type", imageType.getFileExtension());
|
||||
// params.put("base64Img", base64String);
|
||||
// params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
// params.put("timestamp", timestamp);
|
||||
// String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
// params.put("signature", signature);
|
||||
//
|
||||
//
|
||||
// String result = HttpUtil.post(IGANDAN_WX_HOST + UOLOADIMG_URL, params, 60 * 1000);
|
||||
// ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
// if(responseDTO.getCode() == 200){
|
||||
// String data = (String) responseDTO.getData();
|
||||
//
|
||||
// return ResponseDTO.app_ok(IGANDAN_DOC_HOST + data);
|
||||
// }
|
||||
// return ResponseDTO.userErrorParam();
|
||||
//}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "上传图片", notes = "仅在上传执业医师资格证使用")
|
||||
@PostMapping("/user/uoloadImg")
|
||||
public ResponseDTO<String> uoloadImg(@RequestParam("file") MultipartFile file) throws IOException {
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
//文件上传只需将参数中的键指定(默认file),值设为文件对象即可,对于使用者来说,文件上传与普通表单提交并无区别
|
||||
// 创建一个临时文件
|
||||
File tempFile = File.createTempFile("temp", file.getOriginalFilename());
|
||||
// 将 MultipartFile 的内容写入到临时文件中
|
||||
try (InputStream inputStream = file.getInputStream();
|
||||
OutputStream outputStream = new FileOutputStream(tempFile)) {
|
||||
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead;
|
||||
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
}
|
||||
params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
params.put("timestamp", System.currentTimeMillis()/1000);
|
||||
String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
params.put("signature", signature);
|
||||
params.put("file", tempFile);
|
||||
String result= HttpUtil.post(IGANDAN_WX_HOST + UOLOADIMGV2_URL, params);
|
||||
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
if(responseDTO.getCode() == 200){
|
||||
String data = (String) responseDTO.getData();
|
||||
return ResponseDTO.app_ok(IGANDAN_DOC_HOST + data);
|
||||
}
|
||||
}finally {
|
||||
tempFile.deleteOnExit();
|
||||
}
|
||||
return ResponseDTO.userErrorParam();
|
||||
}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "科室列表")
|
||||
@GetMapping("/user/officeList")
|
||||
public ResponseDTO officeList() {
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
params.put("timestamp", System.currentTimeMillis()/1000);
|
||||
String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
params.put("signature", signature);
|
||||
String result = HttpUtil.post(IGANDAN_WX_HOST + OFFICELIST_URL, params);
|
||||
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
if(responseDTO.getCode() == 200){
|
||||
Object data = responseDTO.getData();
|
||||
return ResponseDTO.app_ok(data);
|
||||
}
|
||||
return ResponseDTO.userErrorParam();
|
||||
}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "职称列表")
|
||||
@GetMapping("/user/positionList")
|
||||
public ResponseDTO positionList() {
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
params.put("timestamp", System.currentTimeMillis()/1000);
|
||||
String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
params.put("signature", signature);
|
||||
String result = HttpUtil.post(IGANDAN_WX_HOST + POSITIONLIST_URL, params);
|
||||
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
if(responseDTO.getCode() == 200){
|
||||
Object data = responseDTO.getData();
|
||||
return ResponseDTO.app_ok(data);
|
||||
}
|
||||
return ResponseDTO.userErrorParam();
|
||||
}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "医院列表")
|
||||
@GetMapping("/user/hospitalList/{countyId}")
|
||||
public ResponseDTO hospitalList(@PathVariable Long countyId) {
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("countyId", countyId);
|
||||
params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
params.put("timestamp", System.currentTimeMillis()/1000);
|
||||
String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
params.put("signature", signature);
|
||||
String result = HttpUtil.post(IGANDAN_WX_HOST + HOSPITALLIST_URL, params);
|
||||
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
if(responseDTO.getCode() == 200){
|
||||
Object data = responseDTO.getData();
|
||||
return ResponseDTO.app_ok(data);
|
||||
}
|
||||
return ResponseDTO.userErrorParam();
|
||||
}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "账户密码登录")
|
||||
@PostMapping("/user/login")
|
||||
public ResponseDTO login(@RequestBody @Valid PWDLoginForm loginForm) {
|
||||
|
||||
ResponseDTO<String> checkCaptcha = captchaService.checkCaptcha(loginForm);
|
||||
if(!checkCaptcha.getOk()){
|
||||
return checkCaptcha;
|
||||
}
|
||||
String pwd = loginForm.getPwd();
|
||||
String mobile = loginForm.getMobile();
|
||||
Map<String, Object> params = new HashMap<>(8);
|
||||
params.put("password", pwd);
|
||||
params.put("mobile", mobile);
|
||||
params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
params.put("timestamp", System.currentTimeMillis()/1000);
|
||||
String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
params.put("signature", signature);
|
||||
|
||||
String result = HttpUtil.post(IGANDAN_WX_HOST + PWDLOGIN_URL, params);
|
||||
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
if(responseDTO.getCode() == 200){
|
||||
Map data = (Map) responseDTO.getData();
|
||||
String uuid = (String) data.get("uuid");
|
||||
String name = (String) data.get("name");
|
||||
String photo = (String) data.get("photo");
|
||||
String hospital_uuid = (String) data.get("hospital_uuid");
|
||||
String hospital_name = (String) data.get("hospital_name");
|
||||
Integer prov_id = (Integer) data.get("prov_id");
|
||||
Integer county_id = (Integer) data.get("county_id");
|
||||
Integer city_id = (Integer) data.get("city_id");
|
||||
|
||||
// 获取白名单用户-姓名、医院名称
|
||||
ExpertWhiteEntity expertWhiteEntity = expertWhiteEntityService.getExpertWhiteEntityByNameAndHospitalName(name,hospital_name);
|
||||
if (expertWhiteEntity == null) {
|
||||
responseDTO.setMsg("暂无登录权限");
|
||||
return responseDTO;
|
||||
}
|
||||
|
||||
ExpertEntity expert = new ExpertEntity();
|
||||
expert.setName(name);
|
||||
if(StrUtil.isBlank(photo)){
|
||||
expert.setPhoto("");
|
||||
}else{
|
||||
expert.setPhoto(IGANDAN_DOC_HOST+photo);
|
||||
}
|
||||
expert.setUuid(uuid);
|
||||
expert.setHospitalName(hospital_name);
|
||||
expert.setHospitalUuid(hospital_uuid);
|
||||
expert.setProvId(prov_id);
|
||||
expert.setCityId(city_id);
|
||||
expert.setCountyId(county_id);
|
||||
expert.setMobile(mobile);
|
||||
ExpertEntity expertVO = expertService.addExpert(expert);
|
||||
|
||||
ExpertLoginVO expertLoginVO = SmartBeanUtil.copy(expertVO, ExpertLoginVO.class);
|
||||
return ResponseDTO.app_ok(expertLoginVO);
|
||||
}else{
|
||||
return responseDTO;
|
||||
}
|
||||
}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "获取待补充资料时候-HCP详情")
|
||||
@GetMapping("/user/getDetail/{mobile}")
|
||||
public ResponseDTO getDetail(@PathVariable String mobile) {
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("mobile", mobile);
|
||||
params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
params.put("timestamp", System.currentTimeMillis()/1000);
|
||||
String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
params.put("signature", signature);
|
||||
String result = HttpUtil.post(IGANDAN_WX_HOST + GETINFO_URL, params);
|
||||
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
if(responseDTO.getCode() == 200){
|
||||
Map data = (Map) responseDTO.getData();
|
||||
if(data == null){
|
||||
return ResponseDTO.error(NO_MODIFY);
|
||||
}
|
||||
String uuid = (String) data.get("uuid");
|
||||
String name = (String) data.get("realname");
|
||||
String office_uuid = (String) data.get("office_uuid");
|
||||
String office_name = (String) data.get("office_name");
|
||||
String position_uuid = (String) data.get("position_uuid");
|
||||
String certificate = (String) data.get("certificate");
|
||||
String certificate_img = (String) data.get("certificate_img");
|
||||
String hospital_uuid = (String) data.get("hospital_uuid");
|
||||
String hospital_name = (String) data.get("hospital_name");
|
||||
Integer prov_id = (Integer) data.get("prov_id");
|
||||
Integer county_id = (Integer) data.get("county_id");
|
||||
Integer city_id = (Integer) data.get("city_id");
|
||||
ExpertModifyVO expert = new ExpertModifyVO();
|
||||
expert.setName(name);
|
||||
expert.setUuid(uuid);
|
||||
expert.setHospital_name(hospital_name);
|
||||
expert.setHospital_uuid(hospital_uuid);
|
||||
expert.setProv_id(prov_id);
|
||||
expert.setCity_id(city_id);
|
||||
expert.setCounty_id(county_id);
|
||||
|
||||
expert.setOffice_name(office_name);
|
||||
expert.setOffice_uuid(office_uuid);
|
||||
expert.setPosition_uuid(position_uuid);
|
||||
expert.setCertificate(certificate);
|
||||
expert.setCertificate_img(certificate_img);
|
||||
if(StrUtil.isBlank(certificate_img)){
|
||||
expert.setCertificate_img("");
|
||||
}else{
|
||||
expert.setCertificate_img(IGANDAN_DOC_HOST+certificate_img);
|
||||
}
|
||||
return ResponseDTO.app_ok(expert);
|
||||
}
|
||||
return ResponseDTO.userErrorParam();
|
||||
}
|
||||
|
||||
@NoNeedLogin
|
||||
@ApiOperation(value = "修改HCP资料")
|
||||
@PostMapping("/user/modify")
|
||||
public ResponseDTO modify(@RequestBody @Valid ExpertModifyForm form) {
|
||||
String uuid = form.getUuid();
|
||||
String name = form.getName();
|
||||
String hospital_uuid = form.getHospital_uuid();
|
||||
String hospital_name = form.getHospital_name();
|
||||
String office_uuid = form.getOffice_uuid();
|
||||
String office_name = form.getOffice_name();
|
||||
String position_uuid = form.getPosition_uuid();
|
||||
String certificate = form.getCertificate();
|
||||
String certificate_img = form.getCertificate_img().replaceAll(IGANDAN_DOC_HOST,"");
|
||||
String county_id = form.getCounty_id();
|
||||
Map<String, Object> params = new HashMap<>(16);
|
||||
params.put("uuid", uuid);
|
||||
params.put("realname", name);
|
||||
params.put("hospital_uuid", hospital_uuid);
|
||||
params.put("hospital_name", hospital_name);
|
||||
params.put("office_uuid", office_uuid);
|
||||
params.put("office_name", office_name);
|
||||
params.put("position_uuid", position_uuid);
|
||||
params.put("certificate", certificate);
|
||||
params.put("certificate_img", certificate_img);
|
||||
params.put("county_id", county_id);
|
||||
params.put("platform", IGANDAN_WX_PLATFORM);
|
||||
params.put("timestamp", System.currentTimeMillis()/1000);
|
||||
String signature = Sha256Util.getSign(params, IGANDAN_WX_token);
|
||||
params.put("signature", signature);
|
||||
String result = HttpUtil.post(IGANDAN_WX_HOST + MODIFY_URL, params);
|
||||
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
|
||||
return responseDTO;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertSignVO;
|
||||
import net.lab1024.sa.admin.module.app.expert.service.ExpertSignService;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.form.CaseplatformBankAddForm;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.service.CaseplatformBankService;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.wangyi.yidun.sdk.BankCardCheckAPI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static net.lab1024.sa.common.common.code.UserErrorCode.ExpertBankVerifyFail;
|
||||
|
||||
@RestController
|
||||
@Api(tags = {AdminSwaggerTagConst.App.ExpertSign})
|
||||
public class ExpertSignController {
|
||||
|
||||
@Autowired
|
||||
private ExpertSignService expertSignService;
|
||||
|
||||
@Autowired
|
||||
private CaseplatformBankService caseplatformBankService;
|
||||
|
||||
/**
|
||||
* 获取专家 签名
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取专家 签名")
|
||||
@GetMapping("/user/getSign")
|
||||
public ResponseDTO<ExpertSignVO> getExpertSign() {
|
||||
ExpertSignVO expertSign = expertSignService.getExpertSign();
|
||||
return ResponseDTO.app_ok(expertSign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加专家 签名
|
||||
* 认证银行卡
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加专家 签名 & 认证银行卡")
|
||||
@PostMapping("/user/addBank")
|
||||
public ResponseDTO<String> bankVerify(@RequestBody @Valid CaseplatformBankAddForm addForm) {
|
||||
boolean check = BankCardCheckAPI.check(addForm.getName(), addForm.getIdCardNo(), addForm.getBankCardNo());
|
||||
if(check){
|
||||
return caseplatformBankService.add(addForm);
|
||||
}else {
|
||||
return ResponseDTO.error(ExpertBankVerifyFail);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface ExpertDao extends BaseMapper<ExpertEntity> {
|
||||
|
||||
@Select("select * from t_caseplatform_expert where id=#{id}")
|
||||
public ExpertEntity getExpert(Long id);
|
||||
|
||||
@Select("select * from t_caseplatform_expert where uuid=#{uuid}")
|
||||
public ExpertEntity getExpertByUuid(String uuid);
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.dao;
|
||||
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertSignAddForm;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertSignVO;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface ExpertSignDao {
|
||||
|
||||
@Insert("insert into t_caseplatform_sign(expert_id, sign_img) values(#{expertId}, #{sign_img}) ")
|
||||
public int addExpertSign(@Param("expertId")Long expertId, @Param("sign_img")String sign_img);
|
||||
|
||||
@Select("select t_caseplatform_sign.id,t_caseplatform_sign.expert_id,t_caseplatform_sign.sign_img,t_caseplatform_sign.create_time," +
|
||||
"t_caseplatform_bank.id_card_no,t_caseplatform_bank.bank_card_no,t_caseplatform_bank.bank_name," +
|
||||
"t_caseplatform_expert.mobile,t_caseplatform_expert.name " +
|
||||
"from t_caseplatform_sign " +
|
||||
"left join t_caseplatform_bank on t_caseplatform_sign.expert_id = t_caseplatform_bank.expert_id " +
|
||||
"left join t_caseplatform_expert on t_caseplatform_expert.id = t_caseplatform_sign.expert_id " +
|
||||
"where t_caseplatform_sign.expert_id=#{expert_id} " +
|
||||
"order by t_caseplatform_sign.create_time desc limit 1")
|
||||
public ExpertSignVO getExpertSign(Long expert_id);
|
||||
|
||||
@Update("update t_caseplatform_sign set sign_img=#{sign_img} where id=#{id}")
|
||||
public int updateById(@Param("id")Long id, @Param("sign_img")String sign_img);
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertEntity;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertWhiteEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface ExpertWhiteEntityDao extends BaseMapper<ExpertWhiteEntity> {
|
||||
@Select("select * from t_caseplatform_expert_white where id=#{id}")
|
||||
public ExpertWhiteEntity getExpertWhite(Long id);
|
||||
|
||||
@Select("SELECT * FROM t_caseplatform_expert_white WHERE name = #{name} AND hospital_name = #{hospitalName}")
|
||||
ExpertWhiteEntity getExpertWhiteByNameAndHospital(@Param("name")String name, @Param("hospitalName")String hospitalName);
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.service;
|
||||
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertEntity;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertVO;
|
||||
import net.lab1024.sa.admin.module.app.expert.dao.ExpertDao;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.dao.MedicalRecorDao;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.token.service.TokenService;
|
||||
import net.lab1024.sa.admin.module.system.login.service.LoginService;
|
||||
import net.lab1024.sa.common.common.domain.RequestUser;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.enumeration.UserTypeEnum;
|
||||
import net.lab1024.sa.common.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import net.lab1024.sa.common.module.support.loginlog.LoginLogService;
|
||||
import net.lab1024.sa.common.module.support.token.LoginDeviceEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ExpertService {
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private ExpertDao expertDao;
|
||||
|
||||
@Autowired
|
||||
private MedicalRecorDao medicalRecorDao;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据id 查询
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public ExpertEntity getById(Long userId) {
|
||||
ExpertEntity expert = expertDao.getExpert(userId);
|
||||
return expert;
|
||||
}
|
||||
|
||||
public ExpertVO getInfo() {
|
||||
Long expertId = SmartRequestUtil.getRequestUserId();
|
||||
ExpertEntity expert = expertDao.getExpert(expertId);
|
||||
int waitNum = medicalRecorDao.getNum(expertId, CaseStatusEnum.WAIT.getValue());
|
||||
int passNum = medicalRecorDao.getNum(expertId, CaseStatusEnum.PASS.getValue());
|
||||
int refuseNum = medicalRecorDao.getNum(expertId, CaseStatusEnum.REFUSE.getValue());
|
||||
|
||||
ExpertVO data = SmartBeanUtil.copy(expert, ExpertVO.class);
|
||||
data.setRefuseNum(refuseNum);
|
||||
data.setPassNum(passNum);
|
||||
data.setWaitNum(waitNum);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @return
|
||||
*/
|
||||
public ExpertEntity addExpert(ExpertEntity addForm) {
|
||||
String uuid = addForm.getUuid();
|
||||
ExpertEntity expertByUuid = expertDao.getExpertByUuid(uuid);
|
||||
Long id = null;
|
||||
if(expertByUuid == null){
|
||||
expertDao.insert(addForm);
|
||||
id = addForm.getId();
|
||||
}else{
|
||||
id = expertByUuid.getId();
|
||||
addForm.setId(id);
|
||||
expertDao.updateById(addForm);
|
||||
}
|
||||
String name = addForm.getName();
|
||||
String token = tokenService.generateToken(id, name, UserTypeEnum.EXPERT, LoginDeviceEnum.WEIXIN_MP, false);
|
||||
addForm.setToken(token);
|
||||
return addForm;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.service;
|
||||
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertSignAddForm;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertSignVO;
|
||||
import net.lab1024.sa.admin.module.app.expert.dao.ExpertSignDao;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Service
|
||||
public class ExpertSignService {
|
||||
|
||||
@Autowired
|
||||
private ExpertSignDao expertSignDao;
|
||||
|
||||
public ExpertSignVO getExpertSign() {
|
||||
Long expertId = SmartRequestUtil.getRequestUserId();
|
||||
return expertSignDao.getExpertSign(expertId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加专家 签名
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> addExpertSign(ExpertSignAddForm addForm) {
|
||||
Long expertId = SmartRequestUtil.getRequestUserId();
|
||||
String signImg = addForm.getSignImg();
|
||||
ExpertSignVO expertSign = expertSignDao.getExpertSign(expertId);
|
||||
if(expertSign == null){
|
||||
expertSignDao.addExpertSign(expertId, signImg);
|
||||
return ResponseDTO.app_ok();
|
||||
}
|
||||
expertSignDao.updateById(expertSign.getId(), signImg);
|
||||
return ResponseDTO.app_ok();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.service;
|
||||
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertEntity;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertVO;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertWhiteEntity;
|
||||
import net.lab1024.sa.admin.module.app.expert.dao.ExpertDao;
|
||||
import net.lab1024.sa.admin.module.app.expert.dao.ExpertWhiteEntityDao;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.dao.MedicalRecorDao;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.token.service.TokenService;
|
||||
import net.lab1024.sa.common.common.enumeration.UserTypeEnum;
|
||||
import net.lab1024.sa.common.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import net.lab1024.sa.common.module.support.token.LoginDeviceEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ExpertWhiteEntityService {
|
||||
@Autowired
|
||||
private ExpertWhiteEntityDao expertWhiteEntityDao;
|
||||
|
||||
/**
|
||||
* 获取白名单用户-姓名、医院名称
|
||||
* @param name 专家姓名
|
||||
* @param hospitalName 专家所属医院名称
|
||||
* @return 白名单类
|
||||
*/
|
||||
public ExpertWhiteEntity getExpertWhiteEntityByNameAndHospitalName(String name, String hospitalName) {
|
||||
if (name == null || hospitalName == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return expertWhiteEntityDao.getExpertWhiteByNameAndHospital(name, hospitalName);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package net.lab1024.sa.admin.module.app.file.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import net.lab1024.sa.common.common.enumeration.BaseEnum;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum OSSFileTypeEnum implements BaseEnum {
|
||||
PUBLIC(1, "public"),
|
||||
SIGN(2, "sign"),
|
||||
;
|
||||
|
||||
public static OSSFileTypeEnum getByVal(int val){
|
||||
OSSFileTypeEnum[] values = OSSFileTypeEnum.values();
|
||||
for(OSSFileTypeEnum type:values){
|
||||
if(val == type.getValue()){
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package net.lab1024.sa.admin.module.app.file.controller;
|
||||
|
||||
import com.aliyun.oss.OSSClient;
|
||||
import com.aliyun.oss.common.utils.BinaryUtil;
|
||||
import com.aliyun.oss.model.MatchMode;
|
||||
import com.aliyun.oss.model.PolicyConditions;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
|
||||
import net.lab1024.sa.admin.module.app.file.constant.OSSFileTypeEnum;
|
||||
import net.lab1024.sa.admin.module.app.file.domain.OSSPolicyVO;
|
||||
import net.lab1024.sa.common.common.annoation.NoNeedLogin;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
|
||||
import static net.lab1024.sa.common.common.code.UserErrorCode.LOGIN_STATE_INVALID;
|
||||
|
||||
@RestController
|
||||
@Api(tags = {AdminSwaggerTagConst.App.OSS})
|
||||
public class OSSFileController {
|
||||
|
||||
@Value("${file.storage.cloud.endpoint}")
|
||||
private String endpoint;
|
||||
|
||||
@Value("${file.storage.cloud.bucket-name}")
|
||||
private String bucketName;
|
||||
|
||||
@Value("${file.storage.cloud.access-key}")
|
||||
private String accessKey;
|
||||
|
||||
@Value("${file.storage.cloud.secret-key}")
|
||||
private String secretKey;
|
||||
|
||||
@Value("${file.storage.cloud.url.public}")
|
||||
private String host;
|
||||
|
||||
@ApiOperation(value = "获取上传文件 Policy", notes="type==1 普通;type==2 签名图片")
|
||||
@GetMapping("/file/getOSSPolicy/{type}")
|
||||
public ResponseDTO<OSSPolicyVO> getOSSPolicy(@PathVariable int type){
|
||||
OSSFileTypeEnum ossFileType = OSSFileTypeEnum.getByVal(type);
|
||||
Long requestUserId = SmartRequestUtil.getRequestUserId();
|
||||
String dir = ossFileType.getDesc() + File.separator + requestUserId + File.separator;
|
||||
// callbackUrl为 上传回调服务器的URL,请将下面的IP和Port配置为您自己的真实信息。
|
||||
OSSClient client = new OSSClient(endpoint, accessKey, secretKey);
|
||||
try {
|
||||
long expireTime = 30;
|
||||
long expireEndTime = System.currentTimeMillis() + expireTime * 1000;
|
||||
Date expiration = new Date(expireEndTime);
|
||||
PolicyConditions policyConds = new PolicyConditions();
|
||||
policyConds.addConditionItem(PolicyConditions.COND_CONTENT_LENGTH_RANGE, 0, 10*1024*1024);// 最大 10 M
|
||||
policyConds.addConditionItem(MatchMode.StartWith, PolicyConditions.COND_KEY, ossFileType.getDesc());
|
||||
|
||||
String postPolicy = client.generatePostPolicy(expiration, policyConds);
|
||||
byte[] binaryData = postPolicy.getBytes("utf-8");
|
||||
String encodedPolicy = BinaryUtil.toBase64String(binaryData);
|
||||
String postSignature = client.calculatePostSignature(postPolicy);
|
||||
|
||||
|
||||
OSSPolicyVO policyVO = new OSSPolicyVO(accessKey, encodedPolicy, postSignature, dir, host, String.valueOf(expireEndTime / 1000));
|
||||
return ResponseDTO.app_ok(policyVO);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResponseDTO.userErrorParam();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package net.lab1024.sa.admin.module.app.file.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class OSSPolicyVO {
|
||||
|
||||
@ApiModelProperty(value = "OSS accessid")
|
||||
private String accessid;
|
||||
|
||||
@ApiModelProperty(value = "OSS policy")
|
||||
private String policy;
|
||||
|
||||
@ApiModelProperty(value = "OSS 签名")
|
||||
private String signature;
|
||||
|
||||
@ApiModelProperty(value = "OSS 上传路径")
|
||||
private String dir;
|
||||
|
||||
@ApiModelProperty(value = "OSS host")
|
||||
private String host;
|
||||
|
||||
@ApiModelProperty(value = "OSS 过期时间")
|
||||
private String expire;
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordAddForm;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordDetailVO;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordListVO;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordQueryForm;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordUpdateForm;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.service.MedicalRecordService;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@RestController
|
||||
@Api(tags = {AdminSwaggerTagConst.App.MedicalRecord})
|
||||
public class MedicalRecordController {
|
||||
|
||||
@Autowired
|
||||
private MedicalRecordService medicalRecordService;
|
||||
|
||||
/**
|
||||
* 列表页
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取病历列表")
|
||||
@PostMapping("/medicalRecord/getList")
|
||||
public ResponseDTO<PageResult<MedicalRecordListVO>> getList(@RequestBody @Valid MedicalRecordQueryForm queryForm) {
|
||||
return ResponseDTO.app_ok(medicalRecordService.getList(queryForm));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取病历详情")
|
||||
@GetMapping("/medicalRecord/getDetail/{MedicalRecordId}")
|
||||
public ResponseDTO<MedicalRecordDetailVO> getList(@PathVariable Long MedicalRecordId) {
|
||||
return ResponseDTO.app_ok(medicalRecordService.getDetail(MedicalRecordId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加病历")
|
||||
@PostMapping("/medicalRecord/add")
|
||||
public ResponseDTO<String> add(@RequestBody @Valid MedicalRecordAddForm addForm) {
|
||||
return medicalRecordService.add(addForm);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改病历")
|
||||
@PostMapping("/medicalRecord/update")
|
||||
public ResponseDTO<String> update(@RequestBody @Valid MedicalRecordUpdateForm updateForm) {
|
||||
return medicalRecordService.update(updateForm);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordAbstracEntity;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordUserEntity;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface MedicalRecorAbstracDao extends BaseMapper<MedicalRecordAbstracEntity> {
|
||||
|
||||
@Delete("delete from t_caseplatform_case_abstract where case_id=#{medicalRecordId}")
|
||||
int deleteByCaseId(Long medicalRecordId);
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordCheckdataEntity;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface MedicalRecorCheckDataDao extends BaseMapper<MedicalRecordCheckdataEntity> {
|
||||
|
||||
@Delete("delete from t_caseplatform_case_checkdata where case_id=#{medicalRecordId}")
|
||||
int deleteByCaseId(Long medicalRecordId);
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordAbstracEntity;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordDTO;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordDetailVO;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordEntity;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordListVO;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordQueryForm;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface MedicalRecorDao extends BaseMapper<MedicalRecordEntity> {
|
||||
|
||||
List<MedicalRecordListVO> getList(Page page, @Param("queryForm") MedicalRecordQueryForm queryForm);
|
||||
|
||||
MedicalRecordDetailVO getDetail(Long MedicalRecordId);
|
||||
|
||||
@Select("select t_caseplatform_case.id, t_caseplatform_case.admission_time from t_caseplatform_case " +
|
||||
"left join t_caseplatform_user on t_caseplatform_case.user_id = t_caseplatform_user.id " +
|
||||
"where t_caseplatform_case.expert_id=#{expertId} and t_caseplatform_user.uid=#{uid} order by admission_time desc")
|
||||
List<MedicalRecordDTO> getAdmissionTimeByUid(@Param("expertId")Long expertId, @Param("uid")String uid);
|
||||
|
||||
@Select("select * from t_caseplatform_case where id=#{MedicalRecordId}")
|
||||
MedicalRecordListVO getById(Long MedicalRecordId);
|
||||
|
||||
@Select("select count(*) from t_caseplatform_case where expert_id=#{expertId} and status=#{status}")
|
||||
int getNum(@Param("expertId")Long expertId, @Param("status")int status);
|
||||
|
||||
@Select("select count(*) from t_caseplatform_case")
|
||||
int getTotal();
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.DpmsAddForm;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordDpmsEntity;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordUserEntity;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface MedicalRecorDpmasDao extends BaseMapper<MedicalRecordDpmsEntity> {
|
||||
|
||||
@Select("select * from t_caseplatform_case_dpms where case_id=#{caseId}")
|
||||
List<DpmsAddForm> getByCaseId(Long caseId);
|
||||
|
||||
@Delete("delete from t_caseplatform_case_dpms where case_id=#{medicalRecordId}")
|
||||
int deleteByCaseId(Long medicalRecordId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordDetailVO;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordListVO;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordQueryForm;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordUserEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface MedicalRecorUserDao extends BaseMapper<MedicalRecordUserEntity> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class DpmsAddForm {
|
||||
|
||||
@ApiModelProperty(value = "治疗时间", required = true)
|
||||
@NotNull(message = "治疗时间 不能为空")
|
||||
private LocalDateTime treatTime;
|
||||
|
||||
@ApiModelProperty(value = "治疗图片", required = true)
|
||||
@NotNull(message = "治疗图片 不能为空")
|
||||
@Length(min = 1, max = 1000, message = "治疗图片 不能为空")
|
||||
private String dpmasImg;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 病历摘要表 实体类
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("t_caseplatform_case_abstract")
|
||||
public class MedicalRecordAbstracEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联病历表
|
||||
*/
|
||||
private Long caseId;
|
||||
|
||||
/**
|
||||
* 病历摘要 文字
|
||||
*/
|
||||
private String abstractStr;
|
||||
|
||||
/**
|
||||
* 病历摘要 图片
|
||||
*/
|
||||
private String abstractImg;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public MedicalRecordAbstracEntity(Long caseId, String abstractStr, String abstractImg, LocalDateTime createTime) {
|
||||
this.caseId = caseId;
|
||||
this.abstractStr = abstractStr;
|
||||
this.abstractImg = abstractImg;
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,226 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.common.common.domain.PageParam;
|
||||
import net.lab1024.sa.common.common.enumeration.GenderEnum;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 前端提交病历 from
|
||||
*/
|
||||
@Data
|
||||
public class MedicalRecordAddForm {
|
||||
|
||||
/*************************基本信息***************************/
|
||||
@ApiModelProperty(value = "患者姓名", required = true)
|
||||
@NotNull(message = "患者姓名 不能为空")
|
||||
@Length(min = 1, max = 20, message = "患者姓名 的长度为在1-20")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "患者id", required = true)
|
||||
@NotNull(message = "患者id 不能为空")
|
||||
@Length(min = 1, max = 100, message = "患者id 的长度为在1-100")
|
||||
private String uid;
|
||||
|
||||
@ApiModelPropertyEnum(GenderEnum.class)
|
||||
@CheckEnum(value = GenderEnum.class, message = "性别错误")
|
||||
private Integer sex;
|
||||
|
||||
@ApiModelProperty(value = "年龄", required = true)
|
||||
@NotNull(message = "年龄 不能为空")
|
||||
@Range(min = 1, max = 120, message = "年龄输入有误")
|
||||
private Integer age;
|
||||
|
||||
@ApiModelProperty(value = "入院时间", required = true)
|
||||
@NotNull(message = "入院时间 不能为空")
|
||||
private LocalDateTime admissionTime;
|
||||
|
||||
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
|
||||
@CheckEnum(value = CasetypeEnum.class, message = "病历类型 错误", required = true)
|
||||
private Integer caseType;
|
||||
|
||||
@ApiModelProperty(value = "基本信息图片", required = true)
|
||||
@NotNull(message = "基本信息图片 不能为空")
|
||||
@Length(min = 1, max = 1000, message = "基本信息图片 不能为空")
|
||||
private String baseImg;
|
||||
|
||||
/*************************临床资料 病历摘要***************************/
|
||||
@ApiModelProperty(value = "临床资料 病历摘要 文字", required = true)
|
||||
private String abstractStr;
|
||||
|
||||
@ApiModelProperty(value = "临床资料 病历摘要 图片", required = true)
|
||||
private String abstractImg;
|
||||
|
||||
|
||||
/*************************DPMAS***************************/
|
||||
@ApiModelProperty(value = "DPMAS", required = true)
|
||||
@NotNull(message = "DPMAS 不能为空")
|
||||
@Valid
|
||||
private List<DpmsAddForm> dpmas;
|
||||
|
||||
|
||||
/*************************实验室数据***************************/
|
||||
@ApiModelProperty(value = "治疗前 检测时间", required = true)
|
||||
@NotNull(message = "治疗前 检测时间 不能为空")
|
||||
private LocalDateTime headTime;
|
||||
|
||||
/**
|
||||
* 治疗后 检测时间
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 检测时间 ", required = true)
|
||||
@NotNull(message = "治疗后 检测时间 不能为空")
|
||||
private LocalDateTime afterTime;
|
||||
|
||||
/**
|
||||
* 治疗前 总胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 总胆红素", required = true)
|
||||
@NotNull(message = "治疗前 总胆红素 不能为空")
|
||||
@Length(min = 1, max = 10, message = "治疗前 总胆红素 输入不合法")
|
||||
private String headTb;
|
||||
|
||||
/**
|
||||
* 治疗后 总胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 总胆红素 ", required = true)
|
||||
@NotNull(message = "治疗后 总胆红素 不能为空")
|
||||
@Length(min = 1, max = 10, message = "治疗后 总胆红素 输入不合法")
|
||||
private String afterTb;
|
||||
|
||||
/**
|
||||
* 治疗前 白蛋白(g/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 白蛋白", required = true)
|
||||
private String headAlb;
|
||||
|
||||
/**
|
||||
* 治疗后 白蛋白(g/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 白蛋白 ", required = true)
|
||||
private String afterAlb;
|
||||
|
||||
/**
|
||||
* 治疗前 直接胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 直接胆红素", required = true)
|
||||
private String headDb;
|
||||
|
||||
/**
|
||||
* 治疗后 直接胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 直接胆红素 ", required = true)
|
||||
private String afterDb;
|
||||
|
||||
/**
|
||||
* 治疗前 凝血酶原活动度 (%)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 凝血酶原活动度", required = true)
|
||||
private String headPta;
|
||||
|
||||
/**
|
||||
* 治疗后 凝血酶原活动度 (%)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 凝血酶原活动度 ", required = true)
|
||||
private String afterPta;
|
||||
|
||||
/**
|
||||
* 治疗前 间接胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 间接胆红素", required = true)
|
||||
private String headIb;
|
||||
|
||||
/**
|
||||
* 治疗后 间接胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 间接胆红素 ", required = true)
|
||||
private String afterIb;
|
||||
|
||||
/**
|
||||
* 治疗前 国际标准化比值 (INR)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 国际标准化比值", required = true)
|
||||
@NotNull(message = "治疗前 国际标准化比值 不能为空")
|
||||
@Length(min = 1, max = 10, message = "治疗前 国际标准化比值 输入不合法")
|
||||
private String headInr;
|
||||
|
||||
/**
|
||||
* 治疗后 国际标准化比值 (INR)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 国际标准化比值 ", required = true)
|
||||
@NotNull(message = "治疗后 国际标准化比值 不能为空")
|
||||
@Length(min = 1, max = 10, message = "治疗后 国际标准化比值 输入不合法")
|
||||
private String afterInr;
|
||||
|
||||
/**
|
||||
* 治疗前 谷丙转氨 (U/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 谷丙转氨", required = true)
|
||||
@NotNull(message = "治疗前 谷丙转氨 不能为空")
|
||||
@Length(min = 1, max = 10, message = "治疗前 谷丙转氨 输入不合法")
|
||||
private String headAlt;
|
||||
|
||||
/**
|
||||
* 治疗后 谷丙转氨 (U/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 谷丙转氨 ", required = true)
|
||||
@NotNull(message = "治疗后 谷丙转氨 不能为空")
|
||||
@Length(min = 1, max = 10, message = "治疗后 谷丙转氨 输入不合法")
|
||||
private String afterAlt;
|
||||
|
||||
/**
|
||||
* 治疗前 白介素6(ng/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 白介素6", required = true)
|
||||
private String headIl6;
|
||||
|
||||
/**
|
||||
* 治疗后 白介素6(ng/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 白介素6 ", required = true)
|
||||
private String afterIl6;
|
||||
|
||||
/**
|
||||
* 治疗前 谷草转氨酶 (U/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 谷草转氨酶", required = true)
|
||||
@NotNull(message = "治疗前 谷草转氨酶 不能为空")
|
||||
@Length(min = 1, max = 10, message = "治疗前 谷草转氨酶 输入不合法")
|
||||
private String headAst;
|
||||
|
||||
/**
|
||||
* 治疗后 谷草转氨酶 (U/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 谷草转氨酶 ", required = true)
|
||||
@NotNull(message = "治疗后 谷草转氨酶 不能为空")
|
||||
@Length(min = 1, max = 10, message = "治疗后 谷草转氨酶 输入不合法")
|
||||
private String afterAst;
|
||||
|
||||
/**
|
||||
* 治疗前 肿瘤坏死因子α(μg/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 肿瘤坏死因子α", required = true)
|
||||
private String headTnf;
|
||||
|
||||
/**
|
||||
* 治疗后 肿瘤坏死因子α(μg/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 肿瘤坏死因子α ", required = true)
|
||||
private String afterTnf;
|
||||
|
||||
@ApiModelProperty(value = "实验室检测 图片 图片", required = true)
|
||||
@NotNull(message = "实验室检测 图片 不能为空")
|
||||
@Length(min = 1, max = 1000, message = "实验室检测 图片 不能为空")
|
||||
private String checkImg;
|
||||
}
|
||||
@ -0,0 +1,155 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 实验室检测 实体类
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("t_caseplatform_case_checkdata")
|
||||
@Builder
|
||||
public class MedicalRecordCheckdataEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联病历
|
||||
*/
|
||||
private Long caseId;
|
||||
|
||||
/**
|
||||
* 治疗前 检测时间
|
||||
*/
|
||||
private LocalDateTime headTime;
|
||||
|
||||
/**
|
||||
* 治疗后 检测时间
|
||||
*/
|
||||
private LocalDateTime afterTime;
|
||||
|
||||
/**
|
||||
* 治疗前 总胆红素(umol/L)
|
||||
*/
|
||||
private String headTb;
|
||||
|
||||
/**
|
||||
* 治疗后 总胆红素(umol/L)
|
||||
*/
|
||||
private String afterTb;
|
||||
|
||||
/**
|
||||
* 治疗前 白蛋白(g/L)
|
||||
*/
|
||||
private String headAlb;
|
||||
|
||||
/**
|
||||
* 治疗后 白蛋白(g/L)
|
||||
*/
|
||||
private String afterAlb;
|
||||
|
||||
/**
|
||||
* 治疗前 直接胆红素(umol/L)
|
||||
*/
|
||||
private String headDb;
|
||||
|
||||
/**
|
||||
* 治疗后 直接胆红素(umol/L)
|
||||
*/
|
||||
private String afterDb;
|
||||
|
||||
/**
|
||||
* 治疗前 凝血酶原活动度 (%)
|
||||
*/
|
||||
private String headPta;
|
||||
|
||||
/**
|
||||
* 治疗后 凝血酶原活动度 (%)
|
||||
*/
|
||||
private String afterPta;
|
||||
|
||||
/**
|
||||
* 治疗前 间接胆红素(umol/L)
|
||||
*/
|
||||
private String headIb;
|
||||
|
||||
/**
|
||||
* 治疗后 间接胆红素(umol/L)
|
||||
*/
|
||||
private String afterIb;
|
||||
|
||||
/**
|
||||
* 治疗前 国际标准化比值 (INR)
|
||||
*/
|
||||
private String headInr;
|
||||
|
||||
/**
|
||||
* 治疗后 国际标准化比值 (INR)
|
||||
*/
|
||||
private String afterInr;
|
||||
|
||||
/**
|
||||
* 治疗前 谷丙转氨 (U/L)
|
||||
*/
|
||||
private String headAlt;
|
||||
|
||||
/**
|
||||
* 治疗后 谷丙转氨 (U/L)
|
||||
*/
|
||||
private String afterAlt;
|
||||
|
||||
/**
|
||||
* 治疗前 白介素6(ng/L)
|
||||
*/
|
||||
private String headIl6;
|
||||
|
||||
/**
|
||||
* 治疗后 白介素6(ng/L)
|
||||
*/
|
||||
private String afterIl6;
|
||||
|
||||
/**
|
||||
* 治疗前 谷草转氨酶 (U/L)
|
||||
*/
|
||||
private String headAst;
|
||||
|
||||
/**
|
||||
* 治疗后 谷草转氨酶 (U/L)
|
||||
*/
|
||||
private String afterAst;
|
||||
|
||||
/**
|
||||
* 治疗前 肿瘤坏死因子α(μg/L)
|
||||
*/
|
||||
private String headTnf;
|
||||
|
||||
/**
|
||||
* 治疗后 肿瘤坏死因子α(μg/L)
|
||||
*/
|
||||
private String afterTnf;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private String checkImg;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class MedicalRecordDTO {
|
||||
|
||||
@ApiModelProperty(value = "入院时间", required = true)
|
||||
private LocalDateTime admissionTime;
|
||||
|
||||
@ApiModelProperty(value = "入院时间", required = true)
|
||||
private Long id;
|
||||
}
|
||||
@ -0,0 +1,211 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.common.common.enumeration.GenderEnum;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 前端病历 详情
|
||||
*/
|
||||
@Data
|
||||
public class MedicalRecordDetailVO {
|
||||
|
||||
/*************************基本信息***************************/
|
||||
@ApiModelProperty(value = "患者姓名", required = true)
|
||||
@NotNull(message = "患者姓名 不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "患者id", required = true)
|
||||
@NotNull(message = "患者id 不能为空")
|
||||
private String uid;
|
||||
|
||||
@ApiModelPropertyEnum(GenderEnum.class)
|
||||
@CheckEnum(value = GenderEnum.class, message = "性别错误")
|
||||
private Integer sex;
|
||||
|
||||
@ApiModelProperty(value = "年龄", required = true)
|
||||
@NotNull(message = "年龄 不能为空")
|
||||
private Integer age;
|
||||
|
||||
@ApiModelProperty(value = "入院时间", required = true)
|
||||
@NotNull(message = "入院时间 不能为空")
|
||||
private LocalDateTime admissionTime;
|
||||
|
||||
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
|
||||
@CheckEnum(value = CasetypeEnum.class, message = "病历类型 错误", required = true)
|
||||
private Integer caseType;
|
||||
|
||||
@ApiModelProperty(value = "基本信息图片", required = true)
|
||||
@NotNull(message = "基本信息图片 不能为空")
|
||||
private String baseImg;
|
||||
|
||||
@ApiModelProperty(value = "病例状态", required = true)
|
||||
private Integer status;
|
||||
|
||||
/*************************临床资料 病历摘要***************************/
|
||||
@ApiModelProperty(value = "临床资料 病历摘要 文字", required = true)
|
||||
@NotNull(message = "临床资料 病历摘要 文字 不能为空")
|
||||
private String abstractStr;
|
||||
|
||||
@ApiModelProperty(value = "临床资料 病历摘要 图片", required = true)
|
||||
@NotNull(message = "临床资料 病历摘要 图片 不能为空")
|
||||
private String abstractImg;
|
||||
|
||||
|
||||
/*************************DPMAS***************************/
|
||||
@ApiModelProperty(value = "临床资料 病历摘要 图片", required = true)
|
||||
@NotNull(message = "临床资料 病历摘要 图片 不能为空")
|
||||
private List<DpmsAddForm> dpmas;
|
||||
|
||||
|
||||
/*************************实验室数据***************************/
|
||||
@ApiModelProperty(value = "治疗前 检测时间", required = true)
|
||||
@NotNull(message = "治疗前 检测时间 不能为空")
|
||||
private LocalDateTime headTime;
|
||||
|
||||
/**
|
||||
* 治疗后 检测时间
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 检测时间 ", required = true)
|
||||
@NotNull(message = "治疗后 检测时间 不能为空")
|
||||
private LocalDateTime afterTime;
|
||||
|
||||
/**
|
||||
* 治疗前 总胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 总胆红素", required = true)
|
||||
@NotNull(message = "治疗前 总胆红素 不能为空")
|
||||
private String headTb;
|
||||
|
||||
/**
|
||||
* 治疗后 总胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 总胆红素 ", required = true)
|
||||
@NotNull(message = "治疗后 总胆红素 不能为空")
|
||||
private String afterTb;
|
||||
|
||||
/**
|
||||
* 治疗前 白蛋白(g/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 白蛋白", required = true)
|
||||
private String headAlb;
|
||||
|
||||
/**
|
||||
* 治疗后 白蛋白(g/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 白蛋白 ", required = true)
|
||||
private String afterAlb;
|
||||
|
||||
/**
|
||||
* 治疗前 直接胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 直接胆红素", required = true)
|
||||
private String headDb;
|
||||
|
||||
/**
|
||||
* 治疗后 直接胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 直接胆红素 ", required = true)
|
||||
private String afterDb;
|
||||
|
||||
/**
|
||||
* 治疗前 凝血酶原活动度 (%)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 凝血酶原活动度", required = true)
|
||||
private String headPta;
|
||||
|
||||
/**
|
||||
* 治疗后 凝血酶原活动度 (%)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 凝血酶原活动度 ", required = true)
|
||||
private String afterPta;
|
||||
|
||||
/**
|
||||
* 治疗前 间接胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 间接胆红素", required = true)
|
||||
private String headIb;
|
||||
|
||||
/**
|
||||
* 治疗后 间接胆红素(umol/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 间接胆红素 ", required = true)
|
||||
private String afterIb;
|
||||
|
||||
/**
|
||||
* 治疗前 国际标准化比值 (INR)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 国际标准化比值", required = true)
|
||||
@NotNull(message = "治疗前 国际标准化比值 不能为空")
|
||||
private String headInr;
|
||||
|
||||
/**
|
||||
* 治疗后 国际标准化比值 (INR)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 国际标准化比值 ", required = true)
|
||||
@NotNull(message = "治疗后 国际标准化比值 不能为空")
|
||||
private String afterInr;
|
||||
|
||||
/**
|
||||
* 治疗前 谷丙转氨 (U/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 谷丙转氨", required = true)
|
||||
@NotNull(message = "治疗前 谷丙转氨 不能为空")
|
||||
private String headAlt;
|
||||
|
||||
/**
|
||||
* 治疗后 谷丙转氨 (U/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 谷丙转氨 ", required = true)
|
||||
@NotNull(message = "治疗后 谷丙转氨 不能为空")
|
||||
private String afterAlt;
|
||||
|
||||
/**
|
||||
* 治疗前 白介素6(ng/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 白介素6", required = true)
|
||||
private String headIl6;
|
||||
|
||||
/**
|
||||
* 治疗后 白介素6(ng/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 白介素6 ", required = true)
|
||||
private String afterIl6;
|
||||
|
||||
/**
|
||||
* 治疗前 谷草转氨酶 (U/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 谷草转氨酶", required = true)
|
||||
@NotNull(message = "治疗前 谷草转氨酶 不能为空")
|
||||
private String headAst;
|
||||
|
||||
/**
|
||||
* 治疗后 谷草转氨酶 (U/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 谷草转氨酶 ", required = true)
|
||||
@NotNull(message = "治疗后 谷草转氨酶 不能为空")
|
||||
private String afterAst;
|
||||
|
||||
/**
|
||||
* 治疗前 肿瘤坏死因子α(μg/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗前 肿瘤坏死因子α", required = true)
|
||||
private String headTnf;
|
||||
|
||||
/**
|
||||
* 治疗后 肿瘤坏死因子α(μg/L)
|
||||
*/
|
||||
@ApiModelProperty(value = "治疗后 肿瘤坏死因子α ", required = true)
|
||||
private String afterTnf;
|
||||
|
||||
@ApiModelProperty(value = "实验室检测 病历摘要 图片", required = true)
|
||||
@NotNull(message = "实验室检测 图片 不能为空")
|
||||
private String checkImg;
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 病历摘要表 实体类
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("t_caseplatform_case_dpms")
|
||||
public class MedicalRecordDpmsEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联病历表
|
||||
*/
|
||||
private Long caseId;
|
||||
|
||||
/**
|
||||
* 治疗时间
|
||||
*/
|
||||
private LocalDateTime treatTime;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private String dpmasImg;
|
||||
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 病历表 实体类
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("t_caseplatform_case")
|
||||
public class MedicalRecordEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联用户表
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private String baseImg;
|
||||
|
||||
/**
|
||||
* 入院时间
|
||||
*/
|
||||
private LocalDateTime admissionTime;
|
||||
|
||||
/**
|
||||
* 病历类型
|
||||
*/
|
||||
private Integer caseType;
|
||||
|
||||
/**
|
||||
* 统计 天
|
||||
*/
|
||||
private Integer statisticsDay;
|
||||
|
||||
/**
|
||||
* 统计 月
|
||||
*/
|
||||
private Integer statisticsMonth;
|
||||
|
||||
/**
|
||||
* 统计 季度
|
||||
*/
|
||||
private Integer statisticsQuarter;
|
||||
|
||||
/**
|
||||
* 统计 年
|
||||
*/
|
||||
private Integer statisticsYear;
|
||||
|
||||
/**
|
||||
* 专家 id
|
||||
*/
|
||||
private Long expertId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
private Integer status;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public MedicalRecordEntity(Long userId, String baseImg, LocalDateTime admissionTime, Integer caseType, Long expertId, LocalDateTime createTime) {
|
||||
this.userId = userId;
|
||||
this.admissionTime = admissionTime;
|
||||
this.caseType = caseType;
|
||||
this.baseImg = baseImg;
|
||||
this.expertId = expertId;
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public MedicalRecordEntity(Long id, Long userId, String baseImg, LocalDateTime admissionTime, Integer caseType, Long expertId, Integer status, LocalDateTime updateTime) {
|
||||
this.id = id;
|
||||
this.userId = userId;
|
||||
this.admissionTime = admissionTime;
|
||||
this.caseType = caseType;
|
||||
this.baseImg = baseImg;
|
||||
this.expertId = expertId;
|
||||
this.status = status;
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 病历表 列表VO
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MedicalRecordListVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "用户关联id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String uid;
|
||||
|
||||
@ApiModelProperty(value = "不通过原因")
|
||||
private String reason;
|
||||
|
||||
@ApiModelProperty(value = "用户性别")
|
||||
private Integer sex;
|
||||
|
||||
@ApiModelPropertyEnum(value = CaseStatusEnum.class, desc = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.common.common.domain.PageParam;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
|
||||
|
||||
/**
|
||||
* 前端请求列表的 from
|
||||
*/
|
||||
@Data
|
||||
public class MedicalRecordQueryForm extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "name")
|
||||
private String name;
|
||||
|
||||
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
|
||||
@CheckEnum(value = CasetypeEnum.class, message = "病历类型 错误")
|
||||
private Integer caseType;
|
||||
|
||||
@ApiModelPropertyEnum(value = CaseStatusEnum.class, desc = "病例状态(0待审核 1审核通过 2审核不通过)")
|
||||
@CheckEnum(value = CaseStatusEnum.class, message = "病例状态 错误")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Long expertId;
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.common.common.enumeration.GenderEnum;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 前端提交病历 from
|
||||
*/
|
||||
@Data
|
||||
public class MedicalRecordUpdateForm extends MedicalRecordAddForm{
|
||||
|
||||
@ApiModelProperty(value = "病例ID", required = true)
|
||||
@NotNull(message = "病例ID 不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户表 实体类
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("t_caseplatform_user")
|
||||
public class MedicalRecordUserEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联医生id
|
||||
*/
|
||||
private Long expertId;
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
private String uid;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Integer age;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public MedicalRecordUserEntity(Long expertId, String name, String uid, Integer sex, Integer age, LocalDateTime createTime) {
|
||||
this.expertId = expertId;
|
||||
this.name = name;
|
||||
this.uid = uid;
|
||||
this.sex = sex;
|
||||
this.age = age;
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,680 @@
|
||||
package net.lab1024.sa.admin.module.app.medicalrecord.service;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertSignVO;
|
||||
import net.lab1024.sa.admin.module.app.expert.service.ExpertSignService;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.dao.MedicalRecorAbstracDao;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.dao.MedicalRecorCheckDataDao;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.dao.MedicalRecorDao;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.dao.MedicalRecorDpmasDao;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.dao.MedicalRecorUserDao;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.*;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.common.common.util.SmartPageUtil;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import net.lab1024.sa.common.module.support.config.ConfigKeyEnum;
|
||||
import net.lab1024.sa.common.module.support.config.ConfigService;
|
||||
import net.lab1024.sa.common.module.support.config.domain.ConfigVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static net.lab1024.sa.common.common.code.UserErrorCode.NO_PERMISSION_EDIT;
|
||||
import static net.lab1024.sa.common.common.code.UserErrorCode.PROJECT_CLOSE;
|
||||
|
||||
@Service
|
||||
public class MedicalRecordService {
|
||||
|
||||
@Autowired
|
||||
private MedicalRecorDao medicalRecorDao;
|
||||
|
||||
@Autowired
|
||||
private MedicalRecorUserDao medicalRecorUserDao;
|
||||
|
||||
@Autowired
|
||||
private MedicalRecorAbstracDao medicalRecorAbstracDao;
|
||||
|
||||
@Autowired
|
||||
private MedicalRecorDpmasDao medicalRecorDpmasDao;
|
||||
|
||||
@Autowired
|
||||
private MedicalRecorCheckDataDao medicalRecorCheckDataDao;
|
||||
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private ExpertSignService expertSignService;
|
||||
|
||||
public PageResult<MedicalRecordListVO> getList(MedicalRecordQueryForm queryForm){
|
||||
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||
Long expertId = SmartRequestUtil.getRequestUserId();
|
||||
queryForm.setExpertId(expertId);
|
||||
List<MedicalRecordListVO> list = medicalRecorDao.getList(page, queryForm);
|
||||
PageResult<MedicalRecordListVO> pageResult = SmartPageUtil.convert2PageResult(page, list);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
public MedicalRecordDetailVO getDetail(Long MedicalRecordId){
|
||||
MedicalRecordDetailVO detail = medicalRecorDao.getDetail(MedicalRecordId);
|
||||
List<DpmsAddForm> dpmas = medicalRecorDpmasDao.getByCaseId(MedicalRecordId);
|
||||
detail.setDpmas(dpmas);
|
||||
return detail;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public ResponseDTO<String> add(MedicalRecordAddForm addForm){
|
||||
|
||||
|
||||
ConfigVO caseNum = configService.getConfig(ConfigKeyEnum.CaseNum);
|
||||
int total = medicalRecorDao.getTotal();
|
||||
if(Integer.parseInt(caseNum.getConfigValue()) <= total){
|
||||
return ResponseDTO.error(PROJECT_CLOSE);
|
||||
}
|
||||
|
||||
Long expertId = SmartRequestUtil.getRequestUserId();
|
||||
|
||||
ExpertSignVO expertSign = expertSignService.getExpertSign();
|
||||
if(expertSign == null){
|
||||
return ResponseDTO.userErrorParam("请先签署项目协议!");
|
||||
}
|
||||
/*************************前置 检查*****************************/
|
||||
|
||||
ResponseDTO check = check(SmartBeanUtil.copy(addForm, MedicalRecordUpdateForm.class), expertId);
|
||||
|
||||
if(!check.getOk()){
|
||||
return check;
|
||||
}
|
||||
|
||||
//病历类型
|
||||
Integer caseType = addForm.getCaseType();
|
||||
List<DpmsAddForm> dpmas = addForm.getDpmas();
|
||||
//入院时间
|
||||
LocalDateTime admissionTime = addForm.getAdmissionTime();
|
||||
|
||||
//患者id
|
||||
String uid = addForm.getUid();
|
||||
|
||||
//临床资料 病历摘要 文字
|
||||
String abstractStr = addForm.getAbstractStr();
|
||||
|
||||
//临床资料 病历摘要 图片
|
||||
String abstractImg = addForm.getAbstractImg();
|
||||
|
||||
|
||||
//治疗前 检测时间
|
||||
LocalDateTime headTime = addForm.getHeadTime();
|
||||
|
||||
/**
|
||||
* 治疗后 检测时间
|
||||
*/
|
||||
LocalDateTime afterTime = addForm.getAfterTime();
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************基本信息*****************************/
|
||||
//姓名
|
||||
String name = addForm.getName();
|
||||
|
||||
//性别
|
||||
Integer sex = addForm.getSex();
|
||||
|
||||
//年龄
|
||||
Integer age = addForm.getAge();
|
||||
|
||||
//基本信息图片
|
||||
String baseImg = addForm.getBaseImg();
|
||||
|
||||
MedicalRecordUserEntity user = new MedicalRecordUserEntity(expertId, name, uid, sex, age, LocalDateTime.now());
|
||||
medicalRecorUserDao.insert(user);
|
||||
Long userId = user.getId();
|
||||
/*************************病例主体***************************/
|
||||
|
||||
MedicalRecordEntity medicalRecord = new MedicalRecordEntity(userId, baseImg, admissionTime, caseType, expertId, LocalDateTime.now());
|
||||
|
||||
DateTime nowDate = DateUtil.date();
|
||||
String statistics_date = DateUtil.format(nowDate, "yyyyMMdd");
|
||||
String statistics_month = DateUtil.format(nowDate, "yyyyMM");
|
||||
String statistics_year = DateUtil.format(nowDate, "yyyy");
|
||||
int quarter = DateUtil.quarter(nowDate);
|
||||
String statistics_quarter = statistics_year + quarter;
|
||||
|
||||
medicalRecord.setStatisticsDay(Integer.parseInt(statistics_date));
|
||||
medicalRecord.setStatisticsMonth(Integer.parseInt(statistics_month));
|
||||
medicalRecord.setStatisticsQuarter(Integer.parseInt(statistics_quarter));
|
||||
medicalRecord.setStatisticsYear(Integer.parseInt(statistics_year));
|
||||
medicalRecorDao.insert(medicalRecord);
|
||||
Long medicalRecordId = medicalRecord.getId();
|
||||
|
||||
/*************************临床资料 病历摘要***************************/
|
||||
|
||||
|
||||
|
||||
MedicalRecordAbstracEntity abstracEntity = new MedicalRecordAbstracEntity(medicalRecordId, abstractStr, abstractImg, LocalDateTime.now());
|
||||
medicalRecorAbstracDao.insert(abstracEntity);
|
||||
/*************************DPMAS***************************/
|
||||
//DPMAS
|
||||
|
||||
for(DpmsAddForm item:dpmas){
|
||||
MedicalRecordDpmsEntity dp = new MedicalRecordDpmsEntity();
|
||||
dp.setDpmasImg(item.getDpmasImg());
|
||||
dp.setCaseId(medicalRecordId);
|
||||
dp.setTreatTime(item.getTreatTime());
|
||||
medicalRecorDpmasDao.insert(dp);
|
||||
}
|
||||
/*************************实验室数据***************************/
|
||||
|
||||
/**
|
||||
* 治疗前 总胆红素(umol/L)
|
||||
*/
|
||||
String headTb = addForm.getHeadTb();
|
||||
|
||||
/**
|
||||
* 治疗后 总胆红素(umol/L)
|
||||
*/
|
||||
String afterTb = addForm.getAfterTb();
|
||||
|
||||
/**
|
||||
* 治疗前 白蛋白(g/L)
|
||||
*/
|
||||
String headAlb = addForm.getHeadAlb();
|
||||
|
||||
/**
|
||||
* 治疗后 白蛋白(g/L)
|
||||
*/
|
||||
String afterAlb = addForm.getAfterAlb();
|
||||
|
||||
/**
|
||||
* 治疗前 直接胆红素(umol/L)
|
||||
*/
|
||||
String headDb = addForm.getHeadDb();
|
||||
|
||||
/**
|
||||
* 治疗后 直接胆红素(umol/L)
|
||||
*/
|
||||
String afterDb = addForm.getAfterDb();
|
||||
|
||||
/**
|
||||
* 治疗前 凝血酶原活动度 (%)
|
||||
*/
|
||||
String headPta = addForm.getHeadPta();
|
||||
|
||||
/**
|
||||
* 治疗后 凝血酶原活动度 (%)
|
||||
*/
|
||||
String afterPta = addForm.getAfterPta();
|
||||
|
||||
/**
|
||||
* 治疗前 间接胆红素(umol/L)
|
||||
*/
|
||||
String headIb = addForm.getHeadIb();
|
||||
|
||||
/**
|
||||
* 治疗后 间接胆红素(umol/L)
|
||||
*/
|
||||
String afterIb = addForm.getAfterIb();
|
||||
|
||||
/**
|
||||
* 治疗前 国际标准化比值 (INR)
|
||||
*/
|
||||
String headInr = addForm.getHeadInr();
|
||||
|
||||
/**
|
||||
* 治疗后 国际标准化比值 (INR)
|
||||
*/
|
||||
String afterInr = addForm.getAfterInr();
|
||||
|
||||
/**
|
||||
* 治疗前 谷丙转氨 (U/L)
|
||||
*/
|
||||
String headAlt = addForm.getHeadAlt();
|
||||
|
||||
/**
|
||||
* 治疗后 谷丙转氨 (U/L)
|
||||
*/
|
||||
String afterAlt = addForm.getAfterAlt();
|
||||
|
||||
/**
|
||||
* 治疗前 白介素6(ng/L)
|
||||
*/
|
||||
String headIl6 = addForm.getHeadIl6();
|
||||
|
||||
/**
|
||||
* 治疗后 白介素6(ng/L)
|
||||
*/
|
||||
String afterIl6 = addForm.getAfterIl6();
|
||||
|
||||
/**
|
||||
* 治疗前 谷草转氨酶 (U/L)
|
||||
*/
|
||||
String headAst = addForm.getHeadAst();
|
||||
|
||||
/**
|
||||
* 治疗后 谷草转氨酶 (U/L)
|
||||
*/
|
||||
String afterAst = addForm.getAfterAst();
|
||||
|
||||
/**
|
||||
* 治疗前 肿瘤坏死因子α(μg/L)
|
||||
*/
|
||||
String headTnf = addForm.getHeadTnf();
|
||||
|
||||
/**
|
||||
* 治疗后 肿瘤坏死因子α(μg/L)
|
||||
*/
|
||||
String afterTnf = addForm.getAfterTnf();
|
||||
|
||||
//实验室检测 病历摘要 图片
|
||||
String checkImg = addForm.getCheckImg();
|
||||
|
||||
MedicalRecordCheckdataEntity CheckdataEntity = MedicalRecordCheckdataEntity.builder()
|
||||
.afterAlb(afterAlb)
|
||||
.afterAlt(afterAlt)
|
||||
.afterAst(afterAst)
|
||||
.afterDb(afterDb)
|
||||
.afterIb(afterIb)
|
||||
.afterIl6(afterIl6)
|
||||
.afterInr(afterInr)
|
||||
.afterPta(afterPta)
|
||||
.afterTb(afterTb)
|
||||
.afterTime(afterTime)
|
||||
.afterTnf(afterTnf)
|
||||
.headAst(headAst)
|
||||
.headDb(headDb)
|
||||
.headIb(headIb)
|
||||
.headIl6(headIl6)
|
||||
.headAlb(headAlb)
|
||||
.headAlt(headAlt)
|
||||
.headInr(headInr)
|
||||
.headPta(headPta)
|
||||
.headTb(headTb)
|
||||
.headTime(headTime)
|
||||
.headTnf(headTnf)
|
||||
.headAlt(headAlt)
|
||||
.headAlt(headAlt)
|
||||
.checkImg(checkImg)
|
||||
.createTime(LocalDateTime.now())
|
||||
.caseId(medicalRecordId)
|
||||
.build();
|
||||
|
||||
medicalRecorCheckDataDao.insert(CheckdataEntity);
|
||||
return ResponseDTO.app_ok();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public ResponseDTO<String> update(MedicalRecordUpdateForm updateForm){
|
||||
Long expertId = SmartRequestUtil.getRequestUserId();
|
||||
Long medicalRecordId = updateForm.getId();
|
||||
MedicalRecordListVO recorDaoById = medicalRecorDao.getById(medicalRecordId);
|
||||
if(recorDaoById == null){
|
||||
return ResponseDTO.userErrorParam();
|
||||
}
|
||||
/*************************前置 检查*****************************/
|
||||
|
||||
Integer status = recorDaoById.getStatus();
|
||||
|
||||
if(!status.equals(CaseStatusEnum.REFUSE.getValue())){
|
||||
return ResponseDTO.error(NO_PERMISSION_EDIT);
|
||||
}
|
||||
ResponseDTO check = check(updateForm, expertId);
|
||||
|
||||
if(!check.getOk()){
|
||||
return check;
|
||||
}
|
||||
|
||||
//病历类型
|
||||
Integer caseType = updateForm.getCaseType();
|
||||
List<DpmsAddForm> dpmas = updateForm.getDpmas();
|
||||
//入院时间
|
||||
LocalDateTime admissionTime = updateForm.getAdmissionTime();
|
||||
|
||||
//临床资料 病历摘要 文字
|
||||
String abstractStr = updateForm.getAbstractStr();
|
||||
|
||||
//临床资料 病历摘要 图片
|
||||
String abstractImg = updateForm.getAbstractImg();
|
||||
|
||||
|
||||
//治疗前 检测时间
|
||||
LocalDateTime headTime = updateForm.getHeadTime();
|
||||
|
||||
/**
|
||||
* 治疗后 检测时间
|
||||
*/
|
||||
LocalDateTime afterTime = updateForm.getAfterTime();
|
||||
|
||||
/*************************基本信息*****************************/
|
||||
//姓名
|
||||
String name = updateForm.getName();
|
||||
|
||||
//性别
|
||||
Integer sex = updateForm.getSex();
|
||||
|
||||
//年龄
|
||||
Integer age = updateForm.getAge();
|
||||
|
||||
//基本信息图片
|
||||
String baseImg = updateForm.getBaseImg();
|
||||
|
||||
//患者id
|
||||
String uid = updateForm.getUid();
|
||||
|
||||
Long userId = recorDaoById.getUserId();
|
||||
MedicalRecordUserEntity user = new MedicalRecordUserEntity(expertId, name, uid, sex, age, LocalDateTime.now());
|
||||
user.setId(userId);
|
||||
medicalRecorUserDao.updateById(user);
|
||||
/*************************病例主体***************************/
|
||||
|
||||
MedicalRecordEntity medicalRecord = new MedicalRecordEntity(medicalRecordId, userId, baseImg, admissionTime, caseType, expertId, CaseStatusEnum.WAIT.getValue(), LocalDateTime.now());
|
||||
medicalRecorDao.updateById(medicalRecord);
|
||||
/*************************临床资料 病历摘要***************************/
|
||||
|
||||
medicalRecorAbstracDao.deleteByCaseId(medicalRecordId);
|
||||
MedicalRecordAbstracEntity abstracEntity = new MedicalRecordAbstracEntity(medicalRecordId, abstractStr, abstractImg, LocalDateTime.now());
|
||||
medicalRecorAbstracDao.insert(abstracEntity);
|
||||
/*************************DPMAS***************************/
|
||||
//DPMAS
|
||||
medicalRecorDpmasDao.deleteByCaseId(medicalRecordId);
|
||||
for(DpmsAddForm item:dpmas){
|
||||
MedicalRecordDpmsEntity dp = new MedicalRecordDpmsEntity();
|
||||
dp.setDpmasImg(item.getDpmasImg());
|
||||
dp.setCaseId(medicalRecordId);
|
||||
dp.setTreatTime(item.getTreatTime());
|
||||
medicalRecorDpmasDao.insert(dp);
|
||||
}
|
||||
/*************************实验室数据***************************/
|
||||
|
||||
/**
|
||||
* 治疗前 总胆红素(umol/L)
|
||||
*/
|
||||
String headTb = updateForm.getHeadTb();
|
||||
|
||||
/**
|
||||
* 治疗后 总胆红素(umol/L)
|
||||
*/
|
||||
String afterTb = updateForm.getAfterTb();
|
||||
|
||||
/**
|
||||
* 治疗前 白蛋白(g/L)
|
||||
*/
|
||||
String headAlb = updateForm.getHeadAlb();
|
||||
|
||||
/**
|
||||
* 治疗后 白蛋白(g/L)
|
||||
*/
|
||||
String afterAlb = updateForm.getAfterAlb();
|
||||
|
||||
/**
|
||||
* 治疗前 直接胆红素(umol/L)
|
||||
*/
|
||||
String headDb = updateForm.getHeadDb();
|
||||
|
||||
/**
|
||||
* 治疗后 直接胆红素(umol/L)
|
||||
*/
|
||||
String afterDb = updateForm.getAfterDb();
|
||||
|
||||
/**
|
||||
* 治疗前 凝血酶原活动度 (%)
|
||||
*/
|
||||
String headPta = updateForm.getHeadPta();
|
||||
|
||||
/**
|
||||
* 治疗后 凝血酶原活动度 (%)
|
||||
*/
|
||||
String afterPta = updateForm.getAfterPta();
|
||||
|
||||
/**
|
||||
* 治疗前 间接胆红素(umol/L)
|
||||
*/
|
||||
String headIb = updateForm.getHeadIb();
|
||||
|
||||
/**
|
||||
* 治疗后 间接胆红素(umol/L)
|
||||
*/
|
||||
String afterIb = updateForm.getAfterIb();
|
||||
|
||||
/**
|
||||
* 治疗前 国际标准化比值 (INR)
|
||||
*/
|
||||
String headInr = updateForm.getHeadInr();
|
||||
|
||||
/**
|
||||
* 治疗后 国际标准化比值 (INR)
|
||||
*/
|
||||
String afterInr = updateForm.getAfterInr();
|
||||
|
||||
/**
|
||||
* 治疗前 谷丙转氨 (U/L)
|
||||
*/
|
||||
String headAlt = updateForm.getHeadAlt();
|
||||
|
||||
/**
|
||||
* 治疗后 谷丙转氨 (U/L)
|
||||
*/
|
||||
String afterAlt = updateForm.getAfterAlt();
|
||||
|
||||
/**
|
||||
* 治疗前 白介素6(ng/L)
|
||||
*/
|
||||
String headIl6 = updateForm.getHeadIl6();
|
||||
|
||||
/**
|
||||
* 治疗后 白介素6(ng/L)
|
||||
*/
|
||||
String afterIl6 = updateForm.getAfterIl6();
|
||||
|
||||
/**
|
||||
* 治疗前 谷草转氨酶 (U/L)
|
||||
*/
|
||||
String headAst = updateForm.getHeadAst();
|
||||
|
||||
/**
|
||||
* 治疗后 谷草转氨酶 (U/L)
|
||||
*/
|
||||
String afterAst = updateForm.getAfterAst();
|
||||
|
||||
/**
|
||||
* 治疗前 肿瘤坏死因子α(μg/L)
|
||||
*/
|
||||
String headTnf = updateForm.getHeadTnf();
|
||||
|
||||
/**
|
||||
* 治疗后 肿瘤坏死因子α(μg/L)
|
||||
*/
|
||||
String afterTnf = updateForm.getAfterTnf();
|
||||
|
||||
//实验室检测 病历摘要 图片
|
||||
String checkImg = updateForm.getCheckImg();
|
||||
|
||||
MedicalRecordCheckdataEntity CheckdataEntity = MedicalRecordCheckdataEntity.builder()
|
||||
.afterAlb(afterAlb)
|
||||
.afterAlt(afterAlt)
|
||||
.afterAst(afterAst)
|
||||
.afterDb(afterDb)
|
||||
.afterIb(afterIb)
|
||||
.afterIl6(afterIl6)
|
||||
.afterInr(afterInr)
|
||||
.afterPta(afterPta)
|
||||
.afterTb(afterTb)
|
||||
.afterTime(afterTime)
|
||||
.afterTnf(afterTnf)
|
||||
.headAst(headAst)
|
||||
.headDb(headDb)
|
||||
.headIb(headIb)
|
||||
.headIl6(headIl6)
|
||||
.headAlb(headAlb)
|
||||
.headAlt(headAlt)
|
||||
.headInr(headInr)
|
||||
.headPta(headPta)
|
||||
.headTb(headTb)
|
||||
.headTime(headTime)
|
||||
.headTnf(headTnf)
|
||||
.headAlt(headAlt)
|
||||
.headAlt(headAlt)
|
||||
.checkImg(checkImg)
|
||||
.createTime(LocalDateTime.now())
|
||||
.caseId(medicalRecordId)
|
||||
.build();
|
||||
|
||||
medicalRecorCheckDataDao.deleteByCaseId(medicalRecordId);
|
||||
|
||||
medicalRecorCheckDataDao.insert(CheckdataEntity);
|
||||
return ResponseDTO.app_ok();
|
||||
}
|
||||
|
||||
public ResponseDTO check(MedicalRecordUpdateForm form, Long expertId){
|
||||
|
||||
ConfigVO caseSwitch = configService.getConfig(ConfigKeyEnum.CaseSwitch);
|
||||
if(caseSwitch.getConfigValue().equals("false")){
|
||||
return ResponseDTO.error(PROJECT_CLOSE);
|
||||
}
|
||||
/*************************前置 检查*****************************/
|
||||
|
||||
//入院时间
|
||||
LocalDateTime admissionTime = form.getAdmissionTime();
|
||||
//患者id
|
||||
String uid = form.getUid();
|
||||
//获取全部病例
|
||||
List<MedicalRecordDTO> admissionTimeByUid = medicalRecorDao.getAdmissionTimeByUid(expertId, uid);
|
||||
for(MedicalRecordDTO dto:admissionTimeByUid){
|
||||
if(dto.getId().equals(form.getId())){
|
||||
continue;
|
||||
}
|
||||
long daysDiff = Duration.between(dto.getAdmissionTime(), admissionTime).toDays();
|
||||
if(Math.abs(daysDiff) < 30){
|
||||
return ResponseDTO.userErrorParam("同一患者记录入院时间必须间隔30天以上!");
|
||||
}
|
||||
}
|
||||
|
||||
String baseImg = form.getBaseImg();
|
||||
String[] baseImgNum = baseImg.split(",");
|
||||
if(baseImgNum.length > 6){
|
||||
return ResponseDTO.userErrorParam("病案照片应为(1-6张)!");
|
||||
}
|
||||
|
||||
//临床资料 病历摘要 文字
|
||||
String abstractStr = form.getAbstractStr();
|
||||
|
||||
//临床资料 病历摘要 图片
|
||||
String abstractImg = form.getAbstractImg();
|
||||
|
||||
if(StrUtil.isBlank(abstractStr+abstractImg)){
|
||||
return ResponseDTO.userErrorParam("临床资料 病历摘要或者病历图片至少上传一项");
|
||||
}
|
||||
|
||||
String[] abstractImgNum = abstractImg.split(",");
|
||||
if(abstractImgNum.length > 6){
|
||||
return ResponseDTO.userErrorParam("病历摘要图片照片应为(1-6张)!");
|
||||
}
|
||||
//病历类型
|
||||
Integer caseType = form.getCaseType();
|
||||
List<DpmsAddForm> dpmas = form.getDpmas();
|
||||
|
||||
int size = dpmas.size();
|
||||
|
||||
if(caseType == CasetypeEnum.BEFORE.getValue()){
|
||||
if(size == 0){
|
||||
return ResponseDTO.userErrorParam("至少上传1次DPMAS数据!");
|
||||
}
|
||||
}
|
||||
if(caseType == CasetypeEnum.DEFAULT.getValue()){
|
||||
if(size < 4){
|
||||
return ResponseDTO.userErrorParam("至少上传4次DPMAS数据!");
|
||||
}
|
||||
}
|
||||
LocalDateTime firstTreatTime = dpmas.get(0).getTreatTime();//第一次治疗时间
|
||||
|
||||
//治疗时间 2024
|
||||
|
||||
int headYear = firstTreatTime.getYear();
|
||||
|
||||
if(headYear != 2024){
|
||||
return ResponseDTO.userErrorParam("治疗时间:限制在2024年1月1日-2024年12月31日!");
|
||||
}
|
||||
|
||||
LocalDateTime lastTreatTime = dpmas.get(size-1).getTreatTime();//最后一次治疗时间
|
||||
|
||||
if(firstTreatTime.toLocalDate().compareTo(admissionTime.toLocalDate()) < 0){
|
||||
return ResponseDTO.userErrorParam("第1次治疗时间比患者基本信息入院时间后!");
|
||||
}
|
||||
LocalDateTime temp = firstTreatTime;
|
||||
for(int i=0;i<dpmas.size();i++){
|
||||
LocalDateTime treatTime = dpmas.get(i).getTreatTime();
|
||||
if(i > 0){
|
||||
if(!treatTime.isAfter(temp)){
|
||||
return ResponseDTO.userErrorParam("第"+(i+1)+"次治疗时间必须在第"+i+"次治疗时间后!");
|
||||
}
|
||||
}
|
||||
|
||||
String dpmasImg = dpmas.get(i).getDpmasImg();
|
||||
String[] dpmasImgNum = dpmasImg.split(",");
|
||||
if(dpmasImgNum.length > 3){
|
||||
return ResponseDTO.userErrorParam("第"+(i+1)+"次治疗照片应为(1-3张)!");
|
||||
}
|
||||
temp = treatTime;
|
||||
}
|
||||
|
||||
int lastYear = lastTreatTime.getYear();
|
||||
if(lastYear != 2024){
|
||||
return ResponseDTO.userErrorParam("治疗时间:限制在2024年1月1日-2024年12月31日!");
|
||||
}
|
||||
|
||||
//治疗前 检测时间
|
||||
LocalDateTime headTime = form.getHeadTime();
|
||||
|
||||
/**
|
||||
* 治疗后 检测时间
|
||||
*/
|
||||
LocalDateTime afterTime = form.getAfterTime();
|
||||
|
||||
if(!afterTime.isAfter(headTime)){
|
||||
return ResponseDTO.userErrorParam("治疗前检测时间:应该小于治疗后检测时间!");
|
||||
}
|
||||
|
||||
if(caseType == CasetypeEnum.BEFORE.getValue()){
|
||||
if((headTime.toLocalDate().compareTo(admissionTime.toLocalDate())) < 0 || (headTime.toLocalDate().compareTo(firstTreatTime.toLocalDate())) > 0){
|
||||
return ResponseDTO.userErrorParam("治疗前检测时间:应该在入院时间与第1次治疗时间之间!");
|
||||
}
|
||||
if(size == 1){
|
||||
if(afterTime.toLocalDate().compareTo(firstTreatTime.toLocalDate()) < 0){
|
||||
return ResponseDTO.userErrorParam("治疗后检测时间:应该在第1次治疗时间之后");
|
||||
}
|
||||
}
|
||||
//治疗后检测时间:应该在第一次治疗时间之后,如果有第二次治疗时间,在应该在第一次与第二次治疗时间之间
|
||||
if(size >= 2){
|
||||
LocalDateTime secondTreatTime = dpmas.get(1).getTreatTime();//第2次治疗时间
|
||||
if((afterTime.toLocalDate().compareTo(firstTreatTime.toLocalDate())) < 0 || (afterTime.compareTo(secondTreatTime)) > 0){
|
||||
return ResponseDTO.userErrorParam("治疗后检测时间:应该在第1次与第2次治疗时间之间");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(caseType == CasetypeEnum.DEFAULT.getValue()){
|
||||
if((headTime.toLocalDate().compareTo(admissionTime.toLocalDate())) < 0 || (headTime.toLocalDate().compareTo(firstTreatTime.toLocalDate())) > 0){
|
||||
return ResponseDTO.userErrorParam("治疗前检测时间:应该在入院时间与第1次治疗时间之间!");
|
||||
}
|
||||
if(afterTime.toLocalDate().compareTo(lastTreatTime.toLocalDate()) < 0){
|
||||
return ResponseDTO.userErrorParam("治疗后检测时间:应该在最后1次治疗时间之后");
|
||||
}
|
||||
}
|
||||
|
||||
String checkImg = form.getCheckImg();
|
||||
String[] checkImgNum = checkImg.split(",");
|
||||
if(checkImgNum.length > 6){
|
||||
return ResponseDTO.userErrorParam("实验室检测照片应为(1-6张)!");
|
||||
}
|
||||
return ResponseDTO.app_ok();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package net.lab1024.sa.admin.module.business.area.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.sa.admin.module.business.area.domain.form.AreaQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.area.domain.vo.ProvVO;
|
||||
import net.lab1024.sa.admin.module.business.area.service.AreaService;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 省市区 Controller
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-12 16:03:16
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Api(tags = "")
|
||||
public class AreaController {
|
||||
|
||||
@Autowired
|
||||
private AreaService areaService;
|
||||
|
||||
@ApiOperation("分页查询 @author HMM")
|
||||
@PostMapping("/area/queryPage")
|
||||
public ResponseDTO<PageResult<ProvVO>> queryPage(@RequestBody @Valid AreaQueryForm queryForm) {
|
||||
return ResponseDTO.ok(areaService.queryPage(queryForm));
|
||||
}
|
||||
|
||||
@ApiOperation("获取省份 @author HMM")
|
||||
@GetMapping("/area/provList")
|
||||
public ResponseDTO<List<ProvVO>> provList() {
|
||||
return ResponseDTO.ok(areaService.provList());
|
||||
}
|
||||
|
||||
@ApiOperation("获取市区 @author HMM")
|
||||
@GetMapping("/area/cityList/{parent}")
|
||||
public ResponseDTO<List<ProvVO>> cityList(@PathVariable Long parent) {
|
||||
return ResponseDTO.ok(areaService.cityList(parent));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package net.lab1024.sa.admin.module.business.area.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.business.area.domain.entity.AreaEntity;
|
||||
import net.lab1024.sa.admin.module.business.area.domain.form.AreaQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.area.domain.vo.ProvVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 省市区 Dao
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-12 16:03:16
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface AreaDao extends BaseMapper<AreaEntity> {
|
||||
|
||||
/**
|
||||
* 分页 查询
|
||||
*
|
||||
* @param page
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
List<ProvVO> queryPage(Page page, @Param("queryForm") AreaQueryForm queryForm);
|
||||
|
||||
/**
|
||||
* 获取省份列表
|
||||
* @return
|
||||
*/
|
||||
@Select("select * from t_area where parent is null")
|
||||
List<ProvVO> provList();
|
||||
|
||||
/**
|
||||
* 获取城市列表
|
||||
* @return
|
||||
*/
|
||||
@Select("select * from t_area where parent = #{parent}")
|
||||
List<ProvVO> cityList(long parent);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package net.lab1024.sa.admin.module.business.area.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 省市区 实体类
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-12 16:03:16
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("t_area")
|
||||
public class AreaEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer orders;
|
||||
|
||||
/**
|
||||
* 全名
|
||||
*/
|
||||
private String fullName;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 树路径
|
||||
*/
|
||||
private String treePath;
|
||||
|
||||
/**
|
||||
* 父节点
|
||||
*/
|
||||
private Long parent;
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package net.lab1024.sa.admin.module.business.area.domain.form;
|
||||
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.common.common.domain.PageParam;
|
||||
|
||||
/**
|
||||
* 省市区 分页查询表单
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-12 16:03:16
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class AreaQueryForm extends PageParam{
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package net.lab1024.sa.admin.module.business.area.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 省市区 列表VO
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-12 16:03:16
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class AreaVO {
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer orders;
|
||||
|
||||
@ApiModelProperty(value = "全名")
|
||||
private String fullName;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "树路径")
|
||||
private String treePath;
|
||||
|
||||
@ApiModelProperty(value = "父节点")
|
||||
private Long parent;
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package net.lab1024.sa.admin.module.business.area.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProvVO {
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package net.lab1024.sa.admin.module.business.area.manager;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.area.domain.entity.AreaEntity;
|
||||
import net.lab1024.sa.admin.module.business.area.dao.AreaDao;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 省市区 Manager
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-12 16:03:16
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
@Service
|
||||
public class AreaManager extends ServiceImpl<AreaDao, AreaEntity> {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package net.lab1024.sa.admin.module.business.area.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.business.area.dao.AreaDao;
|
||||
import net.lab1024.sa.admin.module.business.area.domain.form.AreaQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.area.domain.vo.ProvVO;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import net.lab1024.sa.common.common.util.SmartPageUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 省市区 Service
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-12 16:03:16
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class AreaService {
|
||||
|
||||
@Autowired
|
||||
private AreaDao areaDao;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
public PageResult<ProvVO> queryPage(AreaQueryForm queryForm) {
|
||||
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||
List<ProvVO> list = areaDao.queryPage(page, queryForm);
|
||||
PageResult<ProvVO> pageResult = SmartPageUtil.convert2PageResult(page, list);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
public List<ProvVO> provList() {
|
||||
return areaDao.provList();
|
||||
}
|
||||
|
||||
public List<ProvVO> cityList(Long parent) {
|
||||
return areaDao.cityList(parent);
|
||||
}
|
||||
|
||||
public List<ProvVO> areaList(Long parent) {
|
||||
if(parent == null){
|
||||
return areaDao.provList();
|
||||
}
|
||||
return areaDao.cityList(parent);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package net.lab1024.sa.admin.module.business.bankcard.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.form.CaseplatformBankAddForm;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.form.CaseplatformBankQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.vo.CaseplatformBankVO;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.service.CaseplatformBankService;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 银行卡 Controller
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-02-27 13:20:37
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@RestController
|
||||
public class CaseplatformBankController {
|
||||
|
||||
@Autowired
|
||||
private CaseplatformBankService caseplatformBankService;
|
||||
|
||||
@ApiOperation("分页查询 @author HMM")
|
||||
@PostMapping("/caseplatformBank/queryPage")
|
||||
public ResponseDTO<PageResult<CaseplatformBankVO>> queryPage(@RequestBody @Valid CaseplatformBankQueryForm queryForm) {
|
||||
return ResponseDTO.ok(caseplatformBankService.queryPage(queryForm));
|
||||
}
|
||||
|
||||
@ApiOperation("添加 @author HMM")
|
||||
@PostMapping("/caseplatformBank/add")
|
||||
public ResponseDTO<String> add(@RequestBody @Valid CaseplatformBankAddForm addForm) {
|
||||
return caseplatformBankService.add(addForm);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package net.lab1024.sa.admin.module.business.bankcard.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.entity.CaseplatformBankEntity;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.form.CaseplatformBankQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.vo.CaseplatformBankVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 银行卡 Dao
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-02-27 13:20:37
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface CaseplatformBankDao extends BaseMapper<CaseplatformBankEntity> {
|
||||
|
||||
/**
|
||||
* 分页 查询
|
||||
*
|
||||
* @param page
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
List<CaseplatformBankVO> queryPage(Page page, @Param("queryForm") CaseplatformBankQueryForm queryForm);
|
||||
|
||||
/**
|
||||
* 获取医生的银行卡信息
|
||||
* @param expertId
|
||||
* @return
|
||||
*/
|
||||
@Select("select * from t_caseplatform_bank where expert_id=#{expertId} order by create_time desc limit 1")
|
||||
CaseplatformBankVO getExpertBank(Long expertId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package net.lab1024.sa.admin.module.business.bankcard.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 银行卡 实体类
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-02-27 13:20:37
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("t_caseplatform_bank")
|
||||
public class CaseplatformBankEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 专家id
|
||||
*/
|
||||
private Long expertId;
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
private String idCardNo;
|
||||
|
||||
/**
|
||||
* 银行卡
|
||||
*/
|
||||
private String bankCardNo;
|
||||
|
||||
/**
|
||||
* 开户行
|
||||
*/
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private Integer provId;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private Integer cityId;
|
||||
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
private Integer countyId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package net.lab1024.sa.admin.module.business.bankcard.domain.form;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertSignAddForm;
|
||||
|
||||
/**
|
||||
* 银行卡 新建表单
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-02-27 13:20:37
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CaseplatformBankAddForm extends ExpertSignAddForm {
|
||||
|
||||
@ApiModelProperty(value = "身份证", required = true)
|
||||
@NotBlank(message = "身份证 不能为空")
|
||||
private String idCardNo;
|
||||
|
||||
@ApiModelProperty(value = "姓名", required = true)
|
||||
@NotBlank(message = "姓名 不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "开户行", required = true)
|
||||
@NotBlank(message = "开户行 不能为空")
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty(value = "银行卡", required = true)
|
||||
@NotBlank(message = "银行卡 不能为空")
|
||||
private String bankCardNo;
|
||||
|
||||
@ApiModelProperty(value = "省", required = true)
|
||||
@NotNull(message = "省 不能为空")
|
||||
private Integer provId;
|
||||
|
||||
@ApiModelProperty(value = "市", required = true)
|
||||
@NotNull(message = "市 不能为空")
|
||||
private Integer cityId;
|
||||
|
||||
@ApiModelProperty(value = "区", required = true)
|
||||
@NotNull(message = "区 不能为空")
|
||||
private Integer countyId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package net.lab1024.sa.admin.module.business.bankcard.domain.form;
|
||||
|
||||
import net.lab1024.sa.common.common.domain.PageParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 银行卡 分页查询表单
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-02-27 13:20:37
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CaseplatformBankQueryForm extends PageParam{
|
||||
|
||||
@ApiModelProperty(value = "keywords")
|
||||
private String keywords;
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package net.lab1024.sa.admin.module.business.bankcard.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 银行卡 列表VO
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-02-27 13:20:37
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CaseplatformBankVO {
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "专家id")
|
||||
private Long expertId;
|
||||
|
||||
@ApiModelProperty(value = "身份证")
|
||||
private String idCardNo;
|
||||
|
||||
@ApiModelProperty(value = "银行卡")
|
||||
private String bankCardNo;
|
||||
|
||||
@ApiModelProperty(value = "开户行")
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty(value = "省")
|
||||
private Integer provId;
|
||||
|
||||
@ApiModelProperty(value = "市")
|
||||
private Integer cityId;
|
||||
|
||||
@ApiModelProperty(value = "区")
|
||||
private Integer countyId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package net.lab1024.sa.admin.module.business.bankcard.manager;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.entity.CaseplatformBankEntity;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.dao.CaseplatformBankDao;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 银行卡 Manager
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-02-27 13:20:37
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
@Service
|
||||
public class CaseplatformBankManager extends ServiceImpl<CaseplatformBankDao, CaseplatformBankEntity> {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package net.lab1024.sa.admin.module.business.bankcard.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertSignVO;
|
||||
import net.lab1024.sa.admin.module.app.expert.dao.ExpertSignDao;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.dao.CaseplatformBankDao;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.entity.CaseplatformBankEntity;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.form.CaseplatformBankAddForm;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.form.CaseplatformBankQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.bankcard.domain.vo.CaseplatformBankVO;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.common.common.util.SmartPageUtil;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 银行卡 Service
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-02-27 13:20:37
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class CaseplatformBankService {
|
||||
|
||||
@Autowired
|
||||
private CaseplatformBankDao caseplatformBankDao;
|
||||
|
||||
@Autowired
|
||||
private ExpertSignDao expertSignDao;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
public PageResult<CaseplatformBankVO> queryPage(CaseplatformBankQueryForm queryForm) {
|
||||
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||
List<CaseplatformBankVO> list = caseplatformBankDao.queryPage(page, queryForm);
|
||||
PageResult<CaseplatformBankVO> pageResult = SmartPageUtil.convert2PageResult(page, list);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@Transactional
|
||||
public synchronized ResponseDTO<String> add(CaseplatformBankAddForm addForm) {
|
||||
CaseplatformBankEntity caseplatformBankEntity = SmartBeanUtil.copy(addForm, CaseplatformBankEntity.class);
|
||||
Long expertId = SmartRequestUtil.getRequestUserId();
|
||||
caseplatformBankEntity.setExpertId(expertId);
|
||||
|
||||
CaseplatformBankVO expertBank = caseplatformBankDao.getExpertBank(expertId);
|
||||
if(expertBank == null){
|
||||
caseplatformBankDao.insert(caseplatformBankEntity);
|
||||
}else{
|
||||
caseplatformBankEntity.setId(expertBank.getId());
|
||||
caseplatformBankDao.updateById(caseplatformBankEntity);
|
||||
}
|
||||
|
||||
|
||||
String signImg = addForm.getSignImg();
|
||||
ExpertSignVO expertSign = expertSignDao.getExpertSign(expertId);
|
||||
if(expertSign == null){
|
||||
expertSignDao.addExpertSign(expertId, signImg);
|
||||
return ResponseDTO.app_ok();
|
||||
}else{
|
||||
expertSignDao.updateById(expertSign.getId(), signImg);
|
||||
}
|
||||
return ResponseDTO.app_ok();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package net.lab1024.sa.admin.module.business.captcha.controller;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.sa.admin.module.business.captcha.service.CaptchaService;
|
||||
import net.lab1024.sa.common.common.controller.SupportBaseController;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.module.support.captcha.domain.CaptchaVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
public class CaptchaController extends SupportBaseController {
|
||||
|
||||
@Autowired
|
||||
private CaptchaService captchaService;
|
||||
|
||||
@ApiOperation("获取图形验证码 @author 胡克")
|
||||
@GetMapping("/captcha")
|
||||
public ResponseDTO<CaptchaVO> generateCaptcha() {
|
||||
return ResponseDTO.ok(captchaService.generateCaptcha());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package net.lab1024.sa.admin.module.business.captcha.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.lab1024.sa.admin.module.business.captcha.domain.entity.CaptchaEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Mapper
|
||||
public interface CaptchaDao extends BaseMapper<CaptchaEntity> {
|
||||
|
||||
CaptchaEntity getByCaptchaKey(String captchaKey);
|
||||
|
||||
int delByCaptchaKey(String captchaKey);
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package net.lab1024.sa.admin.module.business.captcha.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.category.constant.CategoryTypeEnum;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("t_captcha")
|
||||
public class CaptchaEntity {
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String captchaUuid;
|
||||
private String captchaKey;
|
||||
private String captchaText;
|
||||
private LocalDateTime exprireDate;
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package net.lab1024.sa.admin.module.business.captcha.domain.from;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class CaptchaAddForm {
|
||||
private String captchaUuid;
|
||||
private String captchaKey;
|
||||
private String captchaText;
|
||||
private LocalDateTime exprireDate;
|
||||
}
|
||||
@ -0,0 +1,140 @@
|
||||
package net.lab1024.sa.admin.module.business.captcha.service;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.google.code.kaptcha.impl.DefaultKaptcha;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.lab1024.sa.admin.module.business.captcha.dao.CaptchaDao;
|
||||
import net.lab1024.sa.admin.module.business.captcha.domain.entity.CaptchaEntity;
|
||||
import net.lab1024.sa.admin.module.business.captcha.domain.from.CaptchaAddForm;
|
||||
import net.lab1024.sa.common.common.constant.StringConst;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.domain.SystemEnvironment;
|
||||
import net.lab1024.sa.common.common.enumeration.SystemEnvironmentEnum;
|
||||
import net.lab1024.sa.common.common.exception.BusinessException;
|
||||
import net.lab1024.sa.common.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.common.constant.RedisKeyConst;
|
||||
import net.lab1024.sa.common.module.support.captcha.domain.CaptchaForm;
|
||||
import net.lab1024.sa.common.module.support.captcha.domain.CaptchaVO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Base64Utils;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CaptchaService {
|
||||
|
||||
@Autowired
|
||||
private CaptchaDao captchaDao;
|
||||
|
||||
/**
|
||||
* 过期时间:65秒
|
||||
*/
|
||||
private static final long EXPIRE_SECOND = 65L;
|
||||
|
||||
@Autowired
|
||||
private DefaultKaptcha defaultKaptcha;
|
||||
|
||||
@Autowired
|
||||
private SystemEnvironment systemEnvironment;
|
||||
|
||||
public ResponseDTO<String> add(CaptchaAddForm addForm) {
|
||||
CaptchaEntity captchaEntity = SmartBeanUtil.copy(addForm, CaptchaEntity.class);
|
||||
captchaDao.insert(captchaEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成图形验证码
|
||||
* 默认 1 分钟有效期
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CaptchaVO generateCaptcha() {
|
||||
String captchaText = defaultKaptcha.createText();
|
||||
BufferedImage image = defaultKaptcha.createImage(captchaText);
|
||||
|
||||
String base64Code;
|
||||
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
|
||||
ImageIO.write(image, "jpg", os);
|
||||
base64Code = Base64Utils.encodeToString(os.toByteArray());
|
||||
} catch (Exception e) {
|
||||
log.error("generateCaptcha error:", e);
|
||||
throw new BusinessException("生成验证码错误");
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回验证码对象
|
||||
* 图片 base64格式
|
||||
*/
|
||||
// uuid 唯一标识
|
||||
String uuid = UUID.randomUUID().toString().replace("-", StringConst.EMPTY);
|
||||
|
||||
CaptchaVO captchaVO = new CaptchaVO();
|
||||
captchaVO.setCaptchaUuid(uuid);
|
||||
captchaVO.setCaptchaBase64Image("data:image/png;base64," + base64Code);
|
||||
captchaVO.setExpireSeconds(EXPIRE_SECOND);
|
||||
//if (!systemEnvironment.isProd()) {
|
||||
// captchaVO.setCaptchaText(captchaText);
|
||||
//}
|
||||
String redisCaptchaKey = generateRedisKey(RedisKeyConst.Support.CAPTCHA, uuid);
|
||||
CaptchaEntity captchaEntity = new CaptchaEntity();
|
||||
captchaEntity.setCaptchaKey(redisCaptchaKey);
|
||||
captchaEntity.setCaptchaText(captchaText);
|
||||
captchaEntity.setExprireDate(LocalDateTimeUtil.offset(LocalDateTime.now(), EXPIRE_SECOND, ChronoUnit.SECONDS));
|
||||
captchaDao.insert(captchaEntity);
|
||||
return captchaVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验图形验证码
|
||||
*
|
||||
* @param captchaForm
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> checkCaptcha(CaptchaForm captchaForm) {
|
||||
|
||||
if (systemEnvironment.getCurrentEnvironment().equals(SystemEnvironmentEnum.TEST)) {
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(captchaForm.getCaptchaUuid()) || StringUtils.isBlank(captchaForm.getCaptchaCode())) {
|
||||
return ResponseDTO.userErrorParam("请输入正确验证码");
|
||||
}
|
||||
/**
|
||||
* 1、校验redis里的验证码
|
||||
* 2、校验成功后,删除redis
|
||||
*/
|
||||
String redisCaptchaKey = generateRedisKey(RedisKeyConst.Support.CAPTCHA, captchaForm.getCaptchaUuid());
|
||||
try {
|
||||
CaptchaEntity byCaptchaKey = captchaDao.getByCaptchaKey(redisCaptchaKey);
|
||||
if(byCaptchaKey == null){
|
||||
return ResponseDTO.userErrorParam("验证码错误,请输入正确的验证码");
|
||||
}
|
||||
String redisCaptchaCode = byCaptchaKey.getCaptchaText();
|
||||
if (StringUtils.isBlank(redisCaptchaCode)) {
|
||||
return ResponseDTO.userErrorParam("验证码已过期,请刷新重试");
|
||||
}
|
||||
if (!Objects.equals(redisCaptchaCode, captchaForm.getCaptchaCode())) {
|
||||
return ResponseDTO.userErrorParam("验证码错误,请输入正确的验证码");
|
||||
}
|
||||
}finally {
|
||||
// 删除已使用的验证码
|
||||
captchaDao.delByCaptchaKey(redisCaptchaKey);
|
||||
}
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
public String generateRedisKey(String prefix, String key) {
|
||||
SystemEnvironmentEnum currentEnvironment = systemEnvironment.getCurrentEnvironment();
|
||||
return systemEnvironment.getProjectName() + RedisKeyConst.SEPARATOR + currentEnvironment.getValue() + RedisKeyConst.SEPARATOR + prefix + key;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import net.lab1024.sa.common.common.enumeration.BaseEnum;
|
||||
|
||||
/**
|
||||
* 病历结算状态
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11T15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum CaseSettlementEnum implements BaseEnum {
|
||||
No(0, "未结算"),
|
||||
Yes(1, "已结算"),
|
||||
;
|
||||
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
public static CaseSettlementEnum getByVal(int val){
|
||||
for (CaseSettlementEnum type: CaseSettlementEnum.values()){
|
||||
if(type.getValue() == val){
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import net.lab1024.sa.common.common.enumeration.BaseEnum;
|
||||
|
||||
/**
|
||||
* 0待审核 1审核通过 2审核不通过
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11T15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum CaseStatusEnum implements BaseEnum {
|
||||
WAIT(0, "待审核"),
|
||||
PASS(1, "审核通过"),
|
||||
REFUSE(2, "审核拒绝"),
|
||||
;
|
||||
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
public static CaseStatusEnum getByVal(int val){
|
||||
for (CaseStatusEnum type:CaseStatusEnum.values()){
|
||||
if(type.getValue() == val){
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import net.lab1024.sa.common.common.enumeration.BaseEnum;
|
||||
|
||||
/**
|
||||
* 病历类型
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11T15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum CasetypeEnum implements BaseEnum {
|
||||
DEFAULT(1, "四次及以上疗程化"),
|
||||
BEFORE(2, "早前期(INR≤1.5)"),
|
||||
;
|
||||
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
public static CasetypeEnum getByVal(int val){
|
||||
for (CasetypeEnum type:CasetypeEnum.values()){
|
||||
if(type.getValue() == val){
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,110 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordDetailVO;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.service.MedicalRecordService;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CancelExamineForm;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformCaseQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformCaseUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.CaseplatformCaseDetailVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.CaseplatformCaseVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.service.CaseplatformCaseService;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.util.SmartEasyPoiExcelUtil;
|
||||
import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 病历表 Controller
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Api(tags = "")
|
||||
@OperateLog
|
||||
public class CaseplatformCaseController {
|
||||
|
||||
@Autowired
|
||||
private CaseplatformCaseService caseplatformCaseService;
|
||||
|
||||
@Autowired
|
||||
private MedicalRecordService medicalRecordService;
|
||||
|
||||
@ApiOperation("分页查询 @author HMM")
|
||||
@PostMapping("/caseplatformCase/queryPage")
|
||||
public ResponseDTO<PageResult<CaseplatformCaseVO>> queryPage(@RequestBody @Valid CaseplatformCaseQueryForm queryForm) {
|
||||
return caseplatformCaseService.queryPage(queryForm);
|
||||
}
|
||||
|
||||
@ApiOperation("更新 @author HMM")
|
||||
@PostMapping("/caseplatformCase/update")
|
||||
public ResponseDTO<String> update(@RequestBody @Valid CaseplatformCaseUpdateForm updateForm) {
|
||||
return caseplatformCaseService.update(updateForm);
|
||||
}
|
||||
|
||||
@ApiOperation("详情 @author HMM")
|
||||
@GetMapping("/caseplatformCase/get/{caseId}")
|
||||
@PreAuthorize("@saAuth.checkPermission('case-system:case:select')")
|
||||
public ResponseDTO<MedicalRecordDetailVO> detail(@PathVariable("caseId") Long caseId) {
|
||||
return ResponseDTO.ok(medicalRecordService.getDetail(caseId));
|
||||
}
|
||||
|
||||
@ApiOperation("审核 @author HMM")
|
||||
@GetMapping("/caseplatformCase/examine/{caseId}/{status}")
|
||||
@PreAuthorize("@saAuth.checkPermission('case-system:case:examine')")
|
||||
public ResponseDTO<String> examine(@PathVariable("caseId") Long caseId, @PathVariable("status") int status) {
|
||||
caseplatformCaseService.examine(caseId, status);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("结算 @author HMM")
|
||||
@GetMapping("/caseplatformCase/settlement/{caseId}")
|
||||
@PreAuthorize("@saAuth.checkPermission('case-system:case:settlement')")
|
||||
public ResponseDTO<String> settlement(@PathVariable("caseId") Long caseId) {
|
||||
caseplatformCaseService.settlement(caseId);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("审核拒绝 @author HMM")
|
||||
@PostMapping("/caseplatformCase/cancelExamine")
|
||||
@PreAuthorize("@saAuth.checkPermission('case-system:case:examine')")
|
||||
public ResponseDTO<String> cancelExamine(@RequestBody @Valid CancelExamineForm form) {
|
||||
caseplatformCaseService.cancelExamine(form);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("导出excle @author HMM")
|
||||
@GetMapping("/caseplatformCase/exportExcel")
|
||||
@PreAuthorize("@saAuth.checkPermission('case-system:case:excle')")
|
||||
public void exportExcel(HttpServletResponse response, @RequestBody @Valid CaseplatformCaseQueryForm queryForm) {
|
||||
try {
|
||||
List<CaseplatformCaseVO> data = caseplatformCaseService.queryList(queryForm);
|
||||
List<CaseplatformCaseDetailVO> list = new ArrayList<>();
|
||||
for(CaseplatformCaseVO vv:data){
|
||||
ResponseDTO<CaseplatformCaseDetailVO> detail = caseplatformCaseService.getDetail(vv.getId());
|
||||
CaseplatformCaseDetailVO data1 = detail.getData();
|
||||
list.add(data1);
|
||||
}
|
||||
SmartEasyPoiExcelUtil.exportExcel(list, "qwe", "病例", CaseplatformCaseDetailVO.class, "病例导出数据", response);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.controller;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
|
||||
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.service.MedicalRecordService;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformCaseQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.EasyExcelCaseDetailVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.service.CaseplatformCaseService;
|
||||
import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 病历表 Controller
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@Api(tags = "")
|
||||
public class CaseplatformCaseExcelController {
|
||||
@Autowired
|
||||
private CaseplatformCaseService caseplatformCaseService;
|
||||
|
||||
@GetMapping("/caseplatformCase/exportEasyExcel")
|
||||
public void exportEasyExcel(HttpServletResponse response, @Valid CaseplatformCaseQueryForm queryForm) {
|
||||
try {
|
||||
List<EasyExcelCaseDetailVO> list = caseplatformCaseService.excelList(queryForm);
|
||||
// 1设置表头样式
|
||||
WriteCellStyle headStyle = new WriteCellStyle();
|
||||
// 1.1设置表头数据居中
|
||||
headStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
|
||||
// 2设置表格内容样式
|
||||
WriteCellStyle bodyStyle = new WriteCellStyle();
|
||||
// 2.1设置表格内容水平居中
|
||||
bodyStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
// 2.2设置表格内容垂直居中
|
||||
bodyStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
|
||||
// 3设置表格sheet样式
|
||||
WriteSheet sheet = EasyExcel.writerSheet("详细数据").head(EasyExcelCaseDetailVO.class).sheetNo(1).build();
|
||||
// 4拿到表格处理对象
|
||||
ExcelWriter writer = EasyExcel.write(response.getOutputStream()).needHead(true).excelType(ExcelTypeEnum.XLSX)
|
||||
// 设置单元格的风格样式
|
||||
.registerWriteHandler(new HorizontalCellStyleStrategy(headStyle, bodyStyle))
|
||||
.build();
|
||||
|
||||
// 5写入excel数据
|
||||
writer.write(list, sheet);
|
||||
// 6通知浏览器以附件的形式下载处理,设置返回头要注意文件名有中文
|
||||
String fileName = URLEncoder.encode("病例数据", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||
response.setContentType("multipart/form-data");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
writer.finish();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.converter;
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.ReadCellData;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseSettlementEnum;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public class CaseCaseSettlConverter implements Converter<Integer> {
|
||||
|
||||
@Override
|
||||
public Class<?> supportJavaTypeKey() {
|
||||
//对象属性类型(java中数据类型)
|
||||
return Integer.class;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CellDataTypeEnum supportExcelTypeKey() {
|
||||
//CellData属性类型(Excel中数据类型)
|
||||
return CellDataTypeEnum.STRING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) throws Exception {
|
||||
return Converter.super.convertToJavaData(cellData, contentProperty, globalConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) throws Exception {
|
||||
|
||||
CaseSettlementEnum byVal = CaseSettlementEnum.getByVal(value);
|
||||
return new WriteCellData<>(Optional.ofNullable(byVal.getDesc()).orElse("--未知--"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.converter;
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.ReadCellData;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public class CaseStatusConverter implements Converter<Integer> {
|
||||
|
||||
@Override
|
||||
public Class<?> supportJavaTypeKey() {
|
||||
//对象属性类型(java中数据类型)
|
||||
return Integer.class;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CellDataTypeEnum supportExcelTypeKey() {
|
||||
//CellData属性类型(Excel中数据类型)
|
||||
return CellDataTypeEnum.STRING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) throws Exception {
|
||||
return Converter.super.convertToJavaData(cellData, contentProperty, globalConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) throws Exception {
|
||||
|
||||
CaseStatusEnum byVal = CaseStatusEnum.getByVal(value);
|
||||
return new WriteCellData<>(Optional.ofNullable(byVal.getDesc()).orElse("--未知--"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.converter;
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.ReadCellData;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public class CasetypeConverter implements Converter<Integer> {
|
||||
|
||||
@Override
|
||||
public Class<?> supportJavaTypeKey() {
|
||||
//对象属性类型(java中数据类型)
|
||||
return Integer.class;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CellDataTypeEnum supportExcelTypeKey() {
|
||||
//CellData属性类型(Excel中数据类型)
|
||||
return CellDataTypeEnum.STRING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) throws Exception {
|
||||
return Converter.super.convertToJavaData(cellData, contentProperty, globalConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) throws Exception {
|
||||
|
||||
CasetypeEnum byVal = CasetypeEnum.getByVal(value);
|
||||
return new WriteCellData<>(Optional.ofNullable(byVal.getDesc()).orElse("--未知--"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.dao;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.area.domain.vo.ProvVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity.CaseplatformCaseEntity;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CancelExamineForm;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformCaseQueryForm;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.CaseplatformCaseDetailVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.CaseplatformCaseVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.EasyExcelCaseDetailVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 病历表 Dao
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface CaseplatformCaseDao extends BaseMapper<CaseplatformCaseEntity> {
|
||||
|
||||
/**
|
||||
* 分页 查询
|
||||
*
|
||||
* @param page
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
List<CaseplatformCaseVO> queryPage(Page page, @Param("queryForm") CaseplatformCaseQueryForm queryForm, @Param("provList")List<ProvVO> provList);
|
||||
|
||||
List<EasyExcelCaseDetailVO> excelList(@Param("queryForm") CaseplatformCaseQueryForm queryForm, @Param("provList")List<ProvVO> provList);
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param case_id
|
||||
* @return
|
||||
*/
|
||||
CaseplatformCaseDetailVO getDetail(Long case_id);
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* @param case_id
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@Update("update t_caseplatform_case set status =#{status} where id=#{case_id}")
|
||||
int examine(@Param("case_id") Long case_id, @Param("status")int status);
|
||||
|
||||
/**
|
||||
* 结算
|
||||
* @param case_id
|
||||
* @return
|
||||
*/
|
||||
@Update("update t_caseplatform_case set settlement_flag =1 where id=#{case_id}")
|
||||
int settlement(@Param("case_id") Long case_id);
|
||||
|
||||
/**
|
||||
* 审核拒绝
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
@Update("update t_caseplatform_case set status =2,reason=#{form.reason} where id=#{form.caseId}")
|
||||
int cancelExamine(@Param("form") CancelExamineForm form);
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 病历表 实体类
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("t_caseplatform_case")
|
||||
public class CaseplatformCaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联用户表
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 入院时间
|
||||
*/
|
||||
private LocalDateTime admissionTime;
|
||||
|
||||
/**
|
||||
* 病历类型
|
||||
*/
|
||||
private Integer caseType;
|
||||
|
||||
/**
|
||||
* 专家 id
|
||||
*/
|
||||
private Long expertId;
|
||||
|
||||
/**
|
||||
* 结算标识
|
||||
*/
|
||||
private Integer settlementFlag;
|
||||
|
||||
/**
|
||||
* 0待审核 1审核通过 2审核不通过
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.form;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class CancelExamineForm {
|
||||
|
||||
@ApiModelProperty(value = "病例id", required = true)
|
||||
@NotNull(message = "病例id 不能为空")
|
||||
private Long caseId;
|
||||
|
||||
@ApiModelProperty(value = "原因", required = true)
|
||||
@NotNull(message = "原因 不能为空")
|
||||
private String reason;
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.form;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
|
||||
|
||||
/**
|
||||
* 病历表 新建表单
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CaseplatformCaseAddForm {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true)
|
||||
@NotNull(message = "主键 不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "关联用户表", required = true)
|
||||
@NotNull(message = "关联用户表 不能为空")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "入院时间", required = true)
|
||||
@NotNull(message = "入院时间 不能为空")
|
||||
private LocalDateTime admissionTime;
|
||||
|
||||
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
|
||||
@CheckEnum(value = CasetypeEnum.class, message = "病历类型 错误", required = true)
|
||||
private Integer caseType;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@NotNull(message = "创建时间 不能为空")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.form;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseSettlementEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.common.common.domain.PageParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
|
||||
|
||||
/**
|
||||
* 病历表 分页查询表单
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CaseplatformCaseQueryForm extends PageParam{
|
||||
|
||||
@ApiModelProperty(value = "name")
|
||||
private String name;
|
||||
|
||||
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
|
||||
@CheckEnum(value = CasetypeEnum.class, message = "病历类型 错误")
|
||||
private Integer caseType;
|
||||
|
||||
@ApiModelPropertyEnum(value = CaseSettlementEnum.class, desc = "结算状态")
|
||||
@CheckEnum(value = CaseSettlementEnum.class, message = "结算状态 错误")
|
||||
private Integer settlementFlag;
|
||||
|
||||
@ApiModelPropertyEnum(value = CaseStatusEnum.class, desc = "0待审核 1审核通过 2审核不通过")
|
||||
@CheckEnum(value = CaseStatusEnum.class, message = "0待审核 1审核通过 2审核不通过 错误")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "省份")
|
||||
private Long provId;
|
||||
|
||||
@ApiModelProperty(value = "市区")
|
||||
private Long cityId;
|
||||
|
||||
@ApiModelProperty(value = "医院")
|
||||
private String hospitalUuid;
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.form;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
|
||||
|
||||
/**
|
||||
* 病历表 更新表单
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CaseplatformCaseUpdateForm extends CaseplatformCaseAddForm{
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true)
|
||||
@NotNull(message = "主键 不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelPropertyEnum(value = CaseStatusEnum.class, desc = "0待审核 1审核通过 2审核不通过")
|
||||
@CheckEnum(value = CaseStatusEnum.class, message = "0待审核 1审核通过 2审核不通过 错误", required = true)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcaseabstrac.domain.vo.CaseplatformCaseAbstracVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcasecheckdata.domain.vo.CaseplatformCaseCheckdataVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcasedpms.domain.vo.CaseplatformCaseDpmsVO;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 病历表 列表VO
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ExcelTarget("caseEntity")
|
||||
public class CaseplatformCaseDetailVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "用户关联id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户姓名")
|
||||
@Excel(name = "患者姓名", orderNum = "1", width = 25,needMerge = true)
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
@Excel(name = "患者ID", orderNum = "2", width = 25,needMerge = true)
|
||||
private String uid;
|
||||
|
||||
@ApiModelProperty(value = "入院时间")
|
||||
@Excel(name = "入院时间", orderNum = "3", databaseFormat = "yyyyMMddHHmmss", format = "yyyy-MM-dd", width = 25,needMerge = true)
|
||||
private LocalDateTime admissionTime;
|
||||
|
||||
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
|
||||
@Excel(name = "病历类型", orderNum = "4", width = 25, replace = { "四次及以上疗程化_1", "早前期_2" }, isImportField = "true_st",needMerge = true)
|
||||
private Integer caseType;
|
||||
|
||||
@ApiModelProperty(value = "专家姓名")
|
||||
@Excel(name = "专家姓名", orderNum = "5", width = 25,needMerge = true)
|
||||
private String expertName;
|
||||
|
||||
@ApiModelProperty(value = "专家所在省份名称")
|
||||
@Excel(name = "省份", orderNum = "6", width = 25,needMerge = true)
|
||||
private String expertProvName;
|
||||
|
||||
@ApiModelProperty(value = "专家所在城市名称")
|
||||
@Excel(name = "城市", orderNum = "7", width = 25,needMerge = true)
|
||||
private String expertCityName;
|
||||
|
||||
@ApiModelPropertyEnum(value = CaseStatusEnum.class, desc = "状态")
|
||||
@Excel(name = "状态", orderNum = "8", width = 25, replace = { "待审核_0", "审核通过_1", "审核拒绝_2" }, isImportField = "true_st",needMerge = true)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Excel(name = "创建时间", orderNum = "9", databaseFormat = "yyyyMMddHHmmss", format = "yyyy-MM-dd", width = 25,needMerge = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(value = "专家所在城市医院")
|
||||
private String expertHospitalName;
|
||||
|
||||
@ApiModelProperty(value = "结算标识")
|
||||
private Integer settlementFlag;
|
||||
/************************ 病历摘要 ********************************/
|
||||
|
||||
@ApiModelProperty(value = "病历摘要")
|
||||
@ExcelEntity(id = "caseAbstract")
|
||||
private CaseplatformCaseAbstracVO caseAbstract;
|
||||
|
||||
/************************ 病历 DPMAS ********************************/
|
||||
@ExcelCollection(name = "DPMAS", orderNum = "4")
|
||||
private List<CaseplatformCaseDpmsVO> dpmsList;
|
||||
|
||||
/************************ 病历 实验室检测 ********************************/
|
||||
|
||||
@ApiModelProperty(value = "实验室检测")
|
||||
@ExcelEntity(id = "caseCheckdata")
|
||||
private CaseplatformCaseCheckdataVO caseCheckdata;
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
|
||||
/**
|
||||
* 病历表 列表VO
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CaseplatformCaseVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "用户关联id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String uid;
|
||||
|
||||
@ApiModelProperty(value = "入院时间")
|
||||
private LocalDateTime admissionTime;
|
||||
|
||||
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
|
||||
private Integer caseType;
|
||||
|
||||
@ApiModelProperty(value = "专家姓名")
|
||||
private String expertName;
|
||||
|
||||
@ApiModelProperty(value = "专家所在省份名称")
|
||||
private String expertProvName;
|
||||
|
||||
@ApiModelProperty(value = "专家所在城市名称")
|
||||
private String expertCityName;
|
||||
|
||||
@ApiModelPropertyEnum(value = CaseStatusEnum.class, desc = "0待审核 1审核通过 2审核不通过")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "专家所在城市医院")
|
||||
private String expertHospitalName;
|
||||
|
||||
@ApiModelProperty(value = "原因")
|
||||
private String reason;
|
||||
|
||||
@ApiModelProperty(value = "结算标识")
|
||||
private Integer settlementFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CasetypeEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.converter.CaseCaseSettlConverter;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.converter.CaseStatusConverter;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.converter.CasetypeConverter;
|
||||
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 病历表 列表VO
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
public class EasyExcelCaseDetailVO {
|
||||
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "专家姓名")
|
||||
@ExcelProperty("姓名")
|
||||
private String expertName;
|
||||
|
||||
@ApiModelProperty(value = "专家所在省份名称")
|
||||
@ExcelProperty("省份")
|
||||
private String expertProvName;
|
||||
|
||||
@ApiModelProperty(value = "专家所在城市名称")
|
||||
@ExcelProperty("城市")
|
||||
private String expertCityName;
|
||||
|
||||
@ApiModelProperty(value = "专家所在城市医院")
|
||||
@ExcelProperty("医院")
|
||||
private String expertHospitalName;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "用户关联id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户姓名")
|
||||
@ExcelProperty("患者")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
@ExcelProperty("患者ID")
|
||||
private String uid;
|
||||
|
||||
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
|
||||
@ExcelProperty(value = "病历类型", converter = CasetypeConverter.class)
|
||||
private Integer caseType;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@ExcelProperty("提交时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelPropertyEnum(value = CaseStatusEnum.class, desc = "状态")
|
||||
@ExcelProperty(value = "病例状态", converter = CaseStatusConverter.class)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "结算标识")
|
||||
@ExcelProperty(value = "结算状态", converter = CaseCaseSettlConverter.class)
|
||||
private Integer settlementFlag;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.manager;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.dao.CaseplatformCaseDao;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity.CaseplatformCaseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 病历表 Manager
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
@Service
|
||||
public class CaseplatformCaseManager extends ServiceImpl<CaseplatformCaseDao, CaseplatformCaseEntity> {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,169 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcase.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.business.area.domain.vo.ProvVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.dao.CaseplatformCaseDao;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity.CaseplatformCaseEntity;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CancelExamineForm;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformCaseAddForm;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformCaseQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformCaseUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.CaseplatformCaseDetailVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.CaseplatformCaseVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.EasyExcelCaseDetailVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcaseabstrac.domain.vo.CaseplatformCaseAbstracVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcaseabstrac.service.CaseplatformCaseAbstracService;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcasecheckdata.domain.vo.CaseplatformCaseCheckdataVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcasecheckdata.service.CaseplatformCaseCheckdataService;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcasedpms.domain.vo.CaseplatformCaseDpmsVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcasedpms.service.CaseplatformCaseDpmsService;
|
||||
import net.lab1024.sa.admin.module.system.login.domain.LoginEmployeeDetail;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import net.lab1024.sa.common.common.domain.RequestUser;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.common.common.util.SmartPageUtil;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static net.lab1024.sa.common.common.code.UserErrorCode.NO_PERMISSION;
|
||||
|
||||
/**
|
||||
* 病历表 Service
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class CaseplatformCaseService {
|
||||
|
||||
@Autowired
|
||||
private CaseplatformCaseDao caseplatformCaseDao;
|
||||
|
||||
@Autowired
|
||||
private CaseplatformCaseAbstracService abstracService;
|
||||
|
||||
@Autowired
|
||||
private CaseplatformCaseDpmsService dpmsService;
|
||||
|
||||
@Autowired
|
||||
private CaseplatformCaseCheckdataService checkdataService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<PageResult<CaseplatformCaseVO>> queryPage(CaseplatformCaseQueryForm queryForm) {
|
||||
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||
|
||||
LoginEmployeeDetail requestUser = (LoginEmployeeDetail)SmartRequestUtil.getRequestUser();
|
||||
List<ProvVO> provList = requestUser.getProvList();
|
||||
Long provId = queryForm.getProvId();
|
||||
if(provId != null){
|
||||
boolean match = provList.stream().anyMatch(item -> item.getId().equals(provId));
|
||||
if(!match){
|
||||
return ResponseDTO.ok(SmartPageUtil.emptyResult(page));
|
||||
}
|
||||
}
|
||||
List<CaseplatformCaseVO> list = caseplatformCaseDao.queryPage(page, queryForm, provList);
|
||||
PageResult<CaseplatformCaseVO> pageResult = SmartPageUtil.convert2PageResult(page, list);
|
||||
return ResponseDTO.ok(pageResult);
|
||||
}
|
||||
|
||||
public List<CaseplatformCaseVO> queryList(CaseplatformCaseQueryForm queryForm) {
|
||||
LoginEmployeeDetail requestUser = (LoginEmployeeDetail)SmartRequestUtil.getRequestUser();
|
||||
List<ProvVO> provList = requestUser.getProvList();
|
||||
Long provId = queryForm.getProvId();
|
||||
if(provId != null){
|
||||
boolean match = provList.stream().anyMatch(item -> item.getId().equals(provId));
|
||||
if(!match){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
List<CaseplatformCaseVO> list = caseplatformCaseDao.queryPage(null, queryForm, provList);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 不分页导出 excel
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
public List<EasyExcelCaseDetailVO> excelList(CaseplatformCaseQueryForm queryForm) {
|
||||
LoginEmployeeDetail requestUser = (LoginEmployeeDetail)SmartRequestUtil.getRequestUser();
|
||||
List<ProvVO> provList = requestUser.getProvList();
|
||||
Long provId = queryForm.getProvId();
|
||||
if(provId != null){
|
||||
boolean match = provList.stream().anyMatch(item -> item.getId().equals(provId));
|
||||
if(!match){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
List<EasyExcelCaseDetailVO> list = caseplatformCaseDao.excelList(queryForm, provList);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public ResponseDTO<String> add(CaseplatformCaseAddForm addForm) {
|
||||
CaseplatformCaseEntity caseplatformCaseEntity = SmartBeanUtil.copy(addForm, CaseplatformCaseEntity.class);
|
||||
caseplatformCaseDao.insert(caseplatformCaseEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param updateForm
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> update(CaseplatformCaseUpdateForm updateForm) {
|
||||
CaseplatformCaseEntity caseplatformCaseEntity = SmartBeanUtil.copy(updateForm, CaseplatformCaseEntity.class);
|
||||
caseplatformCaseDao.updateById(caseplatformCaseEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* @param case_id
|
||||
* @return
|
||||
*/
|
||||
public void examine(Long case_id, int status){
|
||||
caseplatformCaseDao.examine(case_id, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算
|
||||
* @param case_id
|
||||
*/
|
||||
public void settlement(Long case_id){
|
||||
caseplatformCaseDao.settlement(case_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核拒绝
|
||||
* @param form
|
||||
*/
|
||||
public void cancelExamine(CancelExamineForm form){
|
||||
caseplatformCaseDao.cancelExamine(form);
|
||||
}
|
||||
|
||||
public ResponseDTO<CaseplatformCaseDetailVO> getDetail(Long case_id){
|
||||
CaseplatformCaseDetailVO detail = caseplatformCaseDao.getDetail(case_id);
|
||||
CaseplatformCaseAbstracVO abstracVO = abstracService.getByCaseId(case_id);
|
||||
List<CaseplatformCaseDpmsVO> dpmsVOS = dpmsService.getByCaseId(case_id);
|
||||
CaseplatformCaseCheckdataVO checkdataVO = checkdataService.getByCaseId(case_id);
|
||||
detail.setCaseAbstract(abstracVO);
|
||||
detail.setCaseCheckdata(checkdataVO);
|
||||
detail.setDpmsList(dpmsVOS);
|
||||
return ResponseDTO.ok(detail);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package net.lab1024.sa.admin.module.business.caseplatformcaseabstrac.controller;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcaseabstrac.domain.form.CaseplatformCaseAbstracQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcaseabstrac.domain.vo.CaseplatformCaseAbstracVO;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcaseabstrac.service.CaseplatformCaseAbstracService;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 病历摘要表 Controller
|
||||
*
|
||||
* @Author HMM
|
||||
* @Date 2024-01-11 15:18:32
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Api(tags = "")
|
||||
@OperateLog
|
||||
public class CaseplatformCaseAbstracController {
|
||||
|
||||
@Autowired
|
||||
private CaseplatformCaseAbstracService caseplatformCaseAbstracService;
|
||||
|
||||
@ApiOperation("分页查询 @author HMM")
|
||||
@PostMapping("/caseplatformCaseAbstrac/queryPage")
|
||||
public ResponseDTO<PageResult<CaseplatformCaseAbstracVO>> queryPage(@RequestBody @Valid CaseplatformCaseAbstracQueryForm queryForm) {
|
||||
return ResponseDTO.ok(caseplatformCaseAbstracService.queryPage(queryForm));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user