hurugang 5 lat temu
rodzic
commit
096bc7e351

+ 1 - 1
src/main/java/cn/hnthyy/thmz/common/ScheduledService.java

@@ -45,7 +45,7 @@ public class ScheduledService {
     }
 
 
-//    @Scheduled(cron = "5 0 2 * * *")
+//    @Scheduled(cron = "15 27 11 * * *")
 //    public void scheduledFull() {
 //        process();
 //    }

+ 2 - 1
src/main/java/cn/hnthyy/thmz/controller/MzChargeDetailController.java

@@ -322,6 +322,7 @@ public class MzChargeDetailController {
             resultMap.put("message", "缴费成功");
             return resultMap;
         } catch (MzException e) {
+            e.printStackTrace();;
             resultMap.put("code", -1);
             resultMap.put("message", "缴费失败," + e.getMessage());
             log.error("缴费失败,系统异常,错误信息【{}】", e.getMessage());
@@ -330,7 +331,7 @@ public class MzChargeDetailController {
             e.printStackTrace();
             resultMap.put("code", -1);
             resultMap.put("message", "缴费失败,系统出错,请联系管理员");
-            log.error("缴费失败,系统异常");
+            log.error("缴费失败,系统异常"+e);
             return resultMap;
         }
     }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/ChargeFeeVoMapper.java

@@ -890,7 +890,7 @@ public interface ChargeFeeVoMapper {
      *
      * @return
      */
-    @Update("update mz_receipt_serial set charge_dcount_date =dcount_date,charge_dcount_no =dcount_no where operator_id = pay_id and (charge_dcount_date is null or charge_dcount_no =0)")
+    @Update("update mz_receipt_serial set charge_dcount_date =dcount_date,charge_dcount_no =dcount_no where operator_id = pay_id and (charge_dcount_date is null or charge_dcount_no =0) ")
     int dataRefsh();
 
 

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

@@ -285,8 +285,8 @@ public interface MzChargeDetailMapper {
      * @param chargeItemCode
      * @return
      */
-    @Select("select * from mz_charge_detail where patient_id =#{patientId,jdbcType=CHAR} and times =#{times,jdbcType=INTEGER} and charge_item_code=#{chargeItemCode,jdbcType=CHAR} and quantity>0")
-    MzChargeDetail selectMzChargeDetailByChargeItemCode(@Param("patientId") String patientId, @Param("times") Integer times, @Param("chargeItemCode") String chargeItemCode);
+    @Select("select * from mz_charge_detail where patient_id =#{patientId,jdbcType=CHAR} and times =#{times,jdbcType=INTEGER} and charge_item_code=#{chargeItemCode,jdbcType=CHAR} and order_no =#{orderNo} and quantity>0")
+    MzChargeDetail selectMzChargeDetailByChargeItemCode(@Param("patientId") String patientId, @Param("times") Integer times, @Param("chargeItemCode") String chargeItemCode,@Param("orderNo") Integer orderNo);
     /**
      * 新增收费明细记录
      * @param mzChargeDetail
@@ -363,7 +363,7 @@ public interface MzChargeDetailMapper {
             "<when test='patientId!=null'>",
             " and patient_id=#{patientId,jdbcType=CHAR}",
             "</when>",
-            " and pay_mark='5' and (datediff(day,price_time,getdate()) <![CDATA[ <= ]]> 30) group by patient_id,times",
+            " and pay_mark='5' and (datediff(day,price_time,getdate()) <![CDATA[ <= ]]> 3) group by patient_id,times",
             "</script>"})
     List<Map<String, Object>> selectUnPaidChargeDetail(@Param(value = "patientId") String patientId);
 

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

@@ -191,6 +191,7 @@ public class ChargeFeeVoServiceImpl implements ChargeFeeVoService {
 
     @Override
     public int refeshPayManData() {
+        chargeFeeVoMapper.dataRefsh();
         chargeFeeVoMapper.refeshNomalPayManData();
         chargeFeeVoMapper.refeshZzPayManData();
         chargeFeeVoMapper.refeshRefund();

+ 37 - 5
src/main/java/cn/hnthyy/thmz/service/impl/his/MzChargeDetailServiceImpl.java

@@ -538,8 +538,22 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 ypMzFytjList = ypMzFytjMapper.selectXyTyYpMzFytj(patientId, refundTimes);
                 if (ypMzFytjList != null && ypMzFytjList.size() > 0) {
                     for (YpMzFytj ypMzFytj : ypMzFytjList) {
-                        MzChargeDetail mzChargeDetail = mzChargeDetailMapper.selectMzChargeDetailByChargeItemCode(ypMzFytj.getPatientId(), ypMzFytj.getTimes(), ypMzFytj.getChargeItemCode());
+                        MzChargeDetail mzChargeDetail = mzChargeDetailMapper.selectMzChargeDetailByChargeItemCode(ypMzFytj.getPatientId(), ypMzFytj.getTimes(), ypMzFytj.getChargeItemCode(),ypMzFytj.getOrderNo());
                         Integer syCount = BigDecimal.valueOf(mzChargeDetail.getQuantity()).subtract(mzChargeDetail.getDecAmount()==null?BigDecimal.ZERO:mzChargeDetail.getDecAmount()).intValue();
+                        //皮试药特别逻辑
+                        if(Constants.XYF.equals(mzChargeDetail.getBillItemCode())){
+                            BigDecimal origPrice= mzChargeDetail.getOrigPrice();
+                            origPrice=origPrice==null?BigDecimal.ZERO:origPrice;
+                            BigDecimal unitPrice= mzChargeDetail.getUnitPrice();
+                            unitPrice=unitPrice==null?BigDecimal.ZERO:unitPrice;
+                            //如果原价大于单价,说明是皮试自备
+                            if(origPrice.compareTo(unitPrice)==1){
+                                if (Integer.valueOf(1).equals(syCount)){
+                                    syCount=0;
+                                }
+                            }
+                        }
+
                         if (syCount <= 0) {
                             continue;
                         }
@@ -833,6 +847,13 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if (lastMzVisitTable != null && lastMzVisitTable.getTimes() != null && lastMzVisitTable.getTimes() > times) {
             times = lastMzVisitTable.getTimes();
         }
+        MzPatientMi mzPatientMi=mzPatientMiMapper.selectByPatientId(mzDepositFileVo.getPatientId());
+        if(mzPatientMi==null){
+            throw new MzException("当前病人信息不存在,请先保存病人信息!");
+        }
+        if(mzPatientMi.getTimes()!=null && mzPatientMi.getTimes()>times){
+            times = mzPatientMi.getTimes();
+        }
         times++;
         if (YesNoEnum.YES.equals(yesNo)) {
             MzVisitTable newMzVisitTable = getMzVisitTable(opId, mzChargeDetails, times, now);
@@ -845,15 +866,29 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         int receiptNo = 1;
         for (MzChargeDetail md : mzChargeDetails) {
             MzChargeDetail temp = null;
-            if (chargeItemCodeList.contains(md.getChargeItemCode())) {
+            if (chargeItemCodeList.contains(md.getOrderNo()+"_"+md.getChargeItemCode())) {
                 if (Constants.XYF.equals(md.getBillItemCode())) {
                     if (ConfirmFlagEnum.DONE.code.equals(md.getConfirmFlag()) && md.getDecAmount() != null && md.getDecAmount().compareTo(BigDecimal.ZERO) == 1) {
+                        Double oriQuantity=md.getQuantity();
                         BigDecimal surplus = BigDecimal.valueOf(md.getQuantity()).subtract(md.getDecAmount());
                         if (surplus.compareTo(BigDecimal.ZERO) == 1) {
                             temp = CloneUtil.clone(md);
                             temp.setQuantity(surplus.doubleValue());
                             BigDecimal proportion = BigDecimal.valueOf(md.getQuantity()).divide(BigDecimal.valueOf(md.getSupplyAmount()));
                             temp.setSupplyAmount(BigDecimal.valueOf(md.getQuantity()).divide(proportion).intValue());
+                            BigDecimal origPrice= temp.getOrigPrice();
+                            origPrice=origPrice==null?BigDecimal.ZERO:origPrice;
+                            BigDecimal unitPrice= temp.getUnitPrice();
+                            unitPrice=unitPrice==null?BigDecimal.ZERO:unitPrice;
+                            //如果原价大于单价,说明是皮试自备
+                            if(origPrice.compareTo(unitPrice)==1){
+                                //如果只剩一直,单价为0
+                                if (surplus.compareTo(BigDecimal.ONE) == 0) {
+                                    temp.setUnitPrice(BigDecimal.ZERO);
+                                }else {
+                                    temp.setUnitPrice(BigDecimal.valueOf(oriQuantity).multiply(md.getUnitPrice()).subtract(md.getDecAmount().multiply(md.getOrigPrice())).divide(surplus));
+                                }
+                            }
                         }
                     }
                 }else if(Constants.CYF.equals(md.getBillItemCode())){
@@ -894,9 +929,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         List<MzChargeDetail> supplyFeeMzChargeDetails = new ArrayList<>();
         //重新计算给药方式费用
         itemNo = formatSupplyFee(supplyFeeMzChargeDetails, newMzChargeDetailList, itemNo);
-        MzPatientMi mzPatientMi = new MzPatientMi();
-        mzPatientMi.setName(mzChargeDetails.get(0).getName());
-        mzPatientMi.setResponseType(mzChargeDetails.get(0).getResponceType());
         formatPriceRoundDetail(new MzChargeDetail(mzDepositFileVo.getPatientId(), times), supplyFeeMzChargeDetails, mzPatientMi, newMzChargeDetailList, 127, itemNo, receiptNo);
         List<String> supplyList = supplyFeeMzChargeDetails.stream().filter(u -> StringUtils.isNotBlank(u.getChargeItemCode())).map(u -> u.getChargeItemCode()).collect(Collectors.toList());
         List<MzChargeDetail> removeList = new ArrayList<>();

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

@@ -76,14 +76,14 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         if(mzyZdChargeType==null){
             throw new MzException("当前号别不存在,请先设置!");
         }
-        MzyReqrec lastMzyReqrec = mzyReqrecMapper.selectLastMzyReqrecByPatientId(mzyReqrec.getPatientId());
+        //MzyReqrec lastMzyReqrec = mzyReqrecMapper.selectLastMzyReqrecByPatientId(mzyReqrec.getPatientId());
         MzVisitTable lastMzVisitTable = mzVisitTableMapper.selectLastMzVisitTableByPatientId(mzyReqrec.getPatientId());
         int times = 0;
-        if(lastMzyReqrec!=null && lastMzyReqrec.getTimes()!=null && lastMzyReqrec.getTimes()>times){
-            times =lastMzyReqrec.getTimes();
-        }
         if(lastMzVisitTable!=null && lastMzVisitTable.getTimes()!=null && lastMzVisitTable.getTimes()>times){
-            times = lastMzVisitTable.getTimes();
+            times =lastMzVisitTable.getTimes();
+        }
+        if(mzPatientMi.getTimes()!=null && mzPatientMi.getTimes()>times){
+            times = mzPatientMi.getTimes();
         }
         times++;
         int serialNo=mzSerialNoService.getMzSerialNo();

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

@@ -1407,6 +1407,7 @@ function modifyPatient() {
             if (res.code == 0) {
                 $('#editUserModal').modal('hide');
                 fillPatinet($("#patientId").val());
+                successMesage(res);
             } else {
                 new PNotify({
                     title: '错误提示',

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

@@ -1731,7 +1731,7 @@ function readyRefundFee() {
     chargeItemCodes=null;
     if(allSelecteds!=null && allSelecteds.length>0){
         for (var i = 0; i < allSelecteds.length; i++) {
-            var temp = allSelecteds[i].chargeItemCode;
+            var temp = allSelecteds[i].orderNo+"_"+allSelecteds[i].chargeItemCode;
             if (chargeItemCodes == null) {
                 chargeItemCodes = temp;
             } else {