This commit is contained in:
Timer
2026-02-20 16:58:22 +08:00
parent e847ff6626
commit c66e19dac8

View File

@ -241,23 +241,23 @@ public class ProcessSectionController {
*/ */
@RequestMapping("/getProcessSection4Select.do") @RequestMapping("/getProcessSection4Select.do")
public String getProcessSection4Select(HttpServletRequest request, Model model) { public String getProcessSection4Select(HttpServletRequest request, Model model) {
String companyId = request.getParameter("companyId"); String companyId = request.getParameter("companyId"); // 默认查询JSBZ???
Company company = this.companyService.selectByPrimaryKey(companyId); Company company = this.companyService.selectByPrimaryKey(companyId);
String wherestr = "where 1=1 and active='" + CommString.Active_True + "' "; 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 String bizs = "";//公司下属所有厂id
List<Unit> blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId); List<Unit> blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId);
if (blist != null && blist.size() > 0) { if (blist != null && blist.size() > 0) {
for (int i = 0; i < blist.size(); i++) { 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 += blist.get(i).getId() + ",";
} }
} }
} }
bizs = bizs.replace(",", "','"); 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 + "') ) "; 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 + "' "; wherestr += " and unit_id='" + companyId + "' ";
} }
if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { 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++) { for (int i = 0; i < processSections.size(); i++) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("id", processSections.get(i).getCode()); 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)) { if (!processSections.get(i).getUnitId().equals(ProcessSection.UnitId_Sys)) {
jsonObject.put("text", processSections.get(i).getSname() + "(" + processSections.get(i).getCompanySname() + ")"); jsonObject.put("text", processSections.get(i).getSname() + "(" + processSections.get(i).getCompanySname() + ")");
} else { } else {
jsonObject.put("text", processSections.get(i).getSname()); 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()); jsonObject.put("text", processSections.get(i).getSname());
} }