瀏覽代碼

解决手术报错问题

xiaochan 2 月之前
父節點
當前提交
2ed23fdf56

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/inpatient/PatientDao.java

@@ -300,7 +300,7 @@ public interface PatientDao {
                         @Param("times") int times,
                         @Param("ledger") int ledger);
 
-    @Update("execute zy_receive_drug #{zyh},#{times},#{zyh} ")
+    @Update("execute zy_receive_drug #{zyh},#{times},#{zyh},#{infant} ")
     void zyReceiveDrug(@Param("zyh") String zyh,
                        @Param("times") int times,
                        @Param("infant") int infant);

+ 8 - 1
src/main/java/thyyxxk/webserver/service/inpatient/PatientService.java

@@ -2,6 +2,8 @@ package thyyxxk.webserver.service.inpatient;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
@@ -433,7 +435,7 @@ public class PatientService {
         }
         if (null != age && (age < 16 || age > 60)) {
             if (patient.getName().equals(patient.getContactName()) ||
-                patient.getContactRelation().equals("0")) {
+                    patient.getContactRelation().equals("0")) {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "16岁以下或60岁以上的患者,联系人不能填写本人。");
             }
         }
@@ -552,4 +554,9 @@ public class PatientService {
         dao.updateZyActPatientBalance(zyh, balance);
         return getPatientInfo(zyh);
     }
+
+
+
+
+
 }

+ 31 - 0
src/main/java/thyyxxk/webserver/utils/WrapperUtils.java

@@ -0,0 +1,31 @@
+package thyyxxk.webserver.utils;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
+import java.util.Date;
+import java.util.Map;
+
+public class WrapperUtils {
+    public static String getFullSql(QueryWrapper<?> wrapper) {
+        // 1. 获取SQL片段(带#{param}格式)
+        String sqlSegment = wrapper.getSqlSegment();
+
+        // 2. 获取参数映射
+        Map<String, Object> paramMap = wrapper.getParamNameValuePairs();
+
+        // 3. 替换参数
+        for (Map.Entry<String, Object> entry : paramMap.entrySet()) {
+            String paramName = entry.getKey();
+            Object value = entry.getValue();
+            String placeholder = "#{ew.paramNameValuePairs." + paramName + "}";
+
+            // 处理特殊值(字符串/日期需加引号)
+            String replacement = (value instanceof CharSequence || value instanceof Date)
+                    ? "'" + value + "'" : String.valueOf(value);
+
+            sqlSegment = sqlSegment.replace(placeholder, replacement);
+        }
+
+        return sqlSegment;
+    }
+}

+ 1 - 1
src/main/resources/application-mhyy.yml

@@ -81,7 +81,7 @@ forest:
   log-response-status: true
   connect-timeout: 1500
   variables:
-    emrUrl: "http://172.16.32.125:8001/emr/runtime/api/v1"
+    emrUrl: "http://130.150.161.69:8001/emr/runtime/api/v1"
 
 management:
   server: