瀏覽代碼

feat(宿舍): 增加星级文明班级评比总表入口

apple 1 月之前
父節點
當前提交
26a2ddb256

+ 80 - 0
docs/17_升旗礼_宿舍内务检查小程序开发/sql/2026-10-19_星级文明班级评比总表_menu.sql

@@ -0,0 +1,80 @@
+-- =====================================================================
+-- 星级文明班级评比总表菜单挂载
+--
+-- 规则:
+--   1. 在所有已存在“宿舍内务检查”子菜单的菜单模板中,增加同级菜单。
+--   2. 新菜单紧跟“宿舍内务检查”所在父菜单,排在现有兄弟菜单之后。
+--   3. 只插入缺少的记录,不更新、不删除任何现有 GRCD 数据。
+--   4. 新页面直接打开,不依赖业务服务,因此不新增 GW.FWC 服务权限。
+-- =====================================================================
+
+set serveroutput on
+set define off
+
+declare
+    v_insert_count number := 0;
+    v_next_xh      number;
+begin
+    for dorm_menu in (
+        select g.GRCDMBID,
+               g.SJGRCDID,
+               g.CAIDLBM
+          from GRCD g
+         where g.DXM = 'ssnwjc'
+           and g.GNM = 'search'
+           and g.SJGRCDID is not null
+           and g.JLZTM = 1
+         order by g.GRCDMBID, g.GRCDID
+    ) loop
+        if not exists (
+            select 1
+              from GRCD x
+             where x.GRCDMBID = dorm_menu.GRCDMBID
+               and x.SJGRCDID = dorm_menu.SJGRCDID
+               and x.DXM = 'ssnwjc'
+               and x.GNM = 'starClassSummary'
+        ) then
+            select nvl(max(x.XH), 0) + 1
+              into v_next_xh
+              from GRCD x
+             where x.GRCDMBID = dorm_menu.GRCDMBID
+               and x.SJGRCDID = dorm_menu.SJGRCDID;
+
+            insert into GRCD
+                (SJGRCDID, GRCDMBID, CAIDLBM, XH, MC, YWM, DXM, GNM, JLZTM, MS)
+            values
+                (dorm_menu.SJGRCDID,
+                 dorm_menu.GRCDMBID,
+                 nvl(dorm_menu.CAIDLBM, 1),
+                 v_next_xh,
+                 '星级文明班级评比总表',
+                 'xyss',
+                 'ssnwjc',
+                 'starClassSummary',
+                 1,
+                 '星级文明班级评比总表');
+
+            v_insert_count := v_insert_count + 1;
+        end if;
+    end loop;
+
+    dbms_output.put_line('本次新增菜单数:' || v_insert_count);
+end;
+/
+
+commit;
+
+select mb.MC as menu_template,
+       parent.MC as parent_menu,
+       g.GRCDID,
+       g.XH,
+       g.MC,
+       g.DXM,
+       g.GNM,
+       g.JLZTM
+  from GRCD g
+  join GRCDMB mb on mb.GRCDMBID = g.GRCDMBID
+  left join GRCD parent on parent.GRCDID = g.SJGRCDID
+ where g.DXM = 'ssnwjc'
+   and g.GNM in ('search', 'starClassSummary')
+ order by mb.MC, g.SJGRCDID, g.XH, g.GRCDID;

+ 17 - 16
web/cfg/biz/xyss/ssnwjc.obj.xml

@@ -1,21 +1,22 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE xml>
-
-<objs biz="xyss">
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE xml>
+
+<objs biz="xyss">
 <obj name="ssnwjc" desc="宿舍内务检查" po="base.po.SsnwjcPo" child="ssnwjcmx,chgInfo" fts="false"
-		 search="xyssl_zykf" keyword="ms" order="jcsj:desc" cat="kfid,bjid,jcryid,jcsj"
-		 chgFunc="submSus" rootFunc="excelAdd">
-	<field name="fs" desc="分数" title="true"/>
-	<field name="jcsj" desc="检查时间"/>
-	<field name="kfid" desc="客房" cb="cd" width="120"/>
-	<field name="ms" desc="描述" abs="true"/>
-<!--	<field name="mswj" desc="描述" type="html"/>-->
-	<field name="jzwid" desc="建筑物" cb="jzw" width="160"/>
-	<field name="bjid" desc="班级" cb="bj" width="180"/>
-	<field name="fjid" desc="附件" type="cms"/>
-	<field name="jcryid" desc="检查人员" cb="ry" width="120"/>
-
+		 search="xyssl_zykf" keyword="ms" order="jcsj:desc" cat="kfid,bjid,jcryid,jcsj"
+		 chgFunc="submSus" rootFunc="excelAdd">
+	<field name="fs" desc="分数" title="true"/>
+	<field name="jcsj" desc="检查时间"/>
+	<field name="kfid" desc="客房" cb="cd" width="120"/>
+	<field name="ms" desc="描述" abs="true"/>
+<!--	<field name="mswj" desc="描述" type="html"/>-->
+	<field name="jzwid" desc="建筑物" cb="jzw" width="160"/>
+	<field name="bjid" desc="班级" cb="bj" width="180"/>
+	<field name="fjid" desc="附件" type="cms"/>
+	<field name="jcryid" desc="检查人员" cb="ry" width="120"/>
+
 	<func def="parent"/>
 	<func name="excelAdd" desc="录入宿舍内务检查(Excel)" playDesc="录入宿舍内务检查" fullDesc="true" serv="ssnwjc_excelAdd" dest="ssnwjc_excelAdd"/>
+	<func name="starClassSummary" desc="星级文明班级评比总表" playDesc="星级文明班级评比总表" fullDesc="true" dest="ssnwjc_starClassSummary"/>
 </obj>
 </objs>

+ 2 - 0
web/cfg/biz/xyss/ssnwjc.page.xml

@@ -6,4 +6,6 @@
 	<page name="ssnwjc_inp" desc="录入宿舍内务检查"  width="600" height="700"/>
 
 	<page name="ssnwjc_excelAdd" desc="录入宿舍内务检查(Excel)" inp="true"  width="600" height="700"/>
+
+	<page name="ssnwjc_starClassSummary" desc="星级文明班级评比总表" width="1900" height="700"/>
 </pages>

+ 507 - 0
web/page/biz/ssnwjc_starClassSummary.jsp

@@ -0,0 +1,507 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <meta charset="UTF-8">
+    <title>星级文明班级评比总表</title>
+    <style>
+        body {
+            margin: 18px;
+            color: #111;
+            background: #fff;
+            font-family: "Microsoft YaHei", sans-serif;
+            font-size: 14px;
+        }
+
+        .query-area {
+            margin: 0 0 20px;
+            padding: 15px;
+            border: 1px solid #dee2e6;
+            border-radius: 4px;
+            background-color: #f8f9fa;
+        }
+
+        .query-item {
+            display: inline-block;
+            margin-right: 20px;
+            margin-bottom: 10px;
+        }
+
+        .query-item label {
+            margin-right: 5px;
+            font-weight: bold;
+        }
+
+        .query-btn,
+        .export-btn,
+        .reset-btn {
+            padding: 6px 15px;
+            border: none;
+            border-radius: 4px;
+            color: #fff;
+            cursor: pointer;
+        }
+
+        .query-btn {
+            background-color: #007bff;
+        }
+
+        .export-btn {
+            margin-left: 10px;
+            background-color: #28a745;
+        }
+
+        .reset-btn {
+            margin-left: 10px;
+            background-color: #dc3545;
+        }
+
+        select,
+        input[type="month"] {
+            width: 150px;
+            padding: 6px;
+            border: 1px solid #ced4da;
+            border-radius: 4px;
+            background: #fff;
+        }
+
+        .report-title {
+            margin: 20px 0;
+            text-align: center;
+            font-size: 20px;
+            font-weight: bold;
+        }
+
+        .report-info {
+            margin: -8px 0 12px;
+            text-align: right;
+            color: #555;
+            font-size: 13px;
+        }
+
+        .report-info span {
+            margin-left: 14px;
+        }
+
+        table {
+            width: 100%;
+            border-collapse: collapse;
+            font-size: 9pt;
+        }
+
+        table,
+        th,
+        td {
+            border: 1px solid #000;
+        }
+
+        th,
+        td {
+            padding: 6px 5px;
+            text-align: center;
+            white-space: nowrap;
+        }
+
+        th {
+            background-color: #f2f2f2;
+            font-weight: bold;
+        }
+
+        tbody tr:hover {
+            background-color: #f7fbff;
+        }
+
+        .total-cell {
+            font-weight: bold;
+        }
+
+        .empty-row td {
+            padding: 40px 10px;
+            color: #777;
+        }
+
+        .table-footer {
+            margin-top: 10px;
+            color: #666;
+            font-size: 12px;
+            text-align: right;
+        }
+    </style>
+</head>
+<body>
+<div class="query-area">
+    <div class="query-item">
+        <label for="departmentFilter">院系:</label>
+        <select id="departmentFilter">
+            <option value="">全部院系</option>
+        </select>
+    </div>
+    <div class="query-item">
+        <label for="majorFilter">专业:</label>
+        <select id="majorFilter">
+            <option value="">全部专业</option>
+        </select>
+    </div>
+    <div class="query-item">
+        <label for="classFilter">班级:</label>
+        <select id="classFilter">
+            <option value="">全部班级</option>
+        </select>
+    </div>
+    <div class="query-item">
+        <label for="starFilter">星级:</label>
+        <select id="starFilter">
+            <option value="">全部星级</option>
+            <option value="五星级">五星级</option>
+            <option value="四星级">四星级</option>
+            <option value="三星级">三星级</option>
+        </select>
+    </div>
+    <div class="query-item">
+        <label for="monthFilter">月份:</label>
+        <input type="month" id="monthFilter">
+    </div>
+    <button type="button" class="query-btn" id="searchButton">搜索</button>
+    <button type="button" class="export-btn" id="exportButton">导出Excel</button>
+    <button type="button" class="reset-btn" id="resetButton">清空</button>
+</div>
+
+<div class="report-title">星级文明班级评比总表</div>
+<div class="report-info">
+    <span>名称:星级文明班级评比总表</span>
+    <span>年份:<b id="yearText">-</b></span>
+    <span>月份:<b id="monthText">-</b></span>
+    <span>状态:<b id="statusText">演示数据</b></span>
+</div>
+
+<table>
+    <thead>
+    <tr>
+        <th>序号</th>
+        <th>院系</th>
+        <th>专业</th>
+        <th>班级</th>
+        <th>宿舍评分汇总<br>(20%)</th>
+        <th>课堂考核<br>(5%)</th>
+        <th>升旗礼广播操集会<br>(14%)</th>
+        <th>清洁卫生<br>(18%)</th>
+        <th>风纪仪容<br>(20%)</th>
+        <th>考勤<br>(15%)</th>
+        <th>增分</th>
+        <th>减分</th>
+        <th>月份合计</th>
+        <th>星级</th>
+        <th>部门排名</th>
+        <th>全校排名</th>
+    </tr>
+    </thead>
+    <tbody id="reportBody"></tbody>
+</table>
+
+<div class="table-footer">
+    <span id="filterSummary">当前显示当前月份全部演示数据</span>
+    ,共 <b id="resultCount">0</b> 条
+</div>
+
+<script>
+    (function () {
+        "use strict";
+
+        const DEMO_ROWS = [
+            {
+                month: "2026-10",
+                department: "现代服务部",
+                major: "会计",
+                className: "25会计2",
+                dormScore: "89.41",
+                classroomScore: "100.0",
+                flagCeremonyScore: "72.0",
+                cleaningScore: "100.0",
+                disciplineScore: "100.0",
+                attendanceScore: "100.0",
+                bonus: "7.5",
+                deduction: "0.0",
+                monthTotal: "93.46",
+                starLevel: "五星级",
+                departmentRank: "1",
+                schoolRank: "1"
+            },
+            {
+                month: "2026-10",
+                department: "服装技术部",
+                major: "服装陈列",
+                className: "25服5",
+                dormScore: "86.36",
+                classroomScore: "100.0",
+                flagCeremonyScore: "66.0",
+                cleaningScore: "100.0",
+                disciplineScore: "100.0",
+                attendanceScore: "100.0",
+                bonus: "7.0",
+                deduction: "0.0",
+                monthTotal: "91.51",
+                starLevel: "五星级",
+                departmentRank: "1",
+                schoolRank: "2"
+            },
+            {
+                month: "2026-10",
+                department: "智能制造部",
+                major: "数控技术应用",
+                className: "24数控1",
+                dormScore: "85.20",
+                classroomScore: "98.0",
+                flagCeremonyScore: "70.0",
+                cleaningScore: "100.0",
+                disciplineScore: "100.0",
+                attendanceScore: "100.0",
+                bonus: "6.5",
+                deduction: "1.0",
+                monthTotal: "88.70",
+                starLevel: "四星级",
+                departmentRank: "2",
+                schoolRank: "4"
+            },
+            {
+                month: "2026-09",
+                department: "现代服务部",
+                major: "电子商务",
+                className: "24电商1",
+                dormScore: "88.10",
+                classroomScore: "99.0",
+                flagCeremonyScore: "74.0",
+                cleaningScore: "100.0",
+                disciplineScore: "100.0",
+                attendanceScore: "100.0",
+                bonus: "7.2",
+                deduction: "0.0",
+                monthTotal: "92.80",
+                starLevel: "五星级",
+                departmentRank: "1",
+                schoolRank: "2"
+            },
+            {
+                month: "2026-09",
+                department: "服装技术部",
+                major: "服装设计与工艺",
+                className: "24服2",
+                dormScore: "84.75",
+                classroomScore: "98.0",
+                flagCeremonyScore: "68.0",
+                cleaningScore: "100.0",
+                disciplineScore: "100.0",
+                attendanceScore: "99.0",
+                bonus: "6.8",
+                deduction: "0.5",
+                monthTotal: "87.42",
+                starLevel: "四星级",
+                departmentRank: "1",
+                schoolRank: "5"
+            }
+        ];
+
+        const yearText = document.getElementById("yearText");
+        const monthText = document.getElementById("monthText");
+        const statusText = document.getElementById("statusText");
+        const reportBody = document.getElementById("reportBody");
+        const filterSummary = document.getElementById("filterSummary");
+        const resultCount = document.getElementById("resultCount");
+        const departmentFilter = document.getElementById("departmentFilter");
+        const majorFilter = document.getElementById("majorFilter");
+        const classFilter = document.getElementById("classFilter");
+        const starFilter = document.getElementById("starFilter");
+        const monthFilter = document.getElementById("monthFilter");
+
+        function getCurrentMonth() {
+            const now = new Date();
+            return now.getFullYear() + "-" + String(now.getMonth() + 1).padStart(2, "0");
+        }
+
+        function uniqueValues(field) {
+            return Array.from(new Set(DEMO_ROWS.map(function (row) {
+                return row[field];
+            }).filter(Boolean))).sort(function (a, b) {
+                return a.localeCompare(b, "zh-CN");
+            });
+        }
+
+        function fillSelect(select, placeholder, values, selectedValue) {
+            select.innerHTML = "";
+            const defaultOption = document.createElement("option");
+            defaultOption.value = "";
+            defaultOption.textContent = placeholder;
+            select.appendChild(defaultOption);
+
+            values.forEach(function (value) {
+                const option = document.createElement("option");
+                option.value = value;
+                option.textContent = value;
+                select.appendChild(option);
+            });
+            select.value = selectedValue || "";
+        }
+
+        function initializeFilters() {
+            fillSelect(departmentFilter, "全部院系", uniqueValues("department"));
+            fillSelect(majorFilter, "全部专业", uniqueValues("major"));
+            fillSelect(classFilter, "全部班级", uniqueValues("className"));
+        }
+
+        function refreshMajorOptions() {
+            const department = departmentFilter.value;
+            const rows = department
+                ? DEMO_ROWS.filter(function (row) { return row.department === department; })
+                : DEMO_ROWS;
+            const previousMajor = majorFilter.value;
+            fillSelect(majorFilter, "全部专业", Array.from(new Set(rows.map(function (row) {
+                return row.major;
+            }))).sort(function (a, b) {
+                return a.localeCompare(b, "zh-CN");
+            }), previousMajor);
+            refreshClassOptions();
+        }
+
+        function refreshClassOptions() {
+            const rows = DEMO_ROWS.filter(function (row) {
+                return (!departmentFilter.value || row.department === departmentFilter.value)
+                    && (!majorFilter.value || row.major === majorFilter.value);
+            });
+            const previousClass = classFilter.value;
+            fillSelect(classFilter, "全部班级", Array.from(new Set(rows.map(function (row) {
+                return row.className;
+            }))).sort(function (a, b) {
+                return a.localeCompare(b, "zh-CN");
+            }), previousClass);
+        }
+
+        function filterRows() {
+            return DEMO_ROWS.filter(function (row) {
+                return (!monthFilter.value || row.month === monthFilter.value)
+                    && (!departmentFilter.value || row.department === departmentFilter.value)
+                    && (!majorFilter.value || row.major === majorFilter.value)
+                    && (!classFilter.value || row.className === classFilter.value)
+                    && (!starFilter.value || row.starLevel === starFilter.value);
+            }).sort(function (a, b) {
+                if (a.month !== b.month) {
+                    return b.month.localeCompare(a.month);
+                }
+                return Number(a.schoolRank) - Number(b.schoolRank);
+            });
+        }
+
+        function createCell(value, className) {
+            const cell = document.createElement("td");
+            cell.textContent = value == null || value === "" ? "-" : value;
+            if (className) {
+                cell.className = className;
+            }
+            return cell;
+        }
+
+        function renderRows(rows) {
+            reportBody.innerHTML = "";
+            if (!rows.length) {
+                const emptyRow = document.createElement("tr");
+                emptyRow.className = "empty-row";
+                const emptyCell = document.createElement("td");
+                emptyCell.colSpan = 16;
+                emptyCell.textContent = "暂无数据";
+                emptyRow.appendChild(emptyCell);
+                reportBody.appendChild(emptyRow);
+                return;
+            }
+
+            rows.forEach(function (row, index) {
+                const tr = document.createElement("tr");
+                tr.appendChild(createCell(String(index + 1)));
+                tr.appendChild(createCell(row.department));
+                tr.appendChild(createCell(row.major));
+                tr.appendChild(createCell(row.className));
+                tr.appendChild(createCell(row.dormScore));
+                tr.appendChild(createCell(row.classroomScore));
+                tr.appendChild(createCell(row.flagCeremonyScore));
+                tr.appendChild(createCell(row.cleaningScore));
+                tr.appendChild(createCell(row.disciplineScore));
+                tr.appendChild(createCell(row.attendanceScore));
+                tr.appendChild(createCell(row.bonus));
+                tr.appendChild(createCell(row.deduction));
+                tr.appendChild(createCell(row.monthTotal, "total-cell"));
+                tr.appendChild(createCell(row.starLevel));
+                tr.appendChild(createCell(row.departmentRank));
+                tr.appendChild(createCell(row.schoolRank));
+                reportBody.appendChild(tr);
+            });
+        }
+
+        function updateInfo(rows) {
+            const parts = monthFilter.value.split("-");
+            yearText.textContent = parts[0] || "-";
+            monthText.textContent = parts[1] ? String(Number(parts[1])) : "-";
+            statusText.textContent = "演示数据";
+            resultCount.textContent = String(rows.length);
+
+            const selectedFilters = [
+                departmentFilter.value,
+                majorFilter.value,
+                classFilter.value,
+                starFilter.value
+            ].filter(Boolean);
+            filterSummary.textContent = selectedFilters.length
+                ? "筛选条件:" + selectedFilters.join(" / ")
+                : "当前显示当前月份全部演示数据";
+        }
+
+        function validateMonth() {
+            const currentMonth = getCurrentMonth();
+            if (!monthFilter.value) {
+                monthFilter.value = currentMonth;
+            }
+            if (monthFilter.value > currentMonth) {
+                window.alert("不能查询未来月份,已恢复为当前月份。");
+                monthFilter.value = currentMonth;
+            }
+        }
+
+        function executeSearch() {
+            validateMonth();
+            const rows = filterRows();
+            renderRows(rows);
+            updateInfo(rows);
+        }
+
+        function resetFilters() {
+            departmentFilter.value = "";
+            fillSelect(majorFilter, "全部专业", uniqueValues("major"));
+            fillSelect(classFilter, "全部班级", uniqueValues("className"));
+            starFilter.value = "";
+            monthFilter.value = getCurrentMonth();
+            executeSearch();
+        }
+
+        departmentFilter.addEventListener("change", function () {
+            majorFilter.value = "";
+            classFilter.value = "";
+            refreshMajorOptions();
+        });
+
+        majorFilter.addEventListener("change", function () {
+            classFilter.value = "";
+            refreshClassOptions();
+        });
+
+        document.getElementById("searchButton").addEventListener("click", executeSearch);
+        document.getElementById("resetButton").addEventListener("click", resetFilters);
+        document.getElementById("exportButton").addEventListener("click", function () {
+            window.alert("当前为演示数据,真实数据接入后再开放导出功能。");
+        });
+        monthFilter.addEventListener("change", validateMonth);
+
+        const currentMonth = getCurrentMonth();
+        monthFilter.max = currentMonth;
+        monthFilter.value = currentMonth;
+        initializeFilters();
+        executeSearch();
+    }());
+</script>
+</body>
+</html>