Browse Source

chore(日报): 提交 2026-11-25 代码变更(8 个文件)

harper 1 week ago
parent
commit
c32a5b1dc8

BIN
docs/06_生产运维与部署/2026-11-25_沙溪理工PMS产品技术文档.docx


+ 142 - 0
src/biz/kq/KqTjbServ.java

@@ -84,6 +84,20 @@ public class KqTjbServ extends Serv {
         return null;
     }
 
+    public String selKqhzWeekDays() throws Exception {
+
+        doPost(super.req, super.resp,"/serv/selKqhzWeekDays");
+
+        return null;
+    }
+
+    public String selKqhzDayDetail() throws Exception {
+
+        doPost(super.req, super.resp,"/serv/selKqhzDayDetail");
+
+        return null;
+    }
+
     // 数据源对象,通过JNDI获取
     private DataSource dataSource = null;
 
@@ -137,6 +151,12 @@ public class KqTjbServ extends Serv {
                     case "/serv/selBj":
                         selBj(request, response);
                         break;
+                    case "/serv/selKqhzWeekDays":
+                        selKqhzWeekDays(request, response);
+                        break;
+                    case "/serv/selKqhzDayDetail":
+                        selKqhzDayDetail(request, response);
+                        break;
                     default:
                         sendError(response, "无效的请求路径: " + pathInfo);
                         break;
@@ -849,6 +869,128 @@ public class KqTjbServ extends Serv {
         }
     }
 
+    // 全校考勤类型占比图下钻:按考勤类别 + 本周,返回每天的数量。
+    private void selKqhzWeekDays(HttpServletRequest request, HttpServletResponse response)
+            throws Exception {
+        String kqlbmStr = request.getParameter("kqlbm");
+        if (kqlbmStr == null || kqlbmStr.trim().isEmpty()) {
+            sendError(response, "缺少考勤类别参数 kqlbm");
+            return;
+        }
+        int kqlbm = Integer.parseInt(kqlbmStr.trim());
+
+        Connection conn = null;
+        PreparedStatement pstmt = null;
+        ResultSet rs = null;
+
+        Map<String, Object> resultMap = new HashMap<>();
+        List<Map<String, Object>> dataList = new ArrayList<>();
+
+        try {
+            conn = getConnectionFromPool();
+
+            String sql = "SELECT TO_CHAR(KSSJ,'YYYY-MM-DD') RQ, COUNT(*) P "
+                    + "FROM KQJL "
+                    + "WHERE KQLBM=? "
+                    + "AND KSSJ>=TRUNC(SYSDATE,'IW') "
+                    + "AND KSSJ<TRUNC(SYSDATE,'IW')+7 "
+                    + "GROUP BY TO_CHAR(KSSJ,'YYYY-MM-DD') "
+                    + "ORDER BY RQ";
+            pstmt = conn.prepareStatement(sql);
+            pstmt.setInt(1, kqlbm);
+            rs = pstmt.executeQuery();
+
+            while (rs.next()) {
+                Map<String, Object> rowMap = new HashMap<>();
+                rowMap.put("rq", rs.getString("RQ"));
+                rowMap.put("p", rs.getInt("P"));
+                dataList.add(rowMap);
+            }
+
+            resultMap.put("success", true);
+            resultMap.put("code", 200);
+            resultMap.put("message", "查询成功");
+            resultMap.put("data", dataList);
+            resultMap.put("total", dataList.size());
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            resultMap.put("success", false);
+            resultMap.put("code", 500);
+            resultMap.put("message", "查询失败:" + e.getMessage());
+        } finally {
+            closeResources(rs, pstmt, conn);
+            sendJson(response, resultMap);
+        }
+    }
+
+    // 全校考勤类型占比图下钻:按考勤类别 + 某天,返回学生姓名、班级、时间、说明。
+    private void selKqhzDayDetail(HttpServletRequest request, HttpServletResponse response)
+            throws Exception {
+        String kqlbmStr = request.getParameter("kqlbm");
+        String rq = request.getParameter("rq");
+        if (kqlbmStr == null || kqlbmStr.trim().isEmpty()
+                || rq == null || rq.trim().isEmpty()) {
+            sendError(response, "缺少考勤类别 kqlbm 或日期 rq 参数");
+            return;
+        }
+        int kqlbm = Integer.parseInt(kqlbmStr.trim());
+        String rqVal = rq.trim();
+
+        Connection conn = null;
+        PreparedStatement pstmt = null;
+        ResultSet rs = null;
+
+        Map<String, Object> resultMap = new HashMap<>();
+        List<Map<String, Object>> dataList = new ArrayList<>();
+
+        try {
+            conn = getConnectionFromPool();
+
+            String sql = "SELECT RY.XM, BJ.MC BJM, "
+                    + "TO_CHAR(KQJL.KSSJ,'YYYY-MM-DD HH24:MI') KSSJ, "
+                    + "TO_CHAR(KQJL.JSSJ,'YYYY-MM-DD HH24:MI') JSSJ, "
+                    + "KQJL.MS "
+                    + "FROM KQJL "
+                    + "LEFT JOIN RY ON RY.RYID=KQJL.RYID "
+                    + "LEFT JOIN BJ ON BJ.BJID=KQJL.BJID "
+                    + "WHERE KQJL.KQLBM=? "
+                    + "AND KQJL.KSSJ>=TO_DATE(?,'YYYY-MM-DD') "
+                    + "AND KQJL.KSSJ<TO_DATE(?,'YYYY-MM-DD')+1 "
+                    + "ORDER BY KQJL.KSSJ, RY.XM";
+            pstmt = conn.prepareStatement(sql);
+            pstmt.setInt(1, kqlbm);
+            pstmt.setString(2, rqVal);
+            pstmt.setString(3, rqVal);
+            rs = pstmt.executeQuery();
+
+            while (rs.next()) {
+                Map<String, Object> rowMap = new HashMap<>();
+                rowMap.put("xm", rs.getString("XM"));
+                rowMap.put("bjmc", rs.getString("BJM"));
+                rowMap.put("kssj", rs.getString("KSSJ"));
+                rowMap.put("jssj", rs.getString("JSSJ"));
+                rowMap.put("ms", rs.getString("MS"));
+                dataList.add(rowMap);
+            }
+
+            resultMap.put("success", true);
+            resultMap.put("code", 200);
+            resultMap.put("message", "查询成功");
+            resultMap.put("data", dataList);
+            resultMap.put("total", dataList.size());
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            resultMap.put("success", false);
+            resultMap.put("code", 500);
+            resultMap.put("message", "查询失败:" + e.getMessage());
+        } finally {
+            closeResources(rs, pstmt, conn);
+            sendJson(response, resultMap);
+        }
+    }
+
     // 导出考勤日汇总表
     // 导出考勤日汇总表
     private void exportKqDailySummary(HttpServletRequest request, HttpServletResponse response)

+ 2 - 0
web/cfg/biz/kq/kqjl.page.xml

@@ -16,6 +16,8 @@
 	<page name="kqjl_kqhz_kqGradeSummary" desc="年级考勤统计表"  width="1000" height="600"/>
 	<page name="kqjl_kqhz_kqClassDailySummary" desc="班级考勤日报表"  width="1000" height="600"/>
 	<page name="kqjl_kqhz_kqStudentDetail" desc="班级学生考勤明细表"  width="1000" height="600"/>
+	<page name="kqjl_kqhz_weekDays" desc="考勤占比下钻-本周每日"  width="820" height="520"/>
+	<page name="kqjl_kqhz_dayDetail" desc="考勤占比下钻-当日明细"  width="900" height="600"/>
 	<page name="kqjl_kqhz_hkDormDailyDetail" desc="宿舍每日考勤汇总表" width="1500" height="650"/>
 	<page name="kqjl_kqhz_hkDormDailyStat" desc="宿舍每日考勤统计图" width="1500" height="600"/>
 	<page name="kqjl_kqhz_hkAttendanceReconcile" desc="海康考勤回写统计对账" width="1000" height="600"/>

+ 2 - 0
web/cfg/biz/kq/kqjl.serv.xml

@@ -30,6 +30,8 @@
 			<serv name="kqjl_kqhz_exportKqStudentDetail" desc="导出班级学生考勤明细表" clazz="biz.kq.KqTjbServ" func="exportKqStudentDetail"/>
 			<serv name="kqjl_kqhz_selNj" desc="年级查询" clazz="biz.kq.KqTjbServ" func="selNj"/>
 			<serv name="kqjl_kqhz_selBj" desc="班级查询" clazz="biz.kq.KqTjbServ" func="selBj"/>
+			<serv name="kqjl_kqhz_selKqhzWeekDays" desc="考勤占比下钻-本周每日" clazz="biz.kq.KqTjbServ" func="selKqhzWeekDays"/>
+			<serv name="kqjl_kqhz_selKqhzDayDetail" desc="考勤占比下钻-当日明细" clazz="biz.kq.KqTjbServ" func="selKqhzDayDetail"/>
 
 			<serv name="kqjl_kqhz_hkDormDailyDetail" desc="宿舍每日考勤汇总表" clazz="biz.kq.HkKqTjbServ" func="hkDormDailyDetail"/>
 			<serv name="kqjl_kqhz_exportHkDormDailyDetail" desc="导出宿舍每日考勤汇总表" clazz="biz.kq.HkKqTjbServ" func="exportHkDormDailyDetail"/>

+ 25 - 3
web/js/vue/ss-components.js

@@ -7194,10 +7194,12 @@ import { EVEN_VAR } from "./EventBus.js";
     props: {
       options: { type: Object, default: () => ({}) },
       height: { type: String, default: "200px" },
+      onChartClick: { type: Function, default: null },
     },
     setup(props) {
       const elRef = Vue.ref(null);
       let chart = null;
+      let clickBound = false;
 
       const renderChart = () => {
         if (!elRef.value || !window.echarts) return;
@@ -7205,6 +7207,10 @@ import { EVEN_VAR } from "./EventBus.js";
           chart = window.echarts.init(elRef.value);
         }
         chart.setOption(props.options || {}, true);
+        if (!clickBound && typeof props.onChartClick === "function") {
+          chart.on("click", (params) => props.onChartClick(params, chart));
+          clickBound = true;
+        }
       };
 
       const resizeChart = () => {
@@ -7285,6 +7291,7 @@ import { EVEN_VAR } from "./EventBus.js";
       // hover 弹窗建议尺寸:默认 1000x650(比例由逻辑统一管控),实际渲染会按比例自适应视口 by xu 20260115
       previewWidth: { type: Number, default: 1000 },
       previewHeight: { type: Number, default: 650 },
+      onChartClick: { type: Function, default: null },
     },
     setup(props) {
       const triggerRef = Vue.ref(null);
@@ -7674,7 +7681,11 @@ import { EVEN_VAR } from "./EventBus.js";
                 ]
               ),
           Vue.h("div", { class: "ss-sidebar-chart-preview__body" }, [
-            Vue.h(Chart, { options: this.options, height: "100%" }),
+            Vue.h(Chart, {
+              options: this.options,
+              height: "100%",
+              onChartClick: this.onChartClick,
+            }),
           ]),
         ]
       );
@@ -7753,7 +7764,11 @@ import { EVEN_VAR } from "./EventBus.js";
               ]
             ),
             Vue.h("div", { class: "ss-sidebar-chart-fullscreen__body" }, [
-              Vue.h(Chart, { options: this.options, height: "100%" }),
+              Vue.h(Chart, {
+                options: this.options,
+                height: "100%",
+                onChartClick: this.onChartClick,
+              }),
             ]),
           ]
         );
@@ -7773,7 +7788,13 @@ import { EVEN_VAR } from "./EventBus.js";
               this.scheduleClose();
             },
           },
-          [Vue.h(Chart, { options: this.options, height: this.height })]
+          [
+            Vue.h(Chart, {
+              options: this.options,
+              height: this.height,
+              onChartClick: this.onChartClick,
+            }),
+          ]
         ),
         (this.open || this.fullscreen) &&
           Vue.h(Vue.Teleport, { to: "body" }, [
@@ -9064,6 +9085,7 @@ import { EVEN_VAR } from "./EventBus.js";
                         icon: p?.icon ?? "",
                         options: p?.options || {},
                         height: p?.height || "240px",
+                        onChartClick: p?.onChartClick || null,
                       }),
                 ]
               )

+ 85 - 0
web/page/biz/kqjl_kqhz_dayDetail.jsp

@@ -0,0 +1,85 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="/ssTag" prefix="ss" %>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <title>考勤明细</title>
+    <style>
+        body { font-family: "Microsoft YaHei", sans-serif; padding: 12px; }
+        .hdr { font-size: 18px; font-weight: bold; margin: 8px 0 16px; color: #235894; }
+        table { border-collapse: collapse; width: 100%; font-size: 9pt; }
+        table, th, td { border: 1px solid #c9c9c9; padding: 6px; text-align: center; }
+        th { background: #f2f2f2; }
+        .empty { color: #999; text-align: center; padding: 30px 0; }
+    </style>
+    <script type="text/javascript" src="/ss/jquery/jquery.js"></script>
+</head>
+<body>
+<div class="hdr" id="title"></div>
+<div id="tableWrap">
+    <table>
+        <thead>
+            <tr>
+                <th>序号</th>
+                <th>姓名</th>
+                <th>班级</th>
+                <th>开始时间</th>
+                <th>结束时间</th>
+                <th>说明</th>
+            </tr>
+        </thead>
+        <tbody id="tb"></tbody>
+    </table>
+</div>
+<div class="empty" id="empty" style="display:none;">当日暂无记录</div>
+<script>
+var KQLBM = '${param.kqlbm}';
+var RQ = '${param.rq}';
+var LBMC = '${param.lbmc}';
+
+$(function(){
+    $('#title').text(LBMC + ' ' + RQ + ' 明细');
+    $.ajax({
+        type: 'get',
+        url: '<ss:serv name="kqjl_kqhz_selKqhzDayDetail"/>',
+        data: { kqlbm: KQLBM, rq: RQ },
+        dataType: 'json',
+        success: function(res){
+            if (res && res.success && res.data && res.data.length) {
+                render(res.data);
+            } else {
+                $('#tableWrap').hide();
+                $('#empty').show();
+            }
+        },
+        error: function(){
+            $('#tableWrap').hide();
+            $('#empty').text('加载失败').show();
+        }
+    });
+});
+
+function render(data){
+    var html = '';
+    for (var i = 0; i < data.length; i++) {
+        var d = data[i];
+        html += '<tr>'
+              + '<td>' + (i + 1) + '</td>'
+              + '<td>' + esc(d.xm) + '</td>'
+              + '<td>' + esc(d.bjmc) + '</td>'
+              + '<td>' + esc(d.kssj) + '</td>'
+              + '<td>' + esc(d.jssj) + '</td>'
+              + '<td>' + esc(d.ms) + '</td>'
+              + '</tr>';
+    }
+    $('#tb').html(html);
+}
+
+function esc(v){
+    if (v === null || v === undefined) return '';
+    return String(v).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+}
+</script>
+</body>
+</html>

+ 88 - 0
web/page/biz/kqjl_kqhz_weekDays.jsp

@@ -0,0 +1,88 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="/ssTag" prefix="ss" %>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <title>考勤占比下钻</title>
+    <style>
+        body { font-family: "Microsoft YaHei", sans-serif; padding: 12px; }
+        .hdr { font-size: 18px; font-weight: bold; margin: 8px 0 16px; color: #235894; }
+        .day-list { list-style: none; padding: 0; margin: 0; }
+        .day-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border: 1px solid #e3e6eb; border-radius: 6px; margin-bottom: 8px; cursor: pointer; background: #fafbfc; }
+        .day-item:hover { background: #eef4ff; border-color: #9cc1ff; }
+        .day-name { font-size: 15px; }
+        .day-count { font-size: 15px; font-weight: bold; color: #235894; }
+        .empty { color: #999; text-align: center; padding: 30px 0; }
+    </style>
+    <script type="text/javascript" src="/ss/jquery/jquery.js"></script>
+</head>
+<body>
+<div class="hdr" id="title"></div>
+<ul class="day-list" id="dayList"></ul>
+<div class="empty" id="empty" style="display:none;">本周暂无记录</div>
+<script>
+var KQLBM = '${param.kqlbm}';
+var LBMC = '${param.lbmc}';
+var WEEK_NAMES = ['周日','周一','周二','周三','周四','周五','周六'];
+
+$(function(){
+    $('#title').text(LBMC + ' - 本周每日分布');
+    $.ajax({
+        type: 'get',
+        url: '<ss:serv name="kqjl_kqhz_selKqhzWeekDays"/>',
+        data: { kqlbm: KQLBM },
+        dataType: 'json',
+        success: function(res){
+            if (res && res.success && res.data && res.data.length) {
+                render(res.data);
+            } else {
+                $('#empty').show();
+            }
+        },
+        error: function(){
+            $('#empty').text('加载失败').show();
+        }
+    });
+});
+
+function render(data){
+    var html = '';
+    for (var i = 0; i < data.length; i++) {
+        var d = data[i];
+        var wd = getWeekName(d.rq);
+        html += '<li class="day-item" onclick="openDay(\'' + d.rq + '\')">'
+              + '<span class="day-name">' + d.rq + ' ' + wd + '</span>'
+              + '<span class="day-count">' + d.p + ' 人</span></li>';
+    }
+    $('#dayList').html(html);
+}
+
+function getWeekName(rq){
+    try {
+        var d = new Date(rq.replace(/-/g, '/'));
+        return WEEK_NAMES[d.getDay()];
+    } catch(e) {
+        return '';
+    }
+}
+
+function openDay(rq){
+    var url = '/service?ssDest=kqjl_kqhz_dayDetail'
+        + '&kqlbm=' + encodeURIComponent(KQLBM)
+        + '&rq=' + encodeURIComponent(rq)
+        + '&lbmc=' + encodeURIComponent(LBMC);
+    var opened = false;
+    try {
+        if (window.top && window.top.wd && window.top.wd.display && window.top.wd.display.showComponent) {
+            window.top.wd.display.showComponent({show:['wdDialog'], url:url, title:LBMC + ' ' + rq + ' 明细', width:900, height:600, minHeight:400, maxHeight:720});
+            opened = true;
+        }
+    } catch(e) {}
+    if (!opened) {
+        window.open(url, '_blank');
+    }
+}
+</script>
+</body>
+</html>

+ 22 - 0
web/page/objList.jsp

@@ -1307,6 +1307,8 @@
                                 yAxis: {type: "value"},
                                 series: [{type: "bar", data: []}]
                             },
+                            // 功能说明:全校考勤类型占比图扇区点击下钻(出勤不可下钻) by 20261125
+                            onChartClick: (params) => this.openKqhzDrillDown(it, params),
                         }));
                 },
                 // 功能说明:按 wrPchtPlay 返回的 tjtlbm 生成扇形/折线/条形图配置(1扇形/11折线/21条形) by xu 20260520
@@ -1440,6 +1442,26 @@
                             console.error("loadPstatChartData failed", grtjid, e);
                             return null;
                         });
+                },
+                // 功能说明:仅“全校考勤类型占比图”启用三级下钻:缺勤/事假/病假 -> 本周每日 -> 当日明细 by 20261125
+                openKqhzDrillDown(chartItem, params) {
+                    const title = chartItem?.mc || "";
+                    if (title !== "全校考勤类型占比图") return;
+                    const name = params?.name || "";
+                    const lbMap = { "缺勤": 1, "事假": 31, "病假": 41 };
+                    const kqlbm = lbMap[name];
+                    if (!kqlbm) return;  // 出勤及其它扇区不下钻
+                    try {
+                        window.ssTools.openServiceDialog({
+                            dest: "kqjl_kqhz_weekDays",
+                            parm: { kqlbm: kqlbm, lbmc: name },
+                            title: name + " - 本周每日分布",
+                            width: 820,
+                            height: 520,
+                        });
+                    } catch (e) {
+                        console.error("openKqhzDrillDown failed", e);
+                    }
                 },
 	                applyPobjHomeData(ssData) {
                     if (!ssData || typeof ssData !== "object") return;