Browse Source

特门功能完成

hurugang 5 năm trước cách đây
mục cha
commit
092a0de87d

+ 10 - 0
src/main/java/cn/hnthyy/thmz/controller/MzChargeDetailController.java

@@ -8,6 +8,7 @@ import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.*;
 import cn.hnthyy.thmz.entity.thmz.PayInfo;
 import cn.hnthyy.thmz.entity.thmz.User;
+import cn.hnthyy.thmz.enums.ConfirmFlagEnum;
 import cn.hnthyy.thmz.enums.PayMarkEnum;
 import cn.hnthyy.thmz.enums.YesNoEnum;
 import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
@@ -434,6 +435,11 @@ public class MzChargeDetailController {
             }
             List<MzChargeDetail> removeList = new ArrayList<>();
             if (mzChargeDetailList != null && mzChargeDetailList.size() > 0) {
+                MzChargeDetailYb mzChargeDetailYb = new  MzChargeDetailYb();
+                mzChargeDetailYb.setPatientId(mzChargeDetail.getPatientId());
+                mzChargeDetailYb.setTimes(mzChargeDetail.getTimes());
+                mzChargeDetailYb.setReceiptNo(mzChargeDetail.getReceiptNo());
+                int count = mzChargeDetailYbService.queryTmCount(mzChargeDetailYb);
                 for (MzChargeDetail md : mzChargeDetailList) {
                     if ("TC".equals(md.getBillItemCode()) || Constants.SSWRF.equals(md.getBillItemCode())) {
                         removeList.add(md);
@@ -444,6 +450,10 @@ public class MzChargeDetailController {
                     }
                     md.setExecDept(zdUnitCodeService.queryDeptNameByIdInCache(md.getExecDept()));
                     md.setAmount((md.getUnitPrice() == null ? BigDecimal.ZERO : md.getUnitPrice()).multiply(BigDecimal.valueOf(md.getQuantity() == null ? 1D : md.getQuantity())).multiply(BigDecimal.valueOf(md.getDrugWin() == null ? 1D : md.getDrugWin())));
+                    if(count>0){
+                        //特门必须全退
+                        md.setConfirmFlag(ConfirmFlagEnum.DONE.code);
+                    }
                 }
             }
             mzChargeDetailList.removeAll(removeList);

+ 19 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/MzChargeDetailServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.common.SpringUtil;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.*;
+import cn.hnthyy.thmz.entity.thmz.PayInfo;
 import cn.hnthyy.thmz.entity.thmz.Windows;
 import cn.hnthyy.thmz.enums.*;
 import cn.hnthyy.thmz.mapper.his.*;
@@ -13,6 +14,7 @@ import cn.hnthyy.thmz.mapper.thmz.WindowsMapper;
 import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
 import cn.hnthyy.thmz.service.his.*;
 import cn.hnthyy.thmz.service.thmz.OrderStatusChangeService;
+import cn.hnthyy.thmz.service.thmz.TsmzService;
 import cn.hnthyy.thmz.vo.MzDepositFileVo;
 import cn.hnthyy.thmz.vo.MzPrescriptionVo;
 import cn.hnthyy.thmz.vo.ThmzmxsrParamsVo;
@@ -106,6 +108,11 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
     @SuppressWarnings("all")
     @Autowired
     private YpBaseYfMapper ypBaseYfMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private MzChargeDetailYbMapper mzChargeDetailYbMapper;
+    @Autowired
+    private TsmzService tsmzService;
 
     @Override
     public int countMzChargeDetail(MzChargeDetailPageDto mzChargeDetailPageDto) {
@@ -1026,6 +1033,14 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         List<MzChargeDetail> mzChargeDetails = getNewListForRefundFee(opId, mzDepositFileVo, YesNoEnum.YES);
         //是否全退
         boolean allRefund = mzChargeDetails == null || mzChargeDetails.size() == 0;
+        MzChargeDetailYb mzChargeDetailYb = new  MzChargeDetailYb();
+        mzChargeDetailYb.setPatientId(mzDepositFileVo.getPatientId());
+        mzChargeDetailYb.setTimes(mzDepositFileVo.getTimes());
+        mzChargeDetailYb.setReceiptNo(mzDepositFileVo.getReceiptNo());
+        int count = mzChargeDetailYbMapper.selectTmCount(mzChargeDetailYb);
+        if(count>0 && !allRefund){
+            throw new MzException("退费失败,特门收费必须全退!");
+        }
         List<String> chargeItemCodeList = mzChargeDetails.stream().filter(u -> StringUtils.isNotBlank(u.getChargeItemCode())).map(u -> u.getChargeItemCode()).collect(Collectors.toList());
         List<MzChargeDetail> oriMzChargeDetails = mzChargeDetailMapper.selectMzChargeDetailByPatientId(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo(), PayMarkEnum.CHARGED.code);
         Date now = new Date();
@@ -1058,6 +1073,10 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             //新增收费方式记录
             mzDepositFileMapper.batchInsertMzDepositFile(fullNewMzDepositFiles);
             times = 0;
+            if(count>0){
+                //PayInfo result=
+                tsmzService.retractFees(opId, mzChargeDetailYb.getPatientId(),mzChargeDetailYb.getTimes(),mzChargeDetailYb.getReceiptNo());
+            }
         } else {
             times = mzChargeDetails.get(0).getTimes();
             List<String> orderCodes = new ArrayList<>();

+ 1 - 0
src/main/resources/static/js/toll_administration.js

@@ -1748,6 +1748,7 @@ function initRefundFeeDetailTable(patientId, times, receiptNo) {
                         }
                     }
                     if (row.confirmFlag == 3) {
+                        getRefundFee();
                         return {
                             disabled: true, //设置是否可用
                             checked: true//设置选中