From f89ab0f90d7b3e7f2b5600c05c5568dc6a2db1a6 Mon Sep 17 00:00:00 2001 From: Timer <@> Date: Thu, 9 Apr 2026 09:09:00 +0800 Subject: [PATCH] bug --- .../user/ProcessSectionController.java | 22 +- src/main/webapp/jsp/work/KPIPointList.jsp | 760 +++++++++--------- 2 files changed, 409 insertions(+), 373 deletions(-) diff --git a/src/main/java/com/sipai/controller/user/ProcessSectionController.java b/src/main/java/com/sipai/controller/user/ProcessSectionController.java index ee570fbc..52eb0dee 100644 --- a/src/main/java/com/sipai/controller/user/ProcessSectionController.java +++ b/src/main/java/com/sipai/controller/user/ProcessSectionController.java @@ -242,11 +242,20 @@ public class ProcessSectionController { @RequestMapping("/getProcessSection4Select.do") public String getProcessSection4Select(HttpServletRequest request, Model model) { String companyId = request.getParameter("companyId"); // 默认查询JSBZ??? - // 使用unitService获取Unit信息,因为companyId来自tb_unit表 + // companyId在不同页面可能来自tb_unit或tb_company,统一兼容两种来源 Unit unit = this.unitService.getUnitById(companyId); + String unitType = null; + if (unit != null) { + unitType = unit.getType(); + } else if (companyId != null && !companyId.isEmpty()) { + Company company = this.unitService.getCompById(companyId); + if (company != null) { + unitType = company.getType(); + } + } String wherestr = "where 1=1 and active='" + CommString.Active_True + "' "; - if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司 + if (CommString.UNIT_TYPE_COMPANY.equals(unitType)) { // "C";//公司 String bizs = "";//公司下属所有厂id List blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId); if (blist != null && blist.size() > 0) { @@ -258,7 +267,7 @@ public class ProcessSectionController { } bizs = bizs.replace(",", "','"); wherestr += " and (unit_id='" + ProcessSection.UnitId_Sys + "' or (code not in (select code from tb_process_section where unit_id='" + ProcessSection.UnitId_Sys + "')) and unit_id in ('" + bizs + "') ) "; - } else if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { // B 水厂 + } else if (CommString.UNIT_TYPE_BIZ.equals(unitType)) { // B 水厂 wherestr += " and unit_id='" + companyId + "' "; } if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { @@ -273,13 +282,16 @@ public class ProcessSectionController { for (int i = 0; i < processSections.size(); i++) { JSONObject jsonObject = new JSONObject(); jsonObject.put("id", processSections.get(i).getCode()); - if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司 + if (CommString.UNIT_TYPE_COMPANY.equals(unitType)) { // "C";//公司 if (!processSections.get(i).getUnitId().equals(ProcessSection.UnitId_Sys)) { jsonObject.put("text", processSections.get(i).getSname() + "(" + processSections.get(i).getCompanySname() + ")"); } else { jsonObject.put("text", processSections.get(i).getSname()); } - } else if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { // "B";//水厂 + } else if (CommString.UNIT_TYPE_BIZ.equals(unitType)) { // "B";//水厂 + jsonObject.put("text", processSections.get(i).getSname()); + } else { + // 兜底,避免前端下拉出现有id无text导致显示为空 jsonObject.put("text", processSections.get(i).getSname()); } diff --git a/src/main/webapp/jsp/work/KPIPointList.jsp b/src/main/webapp/jsp/work/KPIPointList.jsp index 8c32ee14..ec57207b 100644 --- a/src/main/webapp/jsp/work/KPIPointList.jsp +++ b/src/main/webapp/jsp/work/KPIPointList.jsp @@ -1,406 +1,430 @@ -<%@ page language="java" pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> -<%@ page import="com.sipai.entity.base.ServerObject"%> -<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%> +<%@ page language="java" pageEncoding="UTF-8" %> +<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> +<%@ page import="com.sipai.entity.base.ServerObject" %> +<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %> -<%= ServerObject.atttable.get("TOPTITLE")%> + <%= ServerObject.atttable.get("TOPTITLE")%> + - - - - + + }) + + + }); + -
- - <%-- --%> - - <%-- --%> -
- -
-

- -
- -
-
-
-
-
- -
+
+ + <%-- --%> + + <%-- --%> +
+ +
+

+ +
+ +
+
+
+
+
+ +
+
-
-
- - - - -
-
-
-
-
- -
- -
+
+ + + +
-
- - -
- -
+
+
+ +
+ +
+
+
+
+ + +
- - - -
- -
- <%-- --%> - <%-- --%> + +
+
+ + +
+
+ <%-- --%> + <%-- --%> +
<%-- --%> + document.write("/node_modules/bootstrap-fileinput/js/fileinput.min.js\">") + document.write("/node_modules/bootstrap-fileinput/js/locales/zh.js\">") + - - + + - - - + + +