소스 검색

Merge branch 'dameng'

# Conflicts:
#	src/main/java/thyyxxk/webserver/config/Assertion.java
#	src/main/java/thyyxxk/webserver/dao/his/inpatient/casefrontsheet/JieShouHuiZhenDao.java
#	src/main/java/thyyxxk/webserver/entity/datamodify/YzActOrder.java
xiaochan 11 달 전
부모
커밋
8d90596c99

+ 8 - 0
pom.xml

@@ -216,6 +216,14 @@
             <version>0.2.2</version>
         </dependency>
 
+        <!-- https://mvnrepository.com/artifact/com.dameng/DmJdbcDriver18 -->
+        <dependency>
+            <groupId>com.dameng</groupId>
+            <artifactId>DmJdbcDriver18</artifactId>
+            <version>8.1.3.140</version>
+        </dependency>
+
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-redis</artifactId>

+ 3 - 5
src/main/java/thyyxxk/webserver/config/Assertion.java

@@ -1,5 +1,6 @@
 package thyyxxk.webserver.config;
 
+import org.apache.poi.ss.formula.functions.T;
 import org.jetbrains.annotations.NotNull;
 import thyyxxk.webserver.config.exception.BizException;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
@@ -49,11 +50,8 @@ public interface Assertion {
         }
     }
 
-    default <T> T nullIf(T t1, T t2) {
-        if (t1 instanceof String) {
-            return StringUtil.isBlank((String) t1) ? t2 : t1;
-        }
-        return null == t1 ? t2 : t1;
+    default <T> T nullIf(T value, T defaultValue) {
+        return StringUtil.nullIf(value, defaultValue);
     }
 
 }

+ 15 - 7
src/main/java/thyyxxk/webserver/dao/his/inpatient/casefrontsheet/JieShouHuiZhenDao.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.entity.casefrontsheet.JieShouHuiZhenPojo;
+import thyyxxk.webserver.entity.executeItem.YzZyPatientFee;
 import thyyxxk.webserver.entity.datamodify.YzActOrder;
 
 import java.math.BigDecimal;
@@ -40,7 +41,7 @@ public interface JieShouHuiZhenDao {
     @Select("SELECT order_code FROM zd_emp_title where code = #{code} ")
     String getOrderCodeByEmpTit(String code);
 
-    @Select("select a.inpatient_no, " +
+    @Select("select  rtrim(a.inpatient_no) inpatient_no , " +
             "       b.admiss_date, " +
             "       rtrim(name)                                                                                          name, " +
             "       bed_no, " +
@@ -94,10 +95,17 @@ public interface JieShouHuiZhenDao {
     @Select("select name from zd_unit_code with(nolock) where code = #{deptCode}")
     String getDeptName(String deptCode);
 
-//    @Insert("insert into zy_detail_charge (inpatient_no, admiss_times, ledger_sn, detail_sn, charge_code, op_id_code, charge_code,\n" +
-//            "                              infant_flag, charge_status, charge_amount, charge_fee, ward_code, dept_code, order_no,\n" +
-//            "                              ope_flag, exec_unit, gen_time, charge_code_mx, serial, doctor_code, trans_flag_yb,\n" +
-//            "                              refer_physician)\n" +
-//            "values (#{yz.inpatientNo},#{yz.admissTimes} , #{} ),")
-//    void insertFees(YzActOrder yz);
+    @Select("select top 1 occ_code\n" +
+            "from yz_order_occurence\n" +
+            "where order_code = '${orderCode}';")
+    String getOccCode(String orderCode);
+
+    @Insert("insert into yz_zy_patient_fee (inpatient_no, admiss_times, ledger_sn, detail_sn, charge_date, op_id_code, charge_code,\n" +
+            "                               infant_flag, charge_status, charge_fee, occ_time, act_order_no, dept_code, ward_code,\n" +
+            "                               order_count, exec_unit)\n" +
+            "values (#{inpatientNo}, #{admissTimes}, NULL, 0, #{chargeDate}, #{opIdCode}, #{chargeCode},\n" +
+            "        #{infantflag, '1', (SELECT charge_amount FROM zd_charge_item where code = '${chargeCode}'), getdate(), #{actOrderNo},\n" +
+            "        #{deptCode}, #{deptCode},\n" +
+            "        1, #{execUnit}})")
+    void insertYzZyPatientFee(YzZyPatientFee fee);
 }

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/HuiZhenShenQingDao.java

@@ -58,7 +58,7 @@ public interface HuiZhenShenQingDao {
     @Insert("INSERT INTO yz_act_order ( order_code, order_name, frequ_code, infant_flag, order_time, physician, start_time,  " +
             "act_order_no, inpatient_no, admiss_times, drug_flag, enter_oper, enter_time, status_flag, self_buy, pay_self, " +
             "serial, group_no, doctor_flag, exec_unit, dept_code, ward_code, reg_flag,confirm_time,signer,emergency_flag,yb_self_flag)  " +
-            "VALUES ( #{orderCode}, #{orderName}, 'ONCE', '0', #{inputDate}, #{inputId}, #{inputDate}, " +
+            "VALUES ( '06054', #{orderName}, 'ONCE', '0', #{inputDate}, #{inputId}, #{inputDate}, " +
             "#{actOrderNo}, #{inpatientNo}, #{admissTimes}, 'o', #{inputId}, #{inputDate}, '2', '0', '0', '00', '00', '1'," +
             " #{reqDept1}, #{deptCode}, #{wardCode}, '',#{inputDate}, #{inputId},#{emergencyFlag},#{ybSelfFlag})")
     void chaRuYiZhu(YshHzRecord param);

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -150,7 +150,7 @@ public interface YiZhuLuRuDao {
             "                           rtrim(status_flag)                               status_flag, " +
             "                           status_time, " +
             "                           cast(a.parent_no as decimal) as parent_no," +
-            "                           cast(cast(a.parent_no as decimal) as varchar(max)) as parent_no_str, " +
+            "                           cast(cast(a.parent_no as decimal) as varchar) as parent_no_str, " +
             "    parent_no_name       = (select kfc.order_name from yz_act_order kfc where kfc.act_order_no = a.parent_no), " +
             "                           self_buy, " +
             "                           dose, " +

+ 7 - 8
src/main/java/thyyxxk/webserver/entity/datamodify/YzActOrder.java

@@ -3,11 +3,7 @@ package thyyxxk.webserver.entity.datamodify;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;
-import lombok.AllArgsConstructor;
-import lombok.NoArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
+import lombok.*;
 import lombok.experimental.Accessors;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -25,14 +21,17 @@ import java.util.List;
  * @since 2021-03-08
  */
 @Data
-@Builder
-@AllArgsConstructor
-@NoArgsConstructor
 @EqualsAndHashCode(callSuper = false)
 @ApiModel(value = "YzActOrder对象")
 @JsonInclude(JsonInclude.Include.NON_NULL)
+@AllArgsConstructor
+@Builder
 public class YzActOrder implements Serializable {
 
+    public YzActOrder() {
+
+    }
+
     private static final long serialVersionUID = 1L;
 
     /**

+ 25 - 1
src/main/java/thyyxxk/webserver/service/inpatient/casefrontsheet/JieShouHuiZhenService.java

@@ -1,19 +1,23 @@
 package thyyxxk.webserver.service.inpatient.casefrontsheet;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import thyyxxk.webserver.config.Assertion;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.dao.his.inpatient.casefrontsheet.JieShouHuiZhenDao;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.casefrontsheet.JieShouHuiZhenPojo;
+import thyyxxk.webserver.entity.executeItem.YzZyPatientFee;
 import thyyxxk.webserver.entity.login.UserInfo;
 import thyyxxk.webserver.service.PublicServer;
 import thyyxxk.webserver.service.redislike.RedisLikeService;
 import thyyxxk.webserver.utils.*;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Set;
 
@@ -27,7 +31,7 @@ import java.util.Set;
  */
 @Service
 @Slf4j
-public class JieShouHuiZhenService {
+public class JieShouHuiZhenService implements Assertion {
 
     private final JieShouHuiZhenDao dao;
     private final PublicServer publicServer;
@@ -118,11 +122,31 @@ public class JieShouHuiZhenService {
             JieShouHuiZhenPojo reqData = dao.getHuanZheXinXi(param.getAdmissTimes(), param.getReqTimes(), param.getInpatientNo());
             dao.wanChenHuiZhen(param);
             dao.updateOrderConsultationCode(orderCode, reqData.getActOrderNo());
+            // 插入費用中间表
+            insertYzZyPatientFee(orderCode, reqData, userInfo);
             return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, param.getStatusFlag() == 1 ? "保存成功" : "完成会诊");
         }
         return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER);
     }
 
+    private void insertYzZyPatientFee(String orderCode, JieShouHuiZhenPojo reqData, UserInfo userInfo) {
+        String occCode = nullIf(dao.getOccCode(orderCode), orderCode);
+
+        YzZyPatientFee fee = YzZyPatientFee.builder()
+                .inpatientNo(reqData.getInpatientNo())
+                .admissTimes(reqData.getAdmissTimes())
+                .chargeDate(reqData.getReqDate())
+                .opIdCode(userInfo.getCode())
+                .chargeCode(occCode)
+                .infantFlag(reqData.getInpatientNo().contains("$") ? "1" : "0")
+                .actOrderNo(reqData.getActOrderNo())
+                .deptCode(reqData.getDeptCode())
+                .execUnit(reqData.getReqDept1())
+                .build();
+
+        dao.insertYzZyPatientFee(fee);
+    }
+
 
 //    public void insert
 

+ 1 - 0
src/main/java/thyyxxk/webserver/service/zhuyuanyiji/QueRenYiZhuShouFeiServer.java

@@ -2,6 +2,7 @@ package thyyxxk.webserver.service.zhuyuanyiji;
 
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;

+ 1 - 1
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/HuiZhenShenQingService.java

@@ -113,7 +113,7 @@ public class HuiZhenShenQingService {
         // 坑爹的医嘱系统的 医嘱变更单,都用的是病房,这两个字段,而患者信息表中 deptCode 记录的是病房
         param.setWardCode(patInfo.getDeptCode());
         param.setDeptCode(patInfo.getDeptCode());
-        //申请成功了就还需要插入一条医嘱
+        //申请成功了就还需要插入一条医嘱
         dao.chaRuYiZhu(param);
     }
 

+ 5 - 0
src/main/resources/application-cytest.yml

@@ -33,6 +33,11 @@ spring:
           username: "sa"
           password:
           driver-class-name: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
+        dameng:
+          url: "jdbc:dm://172.16.30.206:5240"
+          username: "SYSDBA"
+          password: "HUN_SYSDBA2023"
+          driver-class-name: "dm.jdbc.driver.DmDriver"
     druid:
       #type: com.alibaba.druid.pool.DruidDataSource
       #初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时

+ 170 - 0
src/main/resources/application-dameng.yml

@@ -0,0 +1,170 @@
+server:
+  port: 8706
+  tomcat:
+    uri-encoding: utf-8
+    threads:
+      min-spare: 20
+      max: 800
+    accept-count: 200
+    max-connections: 10000
+  servlet:
+    encoding:
+      charset: utf-8
+spring:
+  thymeleaf:
+    cache: false
+  datasource:
+    dynamic:
+      primary: his
+      strict: false
+      datasource:
+        his:
+          url: "jdbc:dm://172.16.32.206:5240?genKeyNameCase=2"
+          username: "THXYHISDB"
+          password: "THXYHISDB@123456"
+          driver-class-name: "dm.jdbc.driver.DmDriver"
+        lis:
+          url: "jdbc:sqlserver://172.16.32.178:1433;databaseName=eLimsCore"
+          username: "sa"
+          password: "hnthxyyy"
+          driver-class-name: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
+        dev:
+          url: "jdbc:sqlserver://172.16.32.179:1433;databaseName=thxyhisdb"
+          username: "sa"
+          password:
+          driver-class-name: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
+    druid:
+      #type: com.alibaba.druid.pool.DruidDataSource
+      #初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时
+      initial-size: 40
+      #最大连接池数量
+      max-active: 100
+      #最小连接池数量
+      min-idle: 40
+      #获取连接时最大等待时间,单位毫秒
+      max-wait: 60000
+      #使用非公平锁。
+      use-unfair-lock: true
+      #用来检测连接是否有效的sql,要求是一个查询语句。
+      validation-query: SELECT 1
+      #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
+      test-while-idle: true
+      #申请连接时执行validationQuery检测连接是否有效,
+      test-on-borrow: true
+      #归还连接时执行validationQuery检测连接是否有效,
+      test-on-return: false
+      #Destroy线程会检测连接的间隔时间,testWhileIdle的判断依据,详细看testWhileIdle属性的说明
+      time-between-eviction-runs-millis: 60000
+      #配置一个连接在池中最小生存的时间,单位是毫秒
+      min-evictable-idle-time-millis: 300000
+      #监控统计用的filter:stat  日志用的filter:log4j    防御sql注入的filter:wall
+      filters: stat
+      #是否缓存preparedStatement,也就是PSCache,在mysql5.5以下的版本中没有PSCache功能,建议关闭掉
+      pool-prepared-statements: false
+      #要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true。
+      max-pool-prepared-statement-per-connection-size: 200
+      #对于长时间不使用的连接强制关闭
+      remove-abandoned: true
+      #数据库链接超过180秒开始关闭空闲连接 秒为单位
+      remove-abandoned-timeout: 180
+      #将当前关闭动作记录到日志  此配置项会影响性能,只在排查的时候打开,系统运行时最好关闭。
+      log-abandoned: true
+  autoconfigure:
+    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 去除druid配置
+  jackson:
+    time-zone: Asia/Shanghai
+    date-format: yyyy-MM-dd HH:mm:ss
+  mvc:
+    format:
+      date: yyyy-MM-dd
+      date-time: yyyy-MM-dd HH:mm:ss
+  redis:
+    host: 172.16.32.167
+    port: 6379
+    database: 0
+    password: thyy@2018
+forest:
+  timeout: 0
+  read-timeout: 0
+  log-enabled: true
+  log-request: true
+  log-response-status: true
+  connect-timeout: 1500
+  variables:
+    socketCenter: http://localhost:8707/socketApi
+
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+  global-config:
+    enableSqlRunner: true
+
+management:
+  server:
+    port: 9093
+  endpoints:
+    web:
+      base-path: /actuator
+      exposure:
+        include: '*'
+  metrics:
+    export:
+      simple:
+        enabled: true
+      jmx:
+        enabled: true
+      prometheus:
+        enabled: true
+    distribution:
+      percentiles-histogram:
+        http:
+          server:
+            requests: false
+      minimum-expected-value:
+        http:
+          server:
+            requests: 20ms
+      maximum-expected-value:
+        http:
+          server:
+            requests: 200ms
+  endpoint:
+    metrics:
+      enabled: true
+    health:
+      show-details: always
+      probes:
+        enabled: true
+    prometheus:
+      enabled: true
+
+execute-scheduled: false
+is-prod: false
+triage-notify-url: http://localhost:8082/triage/roomScreen/pushMsg
+si-tj-url: http://jkglcsx.server.zhongmeihealth.com/openInter
+
+#正式环境
+si-api-url: http://dms.hun.hsip.gov.cn/isp-api/powercsb/1101
+si-access-key: 04eMGRg7beAO6vqwrZiLacV8Uy3jNn7QGDUcBO
+si-secret-key: SK3Oip3a2R3NLz2xm58Mpmi69oFu96KrdKNRKglN
+si-zy-fee-url: http://172.16.32.166:1000
+si-mz-fee-url: http://172.16.32.166:1100/mzFee
+si-injury-fee-url: http://172.16.32.163:2100/siInjury
+#si-injury-systm-url: http://172.16.32.163:2000/siInjury
+thmz-api-url: http://172.16.32.160:81/thmz/api/v1
+
+#测试环境
+#si-api-url: http://10.93.30.130:20001/isp-api/powercsb/1101
+#si-access-key: Zgs5jfxaKb86XbCuUzLK9EhFjiQfHR1vydaPzp
+#si-secret-key: SKT2ETMT3XkAYApqh79DCnN9ZjfbQEBMPU0GyLz9
+#si-zy-fee-url: http://localhost:1000
+#si-mz-fee-url: http://localhost:1100/mzFee
+#si-injury-fee-url: http://localhost:2100/siInjury
+si-injury-systm-url: http://localhost:2000/siInjury
+#thmz-api-url: http://172.16.30.33:81/thmz/api/v1
+
+appletThmzUrl: http://172.16.30.119:8089/thmz
+
+logging:
+  level:
+    thyyxxk.webserver.dao: debug