Compare commits

...

129 Commits

Author SHA1 Message Date
f2eb35fc58 修改了发版配置2 2025-07-15 14:47:04 +08:00
dec3eeca99 修改了发版配置1 2025-07-15 14:05:16 +08:00
b20b15c790 修改了发版配置 2025-07-15 13:59:52 +08:00
d619f13664 33334 2025-07-15 13:05:40 +08:00
9335655f65 3333 2025-07-15 10:46:45 +08:00
90da311654 77777 2025-07-14 17:53:19 +08:00
0d1f3c6be0 66666 2025-07-14 17:50:39 +08:00
d3443b99fa 55555 2025-07-14 17:46:35 +08:00
01c941e830 33333 2025-07-14 17:36:58 +08:00
af84998f8d 修改导出专家的title。增加了测试的数量 2025-07-14 17:17:08 +08:00
f68975eca0 5666 2025-07-14 16:16:47 +08:00
6b680468d8 44555 2025-07-14 11:58:05 +08:00
e5979c11eb 55555 2025-07-14 11:48:25 +08:00
9d3dde48b8 444444 2025-07-14 11:41:41 +08:00
395aec0864 111 2025-07-14 11:22:54 +08:00
d639992bfd 活动申请列表修改为导入手机号 2025-07-14 10:41:29 +08:00
2b39340598 新增了状态1 2025-07-14 10:15:04 +08:00
71a06e44d1 新增了状态 2025-07-14 09:54:06 +08:00
0c91c4301c 病例的字段修改2 2025-07-11 16:46:49 +08:00
1f5ff6272b 病例的字段修改1 2025-07-11 16:17:46 +08:00
9e13a53f32 病例的字段修改 2025-07-11 15:53:17 +08:00
d183b376d8 修改了后台新增员工时性别,修改了前台的出院状态 2025-07-11 09:52:55 +08:00
fc87250f14 1111111 2025-07-10 19:41:13 +08:00
5de78fb105 新增了白介素单位 2025-07-10 19:27:02 +08:00
6628d3f8eb 时间验证 2025-07-10 18:12:43 +08:00
35ff05d871 111 2025-07-10 16:51:57 +08:00
7364df4950 新增了审核时间 2025-07-10 16:37:21 +08:00
f881c06e6a 新增了审核和结算时签名状态 2025-07-10 16:31:56 +08:00
07186d54d5 新增了活动申请状态修改1 2025-07-10 16:15:13 +08:00
7b39539cf3 新增了活动申请状态修改 2025-07-10 16:13:17 +08:00
4c29eb56a8 56666 2025-07-10 15:52:20 +08:00
5d123aacea 5555 2025-07-10 15:09:33 +08:00
d3a1bb4282 8888 2025-07-10 14:38:56 +08:00
e21e28e3f9 77777 2025-07-10 14:00:44 +08:00
a8186b34f7 6666 2025-07-10 13:57:04 +08:00
2ab6aa9689 5555 2025-07-10 13:35:53 +08:00
e2af4be4ef 11112 2025-07-10 11:40:12 +08:00
71280ff0a1 1111 2025-07-10 11:34:49 +08:00
541822c0a7 专家活动申请xiuga 2025-07-10 10:24:43 +08:00
cc88caf03c 44444 2025-07-10 09:52:12 +08:00
12966aa4cf 修改了病例数量 2025-07-10 08:58:34 +08:00
ea838e56d7 44444 2025-07-09 18:53:25 +08:00
2ffaab3de5 33333 2025-07-09 17:23:39 +08:00
983d0f098d 新增了活动申请111 2025-07-09 17:08:49 +08:00
ae6e93bfa7 新增了活动申请 2025-07-09 16:42:21 +08:00
d6133afeac 666666 2025-07-09 16:15:50 +08:00
94f796fdf2 5555 2025-07-09 15:51:31 +08:00
f1a07d4c1a 333 2025-07-09 14:23:36 +08:00
4330be4be2 新增了验证账户名与银行卡姓名 2025-07-09 13:14:44 +08:00
dec2d80131 111 2025-07-09 10:17:12 +08:00
1a44eedc8f 新增了出院时间诊断-未完成,新增了新增病例时,时间判断 2025-07-09 09:05:37 +08:00
71db0a5ca3 增加每人最多病例限制111 2025-07-08 18:00:46 +08:00
042990d6a5 增加每人最多病例限制 2025-07-08 17:43:44 +08:00
89d09449ac 55555 2025-07-08 16:32:36 +08:00
4293c839d4 4444 2025-07-08 15:41:32 +08:00
33e17487c3 111 2025-07-08 15:35:34 +08:00
3299851588 修改审核不通过允许更改1 2025-07-08 15:25:33 +08:00
5dbdb49440 修改审核不通过允许更改 2025-07-08 15:25:02 +08:00
a98998260a 修改登录验证 2025-07-08 14:59:34 +08:00
69385d2a99 55555 2025-07-08 14:18:13 +08:00
19321723bf 2222 2025-07-08 14:09:05 +08:00
a7275b5048 增加了登录验证 2025-07-08 14:04:04 +08:00
aa3d6d91cf 66666 2025-07-08 11:14:55 +08:00
051f227de5 44555 2025-07-08 10:56:47 +08:00
ecaac97e11 4444 2025-07-08 10:34:16 +08:00
a127fe46ce 111 2025-07-08 10:11:40 +08:00
b5554fd3c0 666667774555 2025-07-08 09:26:30 +08:00
3fc39eeb12 66666777 2025-07-08 09:23:20 +08:00
327698768f 66666 2025-07-08 09:20:36 +08:00
333da783cb 55555 2025-07-08 08:54:47 +08:00
e47844559d 44444 2025-07-07 17:40:13 +08:00
e82ee7e019 6666 2025-07-07 17:34:12 +08:00
c53320b516 44444 2025-07-07 17:25:12 +08:00
5075cde8c0 33444 2025-07-07 17:14:22 +08:00
94a668864c 新增了结算导入 2025-07-07 15:27:01 +08:00
8a99d31e33 新增了结算导出 2025-07-07 14:14:35 +08:00
f55d3a07f5 医生统计导出标题问题处理12 2025-07-07 10:52:28 +08:00
c8148d0609 医生统计导出标题问题处理1 2025-07-07 09:09:24 +08:00
78aa87b733 医生统计导出标题问题处理 2025-07-07 09:00:53 +08:00
5909c9682e 增加了医生管理分页查询 2025-07-06 23:52:13 +08:00
7d91e804a2 增加了医生白名单导入 2025-07-06 23:08:13 +08:00
e13129a171 增加了医生统计导出 2025-07-03 17:41:31 +08:00
aaf5dfe921 修改了治疗类型 2025-07-03 17:25:35 +08:00
5eaf4031bf 3333 2025-07-03 14:51:31 +08:00
edad34ca13 1111 2025-07-03 14:16:11 +08:00
1c678b0954 修改了放心签的验证逻辑2 2025-07-02 17:25:23 +08:00
09b631436f 修改了放心签的验证逻辑1 2025-07-02 16:49:55 +08:00
d57329cf1c 修改了放心签的验证逻辑 2025-07-02 13:21:31 +08:00
3eb7af1fff 放心签新增了签署状态 2025-07-01 18:44:45 +08:00
29367a8aaf 后台新增了审核时间 2025-07-01 16:20:26 +08:00
405fe91c65 新增了获取企业的授权地址 2025-07-01 15:22:13 +08:00
96588b4379 4444 2025-07-01 09:15:58 +08:00
fd7f4259ce 1111 2025-07-01 08:55:10 +08:00
b2e9b7fff5 新增了图像识别 2025-06-30 18:11:00 +08:00
7356d6806e 新增了身份证识别,去除了反面114444 2025-06-30 17:35:59 +08:00
3b3c734c8a 新增了身份证识别,去除了反面11 2025-06-30 17:27:14 +08:00
6119e760d3 新增了身份证识别,去除了反面 2025-06-30 16:52:01 +08:00
6cc5dc58de 新增了身份证识别 2025-06-30 16:48:39 +08:00
7c09fd4172 修改添加病例入参 2025-06-30 15:48:52 +08:00
2b69218849 777 2025-06-30 15:13:50 +08:00
1b18f1cf6d 56666 2025-06-30 14:52:42 +08:00
1d5aa232e9 55555 2025-06-30 14:50:15 +08:00
5532a40c06 6666 2025-06-30 14:41:41 +08:00
fcd5a0eb0d 4444 2025-06-30 14:36:08 +08:00
3055b29f17 1111 2025-06-30 14:35:13 +08:00
1ecf3ec22f 1111 2025-06-30 14:32:18 +08:00
40753b1f71 1111 2025-06-30 11:39:42 +08:00
b331bce442 新增病例修改了验证签名逻辑 2025-06-30 10:48:24 +08:00
bed2a987e3 新增了放心签1113333 2025-06-30 08:57:18 +08:00
1a14b66a91 新增了放心签111 2025-06-28 17:36:50 +08:00
aeef91e357 新增了放心签 2025-06-28 17:13:12 +08:00
2d06128915 修改oss签名1 2025-06-28 15:13:13 +08:00
807c2fd080 修改oss签名 2025-06-28 15:08:29 +08:00
f29c161cc1 新增了放心签的对接 2025-06-27 15:09:22 +08:00
656b466917 77777 2025-06-26 17:39:00 +08:00
b294d79bfc 666885555 2025-06-26 17:18:27 +08:00
458089fa8c 66688988 2025-06-26 17:15:14 +08:00
9b0a0639a9 666677777 2025-06-26 17:01:22 +08:00
dedcb575a7 6666 2025-06-26 16:30:44 +08:00
3a6cbecd03 45555 2025-06-26 16:12:27 +08:00
ee3f62bd70 67777 2025-06-26 15:47:39 +08:00
9febf92836 6666 2025-06-26 15:45:25 +08:00
daabf3707f 565555 2025-06-26 15:43:31 +08:00
348c08c495 6666 2025-06-26 14:44:49 +08:00
9f861bf6ec 4444 2025-06-25 18:14:51 +08:00
406a394ebc 2222 2025-06-25 16:29:47 +08:00
4132916c58 1111 2025-06-25 15:59:16 +08:00
a5197591bc 新增了dockerfile,修改了病例新增、登陆逻辑 2025-06-25 13:18:20 +08:00
4c74b0dd01 修改了创建病例中的基本信息,人工肝检测,临床资料实验室检测等方面数据 2025-06-21 17:44:35 +08:00
132 changed files with 6696 additions and 930 deletions

View File

@ -21,18 +21,27 @@ RUN mkdir -p /root/.m2 && \
# 复制项目代码
COPY pom.xml .
COPY src ./src
COPY sa-admin ./sa-admin
COPY sa-common ./sa-common
# 构建项目
RUN mvn clean package -DskipTests
RUN mvn clean package -Dmaven.test.skip=true -P dev
# 第二阶段:使用更小的 Java8 JDK 镜像运行
FROM eclipse-temurin:8-jdk-alpine
WORKDIR /app
# ✅ 安装字体 & libgcc 等依赖
RUN apk add --no-cache \
libstdc++ \
libgcc \
fontconfig \
freetype \
ttf-dejavu
# 复制构建产物
COPY --from=builder /app/target/*.jar app.jar
COPY --from=builder /app/sa-admin/target/*.jar app.jar
# 暴露端口(请替换成你实际应用端口)
EXPOSE 5477

50
Dockerfile-prod Normal file
View File

@ -0,0 +1,50 @@
# 第一阶段:使用 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 sa-admin ./sa-admin
COPY sa-common ./sa-common
# 构建项目
RUN mvn clean package -Dmaven.test.skip=true -P prod
# 第二阶段:使用更小的 Java8 JDK 镜像运行
FROM eclipse-temurin:8-jdk-alpine
WORKDIR /app
# ✅ 安装字体 & libgcc 等依赖
RUN apk add --no-cache \
libstdc++ \
libgcc \
fontconfig \
freetype \
ttf-dejavu
# 复制构建产物
COPY --from=builder /app/sa-admin/target/*.jar app.jar
# 暴露端口(请替换成你实际应用端口)
EXPOSE 5477
# 启动应用
ENTRYPOINT ["java", "-jar", "app.jar"]

View File

@ -24,7 +24,7 @@
<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>
<fastjson.version>1.2.83</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>

View File

@ -33,6 +33,11 @@
<artifactId>weixin-java-miniapp</artifactId>
</dependency>
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.16.22</version>
</dependency>
</dependencies>
<build>

View File

@ -60,7 +60,7 @@ public class AdminSwaggerTagConst extends SwaggerTagConst {
public static final String Expert = "前端-登录、注册、首页";
public static final String ExpertSign = "前端-医生签名";
public static final String OSS = "前端-oss";
public static final String OSS = "前端-文件";
public static final String WX_MINI = "前端-微信小程序";
}
}

View File

@ -0,0 +1,39 @@
package net.lab1024.sa.admin.extend.baidubce;
import com.baidu.aip.ocr.AipOcr;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@Slf4j
@Getter
@Component("baiducebase")
public class Base {
@Value("${baiduce.app-id}")
private String appId;
@Value("${baiduce.app-key}")
private String appkey;
@Value("${baiduce.app-secret}")
private String appSecret;
// AipOcr 实例
protected AipOcr ocrClient;
@PostConstruct
public void init() {
ocrClient = new AipOcr(appId, appkey, appSecret);
ocrClient.setConnectionTimeoutInMillis(2000);
ocrClient.setSocketTimeoutInMillis(60000);
}
// 注意项目使用log4j2百度AI SDK会自动检测log4j2配置文件
// 如果确实需要手动指定log4j2配置文件路径可以使用以下方式
// System.setProperty("log4j.configurationFile", "classpath:dev/log4j2.xml");
// 或者完全移除这行配置让log4j2自动检测
// }
}

View File

@ -0,0 +1,48 @@
package net.lab1024.sa.admin.extend.baidubce;
import java.util.HashMap;
import com.baidu.aip.ocr.AipOcr;
import net.lab1024.sa.common.common.domain.ResponseDTO;
import net.lab1024.sa.common.common.exception.BusinessException;
import org.json.JSONObject;
import org.springframework.stereotype.Component;
// 通用文字识别
@Component
public class Ocr extends Base {
/**
* 身份证识别
*/
public JSONObject idCard(byte[] imageBytes,String idCardSide) {
try {
HashMap<String, String> options = new HashMap<>();
options.put("detect_direction", "true");
options.put("detect_risk", "true");
return ocrClient.idcard(imageBytes, idCardSide, options);
} catch (Exception e) {
throw new BusinessException("OCR识别失败: " + e.getMessage());
}
}
/**
* 文字识别
*/
public JSONObject image(byte[] imageBytes) {
try {
HashMap<String, String> options = new HashMap<>();
options.put("language_type", "CHN_ENG");
options.put("detect_direction", "true");
options.put("detect_language", "true");
options.put("probability", "true");
return ocrClient.basicGeneral(imageBytes, options);
} catch (Exception e) {
throw new BusinessException("OCR识别失败: " + e.getMessage());
}
}
}

View File

@ -0,0 +1,113 @@
package net.lab1024.sa.admin.extend.fangxinqian;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import net.lab1024.sa.common.common.exception.BusinessException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Slf4j
@Component("fangxinqianbase")
@Getter
public class Base {
private static final ObjectMapper objectMapper = new ObjectMapper();
@Value("${fxq.client-id}")
private String clientId;
@Value("${fxq.client-secret}")
private String clientSecret;
@Value("${fxq.client-url}")
private String clientUrl;
@Resource
private RedisTemplate<String, String> redisTemplate;
/**
* 发送 POST JSON 请求
* @param url 请求地址
* @param jsonData JSON 字符串
* @param headers 请求头
* @return 响应字符串
*/
public String postJson(String url, String jsonData, Map<String, String> headers) {
// 获取token
String tokenKey = "fangxinqian:" + clientId;
String token = redisTemplate.opsForValue().get(tokenKey);
if (token == null) {
token = getAccessToken();
}
// 刷新token
HttpRequest request = HttpRequest.post(url)
.body(jsonData)
.header("Content-Type", "application/json")
.header("Authorization", String.format("Bearer %s",token));
if (headers != null) {
headers.forEach(request::header);
}
log.info("获取app数据参数:{}",jsonData);
try (HttpResponse response = request.execute()) {
JSONObject json = JSONUtil.parseObj(response.body());
log.info("获取app数据返回:{}",json);
int code = json.getInt("code", -1);
if (code == 10005) {
// token 失效重新获取
getAccessToken();
return postJson(url,jsonData,headers);
}
return response.body();
}
}
public String getAccessToken(){
String url = String.format("%s?grant_type=client_credentials&client_id=%s&client_secret=%s",
"https://saasapi.fangxinqian.cn/oauth/token", clientId, clientSecret);
HttpRequest request = HttpRequest.post(url);
try (HttpResponse response = request.execute()) {
if (response.getStatus() != 200) {
throw new BusinessException("操作失败");
}
JSONObject json = JSONUtil.parseObj(response.body());
log.info("获取app数据返回:{}",json);
String accessToken = json.getStr("access_token");
if (accessToken == null || accessToken.isEmpty()) {
throw new BusinessException("操作失败");
}
Integer expiresIn = json.getInt("expires_in");
if (expiresIn == null || expiresIn <= 0) {
throw new BusinessException("操作失败");
}
String tokenKey = "fangxinqian:" + clientId;
redisTemplate.opsForValue().set(tokenKey,accessToken,(expiresIn - 120), TimeUnit.SECONDS);
return accessToken;
}
}
}

View File

@ -0,0 +1,43 @@
package net.lab1024.sa.admin.extend.fangxinqian.auth;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import net.lab1024.sa.admin.extend.fangxinqian.Base;
import net.lab1024.sa.admin.extend.fangxinqian.company.RegisterPResponse;
import net.lab1024.sa.common.common.exception.BusinessException;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Slf4j
@Component
public class Auth extends Base {
/**
* 获取静默签署的授权
*/
public GetAuthorizeResponse getAuthorize(String unionId){
// 处理参数
Map<String, Object> requestData = new HashMap<>();
requestData.put("signerUnionId", unionId); // 个人/企业主体在放心签平台与接入方关联的唯一性标识
requestData.put("notifyUrl", "www.baidu.com"); // 授权结果通知地址
requestData.put("notifyWay", "2");
String url = getClientUrl() + "authorize/silent/sign";
String jsonBody = JSONUtil.toJsonStr(requestData);
log.info("获取app数据参数:{}",jsonBody);
String response = postJson(url,jsonBody,null);
GetAuthorizeResponse result = JSONUtil.toBean(response, GetAuthorizeResponse.class);
if (result.getCode() != 10000){
if (!Objects.equals(result.getMessage(), "")){
throw new BusinessException(result.getMessage());
}else{
throw new BusinessException("失败");
}
}
return result;
}
}

View File

@ -0,0 +1,28 @@
package net.lab1024.sa.admin.extend.fangxinqian.auth;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class GetAuthorizeResponse {
private int code;
private String message;
private GetAuthorizeData data;
private String requestId;
/**
* 根据统一标签列表 - 详细数据
*/
@Data
public static class GetAuthorizeData {
private String unionId;
private String pcUrl;
private String h5Url;
}
}

View File

@ -0,0 +1,49 @@
package net.lab1024.sa.admin.extend.fangxinqian.company;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import net.lab1024.sa.admin.extend.fangxinqian.Base;
import net.lab1024.sa.common.common.exception.BusinessException;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* 企业账号
*/
@Slf4j
@Component
public class Company extends Base {
/**
* 添加账号(个人账号已创建)-企业
*/
public RegisterPResponse registerCResponse(String managerUnionId){
// 处理参数
Map<String, Object> requestData = new HashMap<>();
requestData.put("uid", "bjyykxjsfzxh"); // 接入方系统中用户的标识
requestData.put("managerUnionId", managerUnionId); // 个人唯一性标识
requestData.put("orgName", "北京医药科学技术发展协会");
requestData.put("creditNo", "51110000500308634E");
requestData.put("legalName", "侯新晖");
String url = getClientUrl() + "company/register";
String jsonBody = JSONUtil.toJsonStr(requestData);
log.info("获取app数据参数:{}",jsonBody);
String response = postJson(url,jsonBody,null);
RegisterPResponse result = JSONUtil.toBean(response, RegisterPResponse.class);
if (result.getCode() != 10000){
if (!Objects.equals(result.getMessage(), "")){
throw new BusinessException(result.getMessage());
}else{
throw new BusinessException("失败");
}
}
return result;
}
}

View File

@ -0,0 +1,36 @@
package net.lab1024.sa.admin.extend.fangxinqian.company;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
@Data
public class RegisterPResponse {
private int code;
private String message;
private GetRegisterPData data;
private String requestId;
/**
* 根据统一标签列表 - 详细数据
*/
@Data
public static class GetRegisterPData {
/**
* 接入方用户唯一标识
*/
private String uid;
/**
* 企业主体在放心签平台与接入方关联的唯一性标识
*/
@JsonProperty("unionId")
private String unionId;
}
}

View File

@ -0,0 +1,68 @@
package net.lab1024.sa.admin.extend.fangxinqian.personal;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import net.lab1024.sa.admin.extend.fangxinqian.Base;
import net.lab1024.sa.common.common.exception.BusinessException;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* 个人账号
*/
@Slf4j
@Component
public class Personal extends Base {
/**
* 添加账号
*/
public RegisterResponse register(RegisterRequest r){
String url = getClientUrl() + "personal/register";
String jsonBody = JSONUtil.toJsonStr(r);
log.info("获取app数据参数:{}",jsonBody);
String response = postJson(url,jsonBody,null);
RegisterResponse result = JSONUtil.toBean(response, RegisterResponse.class);
if (result.getCode() != 10000){
if (result.getCode() == 50005){
return result;
}
if (!Objects.equals(result.getMessage(), "")){
throw new BusinessException(result.getMessage());
}else{
throw new BusinessException("失败");
}
}
return result;
}
/**
* 查询账号
*/
public QueryResponse query(String uid,String mobile){
String url = getClientUrl() + "personal/query";
Map<String, Object> requestData = new HashMap<>();
requestData.put("uid", uid); // 接入方系统中用户的标识
requestData.put("mobile", mobile); // 接入方系统中用户的标识
String jsonBody = JSONUtil.toJsonStr(requestData);
log.info("获取app数据参数:{}",jsonBody);
String response = postJson(url,jsonBody,null);
QueryResponse result = JSONUtil.toBean(response, QueryResponse.class);
if (result.getCode() != 10000){
if (!Objects.equals(result.getMessage(), "")){
throw new BusinessException(result.getMessage());
}else{
throw new BusinessException("失败");
}
}
return result;
}
}

View File

@ -0,0 +1,45 @@
package net.lab1024.sa.admin.extend.fangxinqian.personal;
import lombok.Data;
@Data
public class QueryResponse {
private int code;
private String message;
private queryData data;
private String requestId;
/**
* 根据统一标签列表 - 详细数据
*/
@Data
public static class queryData {
/**
* 实名注册H5链接
*/
private String uid;
/**
* 实名注册PC链接
*/
private String unionId;
/**
* 认证状态认证成功/认证中
*/
private String status;
/**
* 认证状态码
* 0-未认证
* 1-认证中
* 2-已认证
*/
private String statusCode;
}
}

View File

@ -0,0 +1,41 @@
package net.lab1024.sa.admin.extend.fangxinqian.personal;
import lombok.Data;
@Data
public class RegisterRequest {
/**
* 接入方系统中用户的标识需保证在接入方系统内唯一长度为8-20个字符
*/
private String uid;
/**
* 创建账号所用的手机号码
*/
private String mobile;
/**
* 个人实名认证方案默认为1
* 1全网三要素姓名身份证号实名手机号
* 2银行卡四要素姓名身份证号银行卡号银行预留手机号
* -1创建账号时不实名认证平台会在其签署前触发实名认证也可以请求"独立认证页获取"接口来进行实名认证
*/
private String authType = "1";
/**
* 证件号码
*/
private String identNo;
/**
* 真实姓名
*/
private String name;
/**
* 是否允许用户修改认证页代入信息
* 0不允许
* 1允许默认
*/
private String allowModify = "0";
}

View File

@ -0,0 +1,42 @@
package net.lab1024.sa.admin.extend.fangxinqian.personal;
import lombok.Data;
@Data
public class RegisterResponse {
private int code;
private String message;
private GetRegisterData data;
private String requestId;
/**
* 根据统一标签列表 - 详细数据
*/
@Data
public static class GetRegisterData {
/**
* 实名注册H5链接
*/
private String h5Url;
/**
* 实名注册PC链接
*/
private String pcUrl;
/**
* 接入方用户唯一标识
*/
private String uid;
/**
* 个人在放心签平台与接入方关联的唯一性标识
*/
private String unionId;
}
}

View File

@ -0,0 +1,84 @@
package net.lab1024.sa.admin.extend.fangxinqian.task;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class AddTemplateTaskRequest {
/**
* 个人/企业主体在放心签平台与接入方关联的唯一性标识发起方账号
*/
private String unionId;
/**
* 签署模板编号
*/
private String templateNo;
/**
* 签署完成回调推送地址
* 签署任务中的每一位签署方签署成功以后都会推送
*/
private String notifyUrl = "www.baidu.com";
/**
* 签署方列表
*/
private List<signersData> signers;
/**
* 通知默认为0
* 0接口返回不直接通知用户
* 1短信通知如果选择1则放心签会将签署链接通过短信的方式发送至签署方的手机当中
*/
private String notifyType = "0";
/**
* 签署任务标题(长度最大值默认为50字符)
*/
private String taskTitle = "合作协议";
/**
* 签署完成后跳转地址不传则停留在放心签的页面
*/
private String redirectUrl = "switchTab:/pages/index/index";
/**
* 关键词替换
*/
private List<componentsData> components;
/**
* 详细数据-签署方列表
*/
@Data
public static class signersData {
/**
* 参与方别名标识"获取已配置的签署模版"接口返回参数中获取
*/
private String signerNo;
/**
* 个人/企业主体在放心签平台与接入方关联的唯一性标识 签署方账号
*/
private String signerUnionId;
}
/**
* 详细数据-关键词替换
*/
@Data
public static class componentsData {
/**
* 替换参数对应saas平台控件编码
*/
private String fileKey;
/**
* 替换内容
*/
private String fileValue;
}
}

View File

@ -0,0 +1,28 @@
package net.lab1024.sa.admin.extend.fangxinqian.task;
import lombok.Data;
import java.util.List;
@Data
public class AddTemplateTaskResponse {
private int code;
private String message;
private AddTemplateTaskData data;
private String requestId;
/**
* 详细数据
*/
@Data
public static class AddTemplateTaskData {
/**
* 签署任务编号
*/
private String taskNo;
}
}

View File

@ -0,0 +1,113 @@
package net.lab1024.sa.admin.extend.fangxinqian.task;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import net.lab1024.sa.admin.extend.fangxinqian.Base;
import net.lab1024.sa.common.common.exception.BusinessException;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Slf4j
@Component
public class FxqTask extends Base {
/**
* 获取已配置的签署模版
*/
public GetTemplateListResponse getTemplateList(String unionId){
String url = getClientUrl() + "file/templates";
Map<String, Object> requestData = new HashMap<>();
requestData.put("unionId", unionId); // 个人/企业主体在放心签平台与接入方关联的唯一性标识发起方账号
String jsonBody = JSONUtil.toJsonStr(requestData);
String response = postJson(url,jsonBody,null);
GetTemplateListResponse result = JSONUtil.toBean(response, GetTemplateListResponse.class);
if (result.getCode() != 10000){
if (!Objects.equals(result.getMessage(), "")){
throw new BusinessException(result.getMessage());
}else{
throw new BusinessException("失败");
}
}
return result;
}
/**
* 获取签署链接
*/
public GetTaskLinkResponse getTaskLink(String taskNo, String unionId){
String url = getClientUrl() + "sign/task/link";
Map<String, Object> requestData = new HashMap<>();
requestData.put("taskNo", taskNo); // 签署任务编号创建签署任务时生成
requestData.put("unionId", unionId); // 个人/企业在放心签平台的唯一性标识签署方账号
String jsonBody = JSONUtil.toJsonStr(requestData);
log.info("获取app数据参数:{}",jsonBody);
String response = postJson(url,jsonBody,null);
GetTaskLinkResponse result = JSONUtil.toBean(response, GetTaskLinkResponse.class);
if (result.getCode() != 10000){
if (!Objects.equals(result.getMessage(), "")){
throw new BusinessException(result.getMessage());
}else{
throw new BusinessException("失败");
}
}
return result;
}
/**
* 模版签署任务创建
*/
public AddTemplateTaskResponse addTemplateTask(AddTemplateTaskRequest r){
String url = getClientUrl() + "sign/template_task/create";
String jsonBody = JSONUtil.toJsonStr(r);
log.info("获取app数据参数:{}",jsonBody);
String response = postJson(url,jsonBody,null);
AddTemplateTaskResponse result = JSONUtil.toBean(response, AddTemplateTaskResponse.class);
if (result.getCode() != 10000){
if (!Objects.equals(result.getMessage(), "")){
throw new BusinessException(result.getMessage());
}else{
throw new BusinessException("失败");
}
}
return result;
}
/**
* 签署任务详情查询
*/
public GetTaskDetailResponse getTaskDetail(String taskNo, String unionId){
String url = getClientUrl() + "sign/task/detail";
Map<String, Object> requestData = new HashMap<>();
requestData.put("taskNo", taskNo); // 签署任务编号创建签署任务时生成
requestData.put("unionId", unionId); // 个人/企业在放心签平台的唯一性标识签署方账号
String jsonBody = JSONUtil.toJsonStr(requestData);
log.info("获取app数据参数:{}",jsonBody);
String response = postJson(url,jsonBody,null);
GetTaskDetailResponse result = JSONUtil.toBean(response, GetTaskDetailResponse.class);
if (result.getCode() != 10000){
if (!Objects.equals(result.getMessage(), "")){
throw new BusinessException(result.getMessage());
}else{
throw new BusinessException("失败");
}
}
return result;
}
}

View File

@ -0,0 +1,68 @@
package net.lab1024.sa.admin.extend.fangxinqian.task;
import lombok.Data;
import org.apache.poi.ss.formula.functions.T;
import java.util.List;
@Data
public class GetTaskDetailResponse {
private int code;
private String message;
private GetTaskDetailData data;
private String requestId;
/**
* 详细数据
*/
@Data
public static class GetTaskDetailData {
/**
* 签署详情
*/
private List<contractsData> contracts;
/**
* 签署任务编号创建签署任务时接口返回
*/
private String taskNo;
/**
* 签署任务状态
* -30已过期
* -20已撤销
* -10已拒签
* 0发起签署
* 5待编辑
* 10待签署
* 20已完成
*/
private Integer taskStatus;
}
/**
* 详细数据-合同文件信息
*/
@Data
public static class contractsData {
/**
* 签署任务编号
*/
private String contractNo;
/**
* 签署文件预览地址
*/
private String contractUrl;
/**
* 签署人信息
*/
private List<T> signers;
}
}

View File

@ -0,0 +1,77 @@
package net.lab1024.sa.admin.extend.fangxinqian.task;
import lombok.Data;
import java.util.List;
@Data
public class GetTaskLinkResponse {
private int code;
private String message;
private GetTaskLinkData data;
private String requestId;
/**
* 详细数据
*/
@Data
public static class GetTaskLinkData {
/**
* 签署详情
*/
private List<taskDetailsData> taskDetails;
/**
* 签署任务编号
*/
private String taskNo;
}
/**
* 详细数据-签署详情
*/
@Data
public static class taskDetailsData {
/**
* 签署链接(H5)
*/
private String signH5Url;
/**
* 签署链接(PC)
*/
private String signPCUrl;
/**
* 签署状态
* 1可签署
* 2已签署
* 3拒绝签署
* 9不可签署用于顺序签
*/
private String signStatus;
/**
* 签署顺序
*/
private String sortNum;
/**
* 签署顺序模式
* 1有序
* 2无序
*/
private String sortType;
/**
* 个人/企业在放心签平台的唯一性标识签署方账号
*/
private String unionId;
}
}

View File

@ -0,0 +1,85 @@
package net.lab1024.sa.admin.extend.fangxinqian.task;
import lombok.Data;
import java.util.List;
@Data
public class GetTemplateListResponse {
private int code;
private String message;
private List<GetTemplateListData> data;
private String requestId;
/**
* 详细数据
*/
@Data
public static class GetTemplateListData {
/**
* 参与方
*/
private List<signersData> signers;
/**
* 签署模板编号
*/
private String templateNo;
/**
* 签署模板标题
*/
private String title;
}
/**
* 详细数据 -参与方
*/
@Data
public static class signersData {
/**
* 编辑顺序
*/
private Integer fillOrder;
/**
* 编辑权限 true or false
*/
private boolean fillRole;
/**
* 参与方别名
*/
private String label;
/**
* 是否平台自动落章 true or false
*/
private boolean platFormSign;
/**
* 签署顺序
*/
private Integer signOrder;
/**
* 签署权限 true or false
*/
private boolean signRole;
/**
* 参与方别名标识
*/
private String signerNo;
/**
* 参与方类型 1-个人2-企业
*/
private Integer type;
}
}

View File

@ -6,10 +6,13 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 专家表-白名单实体类
*/
@TableName("`t_caseplatform_expert_white`") // 指定数据库表名
@Data
public class ExpertWhiteEntity {
/**
* 主键
@ -17,12 +20,6 @@ public class ExpertWhiteEntity {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 手机号
*/
@TableField("mobile")
private String mobile;
/**
* 姓名
*/
@ -30,16 +27,16 @@ public class ExpertWhiteEntity {
private String name;
/**
* 头像
* 手机号
*/
@TableField("photo")
private String photo;
@TableField("mobile")
private String mobile;
/**
* 医院uuid
* 状态1:正常 2:无效
*/
@TableField("hospital_uuid")
private String hospitalUuid;
@TableField("status")
private Integer status;
/**
* 医院名称
@ -48,21 +45,33 @@ public class ExpertWhiteEntity {
private String hospitalName;
/**
* ID
* 行政区划代码
*/
@TableField("prov_id")
private Integer provinceId;
@TableField("prov")
private String prov;
/**
* 市ID
* 科室
*/
@TableField("city_id")
private Integer cityId;
@TableField("department")
private String department;
/**
* 区ID
* 职称
*/
@TableField("county_id")
private Integer countyId;
@TableField("title")
private String title;
/**
* 导入的json数据
*/
@TableField("content")
private String content;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
}

View File

@ -3,17 +3,27 @@ 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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.dao.CasePlatformBankDao;
import net.lab1024.sa.admin.module.app.expert.domain.entity.CasePlatformBankEntity;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqExpertTaskEntity;
import net.lab1024.sa.admin.module.app.expert.domain.vo.CasePlatformBankVo;
import net.lab1024.sa.admin.module.app.expert.domain.vo.GetExpertSignVo;
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.app.medicalrecord.domain.MedicalRecordUpdateForm;
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.bankcard.domain.form.CaseplatformBankAddForm;
import net.lab1024.sa.admin.module.business.bankcard.service.CaseplatformBankService;
import net.lab1024.sa.admin.module.business.captcha.service.CaptchaService;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity.CaseplatformAcAppEntity;
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;
@ -21,19 +31,14 @@ 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.common.wangyi.yidun.sdk.BankCardCheckAPI;
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.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
@ -115,6 +120,12 @@ public class ExpertController {
@Autowired
private ExpertWhiteEntityService expertWhiteEntityService;
@Autowired
private CasePlatformBankDao casePlatformBankDao;
@Autowired
private CaseplatformBankService caseplatformBankService;
@ApiOperation("获取验证码")
@GetMapping("/user/getCaptcha")
@NoNeedLogin
@ -227,10 +238,9 @@ public class ExpertController {
Integer city_id = (Integer) data.get("city_id");
// 获取白名单用户-姓名医院名称
ExpertWhiteEntity expertWhiteEntity = expertWhiteEntityService.getExpertWhiteEntityByNameAndHospitalName(name,hospital_name);
ExpertWhiteEntity expertWhiteEntity = expertWhiteEntityService.getExpertWhiteEntityByNameAndHospitalName(mobile,name,hospital_name);
if (expertWhiteEntity == null) {
responseDTO.setMsg("暂无登录权限");
return responseDTO;
return ResponseDTO.error(NO_AUTH);
}
ExpertEntity expert = new ExpertEntity();
@ -250,10 +260,13 @@ public class ExpertController {
ExpertEntity expertVO = expertService.addExpert(expert);
ExpertLoginVO expertLoginVO = SmartBeanUtil.copy(expertVO, ExpertLoginVO.class);
return ResponseDTO.app_ok(expertLoginVO);
}else{
responseDTO.setMsg("账号未注册,请您注册后登陆");
return responseDTO;
}
if (responseDTO.getMsg() == null){
responseDTO.setMsg("登录失败");
}
return responseDTO;
}
@NoNeedLogin
@ -470,10 +483,9 @@ public class ExpertController {
Integer city_id = (Integer) data.get("city_id");
// 获取白名单用户-姓名医院名称
ExpertWhiteEntity expertWhiteEntity = expertWhiteEntityService.getExpertWhiteEntityByNameAndHospitalName(name,hospital_name);
ExpertWhiteEntity expertWhiteEntity = expertWhiteEntityService.getExpertWhiteEntityByNameAndHospitalName(mobile,name,hospital_name);
if (expertWhiteEntity == null) {
responseDTO.setMsg("暂无登录权限");
return responseDTO;
return ResponseDTO.error(NO_AUTH);
}
ExpertEntity expert = new ExpertEntity();
@ -494,9 +506,13 @@ public class ExpertController {
ExpertLoginVO expertLoginVO = SmartBeanUtil.copy(expertVO, ExpertLoginVO.class);
return ResponseDTO.app_ok(expertLoginVO);
}else{
return responseDTO;
}
if (responseDTO.getMsg() == null){
responseDTO.setMsg("登录失败");
}
return responseDTO;
}
@NoNeedLogin
@ -585,4 +601,66 @@ public class ExpertController {
ResponseDTO responseDTO = JSON.parseObject(result, ResponseDTO.class);
return responseDTO;
}
/**
* 获取专家银行卡数据
*/
@ApiOperation(value = "获取专家银行卡数据")
@GetMapping("/user/getBank")
public ResponseDTO<CasePlatformBankVo> getExpertSign() {
Long expertId = SmartRequestUtil.getRequestUserId();
if (expertId == null) {
return ResponseDTO.error(LOGIN_STATE_INVALID);
}
// 获取银行卡数据
LambdaQueryWrapper<CasePlatformBankEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CasePlatformBankEntity::getExpertId, expertId);
CasePlatformBankEntity casePlatformBank = casePlatformBankDao.selectOne(queryWrapper);
CasePlatformBankVo g = SmartBeanUtil.copy(casePlatformBank, CasePlatformBankVo.class);
return ResponseDTO.app_ok(g);
}
/**
* 添加专家银行卡数据
* @return
*/
@ApiOperation(value = "添加专家银行卡数据")
@PostMapping("/user/addBank")
public ResponseDTO<String> bankVerify(@RequestBody @Valid CaseplatformBankAddForm addForm) {
Long expertId = SmartRequestUtil.getRequestUserId();
if (expertId == null) {
return ResponseDTO.error(LOGIN_STATE_INVALID);
}
boolean check = BankCardCheckAPI.check(addForm.getIdCardName(), addForm.getIdCardNo(), addForm.getBankCardNo());
if(check){
return caseplatformBankService.add(addForm);
}else {
return ResponseDTO.error(ExpertBankVerifyFail);
}
}
@ApiOperation("专家活动申请")
@PostMapping("/caseplatformCase/activity")
public ResponseDTO<String> addCaseplatformAcApp() {
Long expertId = SmartRequestUtil.getRequestUserId();
if (expertId == null) {
return ResponseDTO.error(LOGIN_STATE_INVALID);
}
return expertService.addCaseplatformAcApp(expertId);
}
@ApiOperation("专家活动申请查询")
@GetMapping("/caseplatformCase/activity")
public ResponseDTO<CaseplatformAcAppEntity> getCaseplatformAcApp() {
Long expertId = SmartRequestUtil.getRequestUserId();
if (expertId == null) {
return ResponseDTO.error(LOGIN_STATE_INVALID);
}
return expertService.getCaseplatformAcApp(expertId);
}
}

View File

@ -0,0 +1,204 @@
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 com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.extend.fangxinqian.auth.GetAuthorizeResponse;
import net.lab1024.sa.admin.extend.fangxinqian.task.GetTaskLinkResponse;
import net.lab1024.sa.admin.module.app.expert.admin.*;
import net.lab1024.sa.admin.module.app.expert.dao.*;
import net.lab1024.sa.admin.module.app.expert.domain.entity.*;
import net.lab1024.sa.admin.module.app.expert.domain.vo.AddFxqVo;
import net.lab1024.sa.admin.module.app.expert.domain.vo.GetExpertSignVo;
import net.lab1024.sa.admin.module.app.expert.service.ExpertFxqService;
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.bankcard.domain.form.CaseplatformBankAddForm;
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.exception.BusinessException;
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.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.io.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import com.alibaba.fastjson.JSONObject;
import static net.lab1024.sa.common.common.code.UserErrorCode.*;
@Slf4j
@RestController
@Api(tags = {AdminSwaggerTagConst.App.Expert})
public class ExpertFxqController {
@Resource
private FxqExpertTaskDao fxqExpertTaskDao;
@Resource
private ExpertFxqService expertFxqService;
@Resource
private RedisTemplate<String, String> redisTemplate;
@Resource
private FxqUserDao fxqUserDao;
@Resource
private FxqTemplateDao fxqTemplateDao;
@Resource
private ExpertDao expertDao;
@Resource
private FxqSignDao fxqSignDao;
/**
* 获取专家协议签署详情
*/
@ApiOperation(value = "获取专家协议签署详情")
@GetMapping("/expert/sign")
public ResponseDTO<GetExpertSignVo> getExpertSign() {
Long expertId = SmartRequestUtil.getRequestUserId();
if (expertId == null) {
return ResponseDTO.error(LOGIN_STATE_INVALID);
}
GetExpertSignVo g = new GetExpertSignVo();
g.setTaskStatus(2);
// 获取专家协议签署详情
LambdaQueryWrapper<FxqSignEntity> signQueryWrapper = new LambdaQueryWrapper<>();
signQueryWrapper.eq(FxqSignEntity::getExpertId,expertId);
signQueryWrapper.last("LIMIT 1");
FxqSignEntity fxqSign = fxqSignDao.selectOne(signQueryWrapper);
if (fxqSign == null) {
return ResponseDTO.app_ok(g);
}
// 已签署
if (fxqSign.getSignStatus() == 1) {
g.setTaskStatus(1);
g.setTaskFileUrl(fxqSign.getSignLinkH5());
return ResponseDTO.app_ok(g);
}
// 签署任务详情查询
FxqExpertTaskEntity fxqExpertTask = expertFxqService.getTaskDetail(fxqSign.getTaskId());
if (fxqExpertTask == null) {
return ResponseDTO.app_ok(g);
}
// 已签署
if (Objects.equals(fxqExpertTask.getTaskStatus(), "20")) {
g.setTaskStatus(1);
g.setTaskFileUrl(fxqExpertTask.getTaskLinkH5());
return ResponseDTO.app_ok(g);
}
return ResponseDTO.app_ok(g);
}
/**
* 放心签认证
*/
@ApiOperation(value = "放心签认证")
@PostMapping("/expert/fxq")
public ResponseDTO<AddFxqVo> addFxq() {
Long expertId = SmartRequestUtil.getRequestUserId();
if (expertId == null) {
return ResponseDTO.error(LOGIN_STATE_INVALID);
}
// 获取专家数据
ExpertEntity expert = expertDao.getExpert(expertId);
if (expert == null) {
return ResponseDTO.userErrorParam("操作失败");
}
// 获取企业实名认证数据-个人
LambdaQueryWrapper<FxqSignEntity> signQueryWrapper = new LambdaQueryWrapper<>();
signQueryWrapper.eq(FxqSignEntity::getExpertId,expertId);
signQueryWrapper.last("LIMIT 1");
FxqSignEntity fxqSign = fxqSignDao.selectOne(signQueryWrapper);
if (fxqSign != null) {
if (fxqSign.getSignStatus() == 1) {
return ResponseDTO.userErrorParam("您已签订协议,无需再次签订");
}
// 其余状态下去查询签署任务详情获取状态
// 签署任务详情查询
FxqExpertTaskEntity fxqExpertTask = expertFxqService.getTaskDetail(fxqSign.getTaskId());
if (fxqExpertTask != null) {
if (Objects.equals(fxqExpertTask.getTaskStatus(), "20")) {
// 已签署
return ResponseDTO.userErrorParam("您已签订协议,无需再次签订");
}
if (Objects.equals(fxqExpertTask.getTaskStatus(), "10")) {
AddFxqVo g = new AddFxqVo();
g.setTaskStatus(2);
g.setLinkUrl(fxqSign.getSignLinkH5());
return ResponseDTO.app_ok(g);
}
}
}
// 获取企业放心签实名认证数据
FxqCompanyEntity company = expertFxqService.getCompany();
// 获取个人放心签实名认证数据
FxqUserEntity fxqUser = expertFxqService.getPersonal(expertId);
// 获取签署的模版数据
FxqTemplateEntity fxqTemplate = expertFxqService.getTemplate(company.getId());
// 模版签署任务创建
AddFxqVo g = expertFxqService.addTemplateTask(company,fxqUser,fxqTemplate,expert);
return ResponseDTO.app_ok(g);
}
/**
* 获取企业授权地址
*/
@ApiOperation(value = "获取企业授权地址")
@GetMapping("/expert/auth")
public ResponseDTO<String> getCompanyAuth() {
return ResponseDTO.app_ok();
// 以下暂不开放过期时解开授权
// // 获取静默签署的授权
// GetAuthorizeResponse.GetAuthorizeData auth = expertFxqService.getAuthorize("56447a9865aa488caf6036fd00ddcbed");
//
// return ResponseDTO.app_ok(auth.getH5Url());
}
}

View File

@ -31,7 +31,6 @@ public class ExpertSignController {
/**
* 获取专家 签名
* @return
*/
@ApiOperation(value = "获取专家 签名")
@GetMapping("/user/getSign")
@ -39,21 +38,4 @@ public class ExpertSignController {
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);
}
}
}

View File

@ -0,0 +1,13 @@
package net.lab1024.sa.admin.module.app.expert.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.lab1024.sa.admin.module.app.expert.domain.entity.CasePlatformBankEntity;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqExpertTaskEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Mapper
@Component
public interface CasePlatformBankDao extends BaseMapper<CasePlatformBankEntity> {
}

View File

@ -1,13 +1,19 @@
package net.lab1024.sa.admin.module.app.expert.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.lab1024.sa.admin.module.app.expert.admin.ExpertEntity;
import net.lab1024.sa.admin.module.app.expert.admin.ExpertWhiteEntity;
import net.lab1024.sa.admin.module.business.area.domain.vo.ProvVO;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformExpertWhiteQueryForm;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.GetCaseplatformExpertWhitePageVo;
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;
@Mapper
@Component
public interface ExpertWhiteEntityDao extends BaseMapper<ExpertWhiteEntity> {
@ -16,4 +22,13 @@ public interface ExpertWhiteEntityDao extends BaseMapper<ExpertWhiteEntity> {
@Select("SELECT * FROM t_caseplatform_expert_white WHERE name = #{name} AND hospital_name = #{hospitalName}")
ExpertWhiteEntity getExpertWhiteByNameAndHospital(@Param("name")String name, @Param("hospitalName")String hospitalName);
/**
* 分页 查询
*
* @param page
* @param queryForm
* @return
*/
List<GetCaseplatformExpertWhitePageVo> queryPage(Page page, @Param("queryForm") CaseplatformExpertWhiteQueryForm queryForm);
}

View File

@ -0,0 +1,14 @@
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.ExpertSignVO;
import net.lab1024.sa.admin.module.app.expert.admin.ExpertWhiteEntity;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqCompanyEntity;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
@Mapper
@Component
public interface FxqCompanyDao extends BaseMapper<FxqCompanyEntity> {
}

View File

@ -0,0 +1,12 @@
package net.lab1024.sa.admin.module.app.expert.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqExpertTaskEntity;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
@Mapper
@Component
public interface FxqExpertTaskDao extends BaseMapper<FxqExpertTaskEntity> {
}

View File

@ -0,0 +1,20 @@
package net.lab1024.sa.admin.module.app.expert.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqCompanyEntity;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqSignEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
@Mapper
@Component
public interface FxqSignDao extends BaseMapper<FxqSignEntity> {
@Update("UPDATE t_caseplatform_fxq_sign " +
"SET sign_status = #{signStatus}, update_time = NOW() " +
"WHERE expert_id = #{expertId} AND task_id = #{taskId}")
int updateSignStatus(@Param("expertId") Long expertId,
@Param("taskId") Long taskId,
@Param("signStatus") Integer signStatus);
}

View File

@ -0,0 +1,13 @@
package net.lab1024.sa.admin.module.app.expert.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqCompanyEntity;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqTemplateEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Mapper
@Component
public interface FxqTemplateDao extends BaseMapper<FxqTemplateEntity> {
}

View File

@ -0,0 +1,13 @@
package net.lab1024.sa.admin.module.app.expert.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqCompanyEntity;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Mapper
@Component
public interface FxqUserDao extends BaseMapper<FxqUserEntity> {
}

View File

@ -0,0 +1,76 @@
package net.lab1024.sa.admin.module.app.expert.domain.entity;
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;
import java.time.LocalDateTime;
/**
* 病例平台-专家银行卡信息实体类
*/
@TableName("`t_caseplatform_bank`") // 对应数据库表名
@Data
public class CasePlatformBankEntity {
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 专家id
*/
@TableField("expert_id")
private Long expertId;
/**
* 身份证姓名
*/
@TableField("id_card_name")
private String idCardName;
/**
* 身份证号码
*/
@TableField("id_card_no")
private String idCardNo;
/**
* 银行卡号
*/
@TableField("bank_card_no")
private String bankCardNo;
/**
* 开户行名称
*/
@TableField("bank_name")
private String bankName;
/**
* 省ID
*/
@TableField("prov_id")
private Integer provId;
/**
* 市ID
*/
@TableField("city_id")
private Integer cityId;
/**
* 区ID
*/
@TableField("county_id")
private Integer countyId;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,64 @@
package net.lab1024.sa.admin.module.app.expert.domain.entity;
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;
import java.time.LocalDateTime;
/**
* 病例-放心签-公司主体实体类
*/
@TableName("`t_caseplatform_fxq_company`")
@Data
public class FxqCompanyEntity {
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 注册名
*/
@TableField("name")
private String name;
/**
* 接入方用户唯一标识
*/
@TableField("uid")
private String uid;
/**
* 企业主体在放心签平台与接入方关联的唯一性标识
*/
@TableField("union_id")
private String unionId;
/**
* 授权状态1:已授权 2:未授权
*/
@TableField("auth_status")
private Integer authStatus;
/**
* 授权过期日期
*/
@TableField("auth_expire_date")
private LocalDateTime authExpireDate;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
/**
* 修改时间
*/
@TableField("update_time")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,89 @@
package net.lab1024.sa.admin.module.app.expert.domain.entity;
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;
import java.time.LocalDateTime;
/**
* 病例-放心签-签署任务实体类
*/
@Data
@TableName("`t_caseplatform_fxq_expert_task`") // 指定数据库表名
public class FxqExpertTaskEntity {
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 专家id
*/
@TableField("expert_id")
private Long expertId;
/**
* 签署编号
*/
@TableField("task_no")
private String taskNo;
/**
* 签署模板id
*/
@TableField("template_id")
private Long templateId;
/**
* 签署任务状态
* -30已过期
* -20已撤销
* -10已拒签
* 0发起签署
* 5待编辑
* 10待签署
* 20已完成
*/
@TableField("task_status")
private String taskStatus;
/**
* 签署状态1:已签署 2:未签署
*/
@TableField("sign_status")
private Integer signStatus;
/**
* 签署完成时间
*/
@TableField("sign_time")
private LocalDateTime signTime;
/**
* 协议地址-h5
*/
@TableField("task_link_h5")
private String taskLinkH5;
/**
* 协议地址-pc
*/
@TableField("task_link_pc")
private String taskLinkPc;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
/**
* 修改时间
*/
@TableField("update_time")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,64 @@
package net.lab1024.sa.admin.module.app.expert.domain.entity;
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;
import java.time.LocalDateTime;
/**
* 病例-放心签-签署实体类
*/
@TableName("`t_caseplatform_fxq_sign`")
@Data
public class FxqSignEntity {
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 专家id
*/
@TableField("expert_id")
private Long expertId;
/**
* 任务编号
*/
@TableField("task_id")
private Long taskId;
/**
* 签署状态1:已签署 2:未签署
*/
@TableField("sign_status")
private Integer signStatus;
/**
* 协议地址-h5
*/
@TableField("sign_link_h5")
private String signLinkH5;
/**
* 协议地址-pc
*/
@TableField("sign_link_pc")
private String signLinkPc;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
/**
* 修改时间
*/
@TableField("update_time")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,70 @@
package net.lab1024.sa.admin.module.app.expert.domain.entity;
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;
import java.time.LocalDateTime;
/**
* 病例-放心签-签署模板实体类
*/
@TableName("`t_caseplatform_fxq_template`")
@Data
public class FxqTemplateEntity {
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 公司id
*/
@TableField("company_id")
private Long companyId;
/**
* 签署模板编号
*/
@TableField("template_no")
private String templateNo;
/**
* 签署模板标题
*/
@TableField("title")
private String title;
/**
* 参与方别名标识-企业
*/
@TableField("company_signer_no")
private String companySignerNo;
/**
* 参与方别名标识-个人
*/
@TableField("personal_signer_no")
private String personalSignerNo;
/**
* 模板数据
*/
@TableField("content")
private String content;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
/**
* 修改时间
*/
@TableField("update_time")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,58 @@
package net.lab1024.sa.admin.module.app.expert.domain.entity;
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;
import java.time.LocalDateTime;
/**
* 病例-放心签-签署专家主体实体类
*/
@TableName("`t_caseplatform_fxq_user`")
@Data
public class FxqUserEntity {
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 专家id
*/
@TableField("expert_id")
private Long expertId;
/**
* 注册名
*/
@TableField("name")
private String name;
/**
* 接入方用户唯一标识
*/
@TableField("uid")
private String uid;
/**
* 个人在放心签平台与接入方关联的唯一性标识
*/
@TableField("union_id")
private String unionId;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
/**
* 修改时间
*/
@TableField("update_time")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,15 @@
package net.lab1024.sa.admin.module.app.expert.domain.form;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class AddFxqForm {
@ApiModelProperty("UUID")
@NotBlank(message = "UUID 不能为空")
private String uuid;
}

View File

@ -0,0 +1,16 @@
package net.lab1024.sa.admin.module.app.expert.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class AddFxqVo {
/**
* 签署状态1已签署 2未签署
*/
@ApiModelProperty(value = "签署状态", required = true)
private Integer taskStatus;
@ApiModelProperty(value = "链接地址", required = true)
private String linkUrl;
}

View File

@ -0,0 +1,46 @@
package net.lab1024.sa.admin.module.app.expert.domain.vo;
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 com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class CasePlatformBankVo {
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "专家id")
private Long expertId;
@ApiModelProperty(value = "身份证姓名")
private String idCardName;
@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 = "")
@JsonProperty("countyId")
private Integer countyId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,39 @@
package net.lab1024.sa.admin.module.app.expert.domain.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class FxqCompanyVo {
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "注册名")
private String name;
@ApiModelProperty(value = "接入方用户唯一标识")
private String uid;
@ApiModelProperty(value = "企业主体在放心签平台与接入方关联的唯一性标识")
private String unionId;
@ApiModelProperty(value = "授权状态1:已授权 2:未授权)")
private Integer authStatus;
@ApiModelProperty(value = "授权过期日期")
private LocalDateTime authExpireDate;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,43 @@
package net.lab1024.sa.admin.module.app.expert.domain.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class FxqExpertTaskVo {
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "专家id")
private Long expertId;
@ApiModelProperty(value = "签署编号")
private String taskNo;
@ApiModelProperty(value = "签署模板id")
private Long templateId;
@ApiModelProperty(value = "签署任务状态:-30已过期-20已撤销-10已拒签0发起签署5待编辑10待签署20已完成")
private Integer taskStatus;
@ApiModelProperty(value = "签署状态1:已签署 2:未签署)")
private String signStatus;
@ApiModelProperty(value = "签署完成时间")
private LocalDateTime signTime;
@ApiModelProperty(value = "签署协议的预览地址(只有签署成功后才存在)")
private String taskFileUrl;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,37 @@
package net.lab1024.sa.admin.module.app.expert.domain.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class FxqTemplateVo {
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "公司id")
private Long companyId;
@ApiModelProperty(value = "签署模板编号")
private String templateNo;
@ApiModelProperty(value = "签署模板标题")
private String title;
@ApiModelProperty(value = "参与方别名标识")
private String signerNo;
@ApiModelProperty(value = "模板数据")
private String content;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,33 @@
package net.lab1024.sa.admin.module.app.expert.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class FxqUserVo {
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "专家id")
private Long expertId;
@ApiModelProperty(value = "注册名")
private String name;
@ApiModelProperty(value = "接入方用户唯一标识")
private String uid;
@ApiModelProperty(value = "个人在放心签平台与接入方关联的唯一性标识")
private String unionId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,18 @@
package net.lab1024.sa.admin.module.app.expert.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class GetExpertSignVo {
/**
* 签署状态1已签署 2未签署
*/
@ApiModelProperty(value = "签署状态", required = true)
private Integer taskStatus;
@ApiModelProperty(value = "签署协议的预览地址(只有签署成功后才存在)", required = true)
private String taskFileUrl;
}

View File

@ -0,0 +1,522 @@
package net.lab1024.sa.admin.module.app.expert.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import net.lab1024.sa.admin.extend.fangxinqian.auth.Auth;
import net.lab1024.sa.admin.extend.fangxinqian.auth.GetAuthorizeResponse;
import net.lab1024.sa.admin.extend.fangxinqian.company.Company;
import net.lab1024.sa.admin.extend.fangxinqian.company.RegisterPResponse;
import net.lab1024.sa.admin.extend.fangxinqian.personal.Personal;
import net.lab1024.sa.admin.extend.fangxinqian.personal.QueryResponse;
import net.lab1024.sa.admin.extend.fangxinqian.personal.RegisterRequest;
import net.lab1024.sa.admin.extend.fangxinqian.personal.RegisterResponse;
import net.lab1024.sa.admin.extend.fangxinqian.task.*;
import net.lab1024.sa.admin.module.app.expert.admin.ExpertEntity;
import net.lab1024.sa.admin.module.app.expert.dao.*;
import net.lab1024.sa.admin.module.app.expert.domain.entity.*;
import net.lab1024.sa.admin.module.app.expert.domain.vo.AddFxqVo;
import net.lab1024.sa.admin.module.app.expert.domain.vo.GetExpertSignVo;
import net.lab1024.sa.common.common.domain.ResponseDTO;
import net.lab1024.sa.common.common.exception.BusinessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Service
public class ExpertFxqService {
@Resource
private FxqCompanyDao fxqCompanyDao;
@Resource
private ExpertDao expertDao;
@Resource
private FxqUserDao fxqUserDao;
@Resource
private FxqSignDao fxqSignDao;
@Resource
private Company company;
@Resource
private Personal personal;
@Resource
private CasePlatformBankDao casePlatformBankDao;
@Resource
private FxqTemplateDao fxqTemplateDao;
@Resource
private FxqTask fxqTask;
@Resource
private Auth auth;
@Resource
private FxqExpertTaskDao fxqExpertTaskDao;
/**
* 获取企业放心签实名认证数据
*/
@Transactional
public FxqCompanyEntity getCompany(){
try {
// 获取企业实名认证数据-个人
LambdaQueryWrapper<FxqCompanyEntity> personalQueryWrapper = new LambdaQueryWrapper<>();
personalQueryWrapper.eq(FxqCompanyEntity::getUid, "houxinhui");
FxqCompanyEntity personalFxqCompany = fxqCompanyDao.selectOne(personalQueryWrapper);
if (personalFxqCompany == null) {
// 个人实名认证
RegisterRequest r = new RegisterRequest();
r.setUid("houxinhui");
r.setName("侯新晖");
r.setMobile("18610396804");
r.setIdentNo("412901197202131005");
RegisterResponse personalRegister = personal.register(r);
if (personalRegister.getData() == null) {
throw new BusinessException("操作失败");
}
// 添加数据库
FxqCompanyEntity fxqCompanyData = new FxqCompanyEntity();
fxqCompanyData.setName("侯新晖");
fxqCompanyData.setUid("houxinhui");
fxqCompanyData.setUnionId(personalRegister.getData().getUnionId());
fxqCompanyData.setCreateTime(LocalDateTime.now());
int res = fxqCompanyDao.insert(fxqCompanyData);
if (res <= 0){
throw new BusinessException("操作失败");
}
personalFxqCompany = fxqCompanyData;
}
// 获取企业实名认证数据-公司
LambdaQueryWrapper<FxqCompanyEntity> companyQueryWrapper = new LambdaQueryWrapper<>();
companyQueryWrapper.eq(FxqCompanyEntity::getUid, "bjyykxjsfzxh");
FxqCompanyEntity companyFxqCompany = fxqCompanyDao.selectOne(companyQueryWrapper);
if (companyFxqCompany == null) {
RegisterPResponse registerP = company.registerCResponse(personalFxqCompany.getUnionId());
if (registerP.getData() == null) {
throw new BusinessException("操作失败");
}
// 添加数据库
FxqCompanyEntity fxqCompanyData = new FxqCompanyEntity();
fxqCompanyData.setName("北京医药科学技术发展协会");
fxqCompanyData.setUid("bjyykxjsfzxh");
fxqCompanyData.setUnionId(registerP.getData().getUnionId());
fxqCompanyData.setCreateTime(LocalDateTime.now());
int res = fxqCompanyDao.insert(fxqCompanyData);
if (res <= 0){
throw new BusinessException("操作失败");
}
companyFxqCompany = fxqCompanyData;
}
return companyFxqCompany;
} catch (Exception e) {
throw new BusinessException(e.getMessage());
}
}
/**
* 获取个人放心签实名认证数据
*/
@Transactional
public FxqUserEntity getPersonal(Long expertId){
try {
// 获取专家信息
ExpertEntity expert = expertDao.getExpert(expertId);
if (expert == null) {
throw new BusinessException("操作失败");
}
// 获取个人实名认证数据
LambdaQueryWrapper<FxqUserEntity> personalQueryWrapper = new LambdaQueryWrapper<>();
personalQueryWrapper.eq(FxqUserEntity::getExpertId, expertId);
FxqUserEntity fxqUser = fxqUserDao.selectOne(personalQueryWrapper);
if (fxqUser == null) {
// 获取个人银行卡信息
LambdaQueryWrapper<CasePlatformBankEntity> bankQueryWrapper = new LambdaQueryWrapper<>();
bankQueryWrapper.eq(CasePlatformBankEntity::getExpertId, expertId);
CasePlatformBankEntity casePlatformBank = casePlatformBankDao.selectOne(bankQueryWrapper);
if (casePlatformBank == null) {
throw new BusinessException("请绑定银行卡后重试");
}
RegisterRequest r = new RegisterRequest();
String uid = String.format("%010d",casePlatformBank.getExpertId());
r.setUid(uid);
r.setName(casePlatformBank.getIdCardName());
r.setMobile(expert.getMobile());
r.setIdentNo(casePlatformBank.getIdCardNo());
RegisterResponse personalRegister = personal.register(r);
String unionId = "";
if (personalRegister.getCode() == 50005){
// 账号在放心签已存在
QueryResponse personalQuery = personal.query(uid,expert.getMobile());
if (personalQuery.getData() == null) {
throw new BusinessException("实名认证失败");
}
unionId = personalQuery.getData().getUnionId();
}else{
if (personalRegister.getData() == null) {
throw new BusinessException("实名认证失败");
}
unionId = personalRegister.getData().getUnionId();
}
// 添加数据库
FxqUserEntity fxqUserData = new FxqUserEntity();
fxqUserData.setExpertId(casePlatformBank.getExpertId());
fxqUserData.setName(casePlatformBank.getIdCardName());
fxqUserData.setUid(uid);
fxqUserData.setUnionId(unionId);
fxqUserData.setCreateTime(LocalDateTime.now());
int res = fxqUserDao.insert(fxqUserData);
if (res <= 0){
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return null;
}
fxqUser = fxqUserData;
}
return fxqUser;
} catch (Exception e) {
throw new BusinessException(e.getMessage());
}
}
/**
* 获取签署的模版数据
* 这里只会有一个模版获取第一个
*/
@Transactional
public FxqTemplateEntity getTemplate(Long companyId){
try {
// 获取企业实名认证数据-公司
LambdaQueryWrapper<FxqCompanyEntity> companyQueryWrapper = new LambdaQueryWrapper<>();
companyQueryWrapper.eq(FxqCompanyEntity::getUid, "bjyykxjsfzxh");
FxqCompanyEntity companyFxqCompany = fxqCompanyDao.selectOne(companyQueryWrapper);
if (companyFxqCompany == null) {
throw new BusinessException("操作失败4");
}
// 获取数据库模版数据
LambdaQueryWrapper<FxqTemplateEntity> templateQueryWrapper = new LambdaQueryWrapper<>();
templateQueryWrapper.eq(FxqTemplateEntity::getCompanyId, companyId);
List<FxqTemplateEntity> fxqTemplates = fxqTemplateDao.selectList(templateQueryWrapper);
if (fxqTemplates == null || fxqTemplates.isEmpty()){
// 获取企业模版数据
GetTemplateListResponse templateList = fxqTask.getTemplateList(companyFxqCompany.getUnionId());
if (templateList.getData() == null || templateList.getData().isEmpty()) {
throw new BusinessException("操作失败3");
}
for (GetTemplateListResponse.GetTemplateListData data : templateList.getData()) {
if (data.getSigners() == null || data.getSigners().isEmpty()) {
throw new BusinessException("操作失败2");
}
String companySignerNo = "";
String personalSignerNo = "";
// 获取参与方别名标识
for (GetTemplateListResponse.signersData signersData : data.getSigners()) {
if (signersData.getType() == 2){
companySignerNo = signersData.getSignerNo();
}
if (signersData.getType() == 1){
personalSignerNo = signersData.getSignerNo();
}
}
if (Objects.equals(companySignerNo, "") || Objects.equals(personalSignerNo, "")){
throw new BusinessException("操作失败1");
}
// 检测是否存在
LambdaQueryWrapper<FxqTemplateEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FxqTemplateEntity::getTemplateNo, data.getTemplateNo());
FxqTemplateEntity fxqTemplate = fxqTemplateDao.selectOne(queryWrapper);
if (fxqTemplate == null) {
FxqTemplateEntity fxqTemplateData = new FxqTemplateEntity();
fxqTemplateData.setCompanyId(companyId);
fxqTemplateData.setTemplateNo(data.getTemplateNo());
fxqTemplateData.setTitle(data.getTitle());
fxqTemplateData.setCompanySignerNo(companySignerNo);
fxqTemplateData.setPersonalSignerNo(personalSignerNo);
fxqTemplateData.setContent(templateList.getData().toString());
fxqTemplateData.setCreateTime(LocalDateTime.now());
int res = fxqTemplateDao.insert(fxqTemplateData);
if (res <= 0){
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return null;
}
}
}
}
fxqTemplates = fxqTemplateDao.selectList(templateQueryWrapper);
if (fxqTemplates == null || fxqTemplates.isEmpty()) {
throw new BusinessException("操作失败:未找到合适模版");
}
FxqTemplateEntity fxqTemplate = null;
for (FxqTemplateEntity m : fxqTemplates) {
if (m.getTemplateNo().equals("FT1751936689226311")) {
fxqTemplate = m;
break;
}
}
if (fxqTemplate == null) {
throw new BusinessException("操作失败:未找到合适模版");
}
return fxqTemplate;
} catch (Exception e) {
throw new BusinessException(e.getMessage());
}
}
/**
* 获取签署链接
*/
public GetTaskLinkResponse.taskDetailsData getTaskLink(String taskNo, String unionId){
GetTaskLinkResponse taskLink = fxqTask.getTaskLink(taskNo,unionId);
if (taskLink.getData() == null) {
throw new BusinessException("操作失败");
}
if (taskLink.getData().getTaskDetails() == null || taskLink.getData().getTaskDetails().isEmpty()) {
throw new BusinessException("操作失败");
}
return taskLink.getData().getTaskDetails().get(0);
}
/**
* 模版签署任务创建
*/
@Transactional
public AddFxqVo addTemplateTask(FxqCompanyEntity company, FxqUserEntity fxqUser, FxqTemplateEntity fxqTemplate,ExpertEntity expert){
try {
// 授权处理
if (company.getAuthStatus() == 1){
if (company.getAuthExpireDate() != null && company.getAuthExpireDate().isBefore(LocalDateTime.now())) {
// 已授权但已过期
throw new BusinessException("操作失败:请联系客服人员更换授权");
}
}else{
// 未授权
throw new BusinessException("操作失败:请联系客服人员更换授权");
}
// 需创建模版任务
AddTemplateTaskRequest r = new AddTemplateTaskRequest();
r.setUnionId(company.getUnionId());
r.setTemplateNo(fxqTemplate.getTemplateNo());
// 初始化 signers 列表
List<AddTemplateTaskRequest.signersData> signersList = new ArrayList<>();
AddTemplateTaskRequest.signersData signer = new AddTemplateTaskRequest.signersData();
signer.setSignerNo(fxqTemplate.getCompanySignerNo());
signer.setSignerUnionId(company.getUnionId());
signersList.add(signer);
signer = new AddTemplateTaskRequest.signersData();
signer.setSignerNo(fxqTemplate.getPersonalSignerNo());
signer.setSignerUnionId(fxqUser.getUnionId());
signersList.add(signer);
r.setSigners(signersList);
// 初始化 components 列表
List<AddTemplateTaskRequest.componentsData> componentsList = new ArrayList<>();
// 乙方姓名
AddTemplateTaskRequest.componentsData name = new AddTemplateTaskRequest.componentsData();
name.setFileKey("name");
name.setFileValue(fxqUser.getName());
componentsList.add(name);
// 乙方工作单位
AddTemplateTaskRequest.componentsData work = new AddTemplateTaskRequest.componentsData();
work.setFileKey("work");
work.setFileValue(expert.getHospitalName());
componentsList.add(work);
// 乙方联系电话
AddTemplateTaskRequest.componentsData mobile = new AddTemplateTaskRequest.componentsData();
mobile.setFileKey("mobile");
mobile.setFileValue(expert.getMobile());
componentsList.add(mobile);
r.setComponents(componentsList);
AddTemplateTaskResponse templateTask = fxqTask.addTemplateTask(r);
if (templateTask.getData() == null) {
throw new BusinessException("操作失败");
}
if (templateTask.getData().getTaskNo() == null || templateTask.getData().getTaskNo().isEmpty()) {
throw new BusinessException("操作失败");
}
// 获取签署链接
GetTaskLinkResponse.taskDetailsData fxqLink = getTaskLink(templateTask.getData().getTaskNo(),fxqUser.getUnionId());
if (fxqLink == null) {
throw new BusinessException("操作失败");
}
if (!Objects.equals(fxqLink.getSignStatus(), "1")) {
throw new BusinessException("签署状态错误");
}
// 添加数据库-签署任务
FxqExpertTaskEntity fxqExpertTaskData = new FxqExpertTaskEntity();
fxqExpertTaskData.setExpertId(fxqUser.getExpertId());
fxqExpertTaskData.setTaskNo(templateTask.getData().getTaskNo());
fxqExpertTaskData.setTemplateId(fxqTemplate.getId());
fxqExpertTaskData.setTaskStatus("10");
fxqExpertTaskData.setSignStatus(2);
fxqExpertTaskData.setTaskLinkH5(fxqLink.getSignH5Url());
fxqExpertTaskData.setTaskLinkPc(fxqLink.getSignPCUrl());
fxqExpertTaskData.setCreateTime(LocalDateTime.now());
int res = fxqExpertTaskDao.insert(fxqExpertTaskData);
if (res <= 0){
throw new BusinessException("操作失败");
}
LambdaQueryWrapper<FxqSignEntity> signQueryWrapper = new LambdaQueryWrapper<>();
signQueryWrapper.eq(FxqSignEntity::getExpertId,fxqUser.getExpertId());
FxqSignEntity fxqSign = fxqSignDao.selectOne(signQueryWrapper);
if (fxqSign == null) {
// 添加数据库-签署
FxqSignEntity fxqSignData = new FxqSignEntity();
fxqSignData.setExpertId(fxqUser.getExpertId());
fxqSignData.setTaskId(fxqExpertTaskData.getId());
fxqSignData.setSignStatus(2);
fxqSignData.setSignLinkH5(fxqLink.getSignH5Url());
fxqSignData.setSignLinkPc(fxqLink.getSignPCUrl());
fxqSignData.setCreateTime(LocalDateTime.now());
res = fxqSignDao.insert(fxqSignData);
if (res <= 0){
throw new BusinessException("操作失败");
}
}else{
if (fxqSign.getSignStatus() == 1){
// 已签署
throw new BusinessException("操作失败");
}
fxqSign.setTaskId(fxqExpertTaskData.getId());
fxqSign.setSignLinkH5(fxqLink.getSignH5Url());
fxqSign.setSignLinkPc(fxqLink.getSignPCUrl());
fxqSignDao.updateById(fxqSign);
}
if (Objects.equals(templateTask.getData().getTaskNo(), "")){
throw new BusinessException("操作失败");
}
AddFxqVo g = new AddFxqVo();
g.setTaskStatus(2);
g.setLinkUrl(fxqLink.getSignH5Url());
return g;
} catch (Exception e) {
throw new BusinessException(e.getMessage());
}
}
/**
* 签署任务详情查询
*/
public FxqExpertTaskEntity getTaskDetail(Long taskId){
// 获取签署任务
// LambdaQueryWrapper<FxqExpertTaskEntity> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(FxqExpertTaskEntity::getExpertId, expertId);
// queryWrapper.in(FxqExpertTaskEntity::getTaskStatus, "0","10","20");
FxqExpertTaskEntity fxqExpertTask = fxqExpertTaskDao.selectById(taskId);
if (fxqExpertTask == null){
// 未签署
return null;
}
// 已完成
if (Objects.equals(fxqExpertTask.getTaskStatus(), "20")) {
return fxqExpertTask;
}
// 获取企业实名认证数据-公司
LambdaQueryWrapper<FxqCompanyEntity> companyQueryWrapper = new LambdaQueryWrapper<>();
companyQueryWrapper.eq(FxqCompanyEntity::getUid, "bjyykxjsfzxh");
FxqCompanyEntity companyFxqCompany = fxqCompanyDao.selectOne(companyQueryWrapper);
if (companyFxqCompany == null) {
throw new BusinessException("操作失败");
}
GetTaskDetailResponse taskLink = fxqTask.getTaskDetail(fxqExpertTask.getTaskNo(),companyFxqCompany.getUnionId());
if (taskLink.getData() == null) {
throw new BusinessException("操作失败");
}
// 修改签署状态
if (taskLink.getData().getTaskNo() == null || taskLink.getData().getTaskNo().isEmpty()) {
throw new BusinessException("操作失败");
}
if (!taskLink.getData().getTaskNo().equals(fxqExpertTask.getTaskNo())){
throw new BusinessException("操作失败");
}
// 修改状态-签署任务
fxqExpertTask.setTaskStatus(String.valueOf(taskLink.getData().getTaskStatus()));
// 修改专家签署任务表
if (taskLink.getData().getTaskStatus() == 20){
int rows = fxqSignDao.updateSignStatus(fxqExpertTask.getExpertId(), taskId,1);
if (rows == 0) {
throw new BusinessException("更新失败,未找到符合条件的记录");
}
fxqExpertTask.setSignStatus(1);
}
fxqExpertTaskDao.updateById(fxqExpertTask);
return fxqExpertTask;
}
/**
* 获取静默签署的授权
*/
public GetAuthorizeResponse.GetAuthorizeData getAuthorize(String unionId){
GetAuthorizeResponse result = auth.getAuthorize(unionId);
if (result.getData() == null) {
throw new BusinessException("操作失败");
}
if (result.getData().getH5Url() == null || result.getData().getH5Url().isEmpty()) {
throw new BusinessException("操作失败");
}
return result.getData();
}
}

View File

@ -1,10 +1,14 @@
package net.lab1024.sa.admin.module.app.expert.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.app.medicalrecord.domain.MedicalRecordEntity;
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
import net.lab1024.sa.admin.module.business.caseplatformcase.dao.CaseplatformAcAppDao;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity.CaseplatformAcAppEntity;
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;
@ -17,6 +21,9 @@ import net.lab1024.sa.common.module.support.token.LoginDeviceEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.Arrays;
@Service
public class ExpertService {
@ -31,6 +38,11 @@ public class ExpertService {
@Autowired
private CaseplatformAcAppDao caseplatformAcAppDao;
/**
* 根据id 查询
@ -78,5 +90,42 @@ public class ExpertService {
return addForm;
}
/**
* 专家活动申请
*/
public ResponseDTO<String> addCaseplatformAcApp(Long expertId) {
LambdaQueryWrapper<CaseplatformAcAppEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CaseplatformAcAppEntity::getExpertId,expertId);
CaseplatformAcAppEntity caseplatformAcApp = caseplatformAcAppDao.selectOne(queryWrapper);
if (caseplatformAcApp != null) {
return ResponseDTO.app_ok();
}
LambdaQueryWrapper<MedicalRecordEntity> caseCountQueryWrapper = new LambdaQueryWrapper<>();
caseCountQueryWrapper.eq(MedicalRecordEntity::getExpertId,expertId);
caseCountQueryWrapper.eq(MedicalRecordEntity::getStatus, 1);
Long caseCount = medicalRecorDao.selectCount(caseCountQueryWrapper);
if (caseCount < 2){
return ResponseDTO.userErrorParam("病例审核通过2份及以上可申请病例交流活动");
}
CaseplatformAcAppEntity caseplatformAcAppData = new CaseplatformAcAppEntity();
caseplatformAcAppData.setExpertId(expertId);
caseplatformAcAppData.setStatus(2);
caseplatformAcAppData.setCreateTime(LocalDateTime.now());
caseplatformAcAppDao.insert(caseplatformAcAppData);
return ResponseDTO.app_ok();
}
/**
* 专家活动申请-查询
*/
public ResponseDTO<CaseplatformAcAppEntity> getCaseplatformAcApp(Long expertId) {
LambdaQueryWrapper<CaseplatformAcAppEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CaseplatformAcAppEntity::getExpertId,expertId);
CaseplatformAcAppEntity caseplatformAcApp = caseplatformAcAppDao.selectOne(queryWrapper);
return ResponseDTO.app_ok(caseplatformAcApp);
}
}

View File

@ -1,10 +1,12 @@
package net.lab1024.sa.admin.module.app.expert.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.expert.domain.entity.CasePlatformBankEntity;
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;
@ -26,12 +28,26 @@ public class ExpertWhiteEntityService {
* @param hospitalName 专家所属医院名称
* @return 白名单类
*/
public ExpertWhiteEntity getExpertWhiteEntityByNameAndHospitalName(String name, String hospitalName) {
if (name == null || hospitalName == null) {
public ExpertWhiteEntity getExpertWhiteEntityByNameAndHospitalName(String mobile,String name, String hospitalName) {
if ((name == null || hospitalName == null) && mobile == null) {
return null;
}
return expertWhiteEntityDao.getExpertWhiteByNameAndHospital(name, hospitalName);
if (mobile != null){
LambdaQueryWrapper<ExpertWhiteEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ExpertWhiteEntity::getMobile, mobile);
queryWrapper.eq(ExpertWhiteEntity::getStatus, 1);
ExpertWhiteEntity expertWhite = expertWhiteEntityDao.selectOne(queryWrapper);
if (expertWhite != null) {
return expertWhite;
}
}
LambdaQueryWrapper<ExpertWhiteEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ExpertWhiteEntity::getName, name);
queryWrapper.eq(ExpertWhiteEntity::getHospitalName, hospitalName);
queryWrapper.eq(ExpertWhiteEntity::getStatus, 1);
return expertWhiteEntityDao.selectOne(queryWrapper);
}
}

View File

@ -0,0 +1,72 @@
package net.lab1024.sa.admin.module.app.file.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
import net.lab1024.sa.admin.extend.baidubce.Ocr;
import net.lab1024.sa.admin.module.app.file.domain.form.GetIdCardOcrForm;
import net.lab1024.sa.admin.module.app.file.domain.form.GetImageOcrForm;
import net.lab1024.sa.admin.module.app.file.domain.vo.GetIdCardOcrVo;
import net.lab1024.sa.admin.module.app.file.domain.vo.GetImageOcrVo;
import net.lab1024.sa.admin.module.app.file.service.OcrService;
import net.lab1024.sa.admin.module.business.bankcard.domain.form.CaseplatformBankAddForm;
import net.lab1024.sa.common.common.domain.ResponseDTO;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Base64;
@RestController
@Api(tags = {AdminSwaggerTagConst.App.OSS})
public class ImageController {
@Resource
private OcrService ocrService;
@ApiOperation(value = "身份证识别-ocr")
@PostMapping("/ocr/idCard")
public ResponseDTO<GetIdCardOcrVo> getIdCardOcr(
@RequestBody @Valid GetIdCardOcrForm form
){
if (form.getFrontBase64() == null || form.getFrontBase64().isEmpty()) {
return ResponseDTO.userErrorParam("参数错误");
}
try {
// 解码 Base64 字符串为字节数组
byte[] frontBytes = Base64.getDecoder().decode(form.getFrontBase64());
// 调用 Service
GetIdCardOcrVo result = ocrService.getIdCardOcr(frontBytes);
return ResponseDTO.app_ok(result);
} catch (Exception e) {
return ResponseDTO.userErrorParam("识别失败:" + e.getMessage());
}
}
@ApiOperation(value = "通用文字识别-ocr")
@PostMapping("/ocr/image")
public ResponseDTO<GetImageOcrVo> getImageOcr(
@RequestBody @Valid GetImageOcrForm form
){
if (form.getImageBase64() == null || form.getImageBase64().isEmpty()) {
return ResponseDTO.userErrorParam("参数错误");
}
try {
// 解码 Base64 字符串为字节数组
byte[] imageBytes = Base64.getDecoder().decode(form.getImageBase64());
// 调用 Service
GetImageOcrVo result = ocrService.getImageOcr(imageBytes);
return ResponseDTO.app_ok(result);
} catch (Exception e) {
return ResponseDTO.userErrorParam("识别失败:" + e.getMessage());
}
}
}

View File

@ -46,7 +46,8 @@ public class OSSFileController {
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;
String dir = ossFileType.getDesc() + File.separator + "images/";
// String dir = ossFileType.getDesc() + File.separator + requestUserId + File.separator;
// callbackUrl为 上传回调服务器的URL请将下面的IP和Port配置为您自己的真实信息
OSSClient client = new OSSClient(endpoint, accessKey, secretKey);
try {
@ -70,4 +71,35 @@ public class OSSFileController {
return ResponseDTO.userErrorParam();
}
}
@ApiOperation(value = "获取上传文件 Policy ", notes="type==1 普通type==2 签名图片")
@GetMapping("/file/getOSSPolicy/admin/{type}")
public ResponseDTO<OSSPolicyVO> getOSSPolicyAdmin(@PathVariable int type){
OSSFileTypeEnum ossFileType = OSSFileTypeEnum.getByVal(type);
Long requestUserId = SmartRequestUtil.getRequestUserId();
String dir = ossFileType.getDesc() + File.separator + "images/";
// 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.ok(policyVO);
} catch (Exception e) {
e.printStackTrace();
return ResponseDTO.userErrorParam();
}
}
}

View File

@ -0,0 +1,13 @@
package net.lab1024.sa.admin.module.app.file.domain.form;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class GetIdCardOcrForm {
@ApiModelProperty("身份证正面")
@NotBlank(message = "身份证正面 不能为空")
private String frontBase64;
}

View File

@ -0,0 +1,13 @@
package net.lab1024.sa.admin.module.app.file.domain.form;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class GetImageOcrForm {
@ApiModelProperty("图片")
@NotBlank(message = "图片 不能为空")
private String imageBase64;
}

View File

@ -0,0 +1,16 @@
package net.lab1024.sa.admin.module.app.file.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class GetIdCardOcrVo {
@ApiModelProperty(value = "身份证姓名")
private String idCardName;
@ApiModelProperty(value = "身份证号")
private String idCardNo;
}

View File

@ -0,0 +1,24 @@
package net.lab1024.sa.admin.module.app.file.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Size;
import java.util.List;
@Data
public class GetImageOcrVo {
@ApiModelProperty(value = "识别结果数表示words_result的元素个数")
private String wordsResultNum;
@ApiModelProperty(value = "定位和识别结果数组")
private List<wordsResultData> wordsResult;
@Data
public static class wordsResultData {
@JsonProperty("words")
private String words; // 识别结果字符串
}
}

View File

@ -0,0 +1,122 @@
package net.lab1024.sa.admin.module.app.file.service;
import net.lab1024.sa.admin.extend.baidubce.Ocr;
import net.lab1024.sa.admin.extend.fangxinqian.company.Company;
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.app.file.domain.vo.GetIdCardOcrVo;
import net.lab1024.sa.admin.module.app.file.domain.vo.GetImageOcrVo;
import net.lab1024.sa.common.common.exception.BusinessException;
import net.lab1024.sa.common.common.util.SmartRequestUtil;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
public class OcrService {
@Resource
private Ocr ocr;
/**
* 身份证识别
*/
public GetIdCardOcrVo getIdCardOcr(byte[] frontBytes) {
try {
// 正面
JSONObject result = ocr.idCard(frontBytes,"front");
String imageStatus = result.getString("image_status");
switch (imageStatus) {
case "normal":
// 识别正常继续处理
break;
case "reversed_side":
throw new BusinessException("身份证未摆正,请重新上传");
case "non_idcard":
throw new BusinessException("上传的图片中不包含身份证,请上传正确图片");
case "blurred":
throw new BusinessException("身份证模糊,请重新上传清晰图片");
case "over_exposure":
throw new BusinessException("身份证关键字段反光或过曝,请重新拍摄");
case "unknown":
default:
throw new BusinessException("无法识别身份证,请重新上传");
}
if (result.has("risk_type")) {
String riskType = result.getString("risk_type");
if (!"normal".equals(riskType)) {
switch (riskType) {
case "copy":
throw new BusinessException("检测到复印件身份证,请上传原件");
case "temporary":
throw new BusinessException("检测到临时身份证,请上传正式身份证");
case "screen":
throw new BusinessException("检测到翻拍身份证,请上传原件照片");
case "unknow":
default:
throw new BusinessException("身份证真实性存疑,请重新上传");
}
}
}
// 解析识别结果
String name = result.getJSONObject("words_result").getJSONObject("姓名").getString("words");
String idNo = result.getJSONObject("words_result").getJSONObject("公民身份号码").getString("words");
// 构建返回对象
GetIdCardOcrVo vo = new GetIdCardOcrVo();
vo.setIdCardName(name);
vo.setIdCardNo(idNo);
return vo;
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
/**
* 通用文字识别
*/
public GetImageOcrVo getImageOcr(byte[] imageBytes) {
try {
JSONObject result = ocr.image(imageBytes);
// 校验返回是否包含识别内容
int resultNum = result.optInt("words_result_num", 0);
if (resultNum == 0 || !result.has("words_result")) {
throw new BusinessException("识别失败:未检测到有效文字");
}
JSONArray wordsArray = result.getJSONArray("words_result");
List<GetImageOcrVo.wordsResultData> wordList = new ArrayList<>();
for (int i = 0; i < wordsArray.length(); i++) {
JSONObject wordObj = wordsArray.getJSONObject(i);
String word = wordObj.optString("words", "");
if (!word.isEmpty()) {
GetImageOcrVo.wordsResultData data = new GetImageOcrVo.wordsResultData();
data.setWords(word);
wordList.add(data);
}
}
if (wordList.isEmpty()) {
throw new BusinessException("识别失败:没有提取到有效文字");
}
GetImageOcrVo vo = new GetImageOcrVo();
vo.setWordsResultNum(String.valueOf(wordList.size()));
vo.setWordsResult(wordList);
return vo;
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
}

View File

@ -3,23 +3,19 @@ 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.domain.*;
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 net.lab1024.sa.common.common.util.SmartRequestUtil;
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 org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import static net.lab1024.sa.common.common.code.UserErrorCode.LOGIN_STATE_INVALID;
@RestController
@Api(tags = {AdminSwaggerTagConst.App.MedicalRecord})
public class MedicalRecordController {
@ -46,7 +42,7 @@ public class MedicalRecordController {
@ApiOperation(value = "添加病历")
@PostMapping("/medicalRecord/add")
public ResponseDTO<String> add(@RequestBody @Valid MedicalRecordAddForm addForm) {
public ResponseDTO<String> add(@RequestBody @Validated() MedicalRecordAddForm addForm) {
return medicalRecordService.add(addForm);
}
@ -56,4 +52,14 @@ public class MedicalRecordController {
return medicalRecordService.update(updateForm);
}
@ApiOperation("获取有效病例数量")
@GetMapping("/medicalRecord/count")
public ResponseDTO<Long> getMedicalRecordCount(@Valid @ModelAttribute GetMedicalRecordCountForm form) {
Long expertId = SmartRequestUtil.getRequestUserId();
if (expertId == null) {
return ResponseDTO.error(LOGIN_STATE_INVALID);
}
return medicalRecordService.getMedicalRecordCount(form,expertId);
}
}

View File

@ -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.MedicalRecordPrognosisEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Mapper
@Component
public interface MedicalRecorPrognosisDao extends BaseMapper<MedicalRecordPrognosisEntity> {
@Delete("delete from t_caseplatform_case_prognosis where case_id=#{medicalRecordId}")
int deleteByCaseId(Long medicalRecordId);
}

View File

@ -9,6 +9,11 @@ import java.time.LocalDateTime;
@Data
public class DpmsAddForm {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "id")
private Long dpmasId;
@ApiModelProperty(value = "治疗时间", required = true)
@NotNull(message = "治疗时间 不能为空")
@ -18,4 +23,9 @@ public class DpmsAddForm {
@NotNull(message = "治疗图片 不能为空")
@Length(min = 1, max = 1000, message = "治疗图片 不能为空")
private String dpmasImg;
@ApiModelProperty(value = "治疗内容", required = true)
@NotNull(message = "治疗内容 不能为空")
@Length(min = 1, max = 1000, message = "治疗内容 不能为空")
private String content;
}

View File

@ -0,0 +1,15 @@
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 GetMedicalRecordCountForm {
@ApiModelProperty(value = "类型", required = true)
@NotNull(message = "类型 不能为空")
private Integer type = 1;
}

View File

@ -34,11 +34,6 @@ public class MedicalRecordAbstracEntity {
*/
private String abstractStr;
/**
* 病历摘要 图片
*/
private String abstractImg;
/**
* 创建时间
*/
@ -49,10 +44,10 @@ public class MedicalRecordAbstracEntity {
*/
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;
}
// public MedicalRecordAbstracEntity(Long caseId, String abstractStr, String abstractImg, LocalDateTime createTime) {
// this.caseId = caseId;
// this.abstractStr = abstractStr;
// this.abstractImg = abstractImg;
// this.createTime = createTime;
// }
}

View File

@ -5,6 +5,7 @@ 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.DischargeStatusEnum;
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;
@ -13,7 +14,9 @@ import org.hibernate.validator.constraints.Range;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@ -25,18 +28,19 @@ public class MedicalRecordAddForm {
/*************************基本信息***************************/
@ApiModelProperty(value = "患者姓名", required = true)
@NotNull(message = "患者姓名 不能为空")
@NotBlank(message = "患者姓名 不能为空")
@Length(min = 1, max = 20, message = "患者姓名 的长度为在1-20")
private String name;
@ApiModelProperty(value = "患者id", required = true)
@NotNull(message = "患者id 不能为空")
@NotBlank(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;
@NotBlank(message = "患者性别 不能为空")
private String sex;
@ApiModelProperty(value = "年龄", required = true)
@NotNull(message = "年龄 不能为空")
@ -47,69 +51,70 @@ public class MedicalRecordAddForm {
@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 caseType;
@ApiModelProperty(value = "基本信息图片", required = true)
@NotNull(message = "基本信息图片 不能为空")
@Length(min = 1, max = 1000, message = "基本信息图片 不能为空")
private String baseImg;
@ApiModelProperty(value = "主要诊断", required = true)
@NotBlank(message = "主要诊断 不能为空")
private String mainDiagnose;
@ApiModelProperty(value = "患者病因", required = true)
@NotBlank(message = "患者病因 不能为空")
private String diseaseCause;
@ApiModelProperty(value = "诱因", required = true)
private String seductionReason;
/*************************临床资料 病历摘要***************************/
@ApiModelProperty(value = "临床资料 病历摘要 文字", required = true)
@NotBlank(message = "临床资料 病历摘要 不能为空")
private String abstractStr;
@ApiModelProperty(value = "临床资料 病历摘要 图片", required = true)
private String abstractImg;
/*************************DPMAS***************************/
@ApiModelProperty(value = "DPMAS", required = true)
@ApiModelProperty(value = "人工肝治疗", required = true)
@NotNull(message = "DPMAS 不能为空")
@Valid
private List<DpmsAddForm> dpmas;
/*************************实验室数据***************************/
@ApiModelProperty(value = "治疗前 检测时间", required = true)
@NotNull(message = "治疗前 检测时间 不能为空")
@ApiModelProperty(value = "首次人工肝治疗前检测时间", required = true)
@NotNull(message = "首次人工肝治疗前检测时间 不能为空")
private LocalDateTime headTime;
/**
* 治疗后 检测时间
*/
@ApiModelProperty(value = "治疗后 检测时间 ", required = true)
@NotNull(message = "治疗后 检测时间 不能为空")
@ApiModelProperty(value = "首次人工肝治疗后检测时间 ", required = true)
@NotNull(message = "首次人工肝治疗后检测时间 不能为空")
private LocalDateTime afterTime;
/**
* 最后一次治疗后 检测时间
*/
@ApiModelProperty(value = "最后一次人工肝治疗后检测时间 检测时间 ", required = true)
private LocalDateTime lastTime;
/**
* 治疗前 总胆红素(umol/L)
*/
@ApiModelProperty(value = "治疗前 总胆红素", required = true)
@NotNull(message = "治疗前 总胆红素 不能为空")
@Length(min = 1, max = 10, message = "治疗前 总胆红素 输入不合法")
@NotBlank(message = "治疗前 总胆红素 不能为空")
private String headTb;
/**
* 治疗后 总胆红素(umol/L)
*/
@ApiModelProperty(value = "治疗后 总胆红素 ", required = true)
@NotNull(message = "治疗后 总胆红素 不能为空")
@Length(min = 1, max = 10, message = "治疗后 总胆红素 输入不合法")
@NotBlank(message = "治疗后 总胆红素 不能为空")
private String afterTb;
/**
* 治疗前 白蛋白(g/L)
* 最后一次治疗后 总胆红素(umol/L)
*/
@ApiModelProperty(value = "治疗前 白蛋白", required = true)
private String headAlb;
/**
* 治疗后 白蛋白(g/L)
*/
@ApiModelProperty(value = "治疗后 白蛋白 ", required = true)
private String afterAlb;
@ApiModelProperty(value = "最后一次治疗后 总胆红素 ", required = true)
private String lastTb;
/**
* 治疗前 直接胆红素(umol/L)
@ -123,6 +128,69 @@ public class MedicalRecordAddForm {
@ApiModelProperty(value = "治疗后 直接胆红素 ", required = true)
private String afterDb;
/**
* 最后一次治疗后 直接胆红素(umol/L)
*/
@ApiModelProperty(value = "最后一次治疗后 直接胆红素 ", required = true)
private String lastDb;
/**
* 治疗前 丙氨酸氨基转移酶(U/L)
*/
@ApiModelProperty(value = "治疗前 丙氨酸氨基转移酶", required = true)
@NotBlank(message = "治疗前 丙氨酸氨基转移酶 不能为空")
private String headAlt;
/**
* 治疗后 丙氨酸氨基转移酶 (U/L)
*/
@ApiModelProperty(value = "治疗后 丙氨酸氨基转移酶 ", required = true)
@NotBlank(message = "治疗后 丙氨酸氨基转移酶 不能为空")
private String afterAlt;
/**
* 最后一次治疗后 丙氨酸氨基转移酶 (U/L)
*/
@ApiModelProperty(value = "最后一次治疗后 丙氨酸氨基转移酶 ", required = true)
private String lastAlt;
/**
* 治疗前 天门冬氨酸氨基转移酶 (U/L)
*/
@ApiModelProperty(value = "治疗前 天门冬氨酸氨基转移酶", required = true)
@NotBlank(message = "治疗前 天门冬氨酸氨基转移酶 不能为空")
private String headAst;
/**
* 治疗后 天门冬氨酸氨基转移酶 (U/L)
*/
@ApiModelProperty(value = "治疗后 天门冬氨酸氨基转移酶 ", required = true)
private String afterAst;
/**
* 最后一次治疗后 天门冬氨酸氨基转移酶 (U/L)
*/
@ApiModelProperty(value = "最后一次治疗后 天门冬氨酸氨基转移酶 ", required = true)
private String lastAst;
/**
* 治疗前 白蛋白(g/L)
*/
@ApiModelProperty(value = "治疗前 白蛋白", required = true)
private String headAlb;
/**
* 治疗后 白蛋白(g/L)
*/
@ApiModelProperty(value = "治疗后 白蛋白 ", required = true)
private String afterAlb;
/**
* 最后一次治疗后 白蛋白(g/L)
*/
@ApiModelProperty(value = "最后一次治疗后 白蛋白 ", required = true)
private String lastAlb;
/**
* 治疗前 凝血酶原活动度 (%)
*/
@ -136,48 +204,48 @@ public class MedicalRecordAddForm {
private String afterPta;
/**
* 治疗前 间接胆红素(umol/L)
* 最后一次治疗后 凝血酶原活动度 (%)
*/
@ApiModelProperty(value = "治疗前 间接胆红素", required = true)
private String headIb;
/**
* 治疗后 间接胆红素(umol/L)
*/
@ApiModelProperty(value = "治疗后 间接胆红素 ", required = true)
private String afterIb;
@ApiModelProperty(value = "最后一次治疗后 凝血酶原活动度 ", required = true)
private String lastPta;
/**
* 治疗前 国际标准化比值 INR
*/
@ApiModelProperty(value = "治疗前 国际标准化比值", required = true)
@NotNull(message = "治疗前 国际标准化比值 不能为空")
@Length(min = 1, max = 10, message = "治疗前 国际标准化比值 输入不合法")
@NotBlank(message = "治疗前 国际标准化比值 不能为空")
private String headInr;
/**
* 治疗后 国际标准化比值 INR
*/
@ApiModelProperty(value = "治疗后 国际标准化比值 ", required = true)
@NotNull(message = "治疗后 国际标准化比值 不能为空")
@Length(min = 1, max = 10, message = "治疗后 国际标准化比值 输入不合法")
@NotBlank(message = "治疗后 国际标准化比值 不能为空")
private String afterInr;
/**
* 治疗前 谷丙转氨 (U/L)
* 最后一次治疗后 国际标准化比值 INR
*/
@ApiModelProperty(value = "治疗前 谷丙转氨", required = true)
@NotNull(message = "治疗前 谷丙转氨 不能为空")
@Length(min = 1, max = 10, message = "治疗前 谷丙转氨 输入不合法")
private String headAlt;
@ApiModelProperty(value = "最后一次治疗后 国际标准化比值 ", required = true)
private String lastInr;
/**
* 治疗 谷丙转氨 (U/L)
* 治疗 C反应蛋白mg/L
*/
@ApiModelProperty(value = "治疗后 谷丙转氨 ", required = true)
@NotNull(message = "治疗后 谷丙转氨 不能为空")
@Length(min = 1, max = 10, message = "治疗后 谷丙转氨 输入不合法")
private String afterAlt;
@ApiModelProperty(value = "治疗前 C反应蛋白", required = true)
private String headCrp;
/**
* 治疗后 C反应蛋白mg/L
*/
@ApiModelProperty(value = "治疗后 C反应蛋白 ", required = true)
private String afterCrp;
/**
* 最后一次治疗后 C反应蛋白mg/L
*/
@ApiModelProperty(value = "最后一次治疗后 C反应蛋白 ", required = true)
private String lastCrp;
/**
* 治疗前 白介素6(ng/L)
@ -192,20 +260,16 @@ public class MedicalRecordAddForm {
private String afterIl6;
/**
* 治疗前 谷草转氨酶 (U/L)
* 最后一次治疗后 白介素6(ng/L)
*/
@ApiModelProperty(value = "治疗前 谷草转氨酶", required = true)
@NotNull(message = "治疗前 谷草转氨酶 不能为空")
@Length(min = 1, max = 10, message = "治疗前 谷草转氨酶 输入不合法")
private String headAst;
@ApiModelProperty(value = "最后一次治疗后 白介素6 ", required = true)
private String lastIl6;
/**
* 治疗后 谷草转氨酶 (U/L)
* 白介素单位
*/
@ApiModelProperty(value = "治疗后 谷草转氨酶 ", required = true)
@NotNull(message = "治疗后 谷草转氨酶 不能为空")
@Length(min = 1, max = 10, message = "治疗后 谷草转氨酶 输入不合法")
private String afterAst;
@ApiModelProperty(value = "白介素单位")
private String il6Unit;
/**
* 治疗前 肿瘤坏死因子αμg/L
@ -219,8 +283,43 @@ public class MedicalRecordAddForm {
@ApiModelProperty(value = "治疗后 肿瘤坏死因子α ", required = true)
private String afterTnf;
@ApiModelProperty(value = "实验室检测 图片 图片", required = true)
@NotNull(message = "实验室检测 图片 不能为空")
@Length(min = 1, max = 1000, message = "实验室检测 图片 不能为空")
private String checkImg;
/**
* 最后一次治疗后 肿瘤坏死因子αμg/L
*/
@ApiModelProperty(value = "最后一次治疗后 肿瘤坏死因子α ", required = true)
private String lastTnf;
/**
* 肿瘤坏死因子α单位
*/
@ApiModelProperty(value = "肿瘤坏死因子α单位")
private String tnfUnit;
@ApiModelProperty(value = "生化指标 图片", required = true)
@NotBlank(message = "报告单 生化指标 不能为空")
private String bioImg;
@ApiModelProperty(value = "凝血功能指标 图片", required = true)
@NotBlank(message = "报告单 凝血功能指标 不能为空")
private String coaImg;
@ApiModelProperty(value = "炎症因子指标 图片")
private String infImg;
/*************************疾病转归***************************/
@ApiModelProperty(value = "疾病转归 出院时间", required = true)
@NotNull(message = "疾病转归 出院时间 不能为空")
private LocalDateTime dischargeTime;
@ApiModelProperty(value = "住院天数", required = true)
@NotBlank(message = "住院天数 不能为空")
private String day;
@ApiModelPropertyEnum(DischargeStatusEnum.class)
@CheckEnum(value = DischargeStatusEnum.class, message = "出院状态 错误")
private String dischargeStatus;
@ApiModelProperty(value = "疾病转归 出院情况", required = true)
@NotBlank(message = "疾病转归 出院情况 不能为空")
private String dischargeSituation;
}

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
@ -18,7 +19,6 @@ import lombok.Data;
@Data
@TableName("t_caseplatform_case_checkdata")
@Builder
public class MedicalRecordCheckdataEntity {
/**
@ -42,6 +42,11 @@ public class MedicalRecordCheckdataEntity {
*/
private LocalDateTime afterTime;
/**
* 最后一次治疗后 检测时间
*/
private LocalDateTime lastTime;
/**
* 治疗前 总胆红素(umol/L)
*/
@ -52,6 +57,11 @@ public class MedicalRecordCheckdataEntity {
*/
private String afterTb;
/**
* 最后一次治疗后 总胆红素(umol/L)
*/
private String lastTb;
/**
* 治疗前 白蛋白(g/L)
*/
@ -62,6 +72,11 @@ public class MedicalRecordCheckdataEntity {
*/
private String afterAlb;
/**
* 最后一次治疗后 白蛋白(g/L)
*/
private String lastAlb;
/**
* 治疗前 直接胆红素(umol/L)
*/
@ -72,6 +87,11 @@ public class MedicalRecordCheckdataEntity {
*/
private String afterDb;
/**
* 最后一次治疗后 直接胆红素(umol/L)
*/
private String lastDb;
/**
* 治疗前 凝血酶原活动度 (%)
*/
@ -83,14 +103,9 @@ public class MedicalRecordCheckdataEntity {
private String afterPta;
/**
* 治疗前 间接胆红素(umol/L)
* 最后一次治疗后 凝血酶原活动度 (%)
*/
private String headIb;
/**
* 治疗后 间接胆红素(umol/L)
*/
private String afterIb;
private String lastPta;
/**
* 治疗前 国际标准化比值 INR
@ -102,6 +117,11 @@ public class MedicalRecordCheckdataEntity {
*/
private String afterInr;
/**
* 最后一次治疗后 国际标准化比值 INR
*/
private String lastInr;
/**
* 治疗前 谷丙转氨 (U/L)
*/
@ -112,6 +132,31 @@ public class MedicalRecordCheckdataEntity {
*/
private String afterAlt;
/**
* 最后一次治疗后 谷丙转氨 (U/L)
*/
private String lastAlt;
/**
* 治疗前 C反应蛋白mg/L
*/
private String headCrp;
/**
* 治疗后 C反应蛋白mg/L
*/
private String afterCrp;
/**
* 最后一次治疗后 C反应蛋白mg/L
*/
private String lastCrp;
/**
* 治疗前 白介素6(ng/L)
*/
@ -122,6 +167,16 @@ public class MedicalRecordCheckdataEntity {
*/
private String afterIl6;
/**
* 最后一次治疗后 白介素6(ng/L)
*/
private String lastIl6;
/**
* 白介素单位
*/
private String il6Unit;
/**
* 治疗前 谷草转氨酶 (U/L)
*/
@ -132,6 +187,11 @@ public class MedicalRecordCheckdataEntity {
*/
private String afterAst;
/**
* 最后一次治疗后 谷草转氨酶 (U/L)
*/
private String lastAst;
/**
* 治疗前 肿瘤坏死因子αμg/L
*/
@ -143,9 +203,30 @@ public class MedicalRecordCheckdataEntity {
private String afterTnf;
/**
* 图片
* 最后一次治疗后 肿瘤坏死因子αμg/L
*/
private String checkImg;
private String lastTnf;
/**
* 肿瘤坏死因子α单位
*/
private String tnfUnit;
/**
* 生化指标图片
*/
private String bioImg;
/**
* 凝血功能指标图片
*/
private String coaImg;
/**
* 炎症因子指标图片
*/
private String infImg;
/**
* 创建时间

View File

@ -3,10 +3,12 @@ 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.DischargeStatusEnum;
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.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;
@ -38,13 +40,21 @@ public class MedicalRecordDetailVO {
@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 caseType;
@ApiModelProperty(value = "基本信息图片", required = true)
@NotNull(message = "基本信息图片 不能为空")
private String baseImg;
@ApiModelProperty(value = "主要诊断", required = true)
@NotNull(message = "主要诊断 不能为空")
private String mainDiagnose;
@ApiModelProperty(value = "患者病因", required = true)
@NotNull(message = "患者病因 不能为空")
private String diseaseCause;
@ApiModelProperty(value = "诱因", required = true)
@NotNull(message = "诱因 不能为空")
private String seductionReason;
@ApiModelProperty(value = "病例状态", required = true)
private Integer status;
@ -54,14 +64,9 @@ public class MedicalRecordDetailVO {
@NotNull(message = "临床资料 病历摘要 文字 不能为空")
private String abstractStr;
@ApiModelProperty(value = "临床资料 病历摘要 图片", required = true)
@NotNull(message = "临床资料 病历摘要 图片 不能为空")
private String abstractImg;
/*************************DPMAS***************************/
@ApiModelProperty(value = "临床资料 病历摘要 图片", required = true)
@NotNull(message = "临床资料 病历摘要 图片 不能为空")
@ApiModelProperty(value = "人工肝治疗", required = true)
@NotNull(message = "人工肝治疗 不能为空")
private List<DpmsAddForm> dpmas;
@ -77,6 +82,13 @@ public class MedicalRecordDetailVO {
@NotNull(message = "治疗后 检测时间 不能为空")
private LocalDateTime afterTime;
/**
* 最后一次治疗后 检测时间
*/
@ApiModelProperty(value = "最后一次治疗后 检测时间 ", required = true)
@NotNull(message = "最后一次治疗后 检测时间 不能为空")
private LocalDateTime lastTime;
/**
* 治疗前 总胆红素(umol/L)
*/
@ -92,16 +104,11 @@ public class MedicalRecordDetailVO {
private String afterTb;
/**
* 治疗前 白蛋白(g/L)
* 最后一次治疗后 总胆红素(umol/L)
*/
@ApiModelProperty(value = "治疗前 白蛋白", required = true)
private String headAlb;
/**
* 治疗后 白蛋白(g/L)
*/
@ApiModelProperty(value = "治疗后 白蛋白 ", required = true)
private String afterAlb;
@ApiModelProperty(value = "最后一次治疗后 总胆红素 ", required = true)
@NotNull(message = "最后一次治疗后 总胆红素 不能为空")
private String lastTb;
/**
* 治疗前 直接胆红素(umol/L)
@ -115,6 +122,72 @@ public class MedicalRecordDetailVO {
@ApiModelProperty(value = "治疗后 直接胆红素 ", required = true)
private String afterDb;
/**
* 最后一次治疗后 直接胆红素(umol/L)
*/
@ApiModelProperty(value = "最后一次治疗后 直接胆红素 ", required = true)
private String lastDb;
/**
* 治疗前 丙氨酸氨基转移酶(U/L)
*/
@ApiModelProperty(value = "治疗前 丙氨酸氨基转移酶", required = true)
@NotNull(message = "治疗前 丙氨酸氨基转移酶 不能为空")
private String headAlt;
/**
* 治疗后 丙氨酸氨基转移酶 (U/L)
*/
@ApiModelProperty(value = "治疗后 丙氨酸氨基转移酶 ", required = true)
@NotNull(message = "治疗后 丙氨酸氨基转移酶 不能为空")
private String afterAlt;
/**
* 最后一次治疗后 丙氨酸氨基转移酶 (U/L)
*/
@ApiModelProperty(value = "最后一次治疗后 丙氨酸氨基转移酶 ", required = true)
@NotNull(message = "最后一次治疗后 丙氨酸氨基转移酶 不能为空")
private String lastAlt;
/**
* 治疗前 天门冬氨酸氨基转移酶 (U/L)
*/
@ApiModelProperty(value = "治疗前 天门冬氨酸氨基转移酶", required = true)
@NotNull(message = "治疗前 天门冬氨酸氨基转移酶 不能为空")
private String headAst;
/**
* 治疗后 天门冬氨酸氨基转移酶 (U/L)
*/
@ApiModelProperty(value = "治疗后 天门冬氨酸氨基转移酶 ", required = true)
@NotNull(message = "治疗后 天门冬氨酸氨基转移酶 不能为空")
private String afterAst;
/**
* 最后一次治疗后 天门冬氨酸氨基转移酶 (U/L)
*/
@ApiModelProperty(value = "最后一次治疗后 天门冬氨酸氨基转移酶 ", required = true)
@NotNull(message = "最后一次治疗后 天门冬氨酸氨基转移酶 不能为空")
private String lastAst;
/**
* 治疗前 白蛋白(g/L)
*/
@ApiModelProperty(value = "治疗前 白蛋白", required = true)
private String headAlb;
/**
* 治疗后 白蛋白(g/L)
*/
@ApiModelProperty(value = "治疗后 白蛋白 ", required = true)
private String afterAlb;
/**
* 最后一次治疗后 白蛋白(g/L)
*/
@ApiModelProperty(value = "最后一次治疗后 白蛋白 ", required = true)
private String lastAlb;
/**
* 治疗前 凝血酶原活动度 (%)
*/
@ -128,16 +201,10 @@ public class MedicalRecordDetailVO {
private String afterPta;
/**
* 治疗前 间接胆红素(umol/L)
* 最后一次治疗后 凝血酶原活动度 (%)
*/
@ApiModelProperty(value = "治疗前 间接胆红素", required = true)
private String headIb;
/**
* 治疗后 间接胆红素(umol/L)
*/
@ApiModelProperty(value = "治疗后 间接胆红素 ", required = true)
private String afterIb;
@ApiModelProperty(value = "最后一次治疗后 凝血酶原活动度 ", required = true)
private String lastPta;
/**
* 治疗前 国际标准化比值 INR
@ -154,18 +221,32 @@ public class MedicalRecordDetailVO {
private String afterInr;
/**
* 治疗前 谷丙转氨 (U/L)
* 最后一次治疗后 国际标准化比值 INR
*/
@ApiModelProperty(value = "治疗前 谷丙转氨", required = true)
@NotNull(message = "治疗前 谷丙转氨 不能为空")
private String headAlt;
@ApiModelProperty(value = "最后一次治疗后 国际标准化比值 ", required = true)
@NotNull(message = "最后一次治疗后 国际标准化比值 不能为空")
private String lastInr;
/**
* 治疗 谷丙转氨 (U/L)
* 治疗 C反应蛋白mg/L
*/
@ApiModelProperty(value = "治疗后 谷丙转氨 ", required = true)
@NotNull(message = "治疗后 谷丙转氨 不能为空")
private String afterAlt;
@ApiModelProperty(value = "治疗前 C反应蛋白", required = true)
@NotNull(message = "治疗前 C反应蛋白 不能为空")
private String headCrp;
/**
* 治疗后 C反应蛋白mg/L
*/
@ApiModelProperty(value = "治疗后 C反应蛋白 ", required = true)
@NotNull(message = "治疗后 C反应蛋白 不能为空")
private String afterCrp;
/**
* 最后一次治疗后 C反应蛋白mg/L
*/
@ApiModelProperty(value = "最后一次治疗后 C反应蛋白 ", required = true)
@NotNull(message = "最后一次治疗后 C反应蛋白 不能为空")
private String lastCrp;
/**
* 治疗前 白介素6(ng/L)
@ -180,18 +261,16 @@ public class MedicalRecordDetailVO {
private String afterIl6;
/**
* 治疗前 谷草转氨酶 (U/L)
* 最后一次治疗后 白介素6(ng/L)
*/
@ApiModelProperty(value = "治疗前 谷草转氨酶", required = true)
@NotNull(message = "治疗前 谷草转氨酶 不能为空")
private String headAst;
@ApiModelProperty(value = "最后一次治疗后 白介素6 ", required = true)
private String lastIl6;
/**
* 治疗后 谷草转氨酶 (U/L)
* 白介素单位
*/
@ApiModelProperty(value = "治疗后 谷草转氨酶 ", required = true)
@NotNull(message = "治疗后 谷草转氨酶 不能为空")
private String afterAst;
@ApiModelProperty(value = "白介素单位")
private String il6Unit;
/**
* 治疗前 肿瘤坏死因子αμg/L
@ -205,7 +284,43 @@ public class MedicalRecordDetailVO {
@ApiModelProperty(value = "治疗后 肿瘤坏死因子α ", required = true)
private String afterTnf;
@ApiModelProperty(value = "实验室检测 病历摘要 图片", required = true)
@NotNull(message = "实验室检测 图片 不能为空")
private String checkImg;
/**
* 最后一次治疗后 肿瘤坏死因子αμg/L
*/
@ApiModelProperty(value = "最后一次治疗后 肿瘤坏死因子α ", required = true)
private String lastTnf;
/**
* 肿瘤坏死因子α单位
*/
@ApiModelProperty(value = "肿瘤坏死因子α单位")
private String tnfUnit;
@ApiModelProperty(value = "生化指标 图片", required = true)
@NotNull(message = "报告单 生化指标 不能为空")
private String bioImg;
@ApiModelProperty(value = "凝血功能指标 图片", required = true)
@NotNull(message = "报告单 凝血功能指标 不能为空")
private String coaImg;
@ApiModelProperty(value = "炎症因子指标 图片")
private String infImg;
/*************************疾病转归***************************/
@ApiModelProperty(value = "疾病转归 出院时间", required = true)
@NotNull(message = "疾病转归 出院时间 不能为空")
private LocalDateTime dischargeTime;
@ApiModelProperty(value = "住院天数", required = true)
@NotNull(message = "住院天数 不能为空")
private Integer day;
@ApiModelPropertyEnum(DischargeStatusEnum.class)
@CheckEnum(value = DischargeStatusEnum.class, message = "出院状态 错误")
private String dischargeStatus;
@ApiModelProperty(value = "疾病转归 出院情况", required = true)
@NotNull(message = "疾病转归 出院情况 不能为空")
private String dischargeSituation;
}

View File

@ -39,4 +39,9 @@ public class MedicalRecordDpmsEntity {
*/
private String dpmasImg;
/**
* 内容json
*/
private String content;
}

View File

@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 病历表 实体类
*
@ -29,20 +33,25 @@ public class MedicalRecordEntity {
*/
private Long userId;
/**
* 图片
*/
private String baseImg;
/**
* 入院时间
*/
private LocalDateTime admissionTime;
/**
* 病历类型
* 治疗类型
*/
private Integer caseType;
private String caseType;
/**
* 0待审核 1审核通过 2审核不通过
*/
private Integer status;
/**
* 审核不通过原因
*/
private String reason;
/**
* 统计
@ -75,29 +84,43 @@ public class MedicalRecordEntity {
private LocalDateTime createTime;
private Integer status;
/**
* 主要诊断
*/
private String mainDiagnose;
/**
* 患者病因
*/
private String diseaseCause;
/**
* 诱因
*/
private String seductionReason;
/**
* 修改时间
*/
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 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;
}
// 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;
// }
}

View File

@ -0,0 +1,68 @@
package net.lab1024.sa.admin.module.app.medicalrecord.domain;
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;
import java.time.LocalDateTime;
/**
* 病历摘要表 实体类
*
* @Author HMM
* @Date 2024-01-11 15:18:32
* @Copyright gdxz
*/
/**
* 病例-疾病转归实体类
*/
@Data
@TableName("`t_caseplatform_case_prognosis`") // 指定数据库表名
public class MedicalRecordPrognosisEntity {
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 疾病id
*/
@TableField("case_id")
private Long caseId;
/**
* 出院时间
*/
@TableField("discharge_time")
private LocalDateTime dischargeTime;
/**
* 住院天数
*/
@TableField("day")
private Integer day;
/**
* 出院状态1:好转 2:痊愈 3:恶化 4:死亡 5:移植
*/
@TableField("discharge_status")
private Integer dischargeStatus;
/**
* 出院情况
*/
@TableField("discharge_situation")
private String dischargeSituation;
// public MedicalRecordAbstracEntity(Long caseId, String abstractStr, String abstractImg, LocalDateTime createTime) {
// this.caseId = caseId;
// this.abstractStr = abstractStr;
// this.abstractImg = abstractImg;
// this.createTime = createTime;
// }
}

View File

@ -8,6 +8,8 @@ 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;
import javax.validation.constraints.NotNull;
/**
* 前端请求列表的 from
*/
@ -17,8 +19,7 @@ public class MedicalRecordQueryForm extends PageParam {
@ApiModelProperty(value = "name")
private String name;
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
@CheckEnum(value = CasetypeEnum.class, message = "病历类型 错误")
@ApiModelProperty(value = "治疗类型", required = true)
private Integer caseType;
@ApiModelPropertyEnum(value = CaseStatusEnum.class, desc = "病例状态0待审核 1审核通过 2审核不通过")

View File

@ -39,8 +39,6 @@ public class MedicalRecordUserEntity {
*/
private String uid;
/**
* 性别
*/
@ -61,12 +59,12 @@ public class MedicalRecordUserEntity {
*/
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;
}
// 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;
// }
}

View File

@ -29,6 +29,11 @@ public class CaseplatformBankEntity {
*/
private Long expertId;
/**
* 身份证
*/
private String idCardName;
/**
* 身份证
*/

View File

@ -15,7 +15,7 @@ import net.lab1024.sa.admin.module.app.expert.admin.ExpertSignAddForm;
*/
@Data
public class CaseplatformBankAddForm extends ExpertSignAddForm {
public class CaseplatformBankAddForm {
@ApiModelProperty(value = "身份证", required = true)
@NotBlank(message = "身份证 不能为空")
@ -23,7 +23,7 @@ public class CaseplatformBankAddForm extends ExpertSignAddForm {
@ApiModelProperty(value = "姓名", required = true)
@NotBlank(message = "姓名 不能为空")
private String name;
private String idCardName;
@ApiModelProperty(value = "开户行", required = true)
@NotBlank(message = "开户行 不能为空")

View File

@ -21,6 +21,9 @@ public class CaseplatformBankVO {
@ApiModelProperty(value = "专家id")
private Long expertId;
@ApiModelProperty(value = "身份证")
private String idCardName;
@ApiModelProperty(value = "身份证")
private String idCardNo;

View File

@ -1,7 +1,9 @@
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.ExpertEntity;
import net.lab1024.sa.admin.module.app.expert.admin.ExpertSignVO;
import net.lab1024.sa.admin.module.app.expert.dao.ExpertDao;
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;
@ -18,6 +20,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
/**
* 银行卡 Service
@ -36,6 +39,9 @@ public class CaseplatformBankService {
@Autowired
private ExpertSignDao expertSignDao;
@Autowired
private ExpertDao expertDao;
/**
* 分页查询
*
@ -56,6 +62,17 @@ public class CaseplatformBankService {
public synchronized ResponseDTO<String> add(CaseplatformBankAddForm addForm) {
CaseplatformBankEntity caseplatformBankEntity = SmartBeanUtil.copy(addForm, CaseplatformBankEntity.class);
Long expertId = SmartRequestUtil.getRequestUserId();
// 获取专家数据
ExpertEntity expert = expertDao.getExpert(expertId);
if (expert == null) {
return ResponseDTO.userErrorParam("操作失败");
}
if (!Objects.equals(expert.getName(), addForm.getIdCardName())){
return ResponseDTO.userErrorParam("登录用户名与银行卡姓名不一致");
}
caseplatformBankEntity.setExpertId(expertId);
CaseplatformBankVO expertBank = caseplatformBankDao.getExpertBank(expertId);
@ -66,15 +83,6 @@ public class CaseplatformBankService {
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();
}
}

View File

@ -0,0 +1,26 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.lab1024.sa.common.common.enumeration.BaseEnum;
@AllArgsConstructor
@Getter
public enum CaseAcAppStatusEnum implements BaseEnum {
DEFAULT(1, "审核通过"),
BEFORE(2, "审核中"),
;
private final Integer value;
private final String desc;
public static CaseAcAppStatusEnum getByVal(int val){
for (CaseAcAppStatusEnum type: CaseAcAppStatusEnum.values()){
if(type.getValue() == val){
return type;
}
}
return null;
}
}

View File

@ -0,0 +1,26 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.lab1024.sa.common.common.enumeration.BaseEnum;
@AllArgsConstructor
@Getter
public enum CaseplatformExpertWhiteStatusEnum implements BaseEnum {
DEFAULT(1, "正常"),
BEFORE(2, "无效"),
;
private final Integer value;
private final String desc;
public static CaseplatformExpertWhiteStatusEnum getByVal(int val){
for (CaseplatformExpertWhiteStatusEnum type: CaseplatformExpertWhiteStatusEnum.values()){
if(type.getValue() == val){
return type;
}
}
return null;
}
}

View File

@ -5,7 +5,7 @@ import lombok.Getter;
import net.lab1024.sa.common.common.enumeration.BaseEnum;
/**
* 病历类型
* 治疗类型
*
* @Author HMM
* @Date 2024-01-11T15:18:32
@ -15,8 +15,8 @@ import net.lab1024.sa.common.common.enumeration.BaseEnum;
@AllArgsConstructor
@Getter
public enum CasetypeEnum implements BaseEnum {
DEFAULT(1, "四次及以上疗程化"),
BEFORE(2, "早前期INR≤1.5"),
DEFAULT(1, "DPMAS及联合模式"),
BEFORE(2, "CA280及联合模式"),
;
private final Integer value;

View File

@ -4,9 +4,8 @@ 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.form.*;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.CaseplatformAcAppVO;
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;
@ -16,11 +15,7 @@ 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 org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@ -69,16 +64,14 @@ public class CaseplatformCaseController {
@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();
return caseplatformCaseService.examine(caseId, status);
}
@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();
return caseplatformCaseService.settlement(caseId);
}
@ApiOperation("审核拒绝 @author HMM")
@ -89,22 +82,62 @@ public class CaseplatformCaseController {
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();
}
// @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();
// }
// }
@ApiOperation("出院诊断修改")
@PutMapping("/caseplatformCase/mainDiagnose")
@PreAuthorize("@saAuth.checkPermission('case-system:case:mainDiagnose')")
public ResponseDTO<String> caseMainDiagnose(@RequestBody @Valid CaseMainDiagnoseForm form) {
return caseplatformCaseService.caseMainDiagnose(form);
}
@ApiOperation("人工肝治疗图片修改")
@PutMapping("/caseplatformCase/dpmasImg")
@PreAuthorize("@saAuth.checkPermission('case-system:case:checkPermission')")
public ResponseDTO<String> caseDpmasImg(@RequestBody @Valid CaseDpmasImgForm form) {
return caseplatformCaseService.caseDpmasImg(form);
}
@ApiOperation("实验室检测图片修改")
@PutMapping("/caseplatformCase/checkdataImg")
@PreAuthorize("@saAuth.checkPermission('case-system:case:checkdataImg')")
public ResponseDTO<String> caseCheckdataImg(@RequestBody @Valid CaseCheckdataImgForm form) {
return caseplatformCaseService.caseCheckdataImg(form);
}
@ApiOperation("分页查询-活动申请")
@PostMapping("/caseplatformCase/activity/queryPage")
public ResponseDTO<PageResult<CaseplatformAcAppVO>> CaseplatformAcAppQueryPage(@RequestBody @Valid CaseplatformAcAppQueryForm queryForm) {
return caseplatformCaseService.caseplatformAcAppQueryPage(queryForm);
}
@ApiOperation("删除")
@DeleteMapping("/caseplatformCase/activity/delete/{id}")
@PreAuthorize("@saAuth.checkPermission('case-system:case:deleteCaseplatformAcApp')")
public ResponseDTO<String> deleteCaseplatformAcApp(@PathVariable("id") Long id) {
return caseplatformCaseService.deleteCaseplatformAcApp(id);
}
@ApiOperation("活动申请-状态修改")
@PutMapping("/caseplatformCase/activity/status/{id}")
@PreAuthorize("@saAuth.checkPermission('case-system:case:updateCaseplatformAcApp')")
public ResponseDTO<String> updateCaseplatformAcApp(@PathVariable("id") Long id,@RequestBody @Valid CaseplatformAcAppUpdateForm form) {
return caseplatformCaseService.updateCaseplatformAcApp(id,form);
}
}

View File

@ -11,18 +11,25 @@ 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.domain.vo.ExportExpertCaseExcelVo;
import net.lab1024.sa.admin.module.business.caseplatformcase.service.CaseplatformCaseService;
import net.lab1024.sa.common.common.domain.ResponseDTO;
import net.lab1024.sa.common.common.exception.BusinessException;
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.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.FileOutputStream;
import java.net.URLEncoder;
import java.util.List;
import java.util.*;
/**
* 病历表 Controller
@ -32,16 +39,27 @@ import java.util.List;
* @Copyright gdxz
*/
@Controller
@RestController
@Api(tags = "")
@OperateLog
public class CaseplatformCaseExcelController {
@Autowired
private CaseplatformCaseService caseplatformCaseService;
// 病例管理导出
@ApiOperation("病例管理导出")
@GetMapping("/caseplatformCase/exportEasyExcel")
@PreAuthorize("@saAuth.checkPermission('case-system:case:excle')")
public void exportEasyExcel(HttpServletResponse response, @Valid CaseplatformCaseQueryForm queryForm) {
try {
List<EasyExcelCaseDetailVO> list = caseplatformCaseService.excelList(queryForm);
// 处理数据
for (EasyExcelCaseDetailVO m : list) {
// 治疗类型
m.setCaseType(caseplatformCaseService.convertCaseTypeToLabel(m.getCaseType()));
}
// 1设置表头样式
WriteCellStyle headStyle = new WriteCellStyle();
// 1.1设置表头数据居中
@ -75,4 +93,247 @@ public class CaseplatformCaseExcelController {
}
}
// 结算导出
@ApiOperation("结算导出")
@GetMapping("/caseplatformCase/settlementExcel")
@PreAuthorize("@saAuth.checkPermission('case-system:case:exportExpertCaseExceli')")
public void exportExpertCaseExceli(HttpServletResponse response, @Valid CaseplatformCaseQueryForm queryForm) {
try {
List<ExportExpertCaseExcelVo> list = caseplatformCaseService.exportExpertCaseExcel(queryForm);
List<ExportExpertCaseExcelVo> processedList = caseplatformCaseService.exportExpertCaseExcelProcess(list);
// 总计
double totalActual = processedList.stream().mapToDouble(e -> Optional.ofNullable(e.getActualAmount()).orElse(0.0)).sum();
double totalTax = processedList.stream().mapToDouble(e -> Optional.ofNullable(e.getTaxAmount()).orElse(0.0)).sum();
double totalTotal = processedList.stream().mapToDouble(e -> Optional.ofNullable(e.getTotalAmount()).orElse(0.0)).sum();
String filePath = "./人工肝诊疗专家劳务费.xlsx";
FileOutputStream outputStream = new FileOutputStream(filePath);
// 字段标题
List<List<String>> head = Arrays.asList(
Collections.singletonList("序号"),
Collections.singletonList("银行"),
Collections.singletonList("账号所在省份"),
Collections.singletonList("账户所在地市"),
Collections.singletonList("卡号"),
Collections.singletonList("姓名"),
Collections.singletonList("实发"),
Collections.singletonList("备注"),
Collections.singletonList("个税"),
Collections.singletonList("应发"),
Collections.singletonList("单位"),
Collections.singletonList("电话"),
Collections.singletonList("身份证号"),
Collections.singletonList("关联病例")
);
WriteCellStyle headStyle = new WriteCellStyle();
headStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
headStyle.setVerticalAlignment(VerticalAlignment.CENTER);
headStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
headStyle.setBorderBottom(BorderStyle.THIN);
headStyle.setBorderTop(BorderStyle.THIN);
headStyle.setBorderLeft(BorderStyle.THIN);
headStyle.setBorderRight(BorderStyle.THIN);
WriteCellStyle contentStyle = new WriteCellStyle();
contentStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
contentStyle.setVerticalAlignment(VerticalAlignment.CENTER);
contentStyle.setBorderBottom(BorderStyle.THIN);
contentStyle.setBorderTop(BorderStyle.THIN);
contentStyle.setBorderLeft(BorderStyle.THIN);
contentStyle.setBorderRight(BorderStyle.THIN);
// ExcelWriter writer = EasyExcel.write(outputStream, ExportExpertCaseExcelVo.class)
ExcelWriter writer = EasyExcel.write(response.getOutputStream(), ExportExpertCaseExcelVo.class)
.head(head)
.excelType(ExcelTypeEnum.XLSX)
.registerWriteHandler(new HorizontalCellStyleStrategy(headStyle, contentStyle))
.build();
WriteSheet writeSheet = EasyExcel.writerSheet("劳务费明细")
.needHead(true)
.relativeHeadRowIndex(1) // 数据从第3行开始前2行为标题
.build();
// 写数据
writer.write(processedList, writeSheet);
// 合并大标题
Workbook workbook = (Workbook) writer.writeContext().writeWorkbookHolder().getWorkbook();
Sheet sheet = workbook.getSheetAt(0);
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, head.size() - 1));
Row titleRow = sheet.createRow(0);
titleRow.setHeightInPoints(30); // 设置标题行高
Cell titleCell = titleRow.createCell(0);
titleCell.setCellValue("人工肝诊疗病例征集项目专家劳务费表");
CellStyle titleStyle = workbook.createCellStyle();
Font font = workbook.createFont();
font.setFontHeightInPoints((short) 16);
font.setBold(true);
titleStyle.setFont(font);
titleStyle.setAlignment(HorizontalAlignment.CENTER);
titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
titleStyle.setBorderRight(BorderStyle.THIN); // 最后一格加右边框
titleCell.setCellStyle(titleStyle);
// === 设置行高 ===
sheet.getRow(1).setHeightInPoints(25); // 表头行
for (int i = 2; i <= processedList.size() + 2; i++) {
Row row = sheet.getRow(i);
if (row != null) {
row.setHeightInPoints(22);
}
}
// === 设置列宽 ===
int[] columnWidths = {
6, 25, 15, 15, 25, 10, 10, 30, 8, 8, 30, 25, 30, 15
};
for (int i = 0; i < columnWidths.length; i++) {
sheet.setColumnWidth(i, columnWidths[i] * 256); // 256 Excel 单位
}
// 写合计行
int totalRowIndex = processedList.size() + 2; // +1是数据从第3行开始+2是表头行数
Row totalRow = sheet.createRow(totalRowIndex);
totalRow.setHeightInPoints(22);
// 合计行样式黑底白字
CellStyle totalStyle = workbook.createCellStyle();
Font totalFont = workbook.createFont();
totalFont.setBold(true);
totalFont.setColor(IndexedColors.WHITE.getIndex());
totalStyle.setFont(totalFont);
totalStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
totalStyle.setAlignment(HorizontalAlignment.CENTER);
totalStyle.setVerticalAlignment(VerticalAlignment.CENTER);
totalStyle.setBorderTop(BorderStyle.THIN);
totalStyle.setBorderBottom(BorderStyle.THIN);
totalStyle.setBorderLeft(BorderStyle.THIN);
totalStyle.setBorderRight(BorderStyle.THIN);
// 合并前3列合计
sheet.addMergedRegion(new CellRangeAddress(totalRowIndex, totalRowIndex, 0, 5));
Cell cell0 = totalRow.createCell(0);
cell0.setCellValue("合计");
// 设置边框样式
CellStyle borderStyle = workbook.createCellStyle();
borderStyle.setBorderBottom(BorderStyle.THIN);
borderStyle.setBorderTop(BorderStyle.THIN);
borderStyle.setBorderLeft(BorderStyle.THIN);
borderStyle.setBorderRight(BorderStyle.THIN);
borderStyle.setAlignment(HorizontalAlignment.CENTER);
// 创建合计单元格并添加边框
for (int i = 0; i < head.size(); i++) {
Cell cell = totalRow.getCell(i);
if (cell == null) {
cell = totalRow.createCell(i);
}
cell.setCellStyle(borderStyle);
}
// 实发 G = index 6个税I = 8应发J = 9
totalRow.getCell(6).setCellValue(totalActual);
totalRow.getCell(8).setCellValue(totalTax);
totalRow.getCell(9).setCellValue(totalTotal);
// 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();
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
/*
// 结算导出
@ApiOperation("结算导出")
@GetMapping("/caseplatformCase/settlementExcel1")
public void exportExpertCaseExcel(HttpServletResponse response, @Valid CaseplatformCaseQueryForm queryForm) {
try {
List<ExportExpertCaseExcelVo> list = caseplatformCaseService.exportExpertCaseExcel(queryForm);
List<ExportExpertCaseExcelVo> processedList = caseplatformCaseService.exportExpertCaseExcelProcess(list);
// 设置本地文件路径
String filePath = "./病例数据.xlsx";
FileOutputStream outputStream = new FileOutputStream(filePath);
// 字段标题
List<List<String>> head = Arrays.asList(
Collections.singletonList("序号"),
Collections.singletonList("银行"),
Collections.singletonList("账号所在省份"),
Collections.singletonList("账户所在地市"),
Collections.singletonList("卡号"),
Collections.singletonList("姓名"),
Collections.singletonList("实发"),
Collections.singletonList("备注"),
Collections.singletonList("个税"),
Collections.singletonList("应发"),
Collections.singletonList("单位"),
Collections.singletonList("电话"),
Collections.singletonList("身份证号"),
Collections.singletonList("关联病例")
);
// 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().sheetNo(1).build();
// 4拿到表格处理对象
// ExcelWriter writer = EasyExcel.write(response.getOutputStream()).needHead(true).excelType(ExcelTypeEnum.XLSX)
ExcelWriter writer = EasyExcel.write(outputStream).needHead(true).excelType(ExcelTypeEnum.XLSX)
// 设置单元格的风格样式
.head(head)
.registerWriteHandler(new HorizontalCellStyleStrategy(headStyle, bodyStyle))
.build();
// 5写入excel数据
writer.write(processedList, 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();
}
}
*/
@ApiOperation("结算导入")
@PostMapping("/caseplatformCase/settlementImport")
@PreAuthorize("@saAuth.checkPermission('case-system:case:caseplatformCaseSettlementImport')")
public ResponseDTO<T> caseplatformCaseSettlementImport(@RequestParam("file") MultipartFile file) {
try {
caseplatformCaseService.caseplatformCaseSettlementImport(file);
} catch (Exception e) {
throw new BusinessException(e.getMessage());
}
return ResponseDTO.ok();
}
}

View File

@ -0,0 +1,64 @@
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.business.caseplatformcase.domain.form.CaseplatformAcAppUpdateForm;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformCaseQueryForm;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformExpertWhiteQueryForm;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.UpdateCaseplatformExpertWhiteForm;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.CaseplatformCaseVO;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.GetCaseplatformExpertWhitePageVo;
import net.lab1024.sa.admin.module.business.caseplatformcase.service.CaseplatformCaseService;
import net.lab1024.sa.admin.module.business.caseplatformcase.service.CaseplatformExpertWhiteService;
import net.lab1024.sa.admin.module.business.caseplatformcaseabstrac.service.CaseplatformCaseAbstracService;
import net.lab1024.sa.common.common.domain.PageResult;
import net.lab1024.sa.common.common.domain.ResponseDTO;
import net.lab1024.sa.common.common.exception.BusinessException;
import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
@RestController
@Api(tags = "")
@OperateLog
public class CaseplatformExpertWhiteController {
@Autowired
private CaseplatformExpertWhiteService caseplatformExpertWhiteService;
@ApiOperation("医生管理导入")
@PostMapping("/caseplatformExpertWhite/import")
public ResponseDTO<T> caseplatformExpertWhiteImport(@RequestParam("file") MultipartFile file) {
try {
caseplatformExpertWhiteService.importExperts(file);
} catch (Exception e) {
throw new BusinessException(e.getMessage());
}
return ResponseDTO.ok();
}
@ApiOperation("分页查询")
@PostMapping("/caseplatformExpertWhite/queryPage")
public ResponseDTO<PageResult<GetCaseplatformExpertWhitePageVo>> getCaseplatformExpertWhitePage(@RequestBody @Valid CaseplatformExpertWhiteQueryForm queryForm) {
return caseplatformExpertWhiteService.queryPage(queryForm);
}
@ApiOperation("删除")
@DeleteMapping("/caseplatformExpertWhite/delete/{id}")
public ResponseDTO<String> deleteCaseplatformExpertWhite(@PathVariable("id") Long id) {
return caseplatformExpertWhiteService.delete(id);
}
@ApiOperation("修改状态")
@PutMapping("/caseplatformExpertWhite/update/{id}")
public ResponseDTO<String> updateCaseplatformExpertWhite(@PathVariable("id") Long id,@RequestBody @Valid UpdateCaseplatformExpertWhiteForm form) {
return caseplatformExpertWhiteService.updateCaseplatformAcApp(id,form);
}
}

View File

@ -0,0 +1,31 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.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.vo.ProvVO;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity.CaseplatformAcAppEntity;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformAcAppQueryForm;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.form.CaseplatformCaseQueryForm;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.CaseplatformAcAppVO;
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.springframework.stereotype.Component;
import java.util.List;
@Mapper
@Component
public interface CaseplatformAcAppDao extends BaseMapper<CaseplatformAcAppEntity> {
/**
* 分页 查询
*
* @param page
* @param queryForm
* @return
*/
List<CaseplatformAcAppVO> queryPage(Page page, @Param("queryForm") CaseplatformAcAppQueryForm queryForm, @Param("provList")List<ProvVO> provList);
}

View File

@ -9,6 +9,7 @@ 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 net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.ExportExpertCaseExcelVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
@ -39,6 +40,8 @@ public interface CaseplatformCaseDao extends BaseMapper<CaseplatformCaseEntity>
List<EasyExcelCaseDetailVO> excelList(@Param("queryForm") CaseplatformCaseQueryForm queryForm, @Param("provList")List<ProvVO> provList);
List<ExportExpertCaseExcelVo> getExportExpertCaseExcelList(@Param("queryForm") CaseplatformCaseQueryForm queryForm, @Param("provList")List<ProvVO> provList);
/**
* 获取详情
* @param case_id

View File

@ -0,0 +1,40 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity;
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;
import java.time.LocalDateTime;
/**
* 活动申请表实体类
*/
@TableName("`t_caseplatform_activity_application`")
@Data
public class CaseplatformAcAppEntity {
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 专家id
*/
@TableField("expert_id")
private Long expertId;
/**
* 状态1:审核通过 2:审核中
*/
@TableField("status")
private Integer status;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
}

View File

@ -37,7 +37,7 @@ public class CaseplatformCaseEntity {
/**
* 病历类型
*/
private Integer caseType;
private String caseType;
/**
* 专家 id
@ -54,6 +54,9 @@ public class CaseplatformCaseEntity {
*/
private Integer status;
// 审核通过时间
private LocalDateTime examineTime;
/**
* 创建时间
*/
@ -64,4 +67,19 @@ public class CaseplatformCaseEntity {
*/
private LocalDateTime updateTime;
/**
* 主要诊断
*/
private String mainDiagnose;
/**
* 患者病因
*/
private String diseaseCause;
/**
* 诱因
*/
private String seductionReason;
}

View File

@ -0,0 +1,23 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.form;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class CaseCheckdataImgForm {
@ApiModelProperty(value = "病例", required = true)
@NotNull(message = "病例 不能为空")
private String caseId;
@ApiModelProperty(value = "生化指标 图片")
private String bioImg;
@ApiModelProperty(value = "凝血功能指标 图片")
private String coaImg;
@ApiModelProperty(value = "炎症因子指标 图片")
private String infImg;
}

View File

@ -0,0 +1,21 @@
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 CaseDpmasImgForm {
@ApiModelProperty(value = "病例", required = true)
@NotNull(message = "病例 不能为空")
private String dmpsId;
@ApiModelProperty(value = "病例", required = true)
@NotNull(message = "病例 不能为空")
private String caseId;
@ApiModelProperty(value = "记录图片", required = true)
@NotNull(message = "记录图片 不能为空")
private String dpmasImg;
}

View File

@ -0,0 +1,17 @@
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 CaseMainDiagnoseForm {
@ApiModelProperty(value = "病例", required = true)
@NotNull(message = "病例 不能为空")
private String caseId;
@ApiModelProperty(value = "出院诊断", required = true)
@NotNull(message = "出院诊断 不能为空")
private String mainDiagnose;
}

View File

@ -0,0 +1,38 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.form;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseAcAppStatusEnum;
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 net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class CaseplatformAcAppQueryForm extends PageParam{
@ApiModelProperty(value = "专家姓名")
private String expertName;
@ApiModelProperty(value = "省份")
private Long provId;
@ApiModelProperty(value = "市区")
private Long cityId;
@ApiModelProperty(value = "医院")
private String hospitalUuid;
@ApiModelPropertyEnum(value = CaseAcAppStatusEnum.class, desc = "审核状态")
@CheckEnum(value = CaseAcAppStatusEnum.class, message = "审核状态 错误")
private Integer status;
@ApiModelProperty(value = "申请时间")
private List<LocalDateTime> createTime;
}

View File

@ -0,0 +1,19 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.form;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseAcAppStatusEnum;
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;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class CaseplatformAcAppUpdateForm{
@ApiModelPropertyEnum(value = CaseAcAppStatusEnum.class, desc = "审核状态")
@CheckEnum(value = CaseAcAppStatusEnum.class, message = "审核状态 错误")
private Integer status;
}

View File

@ -33,9 +33,9 @@ public class CaseplatformCaseAddForm {
@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 caseType;
@ApiModelProperty(value = "创建时间", required = true)
@NotNull(message = "创建时间 不能为空")

View File

@ -9,6 +9,9 @@ import lombok.Data;
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
import java.time.LocalDateTime;
import java.util.List;
/**
* 病历表 分页查询表单
*
@ -35,6 +38,12 @@ public class CaseplatformCaseQueryForm extends PageParam{
@CheckEnum(value = CaseStatusEnum.class, message = "0待审核 1审核通过 2审核不通过 错误")
private Integer status;
@ApiModelProperty(value = "审核时间")
private List<LocalDateTime> examineTime;
@ApiModelProperty(hidden = true)
private List<String> examineTimeFormatted;
@ApiModelProperty(value = "省份")
private Long provId;

View File

@ -0,0 +1,34 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.form;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
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 net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
import java.time.LocalDateTime;
import java.util.List;
/**
* 病历表 分页查询表单
*
* @Author HMM
* @Date 2024-01-11 15:18:32
* @Copyright gdxz
*/
@Data
public class CaseplatformExpertWhiteQueryForm extends PageParam{
@ApiModelProperty(value = "姓名")
private String name;
@ApiModelProperty(value = "手机号")
private String mobile;
@ApiModelProperty(value = "医院名称")
private String hospitalName;
}

View File

@ -0,0 +1,15 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.form;
import lombok.Data;
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseAcAppStatusEnum;
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseplatformExpertWhiteStatusEnum;
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;
@Data
public class UpdateCaseplatformExpertWhiteForm {
@ApiModelPropertyEnum(value = CaseplatformExpertWhiteStatusEnum.class, desc = "状态")
@CheckEnum(value = CaseplatformExpertWhiteStatusEnum.class, message = "状态 错误")
private Integer status;
}

View File

@ -0,0 +1,45 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseAcAppStatusEnum;
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;
import java.time.LocalDateTime;
@Data
public class CaseplatformAcAppVO {
private Long id;
@ApiModelProperty(value = "专家id")
private Long expertId;
@ApiModelProperty(value = "专家姓名")
private String expertName;
@ApiModelProperty(value = "专家手机号")
private String expertMobile;
@ApiModelProperty(value = "专家所在医院")
private String expertHospitalName;
@ApiModelProperty(value = "专家所在省份名称")
private String expertProvName;
@ApiModelProperty(value = "专家所在城市名称")
private String expertCityName;
@ApiModelPropertyEnum(value = CaseAcAppStatusEnum.class, desc = "状态1:审核通过 2:审核中)")
private Integer status;
@ApiModelProperty(value = "已审核通过病例数")
private Integer caseNum = 0;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
}

View File

@ -34,8 +34,8 @@ public class CaseplatformCaseVO {
@ApiModelProperty(value = "入院时间")
private LocalDateTime admissionTime;
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
private Integer caseType;
@ApiModelProperty(value = "治疗类型")
private String caseType;
@ApiModelProperty(value = "专家姓名")
private String expertName;
@ -49,6 +49,9 @@ public class CaseplatformCaseVO {
@ApiModelPropertyEnum(value = CaseStatusEnum.class, desc = "0待审核 1审核通过 2审核不通过")
private Integer status;
@ApiModelProperty(value = "审核通过时间")
private LocalDateTime examineTime;
@ApiModelProperty(value = "专家所在城市医院")
private String expertHospitalName;
@ -64,4 +67,9 @@ public class CaseplatformCaseVO {
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
@ApiModelProperty(value = "签署状态1:已签署 2:未签署)")
private Integer signStatus = 2;
@ApiModelProperty(value = "协议地址")
private String signLinkPc = "";
}

View File

@ -59,9 +59,9 @@ public class EasyExcelCaseDetailVO {
@ExcelProperty("患者ID")
private String uid;
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
@ExcelProperty(value = "病历类型", converter = CasetypeConverter.class)
private Integer caseType;
@ApiModelProperty(value = "治疗类型")
@ExcelProperty("治疗类型")
private String caseType;
@ApiModelProperty(value = "创建时间")
@ExcelProperty("提交时间")

View File

@ -0,0 +1,63 @@
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.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@EqualsAndHashCode
public class ExportExpertCaseExcelVo {
@ExcelIgnore
@ExcelProperty("专家id")
private Long expertId;
@ExcelIgnore
@ExcelProperty("病例id")
private Long caseId;
@ExcelProperty("序号")
private Integer index;
@ExcelProperty("银行")
private String bankName;
@ExcelProperty("账号所在省份")
private String prov;
@ExcelProperty("账户所在地市")
private String city;
@ExcelProperty("卡号")
private String bankCardNo;
@ExcelProperty("姓名")
private String idCardName;
@ExcelProperty("实发")
private Double actualAmount = 0.00;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("个税")
private Double taxAmount = 0.00;
@ExcelProperty("应发")
private Double totalAmount = 0.00;
@ExcelProperty("单位")
private String hospitalName;
@ExcelProperty("电话")
private String mobile;
@ExcelProperty("身份证号")
private String idCardNo;
@ExcelProperty("关联病例")
private String relatedCaseId;
}

View File

@ -0,0 +1,38 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class GetCaseplatformExpertWhitePageVo {
private Long id;
@ApiModelProperty(value = "姓名")
private String name;
@ApiModelProperty(value = "手机号")
private String mobile;
@ApiModelProperty(value = "状态")
private String status;
@ApiModelProperty(value = "医院名称")
private String hospitalName;
@ApiModelProperty(value = "")
private String prov;
@ApiModelProperty(value = "科室")
private String department;
@ApiModelProperty(value = "职称")
private String title;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
}

View File

@ -1,34 +1,69 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.service;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
// import com.alibaba.fastjson.JSON;
// import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.lab1024.sa.admin.module.app.expert.admin.ExpertWhiteEntity;
import net.lab1024.sa.admin.module.app.expert.dao.CasePlatformBankDao;
import net.lab1024.sa.admin.module.app.expert.dao.ExpertWhiteEntityDao;
import net.lab1024.sa.admin.module.app.expert.dao.FxqSignDao;
import net.lab1024.sa.admin.module.app.expert.domain.entity.CasePlatformBankEntity;
import net.lab1024.sa.admin.module.app.expert.domain.entity.FxqSignEntity;
import net.lab1024.sa.admin.module.app.expert.service.ExpertWhiteEntityService;
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.domain.MedicalRecordCheckdataEntity;
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordDpmsEntity;
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordEntity;
import net.lab1024.sa.admin.module.business.area.domain.vo.ProvVO;
import net.lab1024.sa.admin.module.business.caseplatformcase.dao.CaseplatformAcAppDao;
import net.lab1024.sa.admin.module.business.caseplatformcase.dao.CaseplatformCaseDao;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity.CaseplatformAcAppEntity;
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.caseplatformcase.domain.form.*;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.vo.*;
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.dao.CaseplatformCaseCheckdataDao;
import net.lab1024.sa.admin.module.business.caseplatformcasecheckdata.domain.entity.CaseplatformCaseCheckdataEntity;
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.dao.CaseplatformCaseDpmsDao;
import net.lab1024.sa.admin.module.business.caseplatformcasedpms.domain.entity.CaseplatformCaseDpmsEntity;
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.exception.BusinessException;
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.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.util.List;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import static net.lab1024.sa.common.common.code.UserErrorCode.NO_AUTH;
import static net.lab1024.sa.common.common.code.UserErrorCode.NO_PERMISSION;
/**
@ -54,6 +89,33 @@ public class CaseplatformCaseService {
@Autowired
private CaseplatformCaseCheckdataService checkdataService;
@Autowired
private ExpertWhiteEntityDao expertWhiteDao;
@Autowired
private CasePlatformBankDao casePlatformBankDao;
@Autowired
private MedicalRecorDpmasDao medicalRecorDpmasDao;
@Autowired
private MedicalRecorCheckDataDao medicalRecorCheckDataDao;
@Autowired
private MedicalRecorDao medicalRecorDao;
@Autowired
private CaseplatformAcAppDao caseplatformAcAppDao;
@Resource
private FxqSignDao fxqSignDao;
@Resource
private ExpertWhiteEntityService expertWhiteEntityService;
// 创建 ObjectMapper 实例建议使用 Spring 注入或静态常量
private static final ObjectMapper objectMapper = new ObjectMapper();
/**
* 分页查询
*
@ -72,6 +134,25 @@ public class CaseplatformCaseService {
return ResponseDTO.ok(SmartPageUtil.emptyResult(page));
}
}
// 时间处理
if (queryForm.getExamineTime() != null && queryForm.getExamineTime().size() == 2) {
LocalDateTime start = queryForm.getExamineTime().get(0)
.withHour(0).withMinute(0).withSecond(0).withNano(0);
LocalDateTime end = queryForm.getExamineTime().get(1)
.withHour(23).withMinute(59).withSecond(59).withNano(0);
queryForm.getExamineTime().set(0, start);
queryForm.getExamineTime().set(1, end);
// 格式化后的字符串列表
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
List<String> formattedList = new ArrayList<>();
formattedList.add(start.format(formatter));
formattedList.add(end.format(formatter));
queryForm.setExamineTimeFormatted(formattedList);
}
List<CaseplatformCaseVO> list = caseplatformCaseDao.queryPage(page, queryForm, provList);
PageResult<CaseplatformCaseVO> pageResult = SmartPageUtil.convert2PageResult(page, list);
return ResponseDTO.ok(pageResult);
@ -87,6 +168,24 @@ public class CaseplatformCaseService {
return null;
}
}
if (queryForm.getExamineTime() != null && queryForm.getExamineTime().size() == 2) {
LocalDateTime start = queryForm.getExamineTime().get(0)
.withHour(0).withMinute(0).withSecond(0).withNano(0);
LocalDateTime end = queryForm.getExamineTime().get(1)
.withHour(23).withMinute(59).withSecond(59).withNano(0);
queryForm.getExamineTime().set(0, start);
queryForm.getExamineTime().set(1, end);
// 格式化后的字符串列表
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
List<String> formattedList = new ArrayList<>();
formattedList.add(start.format(formatter));
formattedList.add(end.format(formatter));
queryForm.setExamineTimeFormatted(formattedList);
}
List<CaseplatformCaseVO> list = caseplatformCaseDao.queryPage(null, queryForm, provList);
return list;
}
@ -110,6 +209,204 @@ public class CaseplatformCaseService {
return list;
}
// 结算导出
public List<ExportExpertCaseExcelVo> exportExpertCaseExcel(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<ExportExpertCaseExcelVo> list = caseplatformCaseDao.getExportExpertCaseExcelList(queryForm, provList);
return list;
}
// 处理 结算导出 数据
public List<ExportExpertCaseExcelVo> exportExpertCaseExcelProcess(List<ExportExpertCaseExcelVo> list) {
// 存放 expertId -> ExportExpertCaseExcelVo 列表
Map<Long, List<ExportExpertCaseExcelVo>> expertMap = new HashMap<>();
// 第一次遍历 expertId 分组
for (ExportExpertCaseExcelVo vo : list) {
Long expertId = vo.getExpertId();
if (!expertMap.containsKey(expertId)) {
expertMap.put(expertId, new ArrayList<>());
}
expertMap.get(expertId).add(vo);
}
// 最终结果列表
List<ExportExpertCaseExcelVo> result = new ArrayList<>();
// 第二次遍历处理每组数据
Integer index = 1;
for (List<ExportExpertCaseExcelVo> group : expertMap.values()) {
// 构建一个新的 ExportExpertCaseExcelVo 对象
ExportExpertCaseExcelVo newItem = new ExportExpertCaseExcelVo();
// 取第一个对象的基础信息假设同一个人信息一致
ExportExpertCaseExcelVo first = group.get(0);
newItem.setIndex(index);
newItem.setExpertId(first.getExpertId());
newItem.setBankName(first.getBankName());
newItem.setProv(first.getProv());
newItem.setCity(first.getCity());
newItem.setBankCardNo(first.getBankCardNo());
newItem.setIdCardName(first.getIdCardName());
newItem.setRemark(first.getRemark());
newItem.setHospitalName(first.getHospitalName());
newItem.setMobile(first.getMobile());
newItem.setIdCardNo(first.getIdCardNo());
// 病例数量
int caseCount = group.size();
// relatedCaseId 拼接
StringBuilder relatedCaseIds = new StringBuilder();
for (ExportExpertCaseExcelVo vo : group) {
if (relatedCaseIds.length() > 0) {
relatedCaseIds.append(",");
}
relatedCaseIds.append(vo.getCaseId());
}
// 应发金额 = 数量 × 500
double totalAmount = caseCount * 500.0;
// 实发金额 = 应发 个税暂时用10元代替
double taxAmount = computeIndividualIncomeTax(totalAmount);
double actualAmount = totalAmount - taxAmount;
// 设置金额字段
newItem.setRelatedCaseId(relatedCaseIds.toString());
newItem.setTotalAmount(totalAmount);
newItem.setTaxAmount(taxAmount);
newItem.setActualAmount(actualAmount);
// 加入最终结果
result.add(newItem);
index++;
}
return result;
}
// 结算导入
public void caseplatformCaseSettlementImport(MultipartFile file) throws Exception {
try (InputStream is = file.getInputStream();
Workbook workbook = WorkbookFactory.create(is)) { // 自动识别 .xls .xlsx
Sheet sheet = workbook.getSheetAt(0);
// 获取最后一行的行号 0 开始
int lastRowNum = sheet.getLastRowNum();
// 从第 1 行开始读取跳过标题行
int rowNum = 0;
for (Iterator<Row> it = sheet.rowIterator(); it.hasNext();) {
Row row = it.next();
// 跳过第一行/二行
if (rowNum <= 1) {
rowNum++;
continue;
}
// 跳过最后一行
if (lastRowNum == rowNum) {
rowNum++;
continue;
}
// 判断整行是否为空
boolean isEmptyRow = true;
for (Cell cell : row) {
if (cell != null && cell.getCellType() != CellType.BLANK) {
isEmptyRow = false;
break;
}
}
if (isEmptyRow) {
rowNum++;
continue; // 跳过空行
}
String index = "";
String name = "";
String bankName = "";
String prov = "";
String city = "";
String bankCardNo = "";
String actualAmountStr = "";
String remark = "";
String taxAmountStr = "";
String totalAmountStr = "";
String hospitalName = "";
String mobile = "";
String idCardNo = "";
String relatedCaseId = "";
DataFormatter dataFormatter = new DataFormatter();
Cell cell0 = row.getCell(0); if (cell0 != null) index = cell0.toString().trim();
Cell cell1 = row.getCell(1); if (cell1 != null) bankName = cell1.toString().trim();
Cell cell2 = row.getCell(2); if (cell2 != null) prov = cell2.toString().trim();
Cell cell3 = row.getCell(3); if (cell3 != null) city = cell3.toString().trim();
Cell cell4 = row.getCell(4); if (cell4 != null) bankCardNo = cell4.toString().trim();
Cell cell5 = row.getCell(5); if (cell5 != null) name = cell5.toString().trim();
Cell cell6 = row.getCell(6); if (cell6 != null) actualAmountStr = dataFormatter.formatCellValue(cell6).trim();
Cell cell7 = row.getCell(7); if (cell7 != null) remark = cell7.toString().trim();
Cell cell8 = row.getCell(8); if (cell8 != null) taxAmountStr = dataFormatter.formatCellValue(cell8).trim();
Cell cell9 = row.getCell(9); if (cell9 != null) totalAmountStr = dataFormatter.formatCellValue(cell9).trim();
Cell cell10 = row.getCell(10); if (cell10 != null) hospitalName = cell10.toString().trim();
Cell cell11 = row.getCell(11); if (cell11 != null) mobile = dataFormatter.formatCellValue(cell11).trim();
Cell cell12 = row.getCell(12); if (cell12 != null) idCardNo = dataFormatter.formatCellValue(cell12).trim();
Cell cell13 = row.getCell(13); if (cell13 != null) relatedCaseId = dataFormatter.formatCellValue(cell13).trim();
// 病例id
String[] caseIdList = relatedCaseId.split(",");
for (String id : caseIdList) {
CaseplatformCaseEntity caseplatformCase = caseplatformCaseDao.selectById(id);
if (caseplatformCase == null) {
throw new BusinessException("处理失败: 存在非法病例 " + id);
}
// 已经结算
if (caseplatformCase.getSettlementFlag() == 1){
continue;
}
// 获取专家银行卡
LambdaQueryWrapper<CasePlatformBankEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CasePlatformBankEntity::getExpertId, caseplatformCase.getExpertId());
CasePlatformBankEntity casePlatformBank = casePlatformBankDao.selectOne(queryWrapper);
if (casePlatformBank == null) {
throw new BusinessException("处理失败: 存在非法病例 " + id);
}
if (!Objects.equals(casePlatformBank.getBankCardNo(), bankCardNo)){
throw new BusinessException("处理失败: 存在非法病例 " + id);
}
// 修改病例结算状态
caseplatformCase.setSettlementFlag(1);
caseplatformCase.setUpdateTime(LocalDateTime.now());
caseplatformCaseDao.updateById(caseplatformCase);
}
rowNum++;
}
} catch (Exception e) {
throw new BusinessException("文件读取失败: " + e.getMessage());
}
}
/**
* 添加
*/
@ -136,16 +433,58 @@ public class CaseplatformCaseService {
* @param case_id
* @return
*/
public void examine(Long case_id, int status){
caseplatformCaseDao.examine(case_id, status);
public ResponseDTO<String> examine(Long case_id, int status){
// 获取病例数据
CaseplatformCaseEntity caseplatformCase = caseplatformCaseDao.selectById(case_id);
if (caseplatformCase == null) {
return ResponseDTO.userErrorParam("病例不存在");
}
// 获取用户签署协议状态
LambdaQueryWrapper<FxqSignEntity> signQueryWrapper = new LambdaQueryWrapper<>();
signQueryWrapper.eq(FxqSignEntity::getExpertId,caseplatformCase.getExpertId());
FxqSignEntity fxqSign = fxqSignDao.selectOne(signQueryWrapper);
if (fxqSign == null) {
return ResponseDTO.userErrorParam("该用户未签署协议");
}
if (fxqSign.getSignStatus() != 1){
return ResponseDTO.userErrorParam("该用户未签署协议");
}
caseplatformCase.setStatus(status);
caseplatformCase.setExamineTime(LocalDateTime.now());
caseplatformCaseDao.updateById(caseplatformCase);
return ResponseDTO.ok();
}
/**
* 结算
* @param case_id
*/
public void settlement(Long case_id){
public ResponseDTO<String> settlement(Long case_id){
// 获取病例数据
CaseplatformCaseEntity caseplatformCase = caseplatformCaseDao.selectById(case_id);
if (caseplatformCase == null) {
return ResponseDTO.userErrorParam("病例不存在");
}
// 获取用户签署协议状态
LambdaQueryWrapper<FxqSignEntity> signQueryWrapper = new LambdaQueryWrapper<>();
signQueryWrapper.eq(FxqSignEntity::getExpertId,caseplatformCase.getExpertId());
FxqSignEntity fxqSign = fxqSignDao.selectOne(signQueryWrapper);
if (fxqSign == null) {
return ResponseDTO.userErrorParam("该用户未签署协议");
}
if (fxqSign.getSignStatus() != 1){
return ResponseDTO.userErrorParam("该用户未签署协议");
}
caseplatformCaseDao.settlement(case_id);
return ResponseDTO.ok();
}
/**
@ -166,4 +505,243 @@ public class CaseplatformCaseService {
detail.setDpmsList(dpmsVOS);
return ResponseDTO.ok(detail);
}
/**
* 将类似 ["2","1"] 格式的字符串转换为换行分隔的中文含义
* @param caseTypeJson 数据库存储的字符串比如 ["2","1"]
* @return 转换后的字符串比如
* CA280及联合模式
* DPMAS及联合模式
*/
public String convertCaseTypeToLabel(String caseTypeJson) {
if (caseTypeJson == null || caseTypeJson.isEmpty()) {
return "";
}
try {
ObjectMapper objectMapper = new ObjectMapper();
String[] caseTypes = objectMapper.readValue(caseTypeJson, String[].class);
StringBuilder result = new StringBuilder();
for (String code : caseTypes) {
if (Objects.equals(code, "1")){
result.append("DPMAS及联合模式\n");
}else if (Objects.equals(code, "2")){
result.append("CA280及联合模式\n");
}else{
result.append("未知类型: ").append(code).append("\n");
}
}
// 去掉末尾换行
if (result.length() > 0) {
result.setLength(result.length() - 1);
}
return result.toString();
} catch (Exception e) {
System.err.println("解析 caseTypeJson 出错:" + caseTypeJson);
return "解析失败";
}
}
// 计算个税
public double computeIndividualIncomeTax(double income) {
if (income <= 800) {
return 0;
}
if (income <= 4000) {
income -= 800;
} else {
income *= 0.8;
}
double taxRate;
double quickDeduction;
if (income <= 20000) {
taxRate = 0.2;
quickDeduction = 0;
} else if (income <= 50000) {
taxRate = 0.3;
quickDeduction = 2000;
} else {
taxRate = 0.4;
quickDeduction = 7000;
}
double incomeTax = income * taxRate - quickDeduction;
return Math.max(incomeTax, 0); // 防止负值
}
/**
* 出院诊断修改
*
*/
public ResponseDTO<String> caseMainDiagnose(CaseMainDiagnoseForm form) {
LambdaQueryWrapper<MedicalRecordEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(MedicalRecordEntity::getId,form.getCaseId());
MedicalRecordEntity caseplatformCase = medicalRecorDao.selectOne(queryWrapper);
if (caseplatformCase == null) {
return ResponseDTO.userErrorParam("病例不存在");
}
if (caseplatformCase.getStatus() == 1){
return ResponseDTO.userErrorParam("已通过审核,不允许修改");
}
if (!Objects.equals(caseplatformCase.getMainDiagnose(), form.getMainDiagnose())){
caseplatformCase.setMainDiagnose(form.getMainDiagnose());
medicalRecorDao.updateById(caseplatformCase);
}
return ResponseDTO.ok();
}
/**
* 人工肝治疗图片修改
*/
public ResponseDTO<String> caseDpmasImg(CaseDpmasImgForm form) {
LambdaQueryWrapper<MedicalRecordEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(MedicalRecordEntity::getId,form.getCaseId());
MedicalRecordEntity caseplatformCase = medicalRecorDao.selectOne(queryWrapper);
if (caseplatformCase == null) {
return ResponseDTO.userErrorParam("病例不存在");
}
if (caseplatformCase.getStatus() == 1){
return ResponseDTO.userErrorParam("已通过审核,不允许修改");
}
// 获取人工肝治疗信息
MedicalRecordDpmsEntity caseplatformCaseDpm = medicalRecorDpmasDao.selectById(form.getDmpsId());
if (caseplatformCaseDpm == null) {
return ResponseDTO.userErrorParam("病例不存在");
}
if (!Objects.equals(caseplatformCaseDpm.getDpmasImg(), form.getDpmasImg())){
caseplatformCaseDpm.setDpmasImg(form.getDpmasImg());
medicalRecorDpmasDao.updateById(caseplatformCaseDpm);
}
return ResponseDTO.ok();
}
/**
* 实验室检测图片修改
*/
public ResponseDTO<String> caseCheckdataImg(CaseCheckdataImgForm form) {
LambdaQueryWrapper<MedicalRecordEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(MedicalRecordEntity::getId,form.getCaseId());
MedicalRecordEntity caseplatformCase = medicalRecorDao.selectOne(queryWrapper);
if (caseplatformCase == null) {
return ResponseDTO.userErrorParam("病例不存在");
}
if (caseplatformCase.getStatus() == 1){
return ResponseDTO.userErrorParam("已通过审核,不允许修改");
}
// 获取实验室检测数据
LambdaQueryWrapper<MedicalRecordCheckdataEntity> checkDataQueryWrapper = new LambdaQueryWrapper<>();
checkDataQueryWrapper.eq(MedicalRecordCheckdataEntity::getCaseId,form.getCaseId());
MedicalRecordCheckdataEntity caseplatformCaseCheckdata = medicalRecorCheckDataDao.selectOne(checkDataQueryWrapper);
if (caseplatformCaseCheckdata == null) {
return ResponseDTO.userErrorParam("病例不存在");
}
if (form.getBioImg() != null){
if (!Objects.equals(caseplatformCaseCheckdata.getBioImg(), form.getBioImg())){
caseplatformCaseCheckdata.setBioImg(form.getBioImg());
}
}
if (form.getCoaImg() != null){
if (!Objects.equals(caseplatformCaseCheckdata.getCoaImg(), form.getCoaImg())){
caseplatformCaseCheckdata.setCoaImg(form.getCoaImg());
}
}
if (form.getInfImg() != null) {
if (!Objects.equals(caseplatformCaseCheckdata.getInfImg(), form.getInfImg())){
caseplatformCaseCheckdata.setInfImg(form.getInfImg());
}
}
medicalRecorCheckDataDao.updateById(caseplatformCaseCheckdata);
return ResponseDTO.ok();
}
/**
* 分页查询-病例活动申请
*
* @param queryForm
* @return
*/
public ResponseDTO<PageResult<CaseplatformAcAppVO>> caseplatformAcAppQueryPage(CaseplatformAcAppQueryForm 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));
}
}
// 时间处理
if (queryForm.getCreateTime() != null && queryForm.getCreateTime().size() == 2) {
LocalDateTime start = queryForm.getCreateTime().get(0).withHour(0).withMinute(0).withSecond(0).withNano(0);
LocalDateTime end = queryForm.getCreateTime().get(1).withHour(23).withMinute(59).withSecond(59).withNano(999_999_999);
queryForm.getCreateTime().set(0, start);
queryForm.getCreateTime().set(1, end);
}
List<CaseplatformAcAppVO> list = caseplatformAcAppDao.queryPage(page, queryForm, provList);
PageResult<CaseplatformAcAppVO> pageResult = SmartPageUtil.convert2PageResult(page, list);
for (CaseplatformAcAppVO vo : pageResult.getList()) {
// 获取白名单用户-姓名医院名称
ExpertWhiteEntity expertWhiteEntity = expertWhiteEntityService.getExpertWhiteEntityByNameAndHospitalName(vo.getExpertMobile(),vo.getExpertName(),vo.getExpertHospitalName());
if (expertWhiteEntity != null) {
vo.setExpertMobile(expertWhiteEntity.getMobile());
}
}
return ResponseDTO.ok(pageResult);
}
/**
* 删除-病例活动申请
*/
public ResponseDTO<String> deleteCaseplatformAcApp(Long id) {
caseplatformAcAppDao.deleteById(id);
return ResponseDTO.ok();
}
/**
* 修改-活动申请状态
*/
public ResponseDTO<String> updateCaseplatformAcApp(Long id,CaseplatformAcAppUpdateForm form) {
// 检测申请是否存在
CaseplatformAcAppEntity caseplatformAcApp = caseplatformAcAppDao.selectById(id);
if (caseplatformAcApp == null){
return ResponseDTO.userErrorParam("操作失败");
}
if (caseplatformAcApp.getStatus() == 1){
return ResponseDTO.ok();
}
if (!caseplatformAcApp.getStatus().equals(form.getStatus())){
caseplatformAcApp.setStatus(form.getStatus());
caseplatformAcAppDao.updateById(caseplatformAcApp);
}
return ResponseDTO.ok();
}
}

Some files were not shown because too many files have changed in this diff Show More