Procházet zdrojové kódy

文书入院记录存在则同步更新入院登记qc_type_id

lantone před 5 roky
rodič
revize
1e71b7fa23

+ 5 - 1
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -87,7 +87,6 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/oauth/token", request)
                 || matchers("/oauth/check_token", request)
                 || matchers("/cache/clear", request)
-                || matchers("/qc/mode/getMenu", request)
                 || matchers("/qc/behospitalInfo/execule", request)
                 || matchers("/qc/behospitalInfo/analyze_rpc", request)
                 || matchers("/qc/behospitalInfo/analyze_api", request)
@@ -108,7 +107,12 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/behospitalInfo/exportExcel", request)
                 || matchers("/qc/behospitalInfo/exportQcresult", request)
                 || matchers("/qc/behospitalInfo/exportQcresultByDept", request)
+                || matchers("/console/entryRejectPercent", request)
                 || matchers("/qc/abnormal/getQcAnnormalMode", request)
+                || matchers("/console/qcResultLevelPercent", request)
+                || matchers("/qc/dataimport/import", request)
+                || matchers("/qc/dataimport/dataimportPrepare", request)
+                || matchers("/qc/dataimport/test", request)
                 || matchers("/qc/data/sendDoctorInfos", request)
                 || matchers("/qc/data/sendDeptInfos", request)
                 || matchers("/qc/data/sendRecordTypes", request)

+ 42 - 0
src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java

@@ -8,6 +8,7 @@ import com.diagbot.entity.*;
 import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.facade.ModelHospitalFacade;
 import com.diagbot.facade.QcAbnormalFacade;
+import com.diagbot.facade.QcTypeFacade;
 import com.diagbot.service.impl.MedicalRecordServiceImpl;
 import com.diagbot.service.impl.QcAbnormalServiceImpl;
 import com.diagbot.util.BeanUtil;
@@ -47,6 +48,9 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
     @Qualifier("qcAbnormalServiceImpl")
     private QcAbnormalServiceImpl qcAbnormalService;
 
+    @Autowired
+    private QcTypeFacade qcTypeFacade;
+
     @Autowired
     private ReadProperties readProperties;
 
@@ -185,6 +189,7 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
     public void execute(List<MedicalRecord> medicalRecordList){
         List<MedicalRecord> addE = Lists.newLinkedList();
         List<MedicalRecord> updateE = Lists.newLinkedList();
+        List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
         List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
         if (medicalRecordList != null && medicalRecordList.size() > 0) {
             medicalRecordList.stream().forEach(s -> {
@@ -199,6 +204,40 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                     qcAbnormal.setDescription(s.getRecTitle());
                     qcAbnormal.setGmtCreate(new Date());
                     qcAbnormalList.add(qcAbnormal);
+                }else if(modeId==Long.valueOf("1")){
+
+                    BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
+                            .eq("behospital_code", s.getBehospitalCode())
+                            .eq("hospital_id", s.getHospitalId()));
+                    if(behospitalInfo!=null){
+                        //如果病人住院信息存在,更新对应的qc_type_id
+                        Long qcTypeId=Long.valueOf("0");
+                        QcType qcType=qcTypeFacade.getOne(new QueryWrapper<QcType>()
+                                .eq("name",s.getRecTitle())
+                                .eq("hospital_id", s.getHospitalId()));
+                        if(qcType!=null){
+                            behospitalInfo.setQcTypeId(qcType.getId());
+                        }else{
+                            //新增类型到qc_type表中
+                            QcType qctype=new QcType();
+                            qctype.setHospitalId(s.getHospitalId());
+                            qctype.setName(s.getRecTitle());
+                            qctype.setGmtCreate(new Date());
+
+                            Long id=qcTypeFacade.saveT(qctype);
+                            behospitalInfo.setQcTypeId(id);
+
+                            //新增类型到监测表中
+                            QcAbnormal qcAbnormal=new QcAbnormal();
+                            qcAbnormal.setHospitalId(s.getHospitalId());
+                            qcAbnormal.setBehospitalCode(s.getBehospitalCode());
+                            qcAbnormal.setType(2);
+                            qcAbnormal.setDescription(s.getRecTitle());
+                            qcAbnormal.setGmtCreate(new Date());
+                            qcAbnormalService.getBaseMapper().insert(qcAbnormal);
+                        }
+                        behospitalInfoList.add(behospitalInfo);
+                    }
                 }
                 s.setModeId(modeId);
                 //新增或修改
@@ -224,6 +263,9 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
         if(qcAbnormalList.size()>0){
             qcAbnormalService.saveBatch(qcAbnormalList);
         }
+        if(behospitalInfoList.size()>0){
+            behospitalInfoFacade.updateBatchByKey(behospitalInfoList);
+        }
     }
 
 

+ 2 - 2
src/main/resources/application-local.yml

@@ -1,5 +1,5 @@
 server:
-  port: 5858
+  port: 5959
   max-http-header-size: 10MB
 
 hystrix:
@@ -58,7 +58,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.100.157:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.100.157:3306/qq_test?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
       password: lantone
       # 连接池的配置信息