Selaa lähdekoodia

解决历史数据无法查询

hurugang 4 vuotta sitten
vanhempi
commit
f1709552f8

+ 11 - 0
src/main/java/cn/hnthyy/thmz/controller/zy/ZyActpatientController.java

@@ -4,11 +4,13 @@ import cn.hnthyy.thmz.Utils.TokenUtil;
 import cn.hnthyy.thmz.comment.UserLoginToken;
 import cn.hnthyy.thmz.entity.his.APatientMi;
 import cn.hnthyy.thmz.entity.his.ZyActpatient;
+import cn.hnthyy.thmz.entity.his.ZyLedgerFile;
 import cn.hnthyy.thmz.entity.thmz.User;
 import cn.hnthyy.thmz.enums.GenderEnum;
 import cn.hnthyy.thmz.enums.ResponceTypeEnum;
 import cn.hnthyy.thmz.service.his.ZdUnitCodeService;
 import cn.hnthyy.thmz.service.his.ZyActpatientService;
+import cn.hnthyy.thmz.service.his.zyLedgerFileService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,6 +28,8 @@ public class ZyActpatientController {
     private ZyActpatientService zyActpatientService;
     @Autowired
     private ZdUnitCodeService zdUnitCodeService;
+    @Autowired
+    private zyLedgerFileService zyLedgerFileService;
     /**
      * 保存入院信息
      *
@@ -269,6 +273,13 @@ public class ZyActpatientController {
                 if(StringUtils.isNotBlank(z.getZkDept())){
                     z.setZkDeptName(zdUnitCodeService.queryDeptNameByIdInCache(z.getZkDept()));
                 }
+                Integer ledgerSn=zyLedgerFileService.queryCurrentLedgerSn(z.getInpatientNo(),z.getAdmissTimes());
+                if(ledgerSn!=null && ledgerSn>0){
+                    //未结算
+                    z.setSettleType(0);
+                }
+                ResponceTypeEnum responceTypeEnum=ResponceTypeEnum.getReportTypeByCode(z.getResponceType());
+                z.setResponceType(responceTypeEnum==null?"":responceTypeEnum.name);
             });
             resultMap.put("data", list);
             resultMap.put("total", zyActpatientService.queryCountByInpatientNoOrMzNO(zyActpatient));

+ 2 - 2
src/main/java/cn/hnthyy/thmz/controller/zy/ZyjsController.java

@@ -195,7 +195,7 @@ public class ZyjsController {
                 return resultMap;
             }
             User tokenUser = TokenUtil.getUser(httpServletRequest);
-            Map<String, Object> result= zyjsService.verification(tokenUser.getUserIdCode(),inpatientNo,dismissFlag,zjdzDatetime);
+            Map<String, Object> result= zyjsService.verification(tokenUser.getUserIdCode(),inpatientNo,admissTimes,dismissFlag,zjdzDatetime);
             if(result==null){
                 resultMap.put("code", -1);
                 resultMap.put("message", "费用计算出错,请稍后重试");
@@ -213,7 +213,7 @@ public class ZyjsController {
                 resultMap.put("data", result.get("data"));
                 return resultMap;
             }
-            result= zyjsService.execute(tokenUser.getUserIdCode(),inpatientNo,dismissFlag,zjdzDatetime);
+            result= zyjsService.execute(tokenUser.getUserIdCode(),inpatientNo,admissTimes,dismissFlag,zjdzDatetime);
             if(result==null){
                 resultMap.put("code", -1);
                 resultMap.put("message", "出院结算出错,请稍后重试");

+ 5 - 0
src/main/java/cn/hnthyy/thmz/entity/his/ZyActpatient.java

@@ -216,6 +216,11 @@ public class ZyActpatient extends PageBean implements Comparable<ZyActpatient> {
     private String deptName;
     //医保身份
     private String responceTypeName;
+    /**
+     * 0 未结算 1 结算;2:出纳;3:出纳,4 取消结算 非数据库字段
+     */
+    private Integer settleType;
+
     @Override
     public int compareTo(ZyActpatient o) {
         return o.getAdmissTimes() - this.getAdmissTimes();

+ 1 - 1
src/main/java/cn/hnthyy/thmz/entity/his/ZyLedgerFile.java

@@ -213,7 +213,7 @@ public class ZyLedgerFile {
     private BigDecimal settle;
 
     /**
-    * 1 结算;2:出纳;3:出纳
+    * 1 结算;2:出纳;3:出纳,4 取消结算
     */
     private String settleType;
 

+ 2 - 0
src/main/java/cn/hnthyy/thmz/pageDto/MzChargeDetailPageDto.java

@@ -33,4 +33,6 @@ public class MzChargeDetailPageDto {
     private String beginTimeStr;
     //查询的结束时间
     private String endTimeStr;
+    //表名
+    private String tableName;
 }

+ 8 - 0
src/main/java/cn/hnthyy/thmz/service/his/zyLedgerFileService.java

@@ -13,4 +13,12 @@ public interface zyLedgerFileService {
      * @return
      */
     List<ZyLedgerFile> queryZyLedgerFileByInpatientNoAndTimes(String inpatientNo, Integer admissTimes);
+
+    /**
+     * 查询可以当前未结算的账页信息
+     * @param inpatientNo
+     * @param admissTimes
+     * @return
+     */
+    Integer queryCurrentLedgerSn(String inpatientNo,Integer admissTimes);
 }

+ 13 - 3
src/main/java/cn/hnthyy/thmz/service/impl/his/MzChargeDetailServiceImpl.java

@@ -122,14 +122,25 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
 
     @Override
     public int countMzChargeDetail(MzChargeDetailPageDto mzChargeDetailPageDto) {
-        return mzChargeDetailMapper.countMzChargeDetail(mzChargeDetailPageDto);
+        mzChargeDetailPageDto.setTableName("mz_charge_detail");
+        Integer num= mzChargeDetailMapper.countMzChargeDetail(mzChargeDetailPageDto);
+        if(num==null || num==0){
+            mzChargeDetailPageDto.setTableName("mz_charge_detail_b");
+            num= mzChargeDetailMapper.countMzChargeDetail(mzChargeDetailPageDto);
+        }
+        return num;
     }
 
     @Override
     public List<MzChargeDetail> queryMzChargeDetailWithPage(MzChargeDetailPageDto mzChargeDetailPageDto) {
+        mzChargeDetailPageDto.setTableName("mz_charge_detail");
         List<MzChargeDetail> mzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailWithPage(mzChargeDetailPageDto);
         if (mzChargeDetailList == null || mzChargeDetailList.size() == 0) {
-            return mzChargeDetailList;
+            mzChargeDetailPageDto.setTableName("mz_charge_detail_b");
+            mzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailWithPage(mzChargeDetailPageDto);
+            if (mzChargeDetailList == null || mzChargeDetailList.size() == 0) {
+                return mzChargeDetailList;
+            }
         }
         for (MzChargeDetail mzChargeDetail : mzChargeDetailList) {
             MzChargeDetail temp = mzChargeDetailMapper.selectWarnDeptAndDoctor(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes());
@@ -2100,7 +2111,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     }
                 }
                 //医生系统做完移走 结尾
-
                 BigDecimal tempFee = unitPrice.multiply(BigDecimal.valueOf(mzChargeDetail.getQuantity()).multiply(BigDecimal.valueOf(mzChargeDetail.getDrugWin())));
                 totalPayable = totalPayable.add(tempFee);
                 if (StringUtils.isBlank(billItemCode)) {

+ 5 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/zyLedgerFileServiceImpl.java

@@ -16,4 +16,9 @@ public class zyLedgerFileServiceImpl implements zyLedgerFileService {
     public List<ZyLedgerFile> queryZyLedgerFileByInpatientNoAndTimes(String inpatientNo, Integer admissTimes) {
         return zyLedgerFileMapper.selectZyLedgerFileByInpatientNoAndTimes(inpatientNo,admissTimes);
     }
+
+    @Override
+    public Integer queryCurrentLedgerSn(String inpatientNo, Integer admissTimes) {
+        return zyLedgerFileMapper.selectMaxLedgerSn(inpatientNo,admissTimes);
+    }
 }

+ 4 - 2
src/main/java/cn/hnthyy/thmz/service/impl/thmz/ZyjsServiceImpl.java

@@ -23,11 +23,12 @@ public class ZyjsServiceImpl implements ZyjsService {
     }
 
     @Override
-    public Map<String, Object> verification(String staffId, String inpatientNo, Integer dismissFlag, String zjdzDatetime) {
+    public Map<String, Object> verification(String staffId, String inpatientNo, Integer admissTimes, Integer dismissFlag, String zjdzDatetime) {
         RestTemplate restTemplate = new RestTemplate();
         Map<String,Object> params = new HashMap<>();
         params.put("staffId",staffId);
         params.put("inpatientNo",inpatientNo);
+        params.put("admissTimes",admissTimes);
         params.put("dismissFlag",dismissFlag);
         if(zjdzDatetime!=null){
             params.put("zjdzDatetime",zjdzDatetime);
@@ -36,11 +37,12 @@ public class ZyjsServiceImpl implements ZyjsService {
     }
 
     @Override
-    public Map<String, Object> execute(String staffId, String inpatientNo, Integer dismissFlag, String zjdzDatetime) {
+    public Map<String, Object> execute(String staffId, String inpatientNo, Integer admissTimes, Integer dismissFlag, String zjdzDatetime) {
         RestTemplate restTemplate = new RestTemplate();
         Map<String,Object> params = new HashMap<>();
         params.put("staffId",staffId);
         params.put("inpatientNo",inpatientNo);
+        params.put("admissTimes",admissTimes);
         params.put("dismissFlag",dismissFlag);
         if(zjdzDatetime!=null){
             params.put("zjdzDatetime",zjdzDatetime);

+ 4 - 2
src/main/java/cn/hnthyy/thmz/service/thmz/ZyjsService.java

@@ -23,20 +23,22 @@ public interface ZyjsService {
      *
      * @param staffId      操作员id
      * @param inpatientNo  住院号
+     * @param admissTimes
      * @param dismissFlag  结算标志,1出院结算,2中间断账
      * @param zjdzDatetime 中间断账时间,dismissFlag=2时必填 yyyy-MM-dd HH:mm:ss
      * @return
      */
-    Map<String, Object> verification(String staffId, String inpatientNo, Integer dismissFlag, String zjdzDatetime);
+    Map<String, Object> verification(String staffId, String inpatientNo, Integer admissTimes, Integer dismissFlag, String zjdzDatetime);
 
     /**
      * 出院结算
      *
      * @param staffId      操作员id
      * @param inpatientNo  住院号
+     * @param admissTimes
      * @param dismissFlag  结算标志,1出院结算,2中间断账
      * @param zjdzDatetime 中间断账时间,dismissFlag=2时必填 yyyy-MM-dd HH:mm:ss
      * @return
      */
-    Map<String, Object> execute(String staffId, String inpatientNo, Integer dismissFlag, String zjdzDatetime);
+    Map<String, Object> execute(String staffId, String inpatientNo, Integer admissTimes, Integer dismissFlag, String zjdzDatetime);
 }

+ 31 - 4
src/main/resources/static/js/actpatient.js

@@ -272,6 +272,33 @@ function initFeeTable() {
                 title: '患者姓名',
                 align: "center",
                 valign: 'middle',
+            }, {
+                field: 'settleType',
+                title: '结算状态',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    if(value==0){
+                        return "未结算";
+                    }
+                    if(value==1){
+                        return "已结算";
+                    }
+                    if(value==2){
+                        return "出纳";
+                    }
+                    // if(value==3){
+                    //     return "出纳";
+                    // }
+                    if(value==4){
+                        return "取消结算";
+                    }
+                }
+            }, {
+                field: 'responceType',
+                title: '医保身份',
+                align: "center",
+                valign: 'middle',
             }, {
                 field: 'admissTimes',
                 title: '住院次数',
@@ -323,12 +350,12 @@ function initFeeTable() {
                 // sortable: true,
                 formatter: function (value, row, index) {
                     var str = '';
+                    if (row.settleType == 0){
+                        str += '<button type="button" class="registration-no-color-foot-button"title="出院结算" onclick="settlement(\'' + row.inpatientNo + '\',' + row.admissTimes + ')"><i class="fa fa-credit-card"></i></button>';
+                    }
                     var payMarkGroup = getIndex("pay_mark_group");
                     if (payMarkGroup == 0) {
-                        // if (row.bedStatus == "3"){
-                        //     str += '<button type="button" class="registration-no-color-foot-button"title="出院结算" onclick="settlement(\'' + row.inpatientNo + '\',' + row.admissTimes + ')"><i class="fa fa-credit-card"></i></button>';
-                        // }
-                            str += '<button type="button" class="registration-no-color-foot-button"title="出院结算" onclick="settlement(\'' + row.inpatientNo + '\',' + row.admissTimes + ')"><i class="fa fa-credit-card"></i></button>';
+                          //  str += '<button type="button" class="registration-no-color-foot-button"title="出院结算" onclick="settlement(\'' + row.inpatientNo + '\',' + row.admissTimes + ')"><i class="fa fa-credit-card"></i></button>';
                     }
                     if (payMarkGroup == 1) {
                         str += '<button type="button" class="registration-no-color-foot-button" title="退费" onclick="refundFee(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ',' + row.printFlag + ');"><i class="fa fa-reply"></i></button>';