Browse Source

门诊项目确认与取消页面,需要看到药品

lighter 6 months ago
parent
commit
045568e2d7

+ 5 - 4
src/main/java/thyyxxk/webserver/controller/zhuyuanyiji/MenZhengXiangMuController.java

@@ -7,6 +7,7 @@ import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
 import thyyxxk.webserver.service.zhuyuanyiji.MenZhengXiangMuServer;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -43,10 +44,10 @@ public class MenZhengXiangMuController {
     }
 
     @GetMapping("/getFeiYongXinXi")
-    public ResultVo<List<MzChargeDetail>> getFeiYongXinXi(@RequestParam("realNo") Integer realNo,
-                                                          @RequestParam("patientId") String patientId,
-                                                          @RequestParam("times") Integer times,
-                                                          @RequestParam("xiangMuZhuangTai") Integer xiangMuZhuangTai) {
+    public ResultVo<Map<String, List<MzChargeDetail>>> getFeiYongXinXi(@RequestParam("realNo") Integer realNo,
+                                                                       @RequestParam("patientId") String patientId,
+                                                                       @RequestParam("times") Integer times,
+                                                                       @RequestParam("xiangMuZhuangTai") Integer xiangMuZhuangTai) {
         return server.getFeiYongXinXi(realNo, patientId, times, xiangMuZhuangTai);
     }
 

+ 5 - 0
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyiji/MenZhengXiangMuDao.java

@@ -95,6 +95,11 @@ public interface MenZhengXiangMuDao {
                                       @Param("times") Integer times,
                                       @Param("xiangMuZhuangTai") Integer xiangMuZhuangTai);
 
+    @Select("select tc_name,quantity from mz_charge_detail where patient_id=#{patientNo} " +
+            "and serial_no=#{realNo} and times=#{times} and group_no!='00'")
+    List<MzChargeDetail> yaoPinXinxi(@Param("realNo") Integer realNo,
+                                     @Param("patientNo") String patientNo,
+                                     @Param("times") Integer times);
 
     /**
      * @param patientId 门诊号

+ 13 - 5
src/main/java/thyyxxk/webserver/service/zhuyuanyiji/MenZhengXiangMuServer.java

@@ -58,18 +58,23 @@ public class MenZhengXiangMuServer {
         return ResultVoUtil.success(mz);
     }
 
-    public ResultVo<List<MzChargeDetail>> getFeiYongXinXi(Integer realNo, String patientId, Integer times, Integer xiangMuZhuangTai) {
+    public ResultVo<Map<String, List<MzChargeDetail>>> getFeiYongXinXi(Integer realNo, String patientId, Integer times, Integer xiangMuZhuangTai) {
         log.info("流水号:{},门诊号:{},次数:{} ", realNo, patientId, times);
         if (realNo == null || StringUtil.isBlank(patientId) || times == null) {
             return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER);
         }
         List<MzChargeDetail> feiYongXinXi = dao.feiYongXinXi(realNo, patientId, times, xiangMuZhuangTai);
-        //   父节点 根据  patient_id times receipt_no order_no charge_item_code
-        //   子节点 根据  patient_id times receipt_no order_no tc_no
-        if (ListUtil.isBlank(feiYongXinXi)) {
+        List<MzChargeDetail> yaoPinXinxi = dao.yaoPinXinxi(realNo, patientId, times);
+        if (ListUtil.isBlank(feiYongXinXi) && ListUtil.isBlank(yaoPinXinxi)) {
             return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
         }
-        return ResultVoUtil.success(tcTree(feiYongXinXi));
+        //   父节点 根据  patient_id times receipt_no order_no charge_item_code
+        //   子节点 根据  patient_id times receipt_no order_no tc_no
+        List<MzChargeDetail> treeFeiYongXinXi = tcTree(feiYongXinXi);
+        Map<String, List<MzChargeDetail>> map = new HashMap<>();
+        map.put("f", treeFeiYongXinXi);
+        map.put("y", yaoPinXinxi);
+        return ResultVoUtil.success(map);
     }
 
     public ResultVo<JSONObject> getReqDetailsByNo(String patientId, Integer reqNo) {
@@ -77,6 +82,9 @@ public class MenZhengXiangMuServer {
     }
 
     public List<MzChargeDetail> tcTree(List<MzChargeDetail> tempList) {
+        if (ListUtil.isBlank(tempList)) {
+            return new ArrayList<>();
+        }
         List<MzChargeDetail> resultList = new ArrayList<>();
         Map<String, MzChargeDetail> treeMap = new HashMap<>(tempList.size());