xiaochan 1 mese fa
parent
commit
0fd648ad96

+ 6 - 9
src/main/java/thyyxxk/webserver/controller/inpatient/xmlr/XiangMuLuRuController.java

@@ -66,12 +66,9 @@ public class XiangMuLuRuController {
         return service.getChargeCode(pyCode);
     }
 
-    @GetMapping("/getMuBan")
-    public ResultVo<IPage<ZyDetailCharge>> getMuBan(@RequestParam("deptCode") String deptCode,
-                                                    @RequestParam("currentPage") long currentPage,
-                                                    @RequestParam("pageSize") long pageSize,
-                                                    @RequestParam("total") long total) {
-        return service.getMuBan(deptCode, currentPage, pageSize, total);
+    @PostMapping("/getMuBan")
+    public ResultVo<IPage<ZyDetailCharge>> getMuBan(@RequestBody XiangMuLuRuService.SearchMb params) {
+        return service.getMuBan(params);
     }
 
     @GetMapping("/getMuBanXinXi")
@@ -92,8 +89,9 @@ public class XiangMuLuRuController {
 
     @GetMapping("/queryXiangMu")
     public ResultVo<List<ZyDetailCharge>> queryXiangMu(@RequestParam("pyCode") String pyCode,
-                                                       @RequestParam("xiangMuHuoYaoPinFlag") Integer xiangMuHuoYaoPinFlag) {
-        return service.queryXiangMu(pyCode, xiangMuHuoYaoPinFlag);
+                                                       @RequestParam("xiangMuHuoYaoPinFlag") Integer xiangMuHuoYaoPinFlag,
+                                                       @RequestParam("yfType") String yfType) {
+        return service.queryXiangMu(pyCode, xiangMuHuoYaoPinFlag, yfType);
     }
 
     @PostMapping("/xiangMuFeiYongShangChuan")
@@ -200,6 +198,5 @@ public class XiangMuLuRuController {
     }
 
 
-
 }
 

+ 5 - 5
src/main/java/thyyxxk/webserver/dao/his/inpatient/xmlr/XiangMuLuRuDao.java

@@ -175,7 +175,7 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
             "       national_code," +
             "       national_name," +
             "       descriptions," +
-            "       a.serial  " +
+            "       a.serial,a.group_no  " +
             "FROM zy_charge_pattern a, " +
             "     zd_charge_item b " +
             "WHERE (a.pattern_name =  #{patternName}) " +
@@ -196,7 +196,7 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
             "       national_code," +
             "       national_name," +
             "       specification as descriptions," +
-            "       a.serial " +
+            "       a.serial,a.group_no " +
             "FROM zy_charge_pattern a, " +
             "     yp_base_yf b, " +
             "     yp_zd_dict d " +
@@ -278,8 +278,8 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
             "        a.serial=c.serial    and " +
             "        c.visible_flag_zy <> '1' and" +
             "        isnull(a.del_flag,0) = 0 and  " +
-            "        c.group_no='73'")
-    List<ZyDetailCharge> queryYaoPin(String pyCode);
+            "        c.group_no=#{yfType}")
+    List<ZyDetailCharge> queryYaoPin(String pyCode, String yfType);
 
     /**
      * 插入项目录入费用
@@ -327,7 +327,7 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
             "  cast(#{item.chargeFee,jdbcType=DECIMAL} / #{item.chargeAmount,jdbcType=DECIMAL} as decimal(14,5)) , " +
             // 数量
             "cast(#{item.chargeAmount,jdbcType=DECIMAL} as decimal(14,5)) " +
-            ", #{zyDetailCharge.zySerialNo} , #{item.serial} , '73' ,'1' )" +
+            ", #{zyDetailCharge.zySerialNo} , #{item.serial} , #{item.groupNo} ,'1' )" +
             "</foreach>" +
             "</script>")
     void shenQingYaoPing(@Param("zyDetailCharge") ZyDetailCharge zyDetailCharge,

+ 32 - 7
src/main/java/thyyxxk/webserver/service/inpatient/xmlr/XiangMuLuRuService.java

@@ -323,18 +323,40 @@ public class XiangMuLuRuService {
     }
 
 
+    @Data
+    public static class SearchMb {
+        private String searchName;
+        private long total = 0;
+        private long currentPage;
+        private long pageSize;
+    }
+
+
     /**
      * 获取模板
      *
-     * @param deptCode 根据科室搜索
      * @return 返回模板
      */
-    public ResultVo<IPage<ZyDetailCharge>> getMuBan(String deptCode, long currentPage, long pageSize, long total) {
-        IPage<ZyDetailCharge> page = new Page<>(currentPage, pageSize, total == 0);
+    public ResultVo<IPage<ZyDetailCharge>> getMuBan(SearchMb params) {
+        IPage<ZyDetailCharge> page = new Page<>(params.getCurrentPage(), params.getPageSize(), params.getTotal() == 0);
         QueryWrapper<?> qw = new QueryWrapper<>();
+        UserInfo userInfo = userCache.getUserInfoByToken();
         qw.ne("isnull(pattern_name,'')", "''");
         if (publicServer.noNeedRule()) {
-            qw.eq("op_dept", deptCode);
+            qw.eq("op_dept", userInfo.getDeptCode());
+        }
+        if (StrUtil.isNotBlank(params.getSearchName())) {
+            qw.and(
+                    queryWrapper -> {
+                        queryWrapper.like("pattern_name", params.getSearchName())
+                                .or()
+                                .like("py_code", params.getSearchName().toUpperCase())
+                                .or()
+                                .like("d_code", params.getSearchName().toUpperCase())
+
+                        ;
+                    }
+            );
         }
         dao.getMuBan(page, qw);
         return ResultVoUtil.success(page);
@@ -376,11 +398,11 @@ public class XiangMuLuRuService {
      * @param xiangMuHuoYaoPinFlag 判断是查询项目还是药品 0 - 项目 1- 药品
      * @return 返回项目
      */
-    public ResultVo<List<ZyDetailCharge>> queryXiangMu(String pyCode, Integer xiangMuHuoYaoPinFlag) {
+    public ResultVo<List<ZyDetailCharge>> queryXiangMu(String pyCode, Integer xiangMuHuoYaoPinFlag, String yfType) {
         if (xiangMuHuoYaoPinFlag == 0) {
             return ResultVoUtil.success(dao.queryXiangMu("%" + pyCode.toUpperCase() + "%"));
         }
-        return ResultVoUtil.success(dao.queryYaoPin("%" + pyCode.toUpperCase() + "%"));
+        return ResultVoUtil.success(dao.queryYaoPin("%" + pyCode.toUpperCase() + "%", yfType));
     }
 
     /**
@@ -506,10 +528,13 @@ public class XiangMuLuRuService {
             if (zyDetailCharge.getSelfFlag() == null) {
                 zyDetailCharge.setSelfFlag("0");
             }
+            if (StrUtil.isBlank(zyDetailCharge.getGroupNo())) {
+                zyDetailCharge.setGroupNo("73");
+            }
         }
         Integer ledgerSn = publicServer.getLedgerSn(param.getInpatientNo(), param.getAdmissTimes());
         // 在此处 插入费用
-        dao. chaRuFeiYong(param, param.getList(),
+        dao.chaRuFeiYong(param, param.getList(),
                 infantFlag,
                 ledgerSn,
                 DateUtil.formatDatetime(param.getChargeDate(),