Browse Source

项目录入退费限制,已经结算的就不能操作这个患者的费用了

xiaochan 3 years ago
parent
commit
c5357db0a3

+ 6 - 0
src/main/java/thyyxxk/webserver/dao/his/yibao/XiangMuLuRuDao.java

@@ -764,4 +764,10 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
     @Select("select count(*) from zy_actpatient where inpatient_no = #{inpatientNo}")
     Integer getHuanZheSFZaiYuan(String inpatientNo);
 
+    @Select("select settle_type from zy_ledger_file where " +
+            "inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn =  #{ledgerSn}")
+    Integer getHuanZheSFJieSuan(@Param("inpatientNo") String inpatientNo,
+                                @Param("admissTimes") Integer admissTimes,
+                                @Param("ledgerSn") Integer ledgerSn);
+
 }

+ 5 - 11
src/main/java/thyyxxk/webserver/service/yibao/XiangMuLuRuService.java

@@ -8,7 +8,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
-import thyyxxk.webserver.dao.his.yibao.DismissDao;
 import thyyxxk.webserver.dao.his.yibao.XiangMuLuRuDao;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.datamodify.FeiYongLeiXin;
@@ -35,18 +34,13 @@ import java.util.stream.Collectors;
 @Service
 @Slf4j
 public class XiangMuLuRuService {
-
     private final XiangMuLuRuDao dao;
-
     private final PublicServer publicServer;
 
-    private final DismissDao dismissDao;
-
     @Autowired
-    public XiangMuLuRuService(XiangMuLuRuDao dao, PublicServer publicServer, DismissDao dismissDao) {
+    public XiangMuLuRuService(XiangMuLuRuDao dao, PublicServer publicServer) {
         this.dao = dao;
         this.publicServer = publicServer;
-        this.dismissDao = dismissDao;
     }
 
     /**
@@ -133,8 +127,8 @@ public class XiangMuLuRuService {
         if (dao.chaKanHuanZheSFZaiYuan(param.getInpatientNo()) == 0) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该患者已出院 /(ㄒoㄒ)/~~");
         }
-        if (dismissDao.countDisActOrders(param.getInpatientNo(), param.getAdmissTimes()) > 0 || dismissDao.countDisActOrders2(param.getInpatientNo(), param.getAdmissTimes()) > 0) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该患者已有出院医嘱无法退费 ε(┬┬﹏┬┬)3");
+        if (dao.getHuanZheSFJieSuan(param.getInpatientNo(), param.getAdmissTimes(), param.getLedgerSn()) != 0) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "患者已经结算无法退费。");
         }
         // 判断数据是否为 退费数据
         List<ZyDetailCharge> chaKanSFtuiFei = dao.chaKanSFYiJingTuiFeiLe(param.getInpatientNo(), param.getAdmissTimes(), param.getList());
@@ -293,8 +287,8 @@ public class XiangMuLuRuService {
         if (errorStr.length() > 3) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, errorStr.toString());
         }
-        if (dismissDao.countDisActOrders(param.getInpatientNo(), param.getAdmissTimes()) > 0 || dismissDao.countDisActOrders2(param.getInpatientNo(), param.getAdmissTimes()) > 0) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该患者已有出院医嘱无法退费 ε(┬┬﹏┬┬)3");
+        if (dao.getHuanZheSFJieSuan(param.getInpatientNo(), param.getAdmissTimes(), param.getLedgerSn()) != 0) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "患者已经结算产生费用。");
         }
 
         // 婴儿 要特殊处理