Browse Source

门诊转入的时候要判断药品

xiaochan 3 years ago
parent
commit
e6b35d352b

+ 9 - 10
src/main/java/thyyxxk/webserver/dao/his/PublicDao.java

@@ -117,7 +117,6 @@ public interface PublicDao {
                              @Param("admissTimes") Integer admissTimes,
                              @Param("ledgerSn") Integer ledgerSn);
 
-
     @Select("select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
             "and ori_detail_sn is not null " +
             "and  charge_amount < 0")
@@ -132,19 +131,19 @@ public interface PublicDao {
             "#{item}" +
             "</foreach>" +
             "</script>")
-    void genXingFuLiuShui(@Param("inpatientNo") String inpatientNo,
-                          @Param("admissTimes") Integer admissTimes,
-                          @Param("ledgerSn") Integer ledgerSn,
-                          @Param("list") List<Integer> detailSnList);
+    void genXingFuShuDuiYingZhenLiuShui(@Param("inpatientNo") String inpatientNo,
+                                        @Param("admissTimes") Integer admissTimes,
+                                        @Param("ledgerSn") Integer ledgerSn,
+                                        @Param("list") List<Integer> detailSnList);
 
     @Select("select ori_detail_sn,sum(charge_fee) charge_fee,sum(charge_amount) charge_amount " +
             "from zy_detail_charge a " +
             "where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn}  and order_no <> 6 and trans_flag_yb <> 2 " +
             "  and ori_detail_sn is not null and charge_amount<0 " +
             "group by ori_detail_sn having count(1) > 1")
-    List<ZyDetailCharge> chongFuLiuShui(@Param("inpatientNo") String inpatientNo,
-                                        @Param("admissTimes") Integer admissTimes,
-                                        @Param("ledgerSn") Integer ledgerSn);
+    List<ZyDetailCharge> chongFuTuiFeiLiuShui(@Param("inpatientNo") String inpatientNo,
+                                              @Param("admissTimes") Integer admissTimes,
+                                              @Param("ledgerSn") Integer ledgerSn);
 
 
     @Select("<script>" +
@@ -200,9 +199,9 @@ public interface PublicDao {
                                @Param("detailSn") List<Integer> detailSn);
 
     @Select("select top(1) code,dept_code,name,code_rs from a_employee_mi where (code = #{code}  or code_rs = #{code}) and isnull(del_flag,0) = 0 ")
-    UserInfo huoQuYuanGongXinXi(String code);
+    UserInfo huoQuYuanGongBianMa(String code);
 
     @Select("SELECT small_dept FROM zd_dept_all where dept = #{deptCode}")
-    List<String> huoQuBingFanhKeShi(String deptCode);
+    List<String> bingFangSuoSuKeShi(String deptCode);
 
 }

+ 2 - 2
src/main/java/thyyxxk/webserver/dao/his/yibao/TransferInOfExpensesDao.java

@@ -56,7 +56,7 @@ public interface TransferInOfExpensesDao {
             "       self_flag=c.self_flag, " +
             "       separate_flag = c.separate_flag, " +
             "       suppress_flag = c.suppress_flag, " +
-            "       charge_code = a.charge_item_code, " +
+            "       charge_code = case a.bill_item_code when '010' then 'BILL01' when '011' then 'BILL28' when '012' then 'BILL02' ELSE  a.charge_item_code end, " +
             "       charge_code_mx = a.charge_item_code, " +
             "       serial = a.serial, " +
             "       group_no = a.group_no, " +
@@ -82,7 +82,7 @@ public interface TransferInOfExpensesDao {
             "       self_flag=a.self_flag, " +
             "       separate_flag =  (select separate_flag from yp_zd_dict where yp_zd_dict.code=c.charge_code and yp_zd_dict.serial=c.serial), " +
             "       suppress_flag =  (select suprice_flag from yp_zd_dict where yp_zd_dict.code=c.charge_code and yp_zd_dict.serial=c.serial), " +
-            "       charge_code =  a.charge_item_code, " +
+            "       charge_code = case a.bill_item_code when '010' then 'BILL01' when '011' then 'BILL28' when '012' then 'BILL02' ELSE  a.charge_item_code end, " +
             "       charge_code_mx = a.charge_item_code, " +
             "       serial = a.serial, " +
             "       group_no = a.group_no, " +

+ 4 - 4
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -183,10 +183,10 @@ public class PublicServer {
         if (ListUtil.notBlank(huoQuTuiFeiYuanLiuShui)) {
             List<List<Integer>> fenGeFuLiuShui = ListUtils.partition(huoQuTuiFeiYuanLiuShui, 100);
             for (List<Integer> integers : fenGeFuLiuShui) {
-                dao.genXingFuLiuShui(inpatientNo, admissTimes, ledger, integers);
+                dao.genXingFuShuDuiYingZhenLiuShui(inpatientNo, admissTimes, ledger, integers);
             }
         }
-        Map<Integer, ZyDetailCharge> chongFuLiuShuiMap = dao.chongFuLiuShui(inpatientNo, admissTimes, ledger).stream().collect(
+        Map<Integer, ZyDetailCharge> chongFuLiuShuiMap = dao.chongFuTuiFeiLiuShui(inpatientNo, admissTimes, ledger).stream().collect(
                 Collectors.toMap(ZyDetailCharge::getOriDetailSn, a -> a, (k1, k2) -> k1)
         );
         if (!chongFuLiuShuiMap.isEmpty()) {
@@ -220,7 +220,7 @@ public class PublicServer {
         if (StringUtil.isBlank(code)) {
             return new UserInfo();
         }
-        return dao.huoQuYuanGongXinXi(code);
+        return dao.huoQuYuanGongBianMa(code);
     }
 
 
@@ -228,7 +228,7 @@ public class PublicServer {
         if (getRoleCode().getData().contains(1) || getRoleCode().getData().contains(8) || StringUtil.isBlank(deptCode)) {
             return new ArrayList<>();
         }
-        List<String> keShiDaiMa = dao.huoQuBingFanhKeShi(deptCode);
+        List<String> keShiDaiMa = dao.bingFangSuoSuKeShi(deptCode);
         if (ListUtil.isBlank(keShiDaiMa)) {
             keShiDaiMa.add(deptCode);
         }