Procházet zdrojové kódy

修改数据查询状态,已删除的不能新使用,但是已经做过的质控可以查看数据和结果。

gengjunfang před 3 týdny
rodič
revize
87c8569b1e

binární
doc/质控系统操作手册.docx


+ 4 - 0
src/main/java/com/zskk/qcns/modules/dicom/controller/DicomController.java

@@ -163,6 +163,10 @@ public class DicomController {
             Page<StudyInfo> page = new Page<>(pageNum, pageSize);
             LambdaQueryWrapper<StudyInfo> query = new LambdaQueryWrapper<>();
 
+            // 只查询未删除的数据
+            query.eq(StudyInfo::getIsDeleted, 0);
+            log.info("添加查询条件: isDeleted=0");
+
             // 查询条件 - studyId优先级最高
             if (studyId != null && !studyId.isEmpty()) {
                 query.eq(StudyInfo::getStudyId, studyId);

+ 5 - 0
src/main/java/com/zskk/qcns/modules/qc/controller/QcResultController.java

@@ -128,6 +128,7 @@ public class QcResultController {
                 // 查询检查信息
                 LambdaQueryWrapper<StudyInfo> studyQuery = new LambdaQueryWrapper<>();
                 studyQuery.eq(StudyInfo::getStudyId, result.getExamId());
+                studyQuery.eq(StudyInfo::getIsDeleted, 0);  // 只查询未删除的数据
                 StudyInfo study = studyInfoMapper.selectOne(studyQuery);
 
                 if (study != null) {
@@ -201,6 +202,7 @@ public class QcResultController {
             // 查询检查信息
             LambdaQueryWrapper<StudyInfo> studyQuery = new LambdaQueryWrapper<>();
             studyQuery.eq(StudyInfo::getStudyInstanceUid, result.getExamId());
+            studyQuery.eq(StudyInfo::getIsDeleted, 0);  // 只查询未删除的数据
             StudyInfo study = studyInfoMapper.selectOne(studyQuery);
 
             // 构建返回对象
@@ -386,6 +388,7 @@ public class QcResultController {
 
             LambdaQueryWrapper<StudyInfo> studyQuery = new LambdaQueryWrapper<>();
             studyQuery.in(StudyInfo::getStudyId, resultStudyIds);
+            // studyQuery.eq(StudyInfo::getIsDeleted, 0);  // 只查询未删除的数据
             studyQuery.orderByDesc(StudyInfo::getStudyDate);
 
             List<StudyInfo> studyList = studyInfoMapper.selectList(studyQuery);
@@ -611,6 +614,7 @@ public class QcResultController {
             // 查询检查信息
             LambdaQueryWrapper<StudyInfo> studyQuery = new LambdaQueryWrapper<>();
             studyQuery.eq(StudyInfo::getStudyInstanceUid, studyInstanceUid);
+            studyQuery.eq(StudyInfo::getIsDeleted, 0);  // 只查询未删除的数据
 
             // 如果传入了机构ID,添加到查询条件
             if (institutionId != null && !institutionId.isEmpty()) {
@@ -946,6 +950,7 @@ public class QcResultController {
             // 查询检查信息
             LambdaQueryWrapper<StudyInfo> studyQuery = new LambdaQueryWrapper<>();
             studyQuery.eq(StudyInfo::getStudyInstanceUid, studyInstanceUid);
+            studyQuery.eq(StudyInfo::getIsDeleted, 0);  // 只查询未删除的数据
 
             // 如果传入了机构ID,添加到查询条件
             String institutionId = updateData.get("institutionId");

+ 10 - 3
src/main/java/com/zskk/qcns/modules/qc/controller/QcResultDetailController.java

@@ -101,7 +101,9 @@ public class QcResultDetailController {
 
             // 2. 查询检查信息
             StudyInfo study = studyInfoMapper.selectOne(
-                    new LambdaQueryWrapper<StudyInfo>().eq(StudyInfo::getStudyId, studyId)
+                    new LambdaQueryWrapper<StudyInfo>()
+                            .eq(StudyInfo::getStudyId, studyId)
+                            //.eq(StudyInfo::getIsDeleted, 0)  // 只查询未删除的数据
             );
             if (study == null) {
                 return RestResult.error("检查不存在");
@@ -177,7 +179,9 @@ public class QcResultDetailController {
 
             // 2. 查询检查信息
             StudyInfo study = studyInfoMapper.selectOne(
-                    new LambdaQueryWrapper<StudyInfo>().eq(StudyInfo::getStudyId, studyId)
+                    new LambdaQueryWrapper<StudyInfo>()
+                            .eq(StudyInfo::getStudyId, studyId)
+                            //.eq(StudyInfo::getIsDeleted, 0)  // 只查询未删除的数据
             );
             if (study == null) {
                 return RestResult.error("检查不存在");
@@ -519,6 +523,7 @@ public class QcResultDetailController {
 
             LambdaQueryWrapper<StudyInfo> studyQuery = new LambdaQueryWrapper<>();
             studyQuery.in(StudyInfo::getStudyId, studyIds);
+            //studyQuery.eq(StudyInfo::getIsDeleted, 0);  // 只查询未删除的数据
 
             // 如果有 modality 参数,过滤 study
             if (modality != null && !modality.isEmpty()) {
@@ -729,7 +734,9 @@ public class QcResultDetailController {
 
             // 2. 查询检查信息
             StudyInfo study = studyInfoMapper.selectOne(
-                    new LambdaQueryWrapper<StudyInfo>().eq(StudyInfo::getStudyId, studyId)
+                    new LambdaQueryWrapper<StudyInfo>()
+                            .eq(StudyInfo::getStudyId, studyId)
+                            .eq(StudyInfo::getIsDeleted, 0)  // 只查询未删除的数据
             );
             if (study == null) {
                 return RestResult.error("检查不存在");

+ 1 - 0
src/main/java/com/zskk/qcns/modules/qc/controller/QcTaskManageController.java

@@ -400,6 +400,7 @@ public class QcTaskManageController {
                         // 查询检查信息
                         LambdaQueryWrapper<StudyInfo> studyQuery = new LambdaQueryWrapper<>();
                         studyQuery.eq(StudyInfo::getStudyId, examId);
+                        studyQuery.eq(StudyInfo::getIsDeleted, 0);  // 只查询未删除的数据
                         StudyInfo study = studyInfoMapper.selectOne(studyQuery);
 
                         if (study != null) {

+ 1 - 0
src/main/java/com/zskk/qcns/modules/qc/service/impl/QcTaskServiceImpl.java

@@ -191,6 +191,7 @@ public class QcTaskServiceImpl extends ServiceImpl<QcTaskMapper, QcTask> impleme
                     // 使用 study_id 查询,而不是主键 id
                     LambdaQueryWrapper<StudyInfo> query = new LambdaQueryWrapper<>();
                     query.eq(StudyInfo::getStudyId, examId);
+                    query.eq(StudyInfo::getIsDeleted, 0);  // 只查询未删除的数据
                     StudyInfo exam = studyInfoMapper.selectOne(query);
 
                     if (exam != null) {

+ 18 - 6
src/main/java/com/zskk/qcns/modules/study/service/impl/DataManageServiceImpl.java

@@ -156,7 +156,9 @@ public class DataManageServiceImpl implements DataManageService {
     public DataManageVO getStudyDetail(String studyId) {
         // 查询检查信息
         StudyInfo study = studyInfoMapper.selectOne(
-            new LambdaQueryWrapper<StudyInfo>().eq(StudyInfo::getStudyId, studyId)
+            new LambdaQueryWrapper<StudyInfo>()
+                .eq(StudyInfo::getStudyId, studyId)
+                .eq(StudyInfo::getIsDeleted, 0)  // 只查询未删除的数据
         );
 
         if (study == null) {
@@ -217,7 +219,9 @@ public class DataManageServiceImpl implements DataManageService {
     @Transactional(rollbackFor = Exception.class)
     public boolean saveGovernResults(String studyId, java.util.List<com.zskk.qcns.modules.dicom.vo.GovernResultVO> governResults) {
         StudyInfo study = studyInfoMapper.selectOne(
-            new LambdaQueryWrapper<StudyInfo>().eq(StudyInfo::getStudyId, studyId)
+            new LambdaQueryWrapper<StudyInfo>()
+                .eq(StudyInfo::getStudyId, studyId)
+                .eq(StudyInfo::getIsDeleted, 0)  // 只查询未删除的数据
         );
 
         if (study == null) {
@@ -268,7 +272,9 @@ public class DataManageServiceImpl implements DataManageService {
     @Transactional(rollbackFor = Exception.class)
     public boolean confirmStudy(String studyId, Integer confirmStatus) {
         StudyInfo studyInfo = studyInfoMapper.selectOne(
-            new LambdaQueryWrapper<StudyInfo>().eq(StudyInfo::getStudyId, studyId)
+            new LambdaQueryWrapper<StudyInfo>()
+                .eq(StudyInfo::getStudyId, studyId)
+                .eq(StudyInfo::getIsDeleted, 0)  // 只查询未删除的数据
         );
 
         if (studyInfo == null) {
@@ -288,7 +294,9 @@ public class DataManageServiceImpl implements DataManageService {
     @Transactional(rollbackFor = Exception.class)
     public boolean governStudy(String studyId) {
         StudyInfo studyInfo = studyInfoMapper.selectOne(
-            new LambdaQueryWrapper<StudyInfo>().eq(StudyInfo::getStudyId, studyId)
+            new LambdaQueryWrapper<StudyInfo>()
+                .eq(StudyInfo::getStudyId, studyId)
+                .eq(StudyInfo::getIsDeleted, 0)  // 只查询未删除的数据
         );
 
         if (studyInfo == null) {
@@ -312,7 +320,9 @@ public class DataManageServiceImpl implements DataManageService {
     @Transactional(rollbackFor = Exception.class)
     public boolean updateSeriesAndImageCount(String studyId, Integer seriesCount, Integer imageCount) {
         StudyInfo studyInfo = studyInfoMapper.selectOne(
-            new LambdaQueryWrapper<StudyInfo>().eq(StudyInfo::getStudyId, studyId)
+            new LambdaQueryWrapper<StudyInfo>()
+                .eq(StudyInfo::getStudyId, studyId)
+                .eq(StudyInfo::getIsDeleted, 0)  // 只查询未删除的数据
         );
 
         if (studyInfo == null) {
@@ -335,7 +345,9 @@ public class DataManageServiceImpl implements DataManageService {
     @Transactional(rollbackFor = Exception.class)
     public boolean updateExamItemName(String studyId, String examItemName) {
         StudyInfo studyInfo = studyInfoMapper.selectOne(
-            new LambdaQueryWrapper<StudyInfo>().eq(StudyInfo::getStudyId, studyId)
+            new LambdaQueryWrapper<StudyInfo>()
+                .eq(StudyInfo::getStudyId, studyId)
+                .eq(StudyInfo::getIsDeleted, 0)  // 只查询未删除的数据
         );
 
         if (studyInfo == null) {

+ 119 - 0
src/main/resources/application-hb.yml

@@ -0,0 +1,119 @@
+server:
+  port: 8090
+  servlet:
+    context-path: /
+
+spring:
+  application:
+    name: qc-ns
+  main:
+    allow-circular-references: true
+
+  # 数据源配置
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://122.188.65.89:6210/qc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+    username: yingxiangyun
+    password: ying#20260206@xiang
+
+    druid:
+      initial-size: 5
+      min-idle: 5
+      max-active: 20
+      max-wait: 60000
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      validation-query: SELECT 1
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+      pool-prepared-statements: true
+      max-pool-prepared-statement-per-connection-size: 20
+
+  # Redis配置
+  redis:
+    host: localhost
+    port: 6379
+    password: 123456 # Redis密码
+    database: 0
+    timeout: 6000ms
+    lettuce:
+      pool:
+        max-active: 8
+        max-wait: -1ms
+        max-idle: 8
+        min-idle: 0
+
+  # Jackson配置
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: GMT+8
+    serialization:
+      write-dates-as-timestamps: false
+
+  # 文件上传配置
+  servlet:
+    multipart:
+      max-file-size: 500MB
+      max-request-size: 2GB
+      enabled: true
+
+# MyBatis-Plus配置
+mybatis-plus:
+  mapper-locations: classpath*:mapper/**/*.xml
+  type-aliases-package: com.zskk.qcns.modules.*.entity
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  global-config:
+    db-config:
+      id-type: assign_uuid
+      logic-delete-field: deleted
+      logic-delete-value: 1
+      logic-not-delete-value: 0
+
+# PageHelper分页配置
+pagehelper:
+  helper-dialect: mysql
+  reasonable: true
+  support-methods-arguments: true
+  params: count=countSql
+
+# JWT配置
+jwt:
+  secret: qconline-secret-key-2025
+  expiration: 86400 # 24小时
+
+# 日志配置
+logging:
+  level:
+    com.zskk.qcns: debug
+    org.springframework: info
+  file:
+    path: ./logs
+    name: ./logs/qcns.log
+
+# SpringDoc配置
+springdoc:
+  swagger-ui:
+    path: /swagger-ui.html
+    enabled: true
+  api-docs:
+    path: /v3/api-docs
+    enabled: true
+  group-configs:
+    - group: 'default'
+      paths-to-match: '/**'
+      packages-to-scan: com.zskk.qcns.modules
+
+#dcm_file_url_prefix: dicomweb://192.168.110.91:8080/api/dicom/viewer/%s/%s
+#dcm_file_url_prefix: dicomweb://127.0.0.1:8090/api/dicom/viewer/%s/%s
+#dcm_file_url_prefix: dicomweb://36.140.148.147:9605/api/dicom/viewer/%s/%s
+dcm_file_url_prefix: dicomweb://122.188.65.69:7215/api/dicom/viewer/%s/%s
+
+# Quartz调度器配置
+quartz:
+  enabled: true
+

+ 6 - 6
src/main/resources/application.yml

@@ -13,9 +13,9 @@ spring:
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://122.188.65.89:6210/qc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
-    username: yingxiangyun
-    password: ying#20260206@xiang
+    url: jdbc:mysql://127.0.0.1:3306/qc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+    username: root
+    password: Zskk@2025
 
     druid:
       initial-size: 5
@@ -35,7 +35,7 @@ spring:
   redis:
     host: localhost
     port: 6379
-    password: 123456 # Redis密码
+    password: zskk@2025 # Redis密码
     database: 0
     timeout: 6000ms
     lettuce:
@@ -109,9 +109,9 @@ springdoc:
       packages-to-scan: com.zskk.qcns.modules
 
 #dcm_file_url_prefix: dicomweb://192.168.110.91:8080/api/dicom/viewer/%s/%s
-#dcm_file_url_prefix: dicomweb://127.0.0.1:8090/api/dicom/viewer/%s/%s
+dcm_file_url_prefix: dicomweb://127.0.0.1:8090/api/dicom/viewer/%s/%s
 #dcm_file_url_prefix: dicomweb://36.140.148.147:9605/api/dicom/viewer/%s/%s
-dcm_file_url_prefix: dicomweb://122.188.65.69:7215/api/dicom/viewer/%s/%s
+#dcm_file_url_prefix: dicomweb://122.188.65.69:7215/api/dicom/viewer/%s/%s
 
 # Quartz调度器配置
 quartz: