Parcourir la source

优化挂号发票功能

hurugang il y a 5 ans
Parent
commit
8b2d75788d

+ 3 - 1
src/main/java/cn/hnthyy/thmz/Utils/ExcelUtil.java

@@ -453,7 +453,7 @@ public class ExcelUtil {
         data.put(FILE_NAME_KEY, "门诊明细收入.xls");
         List<Map<String, Object>> heads = new ArrayList<>();
         Map<String, Object> map0 = new HashMap<>();
-        String[] head0 = {"姓名", "病人ID", "就诊/申请科室", "就诊/申请医生", "执行科室", "收费项目", "核算码", "父类码", "数量", "单价", "金额"};
+        String[] head0 = {"姓名", "病人ID","缴费时间", "就诊/申请科室", "就诊/申请医生", "执行科室", "收费项目", "核算码", "父类码", "数量", "单价", "金额"};
         String[] headNum0 = {"0,0,0,0"};
         map0.put(HEAD_ARR_KEY, head0);
         map0.put(HEAD_NUM_KEY, headNum0);
@@ -465,8 +465,10 @@ public class ExcelUtil {
                 Double quty = (Double) thmzmxsr.get("quty");
                 BigDecimal price = (BigDecimal) thmzmxsr.get("price");
                 Double je = (Double) thmzmxsr.get("je");
+                Date chargeDate= (Date) thmzmxsr.get("charge_date");
                 String[] temp = {(String) thmzmxsr.get("xm"),
                         (String) thmzmxsr.get("patient_id"),
+                        DateFormatUtils.format(chargeDate, "yyyy-MM-dd HH:mm:ss"),
                         (String) thmzmxsr.get("jz_sq_dept"),
                         (String) thmzmxsr.get("jz_sq_doctor"),
                         (String) thmzmxsr.get("exec_dept"),

+ 5 - 2
src/main/java/cn/hnthyy/thmz/entity/his/MzyReqrec.java

@@ -52,7 +52,7 @@ public class MzyReqrec {
     private Integer visitedMark;
     //结帐日期
     private Date closingDate;
-    //打印人id
+    //发票打印人id
     private String printerId;
     //借用为全免标志:1:全免
     private String printFlag;
@@ -80,5 +80,8 @@ public class MzyReqrec {
     private String psordnum;
     //流水号
     private String agtordnum;
-
+    //发票结算状态 已结帐 1 是  0 否
+    private Integer printDcountNo;
+    //发票结帐日期
+    private Date printClosingDate;
 }

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

@@ -320,8 +320,8 @@ public interface ChargeFeeVoMapper {
             "        receipt_bill = rtrim(mzy_reqrec.receipt_bill)," +
             "         serial_no =mzy_reqrec.serial_no " +
             "    FROM mzy_reqrec " +
-            " where mzy_reqrec.op_id = #{userIdCode} and dcount_no=1 and times>0 and " +
-            "       closing_date =#{dcountDate} " +
+            " where mzy_reqrec.printer_id = #{userIdCode} and print_dcount_no=1 and times>0 and " +
+            "       print_closing_date =#{dcountDate} " +
             "order by op_id,mzy_reqrec.receipt_bill ")
     List<ReceiptBillVo> selectGhReceiptBillVoReprint(@Param("userIdCode") String userIdCode, @Param("dcountDate") Date dcountDate);
 
@@ -570,19 +570,19 @@ public interface ChargeFeeVoMapper {
             " and times <![CDATA[>]]> 0 ",
             "</when>",
             "<when test='userIdCode!=null'>",
-            " and op_id=#{userIdCode} ",
+            " and printer_id=#{userIdCode} ",
             "</when>",
             "<when test='dcountDate!=null'>",
-            " and closing_date=#{dcountDate,jdbcType=TIMESTAMP} ",
+            " and print_closing_date=#{dcountDate,jdbcType=TIMESTAMP} ",
             "</when>",
             "<when test='beginDate!=null'>",
-            " and closing_date &gt;=#{beginDate,jdbcType=TIMESTAMP} ",
+            " and print_closing_date &gt;=#{beginDate,jdbcType=TIMESTAMP} ",
             "</when>",
             "<when test='endDate!=null'>",
-            " and closing_date &lt;=#{endDate,jdbcType=TIMESTAMP} ",
+            " and print_closing_date &lt;=#{endDate,jdbcType=TIMESTAMP} ",
             "</when>",
             "<when test='dcountDate == null and beginDate == null and endDate == null'>",
-            " and dcount_no =0 ",
+            " and print_dcount_no =0 ",
             "</when>",
             "</script>"})
     Integer countReqrecReceipt(@Param("userIdCode") String userIdCode, @Param("cancelMark") String cancelMark, @Param("dcountDate") Date dcountDate, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
@@ -780,7 +780,7 @@ public interface ChargeFeeVoMapper {
     int dcountDeposit(@Param("userIdCode") String userIdCode, @Param("dcountDate") Date dcountDate);
 
     /**
-     * 挂号表结算
+     * 挂号表收费结算
      *
      * @param userIdCode
      * @param dcountDate
@@ -789,6 +789,17 @@ public interface ChargeFeeVoMapper {
     @Update("update mzy_reqrec set dcount_no =1 , closing_date =#{dcountDate} where op_id =#{userIdCode} and dcount_no =0 ")
     int dcountReqrec(@Param("userIdCode") String userIdCode, @Param("dcountDate") Date dcountDate);
 
+
+    /**
+     * 挂号表打印发票结算
+     *
+     * @param userIdCode
+     * @param dcountDate
+     * @return
+     */
+    @Update("update mzy_reqrec set print_dcount_no =1 , print_closing_date =#{dcountDate} where printer_id =#{userIdCode} and print_dcount_no =0 ")
+    int dcountReqrecReceipt(@Param("userIdCode") String userIdCode, @Param("dcountDate") Date dcountDate);
+
     /**
      * 在发票表中查询当前日期范围内有收款记录的收费员
      *

+ 6 - 6
src/main/java/cn/hnthyy/thmz/mapper/his/MzyReqrecMapper.java

@@ -16,13 +16,13 @@ import java.util.Map;
  */
 public interface MzyReqrecMapper {
     @Insert("INSERT INTO mzy_reqrec(patient_id,times,name,req_type,request_day,ampm,unit_code,group_code,doctor_code,charge_type,req_order,req_fee,oth_fee,cancel_mark,admiss_time,op_id," +
-            "op_day,clinic_fee,visited_mark,plus_mark,closing_date,printer_id,print_flag,windows_no,serial_no,receipt_bill,dcount_no,brochure_fee,dept_no,visit_dept,visit_doctor,visit_date,paymode,psordnum,agtordnum,bl_fee,ck_fee)" +
+            "op_day,clinic_fee,visited_mark,plus_mark,closing_date,printer_id,print_flag,windows_no,serial_no,receipt_bill,dcount_no,brochure_fee,dept_no,visit_dept,visit_doctor,visit_date,paymode,psordnum,agtordnum,bl_fee,ck_fee,print_closing_date,print_dcount_no)" +
             " VALUES (#{patientId,jdbcType=CHAR},#{times,jdbcType=INTEGER},#{name,jdbcType=CHAR},#{reqType,jdbcType=CHAR},#{requestDay,jdbcType=TIMESTAMP},#{ampm,jdbcType=CHAR}," +
             "#{unitCode,jdbcType=CHAR},#{groupCode,jdbcType=CHAR},#{doctorCode,jdbcType=CHAR},#{chargeType,jdbcType=CHAR},#{reqOrder,jdbcType=INTEGER},#{reqFee,jdbcType=DOUBLE}," +
             "#{othFee,jdbcType=DOUBLE},#{cancelMark,jdbcType=CHAR},#{admissTime,jdbcType=CHAR},#{opId,jdbcType=CHAR},#{opDay,jdbcType=TIMESTAMP},#{clinicFee,jdbcType=DOUBLE},#{visitedMark,jdbcType=CHAR},#{plusMark,jdbcType=CHAR}," +
             "#{closingDate,jdbcType=TIMESTAMP},#{printerId,jdbcType=CHAR},#{printFlag,jdbcType=CHAR},#{windowsNo,jdbcType=CHAR},#{serialNo,jdbcType=INTEGER},#{receiptBill,jdbcType=CHAR},#{dcountNo,jdbcType=INTEGER}," +
             "#{brochureFee,jdbcType=DOUBLE},#{deptNo,jdbcType=VARCHAR},#{visitDept,jdbcType=VARCHAR},#{visitDoctor,jdbcType=VARCHAR},#{visitDate,jdbcType=TIMESTAMP},#{paymode,jdbcType=VARCHAR}," +
-            "#{psordnum,jdbcType=VARCHAR},#{agtordnum,jdbcType=VARCHAR},0.00,0.00)")
+            "#{psordnum,jdbcType=VARCHAR},#{agtordnum,jdbcType=VARCHAR},0.00,0.00,#{printClosingDate,jdbcType=TIMESTAMP},#{printDcountNo,jdbcType=INTEGER})")
     int insertMzyReqrec(MzyReqrec mzyReqrec);
 
     /**
@@ -93,7 +93,7 @@ public interface MzyReqrecMapper {
             "rtrim(group_code) group_code,rtrim(doctor_code) doctor_code,rtrim(charge_type) charge_type,req_order,req_fee,oth_fee,rtrim(cancel_mark) cancel_mark,",
             "rtrim(admiss_time) admiss_time,rtrim(op_id) op_id,op_day,clinic_fee,rtrim(visited_mark) visited_mark,rtrim(plus_mark) plus_mark,closing_date,",
             "rtrim(printer_id) printer_id,rtrim(print_flag) print_flag,rtrim(windows_no) windows_no,serial_no,rtrim(receipt_bill) receipt_bill,dcount_no,brochure_fee,dept_no,visit_dept,",
-            "visit_doctor,visit_date,paymode,psordnum,agtordnum   FROM (SELECT ROW_NUMBER() OVER (ORDER BY mzy_reqrec_page.request_day desc) AS RowNumber,",
+            "visit_doctor,visit_date,paymode,psordnum,agtordnum,print_closing_date,print_dcount_no   FROM (SELECT ROW_NUMBER() OVER (ORDER BY mzy_reqrec_page.request_day desc) AS RowNumber,",
             "* from dbo.mzy_reqrec mzy_reqrec_page where times >0 ",
             "<when test='patientIds!=null'>",
             " and patient_id in ",
@@ -145,7 +145,7 @@ public interface MzyReqrecMapper {
             "rtrim(group_code) group_code,rtrim(doctor_code) doctor_code,rtrim(charge_type) charge_type,req_order,req_fee,oth_fee,rtrim(cancel_mark) cancel_mark,",
             "rtrim(admiss_time) admiss_time,rtrim(op_id) op_id,op_day,clinic_fee,rtrim(visited_mark) visited_mark,rtrim(plus_mark) plus_mark,closing_date,",
             "rtrim(printer_id) printer_id,rtrim(print_flag) print_flag,rtrim(windows_no) windows_no,serial_no,rtrim(receipt_bill) receipt_bill,dcount_no,brochure_fee,dept_no,visit_dept,",
-            "visit_doctor,visit_date,paymode,psordnum,agtordnum   from dbo.mzy_reqrec where cancel_mark=1",
+            "visit_doctor,visit_date,paymode,psordnum,agtordnum,print_closing_date,print_dcount_no   from dbo.mzy_reqrec where cancel_mark=1",
             "</script>"})
     List<MzyReqrec> selectAllCancel();
 
@@ -183,7 +183,7 @@ public interface MzyReqrecMapper {
             "rtrim(group_code) group_code,rtrim(doctor_code) doctor_code,rtrim(charge_type) charge_type,req_order,req_fee,oth_fee,rtrim(cancel_mark) cancel_mark,",
             "rtrim(admiss_time) admiss_time,rtrim(op_id) op_id,op_day,clinic_fee,rtrim(visited_mark) visited_mark,rtrim(plus_mark) plus_mark,closing_date,",
             "rtrim(print_flag) print_flag,rtrim(windows_no) windows_no,serial_no,rtrim(receipt_bill) receipt_bill,dcount_no,brochure_fee,dept_no,visit_dept,",
-            "visit_doctor,visit_date,paymode,psordnum,agtordnum   from dbo.mzy_reqrec where patient_id=#{patientId,jdbcType=CHAR} and times = #{times,jdbcType=INTEGER}",
+            "visit_doctor,visit_date,paymode,psordnum,agtordnum,print_closing_date,print_dcount_no   from dbo.mzy_reqrec where patient_id=#{patientId,jdbcType=CHAR} and times = #{times,jdbcType=INTEGER}",
             "</script>"})
     MzyReqrec selectMzyReqrecByPatientIdAndTimes(@Param("patientId") String patientId, @Param("times") Integer times);
 
@@ -271,6 +271,6 @@ public interface MzyReqrecMapper {
             "rtrim(group_code) group_code,rtrim(doctor_code) doctor_code,rtrim(charge_type) charge_type,req_order,req_fee,oth_fee,rtrim(cancel_mark) cancel_mark,"+
             "rtrim(admiss_time) admiss_time,rtrim(op_id) op_id,op_day,clinic_fee,rtrim(visited_mark) visited_mark,rtrim(plus_mark) plus_mark,closing_date,"+
             "rtrim(printer_id) printer_id,rtrim(print_flag) print_flag,rtrim(windows_no) windows_no,serial_no,rtrim(receipt_bill) receipt_bill,dcount_no,brochure_fee,dept_no,visit_dept,"+
-            "visit_doctor,visit_date,paymode,psordnum,agtordnum   from dbo.mzy_reqrec where psordnum=#{psordnum} and agtordnum = #{agtordnum}")
+            "visit_doctor,visit_date,paymode,psordnum,agtordnum,print_closing_date,print_dcount_no   from dbo.mzy_reqrec where psordnum=#{psordnum} and agtordnum = #{agtordnum}")
     MzyReqrec selectMzyReqrecByAgtordnum(@Param("psordnum") String psordnum,@Param("agtordnum") String agtordnum);
 }

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

@@ -145,6 +145,7 @@ public class ChargeFeeVoServiceImpl implements ChargeFeeVoService {
         chargeFeeVoMapper.dcountReceiptChargeCount(userIdCode, dcountDate);
         chargeFeeVoMapper.dcountDeposit(userIdCode, dcountDate);
         chargeFeeVoMapper.dcountReqrec(userIdCode, dcountDate);
+        chargeFeeVoMapper.dcountReqrecReceipt(userIdCode, dcountDate);
         return dcountDate;
     }
 

+ 8 - 0
src/main/resources/static/js/mzsrmx.js

@@ -200,6 +200,14 @@ function initMzsrmxTable() {
                 title: '病人ID',
                 align: "center",
                 valign: 'middle',
+            }, {
+                field: 'charge_date',
+                title: '缴费时间',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return format(value, "yyyy-MM-dd HH:mm:ss");
+                }
             }, {
                 field: 'jz_sq_dept',
                 title: '就诊/申请科室',