xiaochan 1 éve
szülő
commit
71405d69ed

+ 12 - 2
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.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.executeItem.YzZyPatientFee;
 import thyyxxk.webserver.entity.datamodify.YzActOrder;
 
@@ -112,8 +113,17 @@ public interface JieShouHuiZhenDao {
 
     @Select("select count(1)\n" +
             "from zy_detail_charge\n" +
-            "where inpatient_no = #{patNO}\n" +
+            "where inpatient_no = #{patNo}\n" +
             "  and admiss_times = #{times}\n" +
             "  and order_no = #{order} ")
-    int orderFeeCount(String patNO, Integer times, BigDecimal order);
+    int orderFeeCount(String patNo, Integer times, BigDecimal order);
+
+    @Select("select count(1)\n" +
+            "from yz_zy_patient_fee\n" +
+            "where inpatient_no = #{patNo}\n" +
+            "  and admiss_times = #{times}\n" +
+            "  and act_order_no = #{order} ")
+    int feeCount(String patNo, Integer times, BigDecimal order);
+
+
 }

+ 11 - 3
src/main/java/thyyxxk/webserver/service/inpatient/casefrontsheet/JieShouHuiZhenService.java

@@ -1,8 +1,11 @@
 package thyyxxk.webserver.service.inpatient.casefrontsheet;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.extern.slf4j.Slf4j;
+import org.aspectj.weaver.reflect.IReflectionWorld;
+import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -11,13 +14,17 @@ 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.datamodify.ZyDetailCharge;
 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 javax.annotation.PostConstruct;
+import java.math.BigDecimal;
 import java.util.Date;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -122,7 +129,9 @@ public class JieShouHuiZhenService implements Assertion {
             JieShouHuiZhenPojo reqData = dao.getHuanZheXinXi(param.getAdmissTimes(), param.getReqTimes(), param.getInpatientNo());
             dao.wanChenHuiZhen(param);
             dao.updateOrderConsultationCode(orderCode, reqData.getActOrderNo());
-            if (param.getStatusFlag().equals(2) && dao.orderFeeCount(reqData.getInpatientNo(), reqData.getAdmissTimes(), reqData.getActOrderNo()) == 0) {
+            if (param.getStatusFlag().equals(2)
+                    && dao.feeCount(reqData.getInpatientNo(), reqData.getAdmissTimes(), reqData.getActOrderNo()) == 0
+                    && dao.orderFeeCount(reqData.getInpatientNo(), reqData.getAdmissTimes(), reqData.getActOrderNo()) == 0) {
                 // 插入費用中间表
                 insertYzZyPatientFee(orderCode, reqData, userInfo);
             }
@@ -131,7 +140,7 @@ public class JieShouHuiZhenService implements Assertion {
         return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER);
     }
 
-    private void insertYzZyPatientFee(String orderCode, JieShouHuiZhenPojo reqData, UserInfo userInfo) {
+    private void insertYzZyPatientFee(String orderCode, @NotNull JieShouHuiZhenPojo reqData, @NotNull UserInfo userInfo) {
         String occCode = nullIf(dao.getOccCode(orderCode), orderCode);
 
         YzZyPatientFee fee = YzZyPatientFee.builder()
@@ -165,7 +174,6 @@ public class JieShouHuiZhenService implements Assertion {
                 return "0";
         }
     }
-
 }
 
 

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

@@ -15,7 +15,7 @@ spring:
     cache: false
   datasource:
     dynamic:
-      primary: dev
+      primary: his
       strict: false
       datasource:
         his: