Browse Source

费用匹配的bug

xiaochan 3 years ago
parent
commit
bc2a94bdbe

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

@@ -987,7 +987,7 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
             "(select top(1) rtrim(name) from yp_zd_dict where code = a.charge_code_mx) end as name " +
             "from zy_detail_charge a left join zd_charge_item_hnsgs b " +
             "on (a.charge_code_mx = b.hosp_code) where " +
-            "inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} and infant_flag = #{infantFlag} and isnull(b.hnsyb_item_code,'') = '' " +
+            "inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} and infant_flag = #{infantFlag} and ori_detail_sn is null and isnull(b.hnsyb_item_code,'') = '' " +
             "group by a.charge_code_mx ")
     List<WeiGuiFeiYongFenXi> gongShangWeiPiPei(@Param("inpatientNo") String inpatientNo,
                                                @Param("admissTimes") Integer admissTimes,
@@ -1005,7 +1005,7 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
     @Select("select charge_code_mx,b.name from zy_detail_charge a, yp_zd_dict b " +
             "where  trans_flag_yb not in (1,2)  and charge_code like 'BILL%' " +
             "  and  isnull(b.national_code,'') = '' and inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} " +
-            "and a.infant_flag = #{infantFlag}  " +
+            "and a.infant_flag = #{infantFlag}   " +
             "  and a.charge_code_mx = b.code " +
             "group by  charge_code_mx, b.name")
     List<WeiGuiFeiYongFenXi> weiGuiYaoPin(@Param("inpatientNo") String inpatientNo,
@@ -1089,7 +1089,7 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
             "and order_no = #{orderNo}" +
             "</otherwise>" +
             "</choose>" +
-            "and trans_flag_yb &lt;&gt; 2 and order_no &lt;&gt; 6 and charge_fee &gt; 0 and  charge_amount &gt; 0 and ori_detail_sn is null " +
+            "and trans_flag_yb &lt;&gt; 2 and order_no &lt;&gt; 6 and charge_fee &gt; 0 and  charge_amount &gt; 0 " +
             "and infant_flag = #{infantFlag}  " +
             "<if test=\"startTime != null and startTime != '' \">" +
             "and charge_date &gt;= #{startTime} and charge_date &lt;= #{endTime} " +

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

@@ -183,7 +183,7 @@ public interface JianChaShenQingDao {
 
 
     @Select("<script>" +
-            "SELECT jc_text,name,code,wh_flag " +
+            "SELECT jc_text,name,code,wh_flag,op_id " +
             "FROM ysh_zd_yj_template " +
             "WHERE (py_code like #{name} or d_code like #{name} or name like #{name}) " +
             "<if test=\"leiXing == 1\">" +
@@ -192,6 +192,9 @@ public interface JianChaShenQingDao {
             "<if test=\"leiXing == 2\">" +
             "  and dept_code = (select rtrim(dept_code) from a_employee_mi where code = #{userCode}) " +
             "</if>" +
+            "<if test=\"leiXing == 3\">" +
+            "  and wh_flag = '3' " +
+            "</if>" +
             "</script>")
     Page<YshZdYjTemplate> huoQuShuoMingMuBan(IPage<YshZdYjTemplate> page,
                                              @Param("name") String name,

+ 7 - 3
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/JianChaShenQingServer.java

@@ -120,12 +120,11 @@ public class JianChaShenQingServer {
 
     @Transactional(rollbackFor = Exception.class)
     public ResultVo<String> shouMingMuBanChaoZuo(YshZdYjTemplate param) {
-        YshZdYjTemplate mb = dao.muBanShuJu(param.getCode());
         switch (param.getLeiXing()) {
             case "修改":
-                return xiuGaiMuBan(param, mb);
+                return xiuGaiMuBan(param, dao.muBanShuJu(param.getCode()));
             case "删除":
-                return shanChuMuBan(mb);
+                return shanChuMuBan(dao.muBanShuJu(param.getCode()));
             case "新增":
                 return xinZengShouMingMuBan(param);
         }
@@ -133,6 +132,11 @@ public class JianChaShenQingServer {
     }
 
     private ResultVo<String> xinZengShouMingMuBan(YshZdYjTemplate param) {
+        if (param.getWhFlag().trim().equals("3") && publicServer.needRule(new int[]{38})) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您没有权限创建全院模板。");
+        } else if (param.getWhFlag().trim().equals("2") && publicServer.needRule(new int[]{11})) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "科主任才可以创建科室模板。");
+        }
         param.setCode(publicServer.getYjTemplateNo().toString());
         param.setPyCode(PingYinUtils.pyShouZiMuDaXie(param.getName()));
         param.setDCode(PingYinUtils.getWBCode(param.getName()));