From c66e19dac8a061ce6ff1094c35686d25d59c3afd Mon Sep 17 00:00:00 2001 From: Timer <@> Date: Fri, 20 Feb 2026 16:58:22 +0800 Subject: [PATCH] diff --- .../controller/user/ProcessSectionController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sipai/controller/user/ProcessSectionController.java b/src/main/java/com/sipai/controller/user/ProcessSectionController.java index 72317e1f..5aad3455 100644 --- a/src/main/java/com/sipai/controller/user/ProcessSectionController.java +++ b/src/main/java/com/sipai/controller/user/ProcessSectionController.java @@ -241,23 +241,23 @@ public class ProcessSectionController { */ @RequestMapping("/getProcessSection4Select.do") public String getProcessSection4Select(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); + String companyId = request.getParameter("companyId"); // 默认查询JSBZ??? Company company = this.companyService.selectByPrimaryKey(companyId); String wherestr = "where 1=1 and active='" + CommString.Active_True + "' "; - if (company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { + if (company != null && company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司 String bizs = "";//公司下属所有厂id List blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId); if (blist != null && blist.size() > 0) { for (int i = 0; i < blist.size(); i++) { - if (blist.get(i).getType().equals(CommString.UNIT_TYPE_BIZ)) { + if (blist.get(i).getType().equals(CommString.UNIT_TYPE_BIZ)) { // "B";//水厂 bizs += blist.get(i).getId() + ","; } } } 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 (company.getType().equals(CommString.UNIT_TYPE_BIZ)) { + } else if (company != null && company.getType().equals(CommString.UNIT_TYPE_BIZ)) { // B 水厂 wherestr += " and unit_id='" + companyId + "' "; } if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { @@ -272,13 +272,13 @@ public class ProcessSectionController { for (int i = 0; i < processSections.size(); i++) { JSONObject jsonObject = new JSONObject(); jsonObject.put("id", processSections.get(i).getCode()); - if (company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { + if (company != null && company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "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 (company.getType().equals(CommString.UNIT_TYPE_BIZ)) { + } else if (company != null && company.getType().equals(CommString.UNIT_TYPE_BIZ)) { // "B";//水厂 jsonObject.put("text", processSections.get(i).getSname()); }