Просмотр исходного кода

Revert "update 缓存方式"

This reverts commit b19cb3aef5e81937205e92ff5fea990ff21b4151.

# Conflicts:
#	nb-admin/src/main/resources/application.yml
#	nb-common/pom.xml
#	nb-common/src/main/java/com/coffee/common/config/CachingContentFilter.java
#	nb-system/src/main/java/com/coffee/bus/hospital/config/HospitalFunctionExtraConfigHandler.java
#	nb-system/src/main/java/com/coffee/bus/hospital/config/HospitalPatientCodeHandler.java
#	nb-system/src/main/java/com/coffee/bus/registry/Operator.java
#	nb-system/src/main/java/com/coffee/bus/registry/constant/DeviceKeyConstant.java
#	nb-system/src/main/java/com/coffee/bus/registry/device/ClusterDeviceOperator.java
#	nb-system/src/main/java/com/coffee/bus/registry/device/ClusterDeviceRegistry.java
#	nb-system/src/main/java/com/coffee/bus/registry/device/DeviceOperator.java
#	nb-system/src/main/java/com/coffee/bus/registry/patient/ClusterPatientOperator.java
#	nb-system/src/main/java/com/coffee/bus/service/LocalBusHospitalConfigService.java
#	nb-system/src/main/java/com/coffee/bus/websocket/listener/DeviceInfoListener.java
#	nb-system/src/main/resources/mapper/bus/BusDeviceAlarmMapper.xml

# Conflicts:
#	nb-system/src/main/java/com/coffee/bus/hospital/config/HospitalPatientCodeHandler.java
A17404李放 3 лет назад
Родитель
Сommit
58c5beabc2

+ 0 - 0
nb-admin/src/main/resources/logback.xml → nb-admin/src/main/resources/logback-spring.xml


+ 4 - 6
nb-common/src/main/java/com/coffee/common/exception/ExecuteResult.java

@@ -10,15 +10,13 @@ import lombok.Data;
 import javax.script.ScriptException;
 import java.util.function.Supplier;
 @Data
-@ApiModel("执行结果")
+@ApiModel("脚本执行结果")
 public class ExecuteResult {
-    @ApiModelProperty("消息是否执行成功")
-    private String msgId;
-    @ApiModelProperty("是否执行成功")
+    @ApiModelProperty("脚本是否执行成功")
     private boolean success;
-    @ApiModelProperty("输入参数")
+    @ApiModelProperty("脚本输入参数")
     private String input;
-    @ApiModelProperty("输出")
+    @ApiModelProperty("脚本输出")
     private JSON result;
     @ApiModelProperty("错误消息")
     private String message;

+ 1 - 1
nb-system/src/main/java/com/coffee/aliyun/utils/PumpParams.java

@@ -18,7 +18,7 @@ public enum PumpParams {
     classification("classification","分类标识"),
     dataNumber("dataNumber","数据编号"),
     patientCodeLength("patientCodeLength","住院号长度"),
-    patientCode("identityCode","住院号"),
+    patientCode("patientCode","住院号"),
     ward("ward","病区"),
     bedNo("bedNo","床号"),
     totalDose("totalDose","总量"),

+ 0 - 0
nb-system/src/main/java/com/coffee/bus/enums/AppEnum.java


+ 4 - 2
nb-system/src/main/java/com/coffee/bus/hospital/config/HospitalPatientCodeHandler.java

@@ -44,9 +44,11 @@ public class HospitalPatientCodeHandler  extends AbstractHospitalConfigHandler<F
         FunctionPatientCodeConfig config = this.getConfig().as(FunctionPatientCodeConfig.class);
         if(config==null||!Boolean.TRUE.equals(config.getEnable())|| Objects.isNull(config.getFillChar())){
             log.warn("id:{},配置名称:{},不存在",hospitalId,getId());
+            source.setFormatPatientCode(source.getPatientCode());
             return;
         }
-        source.setPatientCode(formatPatientCode(config,source.getPatientCode(),source.getTenantId()));
+//        source.setIdentityCode(formatPatientCode(config,source.getIdentityCode(),source.getTenantId()));
+        source.setFormatPatientCode(formatPatientCode(config,source.getPatientCode(),source.getTenantId()));
     }
 
     /**
@@ -74,7 +76,7 @@ public class HospitalPatientCodeHandler  extends AbstractHospitalConfigHandler<F
             while (CharSequenceUtil.length(append)<subSize){
                 append.append(fillChar);
             }
-            appendChars=append.substring(0,subSize-1);
+            appendChars=append.substring(0,subSize);
         }
         if(Boolean.TRUE.equals(fillLeft)){
             code=appendChars+code;

+ 3 - 6
nb-system/src/main/java/com/coffee/bus/hospital/his/HisScriptSession.java

@@ -34,8 +34,6 @@ import org.tio.core.ChannelContext;
 import org.tio.core.Tio;
 import org.tio.core.utils.TioUtils;
 import org.tio.websocket.common.WsResponse;
-
-import javax.crypto.MacSpi;
 import java.util.*;
 import java.util.concurrent.*;
 
@@ -190,7 +188,7 @@ public class HisScriptSession {
      * @param patientCode
      * @return BusClinicEntity 开始时间最大的手术信息
      */
-    public BusClinicEntity handle(String msgId,String text,String patientCode){
+    public BusClinicEntity handle(String text,String patientCode){
         ScriptParse script = scriptManager.lookUpHospital(hospitalId);
         if(script==null){
             log.warn("没有获取到医院{}的解析脚本信息,不处理该条数据",hospitalId);
@@ -200,7 +198,6 @@ public class HisScriptSession {
             return null;
         }
         ExecuteResult exec = script.exec(text);
-        exec.setMsgId(msgId);
         JSON result=null;
         List<BusClinicEntity> sources=new ArrayList<>();
         try {
@@ -314,7 +311,7 @@ public class HisScriptSession {
                     return;
                 }
                 //正常响应
-                handle(messageId,Value.simple(hisResponse.getContext()).asString(), hisResponse.getPatientCode());
+                handle(Value.simple(hisResponse.getContext()).asString(), hisResponse.getPatientCode());
             }else {
                 Date responseTimestamp = hisResponse.getTimestamp();
                 Date requestTimestamp = hisRequest.getTimestamp();
@@ -332,7 +329,7 @@ public class HisScriptSession {
                         }
                         //正常响应
                         try {
-                            BusClinicEntity clinic = handle(messageId,Value.simple(hisResponse.getContext()).asString(), hisResponse.getPatientCode());
+                            BusClinicEntity clinic = handle(Value.simple(hisResponse.getContext()).asString(), hisResponse.getPatientCode());
                             if(clinic==null){
                                 result.setResult(R.fail(String.format("病号【[%s]】病人数据查询为空",hisResponse.getPatientCode())));
                             }else {

+ 1 - 1
nb-system/src/main/java/com/coffee/bus/hospital/his/strategy/HisStrategyEnum.java

@@ -20,7 +20,7 @@ import java.io.Serializable;
 public enum  HisStrategyEnum  implements IEnum<Integer>, Serializable {
     NONE(0,"无his对接"),
     ALL(1,"拉取所有的病人数据"),
-    PART(2,"拉取部分病人数据"),
+    PART(2,"拉取部分病人数据(例、最新三个月)"),
     NEW(3,"只拉取最新的病人数据"),
     ;
 

+ 2 - 2
nb-system/src/main/java/com/coffee/bus/mapper/BusClinicMapper.java

@@ -30,8 +30,8 @@ public interface BusClinicMapper extends BaseMapper<BusClinicEntity> {
      * @param patientCode
      * @return
      */
-    @Select("select * from bus_clinic where tenant_id=#{hospitalId} and patient_code=#{identityCode} order by start_time DESC limit 0,1")
-    BusClinicEntity recentClinic(@Param("hospitalId") String hospitalId,@Param("identityCode") String patientCode);
+    @Select("select * from bus_clinic where tenant_id=#{hospitalId} and patient_code=#{patientCode} order by start_time DESC limit 0,1")
+    BusClinicEntity recentClinic(@Param("hospitalId") String hospitalId,@Param("patientCode") String patientCode);
 
 
     List<ClinicStatsQueryResult> stats(@Param("query") ClinicStatsVo query);

+ 2 - 2
nb-system/src/main/java/com/coffee/bus/websocket/PatientAddHandler.java → nb-system/src/main/java/com/coffee/bus/websocket/PatientUpdateHandler.java

@@ -13,11 +13,11 @@ import org.tio.core.ChannelContext;
  * @createTime 2022年03月25日 14:21:00
  */
 @Component
-public class PatientAddHandler extends Subscribe {
+public class PatientUpdateHandler extends Subscribe {
 
     @Override
     public String getId() {
-        return WebSocketConstant.PATIENT_ADD;
+        return WebSocketConstant.PATIENT_UPDATE;
     }
 
     @Override