소스 검색

护理大屏

xiaochan 1 년 전
부모
커밋
3435546463

+ 7 - 0
src/main/java/thyyxxk/webserver/config/Assertion.java

@@ -49,4 +49,11 @@ public interface Assertion {
         }
     }
 
+    default <T> T nullIf(T t1, T t2) {
+        if (t1 instanceof String) {
+            return StringUtil.isBlank((String) t1) ? t2 : t1;
+        }
+        return null == t1 ? t2 : t1;
+    }
+
 }

+ 8 - 0
src/main/java/thyyxxk/webserver/controller/dashboard/DashboardController.java

@@ -1,5 +1,6 @@
 package thyyxxk.webserver.controller.dashboard;
 
+import com.alibaba.fastjson.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -28,4 +29,11 @@ public class DashboardController {
         return service.selectInpatientBriefs(deptCode);
     }
 
+
+    @PassToken
+    @GetMapping("/selectInpatientBriefsV2")
+    public ResultVo<JSONObject> selectInpatientBriefsV2(@RequestParam("deptCode") String deptCode) {
+        return service.selectInpatientBriefsV2(deptCode);
+    }
+
 }

+ 6 - 0
src/main/java/thyyxxk/webserver/dao/his/dashboard/DashboardDao.java

@@ -31,4 +31,10 @@ public interface DashboardDao {
             "(select small_dept from zd_dept_all t where t.dept=#{dept})) " +
             "order by cast(bed_no as int)")
     List<InpatientBrief> selectInpatientBrief(@Param("dept") String dept);
+
+
+    @Select("select count(*)\n" +
+            "from zy_bed_mi\n" +
+            "where ward_code = '${dept}'")
+    Integer bedCount(@Param("dept") String dept);
 }

+ 10 - 11
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -1456,17 +1456,16 @@ public interface YiZhuLuRuDao {
             "order_code = '${orderCode}' and serial = '00'")
     Integer selectCountByOrderCode(String patNo, Integer times, String orderCode);
 
-    @Select("SELECT 收费编码=a.occ_code,\n" +
-            "       项目名称=b.name,\n" +
-            "       数量=a.amount,\n" +
-            "       单价=b.charge_amount,\n" +
-            "       个人自付比例=selfpay_prop + '%',\n" +
-            "       医保说明=isnull(b.connotation, '无') + '|' + isnull(b.descriptions, '无'),\n" +
-            "       医保编码=national_code\n" +
-            "FROM yz_order_occurence a,\n" +
-            "     zd_charge_item b\n" +
-            "where a.order_code = '${code}'\n" +
-            "  and a.occ_code = b.code")
+    @Select("SELECT 收费编码=a.occ_code ,          \n" +
+            "         项目名称=b.name ,  \n" +
+            "\t\t 数量=a.amount  ,\n" +
+            "         单价=b.charge_amount ,\n" +
+            "\t\t 个人自付比例=cast(cast(selfpay_prop as decimal(10,2))*100 as varchar)+'%',\n" +
+            "\t\t 医保说明=isnull(b.connotation,'无')+'|'+isnull(b.descriptions,'无'),\n" +
+            "\t\t 医保编码=national_code \n" +
+            "    FROM yz_order_occurence a  ,zd_charge_item b\n" +
+            "where    a.order_code='${code}' and \n" +
+            "         a.occ_code=b.code ")
     List<JSONObject> getItemInstructions(String code);
 
 }

+ 9 - 0
src/main/java/thyyxxk/webserver/service/dashboard/DashboardService.java

@@ -1,5 +1,6 @@
 package thyyxxk.webserver.service.dashboard;
 
+import com.alibaba.fastjson.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.constants.sidicts.MedType;
@@ -40,4 +41,12 @@ public class DashboardService {
         });
         return ResultVoUtil.success(list);
     }
+
+    public ResultVo<JSONObject> selectInpatientBriefsV2(String deptCode) {
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("data", selectInpatientBriefs(deptCode).getData());
+        jsonObject.put("bedCount", dao.bedCount(deptCode));
+        return ResultVoUtil.success(jsonObject);
+    }
+
 }