Bläddra i källkod

出院费用清单bug优化

hurugang 4 år sedan
förälder
incheckning
b9fcd5e158

+ 8 - 3
src/main/java/cn/hnthyy/thmz/controller/ZyActpatientController.java

@@ -276,13 +276,13 @@ public class ZyActpatientController {
 
 
     /**
-     * 根据住院号查询在院记录
+     * 根据住院号查询在/出院记录
      *
      * @return
      */
     @UserLoginToken
     @RequestMapping(value = "/getByInpatientNo", method = {RequestMethod.GET})
-    public Map<String, Object> getByInpatientNo(@RequestParam("inpatientNo") String inpatientNo,@RequestParam("tableName") String tableName) {
+    public Map<String, Object> getByInpatientNo(@RequestParam("inpatientNo") String inpatientNo,@RequestParam("admissTimes") Integer admissTimes,@RequestParam("tableName") String tableName) {
         log.info("根据住院号查询在院记录");
         Map<String, Object> resultMap = new HashMap<>();
         try {
@@ -291,6 +291,11 @@ public class ZyActpatientController {
                 resultMap.put("message", "病人住院号不能为空");
                 return resultMap;
             }
+            if (admissTimes==null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "病人住院次数不能为空");
+                return resultMap;
+            }
             if (StringUtils.isBlank(tableName)) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "病人在院状态不能为空");
@@ -298,7 +303,7 @@ public class ZyActpatientController {
             }
             resultMap.put("code", 0);
             resultMap.put("message", "根据住院号查询在院记录成功");
-            ZyActpatient zyActpatient=zyActpatientService.queryByInpatientNo(tableName,inpatientNo);
+            ZyActpatient zyActpatient=zyActpatientService.queryByInpatientNo(tableName,inpatientNo,admissTimes);
             GenderEnum genderEnum= GenderEnum.getGenderByCode(Integer.valueOf(zyActpatient.getSex()));
             zyActpatient.setGender(genderEnum==null?GenderEnum.UNKNOWN.name:genderEnum.name);
             zyActpatient.setDeptName(zdUnitCodeService.queryDeptNameByIdInCache(zyActpatient.getDept()));

+ 8 - 7
src/main/java/cn/hnthyy/thmz/controller/ZyDepositFileController.java

@@ -228,7 +228,13 @@ public class ZyDepositFileController {
                 resultMap.put("message", "住院号不能为空");
                 return resultMap;
             }
-            ZyActpatient zyActpatient=zyActpatientService.queryByInpatientNo("zy_actpatient",inpatientNo);
+            ZyDepositFile zyDepositFile=zyDepositFileService.queryZyDepositFileByReceiptNo(receiptNo);
+            if(zyDepositFile==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "流水号对应的缴费记录不存在");
+                return resultMap;
+            }
+            ZyActpatient zyActpatient=zyActpatientService.queryByInpatientNo("zy_actpatient",inpatientNo,zyDepositFile.getAdmissTimes().intValue());
             if(zyActpatient==null){
                 resultMap.put("code", -1);
                 resultMap.put("message", "住院号对应的住院记录不存在");
@@ -241,12 +247,7 @@ public class ZyDepositFileController {
                 resultMap.put("message", "门诊病人不存在");
                 return resultMap;
             }
-            ZyDepositFile zyDepositFile=zyDepositFileService.queryZyDepositFileByReceiptNo(receiptNo);
-            if(zyDepositFile==null){
-                resultMap.put("code", -1);
-                resultMap.put("message", "流水号对应的缴费记录不存在");
-                return resultMap;
-            }
+
             ZdChequeType zdChequeType=zdChequeTypeService.queryChequeTypeByCode(zyDepositFile.getDepoType());
             if(zdChequeType==null){
                 resultMap.put("code", -1);

+ 8 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/ZyActpatientMapper.java

@@ -75,12 +75,17 @@ public interface ZyActpatientMapper {
 
 
     /**
-     * 根据住院号查询在院记录
+     * 根据住院号查询在/出院记录
      *
      * @return
      */
-    @Select("select * from ${tableName} where inpatient_no =#{inpatientNo} ")
-    ZyActpatient selectByInpatientNo(@Param("tableName") String tableName,@Param("inpatientNo") String inpatientNo);
+    @Select({"<script>",
+            "select * from ${tableName} where inpatient_no =#{inpatientNo}",
+            "<when test='admissTimes!=null'>",
+            " and admiss_times=#{admissTimes}",
+            "</when>",
+            "</script>"})
+    ZyActpatient selectByInpatientNo(@Param("tableName") String tableName,@Param("inpatientNo") String inpatientNo,@Param("admissTimes") Integer admissTimes);
 
 
     /**

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/his/ZyActpatientService.java

@@ -35,7 +35,7 @@ public interface ZyActpatientService {
      *
      * @return
      */
-    ZyActpatient queryByInpatientNo(String tableName,String inpatientNo);
+    ZyActpatient queryByInpatientNo(String tableName,String inpatientNo,Integer admissTimes);
 
     /**
      * 修改住院号

+ 2 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/ZyActpatientServiceImpl.java

@@ -212,8 +212,8 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
     }
 
     @Override
-    public ZyActpatient queryByInpatientNo(String tableName,String inpatientNo) {
-        return zyActpatientMapper.selectByInpatientNo(tableName,inpatientNo);
+    public ZyActpatient queryByInpatientNo(String tableName,String inpatientNo,Integer admissTimes) {
+        return zyActpatientMapper.selectByInpatientNo(tableName,inpatientNo,admissTimes);
     }
 
     @Override

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/ZyDepositFileServiceImpl.java

@@ -38,7 +38,7 @@ public class ZyDepositFileServiceImpl implements ZyDepositFileService {
     @Override
     @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
     public int saveZyDepositFile(ZyDepositFile zyDepositFile) throws MzException {
-        ZyActpatient zyActpatient= zyActpatientMapper.selectByInpatientNo("zy_actpatient",zyDepositFile.getInpatientNo());
+        ZyActpatient zyActpatient= zyActpatientMapper.selectByInpatientNo("zy_actpatient",zyDepositFile.getInpatientNo(),null);
         if(zyActpatient==null){
             throw new MzException("住院号没有查询到对应的住院记录");
         }

+ 6 - 5
src/main/resources/static/js/accepting.js

@@ -175,14 +175,14 @@ function getZyActpatientByInpatientNoOrMzNO(id) {
             if (res.code == 0) {
                 if (res.data.length > 0) {
                     if(res.data.length==1){
-                        fillPatinet(res.data[0].inpatientNo);
+                        fillPatinet(res.data[0].inpatientNo,res.data[0].admissTimes);
                     }else {
                         $("#patientModal").modal();
                         $("#patientTable").html(null);
                         for (var i = 0; i < res.data.length; i++) {
-                            $("<tr data-target='" + res.data[i].inpatientNo + "'><td>" + res.data[i].inpatientNo + "</td><td>" + res.data[i].name + "</td></tr>").appendTo("#patientTable").bind('click', function () {
+                            $("<tr data-target-inpatientNo='" + res.data[i].inpatientNo + "' data-target-admissTimes='"+res.data[i].admissTimes+"' ><td>" + res.data[i].inpatientNo + "</td><td>"+res.data[i].admissTimes+"</td><td>" + res.data[i].name + "</td></tr>").appendTo("#patientTable").bind('click', function () {
                                 $("#patientModal").modal("hide");
-                                fillPatinet($(this).attr("data-target"));
+                                fillPatinet($(this).attr("data-target-inpatientNo"),$(this).attr("data-target-admissTimes"));
                             });
                         }
                     }
@@ -222,8 +222,9 @@ function getZyActpatientByInpatientNoOrMzNO(id) {
 /**
  * 按照病人inpatientNo查询病人信息
  * @param patientId
+ * @param admissTimes
  */
-function fillPatinet(inpatientNo) {
+function fillPatinet(inpatientNo,admissTimes) {
     if (inpatientNo == null || inpatientNo == "") {
         return;
     }
@@ -234,7 +235,7 @@ function fillPatinet(inpatientNo) {
     }
     $.ajax({
         type: "GET",
-        url: '/thmz/getByInpatientNo?inpatientNo=' + inpatientNo + "&tableName=" + tableName,
+        url: '/thmz/getByInpatientNo?inpatientNo=' + inpatientNo +"&admissTimes="+admissTimes+ "&tableName=" + tableName,
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},

+ 1 - 0
src/main/resources/templates/accepting.html

@@ -197,6 +197,7 @@
                         <thead>
                         <tr>
                             <th>住院号</th>
+                            <th>住院次数</th>
                             <th>患者姓名</th>
                         </tr>
                         </thead>