Browse Source

单病种收费功能开发

hurugang 5 years ago
parent
commit
cf3fe3667e

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

@@ -814,6 +814,10 @@ public class MzChargeDetailController {
             totalPriceCount = getBigDecimal(data, totalPriceCount);
             User tokenUser = TokenUtil.getUser(httpServletRequest);
             MzReceiptSerial mzReceiptSerial = mzReceiptSerialService.queryReceiptDetailsByReceiptSn(Integer.valueOf(chargeFeeParamsVo.getSerialNo()));
+            Employee opEmployee = employeeService.queryByUserCode(mzReceiptSerial.getOperatorId());
+            if (opEmployee != null) {
+                mzReceiptSerial.setOperatorId(opEmployee.getEmployeeName());
+            }
             resultMap.put("code", 0);
             resultMap.put("data", data);
             resultMap.put("totalPriceCount", totalPriceCount);

+ 4 - 14
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -1575,7 +1575,7 @@ public class MedicalViewApiController {
     public Map<String, Object> payChargeDetailFormDbzsf(@RequestBody MzDepositFileVo mzDepositFileVo) {
         Map<String, Object> results = new HashMap<>();
         if (mzDepositFileVo == null) {
-            results.put("resultCode", -1);
+            results.put("code", -1);
             results.put("resultMessage", "门诊缴费订单支付参数为空");
             return results;
         }
@@ -1594,28 +1594,18 @@ public class MedicalViewApiController {
             results.put("message", "病人结算次数不能为空");
             return results;
         }
-        if(mzDepositFileVo.getMzDepositFiles()==null || mzDepositFileVo.getMzDepositFiles().size()==0){
-            results.put("code", -1);
-            results.put("message", "病人缴费方式不能为空");
-            return results;
-        }
-        MzDepositFile mzDepositFile = mzDepositFileVo.getMzDepositFiles().get(0);
-        if(mzDepositFile.getAmount()==null){
-            results.put("code", -1);
-            results.put("message", "病人缴费金额不能为空");
-            return results;
-        }
         try {
+            MzDepositFile mzDepositFile =new MzDepositFile();
             mzDepositFile.setChequeType(Constants.YBJZ);
             mzDepositFileVo.setMzDepositFiles(Arrays.asList(mzDepositFile));
             mzChargeDetailService.chargeFee(Constants.DBZJF_CODE, mzDepositFileVo);
-            results.put("resultCode", 0);
+            results.put("code", 0);
             results.put("resultMessage", "单病种缴费成功");
             results.put("guideListInfo", "");
             return results;
         } catch (Exception e) {
             e.printStackTrace();
-            results.put("resultCode", -1);
+            results.put("code", -1);
             results.put("resultMessage", "单病种门诊缴费订单支付失败,请联系管理员");
             log.error("系统异常,错误信息{}", e.getMessage());
             return results;

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

@@ -127,9 +127,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 List<MzReceiptSerial> mzReceiptSerials = mzReceiptSerialMapper.selectReceiptDetails(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo());
                 if (mzReceiptSerials != null && mzReceiptSerials.size() > 0) {
                     MzReceiptSerial mzReceiptSerial = mzReceiptSerials.get(0);
-                    //此时发票号为空,判断收费类型,如果是Y,说明是本院记账,不允许打印发票 如果其他类型,说明非本院记账,可以打印 故设置打印标记为未打印
+                    //此时发票号为空,判断收费类型,如果是Y,说明是本院记账或者单病种缴费),不允许打印发票 如果其他类型,说明非本院记账,可以打印 故设置打印标记为未打印
                     if (StringUtils.isBlank(mzReceiptSerial.getReceiptBill())) {
-                        if (Constants.BYJZ.equals(mzReceiptSerial.getChequeType())) {
+                        if (Constants.BYJZ.equals(mzReceiptSerial.getChequeType()) || Constants.DBZJF_CODE.equals(mzReceiptSerial.getOperatorId())) {
                             mzChargeDetail.setPrintFlag("-" + YesNoEnum.YES.code.toString());
                         } else {
                             mzChargeDetail.setPrintFlag(YesNoEnum.NO.code.toString());
@@ -406,6 +406,10 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         BigDecimal totalPayable = getTotalPayable(mzChargeDetailList, feeMap);
         //实际应付金额  四舍五入后的值 收费员收的钱小数点后只有一位有效值
         BigDecimal totalPayableRound = totalPayable.setScale(1, BigDecimal.ROUND_HALF_UP);
+        //单病种收费不设置金额,所以自动设置金额
+        if(Constants.DBZJF_CODE.equals(opId)){
+            mzDepositFileVo.getMzDepositFiles().get(0).setAmount(totalPayableRound);
+        }
         Date now = new Date();
         int serialNo = mzSerialNoService.getSerialNo();
         MzReceiptSerial mzReceiptSerial = new MzReceiptSerial();

+ 5 - 1
src/main/resources/static/js/charge_list.js

@@ -399,7 +399,11 @@ function formatMx(res) {
     if (res.data != null && res.data.length > 0) {
         $("#serialNo_t").html("机制号:" + res.data[0].real_no);
         $("#doctor").html("医生:" + res.data[0].doctor_code);
-        $("#cashId").html("收费员:" + res.data[0].op_id);
+        if(res.mzReceiptSerial!=undefined && res.mzReceiptSerial!=null){
+            $("#cashId").html("收费员:" + res.mzReceiptSerial.operatorId);
+        }else {
+            $("#cashId").html("收费员:" + res.data[0].op_id);
+        }
         $("#patientId_t").html("门诊号:" + res.data[0].patient_id);
         $("#name_t").html("姓名:" + res.data[0].name);
         $("#date_t").html("日期:" + format(res.data[0].charge_date, "yyyy-MM-dd"));