修改所属泵站和权限

This commit is contained in:
2026-03-05 10:18:06 +08:00
parent 96605402a5
commit 26031a77da
6 changed files with 127 additions and 102 deletions

View File

@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sipai.entity.base.Result;
import com.sipai.entity.sparepart.Sewage;
import com.sipai.entity.user.ProcessSection;
import com.sipai.entity.user.Unit;
import com.sipai.entity.user.User;
import com.sipai.service.sparepart.SewageService;
@ -85,7 +86,13 @@ public class SewageController {
wherestr += " and (contract_number like '%"+request.getParameter("search_name")+"%' or name like '%"+request.getParameter("search_name")+"%' ) ";
}
if (request.getParameter("processSectionId")!= null && !request.getParameter("processSectionId").isEmpty()) {
wherestr += " and process_section_id = '"+request.getParameter("processSectionId")+"'";
String processSectionId = request.getParameter("processSectionId");
ProcessSection processSection = this.processSectionService.selectById(processSectionId);
if (processSection != null) {
wherestr += " and (process_section_id = '" + processSectionId + "' or process_section_id = '" + processSection.getCode() + "')";
} else {
wherestr += " and process_section_id = '"+processSectionId+"'";
}
}
if (request.getParameter("city")!= null && !request.getParameter("city").isEmpty()) {
wherestr += " and city like '%"+request.getParameter("city")+"%'";
@ -192,6 +199,31 @@ public class SewageController {
return "result";
}
/**
* 排污源页面专用泵站下拉value 使用 process_section.id避免前端提交 code 导致无法正确保存/查询
*/
@RequestMapping("/getProcessSectionId4Select.do")
public ModelAndView getProcessSectionId4Select(HttpServletRequest request, Model model) {
String companyId = request.getParameter("companyId");
String wherestr = "where 1=1 and active='1' ";
if (companyId != null && !companyId.isEmpty()) {
wherestr += " and unit_id = '" + companyId + "' ";
}
wherestr += " order by code asc";
List<ProcessSection> processSections = this.processSectionService.selectListByWhere(wherestr);
JSONArray jsonArray = new JSONArray();
if (processSections != null && processSections.size() > 0) {
for (ProcessSection processSection : processSections) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", processSection.getId());
jsonObject.put("text", processSection.getSname() == null ? processSection.getName() : processSection.getSname());
jsonArray.add(jsonObject);
}
}
model.addAttribute("result", jsonArray.toString());
return new ModelAndView("result");
}
@RequestMapping("/view.do")
public String doview(HttpServletRequest request,Model model,
@ -222,7 +254,13 @@ public class SewageController {
wherestr += " and city like '%"+request.getParameter("search_name1")+"%'";
}
if (request.getParameter("processSectionId")!= null && !request.getParameter("processSectionId").isEmpty()) {
wherestr += " and process_section_id = '"+request.getParameter("processSectionId")+"'";
String processSectionId = request.getParameter("processSectionId");
ProcessSection processSection = this.processSectionService.selectById(processSectionId);
if (processSection != null) {
wherestr += " and (process_section_id = '" + processSectionId + "' or process_section_id = '" + processSection.getCode() + "')";
} else {
wherestr += " and process_section_id = '"+processSectionId+"'";
}
}
List<Sewage> list = this.sewageService.selectListByWhere(wherestr+orderstr);

View File

@ -46,14 +46,30 @@ public class SewageService implements CommService<Sewage>{
@Resource
private JsywPointService jsywPointService;
private ProcessSection getProcessSectionByStoredValue(String processSectionValue) {
if (processSectionValue == null || processSectionValue.isEmpty()) {
return null;
}
ProcessSection processSection = this.processSectionService.selectById(processSectionValue);
if (processSection != null) {
return processSection;
}
List<ProcessSection> processSectionList = this.processSectionService.selectListByWhere(
"where code = '" + processSectionValue + "' and unit_id = 'JSBZ'");
if (processSectionList != null && processSectionList.size() > 0) {
return processSectionList.get(0);
}
return null;
}
@Override
public Sewage selectById(String id) {
Sewage sewage = SewageDao.selectByPrimaryKey(id);
sewage.setCompany(this.unitService.getCompById(sewage.getUnitId()));
List<ProcessSection> processSectionList = this.processSectionService.selectListByWhere("where code = '"+sewage.getProcessSectionId()+"' and unit_id = 'JSBZ'");
if (processSectionList.size()>0) {
sewage.setProcessSection(processSectionList.get(0));
ProcessSection processSection = this.getProcessSectionByStoredValue(sewage.getProcessSectionId());
if (processSection != null) {
sewage.setProcessSection(processSection);
}
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere("where sewage_id='"+sewage.getContractNumber()+"' order by insdt");
if(sewageInputList!=null && sewageInputList.size()>0){
@ -92,9 +108,9 @@ public class SewageService implements CommService<Sewage>{
List<Sewage> list = SewageDao.selectListByWhere(sewage);
for (Sewage item : list) {
item.setCompany(this.unitService.getCompById(item.getUnitId()));
List<ProcessSection> processSectionList = this.processSectionService.selectListByWhere("where code = '"+item.getProcessSectionId()+"' and unit_id = 'JSBZ'");
if (processSectionList.size()>0) {
item.setProcessSection(processSectionList.get(0));
ProcessSection processSection = this.getProcessSectionByStoredValue(item.getProcessSectionId());
if (processSection != null) {
item.setProcessSection(processSection);
}
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere4Pure("where sewage_id='"+item.getContractNumber()+"' order by insdt");
if(sewageInputList!=null && sewageInputList.size()>0){