瀏覽代碼

收费员工作量统计

hurugang 5 年之前
父節點
當前提交
5ab6a726a2

+ 93 - 37
src/main/java/cn/hnthyy/thmz/controller/ChargeFeeVoController.java

@@ -91,7 +91,7 @@ public class ChargeFeeVoController {
                 }
             }
             Map<String, String> chequeTypeMap = chequeTypes.stream().collect(Collectors.toMap(ZdChequeType::getCode, ZdChequeType::getName));
-            Map<String,List<ChargeFeeVo>> chargeFeeMap=new HashMap();
+            Map<String, List<ChargeFeeVo>> chargeFeeMap = new HashMap();
             for (ChargeFeeVo co : chargeFeeVos) {
                 PayMarkEnum payMark = PayMarkEnum.getPayMarkByCode(co.getPayMark());
                 co.setPayMark(payMark == null ? co.getPayMark() : payMark.name);
@@ -107,18 +107,18 @@ public class ChargeFeeVoController {
                     co.setOpId(employeeMap.get(co.getOpId()));
                 }
                 List<ChargeFeeVo> tempList = chargeFeeMap.get(co.getSerialNo());
-                if(tempList==null){
-                    tempList= new ArrayList<>();
-                    chargeFeeMap.put(co.getSerialNo(),tempList);
+                if (tempList == null) {
+                    tempList = new ArrayList<>();
+                    chargeFeeMap.put(co.getSerialNo(), tempList);
                 }
                 tempList.add(co);
             }
-            for (String key:chargeFeeMap.keySet()){
-                if(StringUtils.isNotBlank(key)){
-                    List<ChargeFeeVo> tempList= chargeFeeMap.get(key);
-                    if(tempList.size()>1){
-                        for (ChargeFeeVo co:tempList){
-                            if((Constants.BYJZ_NAME.equals(co.getChequeType()) && StringUtils.isNotBlank(co.getReceiptBill())) || (!Constants.BYJZ_NAME.equals(co.getChequeType()) && StringUtils.isBlank(co.getReceiptBill())) ){
+            for (String key : chargeFeeMap.keySet()) {
+                if (StringUtils.isNotBlank(key)) {
+                    List<ChargeFeeVo> tempList = chargeFeeMap.get(key);
+                    if (tempList.size() > 1) {
+                        for (ChargeFeeVo co : tempList) {
+                            if ((Constants.BYJZ_NAME.equals(co.getChequeType()) && StringUtils.isNotBlank(co.getReceiptBill())) || (!Constants.BYJZ_NAME.equals(co.getChequeType()) && StringUtils.isBlank(co.getReceiptBill()))) {
                                 chargeFeeVos.remove(co);
                             }
                         }
@@ -562,7 +562,7 @@ public class ChargeFeeVoController {
                 return resultMap;
             }
             //数据清洗,将在老系统日结的数据清洗一次
-      //      chargeFeeVoService.refeshPayManData(chargeFeeParamsVo.getOpId(), chargeFeeParamsVo.getDcountDate());
+            //      chargeFeeVoService.refeshPayManData(chargeFeeParamsVo.getOpId(), chargeFeeParamsVo.getDcountDate());
             //门诊部日结没有设置收费人id ,需要清洗
             chargeFeeVoService.modifyMzService();
             User tokenUser = userService.queryUserByUserIdCode(chargeFeeParamsVo.getOpId());
@@ -666,24 +666,6 @@ public class ChargeFeeVoController {
                 resultMap.put("message", "查询费用汇总报表失败,查询时间为空");
                 return resultMap;
             }
-
-//            List<String> operaotors = chargeFeeVoService.queryAllOperatorFromReceipt(chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate());
-//            List<String> ghOperaotors = chargeFeeVoService.queryAllOperatorFromReqrec(chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate());
-//            ghOperaotors.forEach(o -> {
-//                if (!operaotors.contains(o)) {
-//                    operaotors.add(o);
-//                }
-//            });
-//            List<DcountDateListVo> dcountDateListVos = new ArrayList<>();
-//            for (String opId : ghOperaotors) {
-//                dcountDateListVos.addAll(chargeFeeVoService.queryDcountDateList(opId, chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate()));
-//            }
-//
-//            for (DcountDateListVo ddv : dcountDateListVos) {
-//                //数据清洗,将在老系统日结的数据清洗一次
-//                chargeFeeVoService.refeshPayManData(ddv.getOperatorId(), ddv.getDcountDate());
-//            }
-//            chargeFeeVoService.refeshInconformityData(chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate());
             //门诊部日结没有设置收费人id ,需要清洗
             chargeFeeVoService.modifyMzService();
             //挂号收入构成表格数据
@@ -696,10 +678,10 @@ public class ChargeFeeVoController {
             ChargeCountVo chargeCountVo = chargeFeeVoService.queryChargeCountVo(null, null, chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate()).get(0);
             chargeCountVo.fomartChargeCountVo();
             resultMap.put("chargeCountVo", chargeCountVo);
-            List<WorkloadVo> ghWorkloadVos = chargeFeeVoService.queryGhWorkloadVo(chargeFeeParamsVo.getHisData(), chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate());
+            List<WorkloadVo> ghWorkloadVos = chargeFeeVoService.queryGhWorkloadVo(chargeFeeParamsVo.getHisData(), chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate(), null, YesNoEnum.YES);
             frmartWorkloadVo(ghWorkloadVos);
             resultMap.put("ghWorkloadVos", ghWorkloadVos);
-            List<WorkloadVo> sfWorkloadVos = chargeFeeVoService.querySfWorkloadVo(chargeFeeParamsVo.getHisData(), chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate());
+            List<WorkloadVo> sfWorkloadVos = chargeFeeVoService.querySfWorkloadVo(chargeFeeParamsVo.getHisData(), chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate(), null, YesNoEnum.YES);
             frmartWorkloadVo(sfWorkloadVos);
             resultMap.put("sfWorkloadVos", sfWorkloadVos);
             //resultMap.put("user", tokenUser);
@@ -723,6 +705,80 @@ public class ChargeFeeVoController {
     }
 
 
+    /**
+     * 收费员挂号与收费工作量统计
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/getCasherWorkCount", method = {RequestMethod.GET, RequestMethod.POST})
+    public Map<String, Object> getCasherWorkCount(@RequestBody ChargeFeeParamsVo chargeFeeParamsVo) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if (chargeFeeParamsVo == null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "收费员挂号与收费工作量统计失败,参数为空");
+                return resultMap;
+            }
+            if (StringUtils.isBlank(chargeFeeParamsVo.getOpId())) {
+                chargeFeeParamsVo.setOpId(null);
+            }
+            if (chargeFeeParamsVo.getBeginDate() == null || chargeFeeParamsVo.getEndDate() == null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "收费员挂号与收费工作量统计失败,查询时间为空");
+                return resultMap;
+            }
+            List<WorkloadVo> ghWorkloadVos = chargeFeeVoService.queryGhWorkloadVo(chargeFeeParamsVo.getHisData(), chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate(), chargeFeeParamsVo.getOpId(), null);
+            frmartWorkloadVo(ghWorkloadVos);
+            List<WorkloadVo> sfWorkloadVos = chargeFeeVoService.querySfWorkloadVo(chargeFeeParamsVo.getHisData(), chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate(), chargeFeeParamsVo.getOpId(), null);
+            frmartWorkloadVo(sfWorkloadVos);
+            List<Map<String, Object>> resultList = new ArrayList<>();
+            Map<String, Map<String, Object>> allMap = new HashMap<>();
+            for (WorkloadVo workloadVo : ghWorkloadVos) {
+                if(workloadVo.getOpId()==null){
+                    continue;
+                }
+                Map<String, Object> temp = new HashMap<>();
+                temp.put("opId", workloadVo.getOpId());
+                temp.put("opName", workloadVo.getOpName());
+                temp.put("ghCount", workloadVo.getPtCount());
+                temp.put("ghAmount", workloadVo.getPtAmount());
+                temp.put("thCount", workloadVo.getThCount());
+                temp.put("thAmount", workloadVo.getThAmount());
+                resultList.add(temp);
+                allMap.put(workloadVo.getOpId(), temp);
+            }
+            for (WorkloadVo workloadVo : sfWorkloadVos) {
+                if(workloadVo.getOpId()==null){
+                    continue;
+                }
+                Map<String, Object> temp = allMap.get(workloadVo.getOpId());
+                if (temp == null) {
+                    temp = new HashMap<>();
+                    resultList.add(temp);
+                    allMap.put(workloadVo.getOpId(), temp);
+                    temp.put("opId", workloadVo.getOpId());
+                    temp.put("opName", workloadVo.getOpName());
+                }
+                temp.put("sfCount", workloadVo.getPtCount());
+                temp.put("sfAmount", workloadVo.getPtAmount());
+                temp.put("tfCount", workloadVo.getThCount());
+                temp.put("tfAmount", workloadVo.getThAmount());
+            }
+            resultMap.put("code", 0);
+            resultMap.put("message", "收费员挂号与收费工作量统计成功");
+            resultMap.put("data", resultList);
+            return resultMap;
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("收费员挂号与收费工作量统计失败,错误信息{}", e.getMessage());
+            resultMap.put("code", -1);
+            resultMap.put("message", "收费员挂号与收费工作量统计失败");
+            return resultMap;
+        }
+    }
+
+
     private void frmartWorkloadVo(List<WorkloadVo> workloadVos) {
         if (workloadVos != null && workloadVos.size() > 0) {
             WorkloadVo totalWorkloadVo = new WorkloadVo();
@@ -735,7 +791,7 @@ public class ChargeFeeVoController {
                 }
             }
             for (WorkloadVo wo : workloadVos) {
-                wo.setOpId(employeeMap.get(wo.getOpId()));
+                wo.setOpName(employeeMap.get(wo.getOpId()));
                 if (totalWorkloadVo.getPtCount() == null) {
                     totalWorkloadVo.setPtCount(wo.getPtCount());
                 } else {
@@ -982,7 +1038,7 @@ public class ChargeFeeVoController {
             List<Map<String, Object>> thmzmxsrs = chargeFeeVoService.queryThmzmxsr(thmzmxsrParamsVo);
             thmzmxsrParamsVo.setHisData(YesNoEnum.YES);
             List<Map<String, Object>> thmzmxsrsHis = chargeFeeVoService.queryThmzmxsr(thmzmxsrParamsVo);
-            BigDecimal totalAmount = fomartThmzmxsr(thmzmxsrs,thmzmxsrsHis);
+            BigDecimal totalAmount = fomartThmzmxsr(thmzmxsrs, thmzmxsrsHis);
             resultMap.put("data", thmzmxsrs);
             resultMap.put("totalAmount", totalAmount);
             return resultMap;
@@ -996,7 +1052,7 @@ public class ChargeFeeVoController {
     }
 
 
-    private BigDecimal fomartThmzmxsr(List<Map<String, Object>> thmzmxsrs,List<Map<String, Object>> thmzmxsrsHis) {
+    private BigDecimal fomartThmzmxsr(List<Map<String, Object>> thmzmxsrs, List<Map<String, Object>> thmzmxsrsHis) {
         BigDecimal totalAmount = BigDecimal.ZERO;
         if (thmzmxsrs != null && thmzmxsrs.size() > 0) {
             List<MzBillItem> mzBillItems = mzBillItemService.queryMzBillItem();
@@ -1011,12 +1067,12 @@ public class ChargeFeeVoController {
             }
             Set<Date> repeatSet = new HashSet<>();
             for (Map<String, Object> map : thmzmxsrs) {
-                repeatSet.add((Date)map.get("dcount_date"));
+                repeatSet.add((Date) map.get("dcount_date"));
                 totalAmount = getBigDecimal(totalAmount, mzBillItemMap, employeeMap, map);
             }
 
             for (Map<String, Object> map : thmzmxsrsHis) {
-                if(repeatSet.contains(map.get("dcount_date"))){
+                if (repeatSet.contains(map.get("dcount_date"))) {
                     continue;
                 }
                 totalAmount = getBigDecimal(totalAmount, mzBillItemMap, employeeMap, map);
@@ -1110,7 +1166,7 @@ public class ChargeFeeVoController {
         List<Map<String, Object>> thmzmxsrs = chargeFeeVoService.queryThmzmxsr(thmzmxsrParamsVo);
         thmzmxsrParamsVo.setHisData(YesNoEnum.YES);
         List<Map<String, Object>> thmzmxsrsHis = chargeFeeVoService.queryThmzmxsr(thmzmxsrParamsVo);
-        fomartThmzmxsr(thmzmxsrs,thmzmxsrsHis);
+        fomartThmzmxsr(thmzmxsrs, thmzmxsrsHis);
         ExcelUtil.exportExcelForThmzmxsrs(request, response, thmzmxsrs);
         return null;
     }

+ 9 - 0
src/main/java/cn/hnthyy/thmz/controller/NavigationController.java

@@ -175,4 +175,13 @@ public class NavigationController {
     public String request() {
         return "request";
     }
+
+    /**
+     * 收费员工作量统计
+     * @return
+     */
+    @RequestMapping("/cash-work-count")
+    public String cashWorkCount() {
+        return "cash_work_count";
+    }
 }

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

@@ -1,6 +1,7 @@
 package cn.hnthyy.thmz.mapper.his;
 
 import cn.hnthyy.thmz.entity.his.MzReceiptSerial;
+import cn.hnthyy.thmz.enums.YesNoEnum;
 import cn.hnthyy.thmz.vo.*;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -815,8 +816,11 @@ public interface ChargeFeeVoMapper {
      * @param endDate
      * @return
      */
-    @Select("    SELECT b.op_id," +
+    @Select({"<script>" +
+            "    SELECT b.op_id," +
+            "<when test='orderByDcountDate!=null'>" +
             "           closing_date = b.closing_date," +
+            "</when>" +
             "           pt_count =count((case when  b.cancel_mark = '0' then b.patient_id else null end)), " +
             "           th_count =count(case when b.cancel_mark='1' then b.patient_id else null end),            " +
             "           pt_amount =sum((case  when b.cancel_mark = '0' then  b.req_fee + b.clinic_fee + b.oth_fee + isnull(b.bl_fee,0) + isnull(b.ck_fee,0) else 0 end))," +
@@ -824,12 +828,19 @@ public interface ChargeFeeVoMapper {
             "           total_amount=sum((case  when b.cancel_mark in ('0','1') then  b.req_fee + b.clinic_fee + b.oth_fee + isnull(b.bl_fee,0) + isnull(b.ck_fee,0) else 0 end)) " +
             "    FROM ${tableName}   b " +
             "   WHERE " +
-            "         (case when 1=0 then b.op_day else b.closing_date end) >= #{beginDate,jdbcType=TIMESTAMP} and " +
-            "         (case when 1=0 then b.op_day else b.closing_date end) <= #{endDate,jdbcType=TIMESTAMP} and " +
-            " b.unit_code<>'0000000' " +
-            "group by b.op_id,b.closing_date " +
-            "order by b.op_id ")
-    List<WorkloadVo> selectGhWorkloadVo(@Param("tableName") String tableName, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+            "         (case when 1=0 then b.op_day else b.closing_date end) <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP} and " +
+            "         (case when 1=0 then b.op_day else b.closing_date end) <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}  " +
+            "<when test='cashId!=null'>" +
+            " and b.op_id =#{cashId}" +
+            "</when>" +
+            " and b.unit_code <![CDATA[<>]]> '0000000' " +
+            "group by b.op_id " +
+            "<when test='orderByDcountDate!=null'>" +
+            ",b.closing_date " +
+            "</when>" +
+            "order by b.op_id " +
+            "</script>"})
+    List<WorkloadVo> selectGhWorkloadVo(@Param("tableName") String tableName, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("cashId") String cashId,@Param("orderByDcountDate") YesNoEnum orderByDcountDate);
 
     /**
      * 门诊收费一览表
@@ -838,8 +849,11 @@ public interface ChargeFeeVoMapper {
      * @param endDate
      * @return
      */
-    @Select("select op_id," +
+    @Select({"<script>" +
+            "select op_id," +
+            "<when test='orderByDcountDate!=null'>" +
             "       dcount_date closing_date," +
+            "</when>" +
             "       pt_count=count(distinct case when pay_mark='0' then receipt_sn else null end)," +
             "       pt_amount=sum(case when pay_mark='0' then amount else 0 end)," +
             "       th_count=count(distinct case when pay_mark='1' then receipt_sn else null end)," +
@@ -847,11 +861,18 @@ public interface ChargeFeeVoMapper {
             "       total_amount=sum(case when pay_mark in ('0','1') then amount else 0 end) " +
             " from " +
             " ${tableName} " +
-            " where dcount_date>=#{beginDate} and " +
-            "      dcount_date<=#{endDate}  and pay_mark <> 2 " +
-            "group by op_id,dcount_date " +
-            "order by op_id ")
-    List<WorkloadVo> selectSfWorkloadVo(@Param("tableName") String tableName, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+            " where dcount_date <![CDATA[>=]]> #{beginDate} and " +
+            "      dcount_date <![CDATA[<=]]> #{endDate}  and pay_mark <![CDATA[<>]]> 2 " +
+            "<when test='cashId!=null'>" +
+            " and op_id =#{cashId} " +
+            "</when>" +
+            " group by op_id " +
+            "<when test='orderByDcountDate!=null'>" +
+            ",dcount_date " +
+            "</when>" +
+            "order by op_id " +
+            "</script>"})
+    List<WorkloadVo> selectSfWorkloadVo(@Param("tableName") String tableName, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("cashId") String cashId,@Param("orderByDcountDate") YesNoEnum orderByDcountDate);
 
 
     /**
@@ -938,6 +959,7 @@ public interface ChargeFeeVoMapper {
 
     /**
      * 清洗老系统收费方式表退费方式
+     *
      * @return
      */
     @Update("update mz_deposit_file set cheque_type='1' where pay_mark = 1 and op_id <> '99999' and cheque_type in ('W','M') ")
@@ -945,6 +967,7 @@ public interface ChargeFeeVoMapper {
 
     /**
      * 清洗老系统发票表退费方式
+     *
      * @return
      */
     @Update("update mz_receipt_serial set cheque_type='1' where pay_mark = 1 and pay_id <> '99999' and cheque_type in ('W','M') ")
@@ -952,6 +975,7 @@ public interface ChargeFeeVoMapper {
 
     /**
      * 查询泰和医院门诊明细收入
+     *
      * @param thmzmxsrParamsVo
      * @return
      */
@@ -995,19 +1019,19 @@ public interface ChargeFeeVoMapper {
             "</when>" +
             "<when test='jzSqDept!=null'>" +
             " and mzsr.jz_sq_dept =#{jzSqDept}" +
-            "</when>"+
+            "</when>" +
             "<when test='jzSqDoctor!=null'>" +
             " and mzsr.jz_sq_doctor =#{jzSqDoctor}" +
-            "</when>"+
+            "</when>" +
             "<when test='execDept!=null'>" +
             " and mzsr.exec_dept =#{execDept}" +
-            "</when>"+
+            "</when>" +
             "<when test='hsm!=null'>" +
             " and mzsr.hsm =#{hsm}" +
-            "</when>"+
+            "</when>" +
             "<when test='parentCode!=null'>" +
             " and mzsr.parent_code =#{parentCode}" +
-            "</when>"+
+            "</when>" +
             "<when test='xmm!=null'>" +
             " and mzsr.xmm =#{xmm}" +
             "</when>"

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

@@ -228,17 +228,19 @@ public interface ChargeFeeVoService {
      * 挂号工作量一览表
      * @param beginDate
      * @param endDate
+     * @param cashId
      * @return
      */
-    List<WorkloadVo> queryGhWorkloadVo(YesNoEnum hisDate,Date beginDate, Date endDate);
+    List<WorkloadVo> queryGhWorkloadVo(YesNoEnum hisDate,Date beginDate, Date endDate,String cashId,YesNoEnum orderByDcountDate);
 
     /**
      * 门诊收费一览表
      * @param beginDate
      * @param endDate
+     * @param cashId
      * @return
      */
-    List<WorkloadVo>  querySfWorkloadVo(YesNoEnum hisDate,Date beginDate, Date endDate);
+    List<WorkloadVo>  querySfWorkloadVo(YesNoEnum hisDate,Date beginDate, Date endDate,String cashId,YesNoEnum orderByDcountDate);
 
 
     /**

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

@@ -159,21 +159,21 @@ public class ChargeFeeVoServiceImpl implements ChargeFeeVoService {
     }
 
     @Override
-    public List<WorkloadVo> queryGhWorkloadVo(YesNoEnum hisDate, Date beginDate, Date endDate) {
+    public List<WorkloadVo> queryGhWorkloadVo(YesNoEnum hisDate, Date beginDate, Date endDate,String cashId,YesNoEnum orderByDcountDate) {
         String tableName = "mzy_reqrec";
         if (YesNoEnum.YES.equals(hisDate)) {
             tableName = "mzy_reqrec_b";
         }
-        return chargeFeeVoMapper.selectGhWorkloadVo(tableName, beginDate, endDate);
+        return chargeFeeVoMapper.selectGhWorkloadVo(tableName, beginDate, endDate,cashId,orderByDcountDate);
     }
 
     @Override
-    public List<WorkloadVo> querySfWorkloadVo(YesNoEnum hisDate, Date beginDate, Date endDate) {
+    public List<WorkloadVo> querySfWorkloadVo(YesNoEnum hisDate, Date beginDate, Date endDate,String cashId,YesNoEnum orderByDcountDate) {
         String tableName = "mz_deposit_file";
         if (YesNoEnum.YES.equals(hisDate)) {
             tableName = "mz_deposit_file_b";
         }
-        return chargeFeeVoMapper.selectSfWorkloadVo(tableName, beginDate, endDate);
+        return chargeFeeVoMapper.selectSfWorkloadVo(tableName, beginDate, endDate,cashId,orderByDcountDate);
     }
 
     @Override

+ 2 - 0
src/main/java/cn/hnthyy/thmz/vo/WorkloadVo.java

@@ -24,4 +24,6 @@ public class WorkloadVo {
     private BigDecimal thAmount;
     //总收入
     private BigDecimal totalAmount;
+    //员工姓名
+    private String opName;
 }

+ 231 - 0
src/main/resources/static/js/cash_work_count.js

@@ -0,0 +1,231 @@
+//@ sourceURL=cash_work_count.js
+$(function () {
+    //init_daterangepicker();
+    daterangepicker(getAllOperator);
+    //  initFeeTable();
+    //重置查询参数
+    $('#btn_clean').click(function () {
+        cleanParams();
+    });
+
+    $(".selectpicker").selectpicker({
+        dropuAuto: false
+    });
+
+    //初始化页面上面的按钮事件
+    $("#btn_excel").click(function (t) {
+        exportExcel();
+    });
+    getCasherWorkCount();
+});
+
+
+
+
+
+/**
+ * 收费与挂号工作量统计
+ */
+function getCasherWorkCount() {
+    $('#tb_table').bootstrapTable("destroy");
+    $('#tb_table').bootstrapTable({
+        url: '/thmz/getCasherWorkCount',         //请求后台的URL(*)
+        method: 'post',                      //请求方式(*)
+        toolbar: '#toolbar',                //工具按钮用哪个容器
+        striped: true,                      //是否显示行间隔色
+        cache: false,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: true,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "asc",                   //排序方式
+        queryParams: queryParams,           //传递参数(*)
+        sidePagination: "client",           //分页方式:client客户端分页,server服务端分页(*)
+        pageNumber: 1,                       //初始化加载第一页,默认第一页
+        pageSize: 10,                       //每页的记录行数(*)
+        pageList: [10, 25, 50, 100],        //可供选择的每页的行数(*)
+        search: false,                       //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
+        strictSearch: true,
+        showColumns: false,                  //是否显示所有的列
+        showRefresh: false,                  //是否显示刷新按钮
+        minimumCountColumns: 2,             //最少允许的列数
+        clickToSelect: true,                //是否启用点击选中行
+        uniqueId: "ID",                     //每一行的唯一标识,一般为主键列
+        showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
+        cardView: false,                    //是否显示详细视图
+        detailView: false,
+        //rowStyle:rowStyle,//通过自定义函数设置行样式
+        ajaxOptions: {
+            headers: {
+                'Accept': 'application/json',
+                'Authorization': 'Bearer ' + localStorage.getItem("token")
+            }
+        },
+        columns: [
+            {
+                field: 'opName',
+                title: '收费员',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'ghCount',
+                title: '挂号数',
+                align: "center",
+                valign: 'middle',
+            }, {
+                field: 'ghAmount',
+                title: '挂号金额',
+                align: "center",
+                valign: 'middle',
+            }, {
+                field: 'thCount',
+                title: '退号数',
+                align: "center",
+                valign: 'middle'
+                // ,
+                // formatter: function (value, row, index) {
+                //     return value.toFixed(2);
+                // }
+            }, {
+                field: 'thAmount',
+                title: '退号金额',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'sfCount',
+                title: '收费数',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'sfAmount',
+                title: '收费金额',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'tfCount',
+                title: '退费数',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'tfAmount',
+                title: '退费金额',
+                align: "center",
+                valign: 'middle'
+            }
+        ],
+        responseHandler: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var ress = eval(res);
+            if (ress.code == -1) {
+                if (ress.message != null && ress.message != '') {
+                    new PNotify({
+                        title: '错误提示',
+                        text: ress.message,
+                        type: 'error',
+                        hide: true,
+                        styling: 'bootstrap3'
+                    });
+                }
+                return {
+                    "total": 0,//总页数
+                    "rows": {}   //数据
+                };
+            }
+            return {
+                "total": ress.data.length,//总页数
+                "rows": ress.data   //数据
+            };
+        },
+    });
+}
+
+/**
+ * 构建列表查询参数
+ * @param params
+ * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
+ */
+function queryParams(params) {
+    var rePortRangeArr = getRePortRangeArr();
+    var temp = {
+        beginDate: rePortRangeArr[0],
+        endDate: rePortRangeArr[1],
+        opId: $('#cashParam').val()
+    };
+    return temp;
+};
+
+
+
+
+/**
+ * 获取时间选择器的时间数组
+ * @returns {string[]}
+ */
+function getRePortRangeArr() {
+    var rePortRange = $('#reportrange span').html();
+    var rePortRangeArr = rePortRange.split(" - ");
+    rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
+    rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
+    return rePortRangeArr;
+}
+
+
+
+
+
+/**
+ * 清空查询条件
+ */
+function cleanParams() {
+    $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
+    getAllOperator();
+}
+
+
+
+
+
+/**
+ * 导出excel
+ */
+function exportExcel() {
+    var table2excel = new Table2Excel();
+// 传入你的tableId即可导出
+    table2excel.export($('#tb_table'), "收费员工作量统计");
+}
+
+
+
+/**
+ * 查询给定日期内收费员列表
+ */
+function getAllOperator() {
+    var rePortRangeArr = getRePortRangeArr();
+    $.ajax({
+        type: "POST",
+        url: '/thmz/getAllOperator',
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        data: JSON.stringify({"beginDate": rePortRangeArr[0], "endDate": rePortRangeArr[1]}),
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                var html = '';
+                $.each(res.employees, function (commentIndex, comment) {
+                    html += '<option value="' + comment.employeeCode + '">' + comment.employeeName + '</option>';
+                });
+                $('#cashParam').empty();
+                $('#cashParam').html(html);
+                $('#cashParam').selectpicker('refresh');
+                getCasherWorkCount();
+            } else {
+                errorMesage(res);
+            }
+        }
+    });
+}

+ 2 - 2
src/main/resources/static/js/daily_collect.js

@@ -435,7 +435,7 @@ function getRjbb() {
                     var html = '';
                     for (var i = 0; i < res.ghWorkloadVos.length - 1; i++) {
                         var temp = res.ghWorkloadVos[i];
-                        html += '<tr><td>' + temp.opId + '</td>';
+                        html += '<tr><td>' + temp.opName + '</td>';
                         html += '<td>' + format(temp.closingDate, "yyyy-MM-dd HH:mm:ss") + '</td>';
                         html += '<td>' + temp.ptCount + '</td>';
                         html += '<td>' + temp.ptAmount.toFixed(2) + '</td>';
@@ -463,7 +463,7 @@ function getRjbb() {
                     var html = '';
                     for (var i = 0; i < res.sfWorkloadVos.length-1; i++) {
                         var temp = res.sfWorkloadVos[i];
-                        html += '<tr><td>' + temp.opId + '</td>';
+                        html += '<tr><td>' + temp.opName + '</td>';
                         html += '<td>' + format(temp.closingDate, "yyyy-MM-dd HH:mm:ss") + '</td>';
                         html += '<td>' + temp.ptCount + '</td>';
                         html += '<td>' + temp.ptAmount.toFixed(2) + '</td>';

+ 52 - 0
src/main/resources/templates/cash_work_count.html

@@ -0,0 +1,52 @@
+<link rel="stylesheet" href="/thmz/css/bootstrap/css/bootstrap-select.css"/>
+<link rel="stylesheet" href="/thmz/css/bootstrap/css/daterangepicker.css"/>
+<link rel="stylesheet" href="/thmz/css/custom.min.css">
+<link rel="stylesheet" href="/thmz/css/toll_administration.css">
+<script src="/thmz/js/bootstrap-select.js"></script>
+<script src="/thmz/js/daterangepicker.js"></script>
+<script src="/thmz/js/common/date-util.js"></script>
+<script src="/thmz/js/excel/table2excel.js"></script>
+<script src="/thmz/js/cash_work_count.js"></script>
+<div class="row">
+    <div class="col-md-12 col-sm-12 col-xs-12">
+        <div class="x_panel">
+            <div class="panel-body">
+                <form id="formSearch" class="form-horizontal" autocomplete="off">
+                    <div class="btn-group col-md-3 col-sm-3 col-xs-12" id="pay_mark_group">
+                    </div>
+                    <div class="form-group col-md-9 col-sm-9 col-xs-12" style="margin-left: -40px;">
+                        <!--<div class="col-md-6 col-sm-6 col-xs-12"></div>-->
+                        <label class="control-label col-md-2 col-sm-2 col-xs-12" for="reportrange"> 日结时间
+                        </label>
+                        <div class="col-md-4 col-sm-4 col-xs-12">
+                            <div id="reportrange" class="pull-right"
+                                 style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc">
+                                <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
+                                <span>December 30, 2014 - January 28, 2015</span> <b class="caret"></b>
+                            </div>
+                        </div>
+                        <label class="control-label col-md-2 col-sm-2 col-xs-12" for="cashParam">收费员
+                        </label>
+                        <div class="col-md-2 col-sm-2 col-xs-12">
+                            <select class="form-control selectpicker show-tick" data-live-search="true" title="请选择"
+                                    id="cashParam" onchange="getCasherWorkCount()">
+                            </select>
+                        </div>
+                        <div class="col-md-2 col-sm-2 col-xs-12" style="text-align:left;">
+                            <button type="button" id="btn_clean" class="btn btn-primary"
+                                    title="重置"><i class="fa fa-rotate-left"></i>
+                            </button>
+                            <button type="button"  id="btn_excel" class="btn btn-primary"
+                                    title="导出EXCEL"><i class="fa fa-file-excel-o"></i>
+                            </button>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <table id="tb_table"></table>
+        </div>
+    </div>
+</div>
+</div>
+
+

+ 1 - 0
src/main/resources/templates/menu.html

@@ -82,6 +82,7 @@
                                     <li><a href="#" onclick="changeContent('/thmz/daily-collect')">日结汇总</a></li>
                                     <li><a href="#" onclick="changeContent('/thmz/mzsrmx')">门诊明细收入</a></li>
                                     <li><a href="#" onclick="changeContent('/thmz/mzhbtj')">门诊号别统计</a></li>
+                                    <li><a href="#" onclick="changeContent('/thmz/cash-work-count')">收费员工作量统计</a></li>
                                     <li><a href="#" onclick="changeContent('/thmz/bissinessReport')">门诊科室核算报表</a></li>
                                 </ul>
                             </li>