diff --git a/.gitignore b/.gitignore index 0192f93c..8ac1f6ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # IntelliJ IDEA .idea/ +.smarttomcat/ *.iml # Eclipse diff --git a/pom.xml b/pom.xml index ac575730..25efc0b0 100644 --- a/pom.xml +++ b/pom.xml @@ -611,6 +611,12 @@ com.github.xiaoymin knife4j-spring 2.0.5 + + + com.google.guava + guava + + com.github.xiaoymin diff --git a/src/main/java/com/sipai/controller/pipeline/PipelineDataController.java b/src/main/java/com/sipai/controller/pipeline/PipelineDataController.java new file mode 100644 index 00000000..f93d7457 --- /dev/null +++ b/src/main/java/com/sipai/controller/pipeline/PipelineDataController.java @@ -0,0 +1,117 @@ +package com.sipai.controller.pipeline; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.sipai.entity.pipeline.PipelineData; +import com.sipai.entity.user.User; +import com.sipai.service.pipeline.PipelineDataService; +import com.sipai.tools.CommUtil; +import net.sf.json.JSONArray; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.ModelAndView; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +@Controller +@RequestMapping("/pipeline/pipelineData") +public class PipelineDataController { + @Resource + private PipelineDataService pipelineDataService; + + @RequestMapping("/showList.do") + public String showList(HttpServletRequest request, Model model) { + return "/pipeline/pipelineDataList"; + } + + @RequestMapping("/getList.do") + public ModelAndView getList(HttpServletRequest request, Model model, + @RequestParam(value = "page") Integer page, + @RequestParam(value = "rows") Integer rows, + @RequestParam(value = "sort", required = false) String sort, + @RequestParam(value = "order", required = false) String order) { + User cu = (User) request.getSession().getAttribute("cu"); + if (sort == null || sort.equals("id")) { + sort = " id "; + } + if (order == null) { + order = " desc "; + } + String orderstr = " order by " + sort + " " + order; + String wherestr = " where 1=1 "; + if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { + wherestr += " and pipeline_name like '%" + request.getParameter("search_name") + "%'"; + } + PageHelper.startPage(page, rows); + List list = this.pipelineDataService.selectListByWhere(wherestr + orderstr); + PageInfo pInfo = new PageInfo(list); + JSONArray jsonArray = JSONArray.fromObject(list); + String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; + model.addAttribute("result", result); + return new ModelAndView("result"); + } + + @RequestMapping("/add.do") + public String doadd(HttpServletRequest request, Model model) { + return "/pipeline/pipelineDataAdd"; + } + + @RequestMapping("/save.do") + public String dosave(HttpServletRequest request, Model model, + @ModelAttribute PipelineData pipelineData) { + User cu = (User) request.getSession().getAttribute("cu"); +// pipelineData.setId(CommUtil.getUUID()); + int result = this.pipelineDataService.save(pipelineData); + String resultstr = "{\"res\":\"" + result + "\",\"id\":\"" + pipelineData.getId() + "\"}"; + model.addAttribute("result", resultstr); + return "result"; + } + + @RequestMapping("/delete.do") + public String dodelete(HttpServletRequest request, Model model, + @RequestParam(value = "id") String id) { + int result = this.pipelineDataService.deleteById(id); + model.addAttribute("result", result); + return "result"; + } + + @RequestMapping("/deletes.do") + public String dodeletes(HttpServletRequest request, Model model, + @RequestParam(value = "ids") String ids) { + ids = ids.replace(",", "','"); + int result = this.pipelineDataService.deleteByWhere("where id in ('" + ids + "')"); + model.addAttribute("result", result); + return "result"; + } + + @RequestMapping("/edit.do") + public String doedit(HttpServletRequest request, Model model, + @RequestParam(value = "id") String id) { + PipelineData pipelineData = this.pipelineDataService.selectById(id); + model.addAttribute("pipelineData", pipelineData); + return "/pipeline/pipelineDataEdit"; + } + + @RequestMapping("/update.do") + public String doupdate(HttpServletRequest request, Model model, + @ModelAttribute PipelineData pipelineData) { + User cu = (User) request.getSession().getAttribute("cu"); + int result = this.pipelineDataService.update(pipelineData); + String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + pipelineData.getId() + "\"}"; + model.addAttribute("result", resstr); + return "result"; + } + + @RequestMapping("/view.do") + public String doview(HttpServletRequest request, Model model, + @RequestParam(value = "id") String id) { + PipelineData pipelineData = this.pipelineDataService.selectById(id); + model.addAttribute("pipelineData", pipelineData); + return "/pipeline/pipelineDataView"; + } +} diff --git a/src/main/java/com/sipai/dao/pipeline/PipelineDataDao.java b/src/main/java/com/sipai/dao/pipeline/PipelineDataDao.java new file mode 100644 index 00000000..d88f43f7 --- /dev/null +++ b/src/main/java/com/sipai/dao/pipeline/PipelineDataDao.java @@ -0,0 +1,13 @@ +package com.sipai.dao.pipeline; + +import com.sipai.dao.base.CommDaoImpl; +import com.sipai.entity.pipeline.PipelineData; +import org.springframework.stereotype.Repository; + +@Repository +public class PipelineDataDao extends CommDaoImpl { + public PipelineDataDao() { + super(); + this.setMappernamespace("pipeline.PipelineDataMapper"); + } +} diff --git a/src/main/java/com/sipai/entity/pipeline/PipelineData.java b/src/main/java/com/sipai/entity/pipeline/PipelineData.java new file mode 100644 index 00000000..329cbad4 --- /dev/null +++ b/src/main/java/com/sipai/entity/pipeline/PipelineData.java @@ -0,0 +1,165 @@ +package com.sipai.entity.pipeline; + +import com.sipai.entity.base.SQLAdapter; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 管道数据实体类 + */ +public class PipelineData extends SQLAdapter implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + /** + * 自增主键ID,唯一标识每条记录 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; + + /** + * 管道的名称、编号或位置描述 + */ + @Column(name = "pipeline_name", length = 100) + private String pipelineName; + + /** + * 管道的直径,通常指公称直径或内径,单位:毫米(mm) + */ + @Column(name = "diameter_mm", precision = 10, scale = 5) + private BigDecimal diameterMm; + + /** + * 管道的实际铺设总长度,单位:米(m) + */ + @Column(name = "length_m", precision = 10, scale = 5) + private BigDecimal lengthM; + + /** + * 管道起点处的埋设深度,从地面到管道顶部的垂直距离,单位:米(m) + */ + @Column(name = "start_burial_depth_m", precision = 10, scale = 5) + private BigDecimal startBurialDepthM; + + /** + * 管道终点处的埋设深度,从地面到管道顶部的垂直距离,单位:米(m) + */ + @Column(name = "end_burial_depth_m", precision = 10, scale = 5) + private BigDecimal endBurialDepthM; + + /** + * 管道起点处的地面高程(海拔或相对标高),单位:米(m) + */ + @Column(name = "start_ground_elevation_m", precision = 10, scale = 5) + private BigDecimal startGroundElevationM; + + /** + * 管道终点处的地面高程(海拔或相对标高),单位:米(m) + */ + @Column(name = "end_ground_elevation_m", precision = 10, scale = 5) + private BigDecimal endGroundElevationM; + + /** + * 管道内部底部的标高,常用于水力坡降计算,单位:米(m) + */ + @Column(name = "pipeline_invert_elevation_m", precision = 10, scale = 5) + private BigDecimal pipelineInvertElevationM; + + // 构造方法 + public PipelineData() { + } + + // Getters 和 Setters + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineName() { + return pipelineName; + } + + public void setPipelineName(String pipelineName) { + this.pipelineName = pipelineName; + } + + public BigDecimal getDiameterMm() { + return diameterMm; + } + + public void setDiameterMm(BigDecimal diameterMm) { + this.diameterMm = diameterMm; + } + + public BigDecimal getLengthM() { + return lengthM; + } + + public void setLengthM(BigDecimal lengthM) { + this.lengthM = lengthM; + } + + public BigDecimal getStartBurialDepthM() { + return startBurialDepthM; + } + + public void setStartBurialDepthM(BigDecimal startBurialDepthM) { + this.startBurialDepthM = startBurialDepthM; + } + + public BigDecimal getEndBurialDepthM() { + return endBurialDepthM; + } + + public void setEndBurialDepthM(BigDecimal endBurialDepthM) { + this.endBurialDepthM = endBurialDepthM; + } + + public BigDecimal getStartGroundElevationM() { + return startGroundElevationM; + } + + public void setStartGroundElevationM(BigDecimal startGroundElevationM) { + this.startGroundElevationM = startGroundElevationM; + } + + public BigDecimal getEndGroundElevationM() { + return endGroundElevationM; + } + + public void setEndGroundElevationM(BigDecimal endGroundElevationM) { + this.endGroundElevationM = endGroundElevationM; + } + + public BigDecimal getPipelineInvertElevationM() { + return pipelineInvertElevationM; + } + + public void setPipelineInvertElevationM(BigDecimal pipelineInvertElevationM) { + this.pipelineInvertElevationM = pipelineInvertElevationM; + } + + @Override + public String toString() { + return "PipelineData{" + + "id=" + id + + ", pipelineName='" + pipelineName + '\'' + + ", diameterMm=" + diameterMm + + ", lengthM=" + lengthM + + ", startBurialDepthM=" + startBurialDepthM + + ", endBurialDepthM=" + endBurialDepthM + + ", startGroundElevationM=" + startGroundElevationM + + ", endGroundElevationM=" + endGroundElevationM + + ", pipelineInvertElevationM=" + pipelineInvertElevationM + + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/com/sipai/mapper/pipeline/PipelineDataMapper.xml b/src/main/java/com/sipai/mapper/pipeline/PipelineDataMapper.xml new file mode 100644 index 00000000..ccaf5688 --- /dev/null +++ b/src/main/java/com/sipai/mapper/pipeline/PipelineDataMapper.xml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + id, pipeline_name, diameter_mm, length_m, start_burial_depth_m, end_burial_depth_m, + start_ground_elevation_m, end_ground_elevation_m, pipeline_invert_elevation_m + + + + delete from pipeline_data + where id = #{id,jdbcType=VARCHAR} + + + insert into pipeline_data (id, pipeline_name, diameter_mm, + length_m, start_burial_depth_m, end_burial_depth_m, + start_ground_elevation_m, end_ground_elevation_m, + pipeline_invert_elevation_m) + values (#{id,jdbcType=VARCHAR}, #{pipelineName,jdbcType=VARCHAR}, #{diameterMm,jdbcType=DECIMAL}, + #{lengthM,jdbcType=DECIMAL}, #{startBurialDepthM,jdbcType=DECIMAL}, #{endBurialDepthM,jdbcType=DECIMAL}, + #{startGroundElevationM,jdbcType=DECIMAL}, #{endGroundElevationM,jdbcType=DECIMAL}, + #{pipelineInvertElevationM,jdbcType=DECIMAL}) + + + insert into pipeline_data + + + id, + + + pipeline_name, + + + diameter_mm, + + + length_m, + + + start_burial_depth_m, + + + end_burial_depth_m, + + + start_ground_elevation_m, + + + end_ground_elevation_m, + + + pipeline_invert_elevation_m, + + + + + #{id,jdbcType=VARCHAR}, + + + #{pipelineName,jdbcType=VARCHAR}, + + + #{diameterMm,jdbcType=DECIMAL}, + + + #{lengthM,jdbcType=DECIMAL}, + + + #{startBurialDepthM,jdbcType=DECIMAL}, + + + #{endBurialDepthM,jdbcType=DECIMAL}, + + + #{startGroundElevationM,jdbcType=DECIMAL}, + + + #{endGroundElevationM,jdbcType=DECIMAL}, + + + #{pipelineInvertElevationM,jdbcType=DECIMAL}, + + + + + update pipeline_data + + + pipeline_name = #{pipelineName,jdbcType=VARCHAR}, + + + diameter_mm = #{diameterMm,jdbcType=DECIMAL}, + + + length_m = #{lengthM,jdbcType=DECIMAL}, + + + start_burial_depth_m = #{startBurialDepthM,jdbcType=DECIMAL}, + + + end_burial_depth_m = #{endBurialDepthM,jdbcType=DECIMAL}, + + + start_ground_elevation_m = #{startGroundElevationM,jdbcType=DECIMAL}, + + + end_ground_elevation_m = #{endGroundElevationM,jdbcType=DECIMAL}, + + + pipeline_invert_elevation_m = #{pipelineInvertElevationM,jdbcType=DECIMAL}, + + + where id = #{id,jdbcType=VARCHAR} + + + update pipeline_data + set pipeline_name = #{pipelineName,jdbcType=VARCHAR}, + diameter_mm = #{diameterMm,jdbcType=DECIMAL}, + length_m = #{lengthM,jdbcType=DECIMAL}, + start_burial_depth_m = #{startBurialDepthM,jdbcType=DECIMAL}, + end_burial_depth_m = #{endBurialDepthM,jdbcType=DECIMAL}, + start_ground_elevation_m = #{startGroundElevationM,jdbcType=DECIMAL}, + end_ground_elevation_m = #{endGroundElevationM,jdbcType=DECIMAL}, + pipeline_invert_elevation_m = #{pipelineInvertElevationM,jdbcType=DECIMAL} + where id = #{id,jdbcType=VARCHAR} + + + + delete from + pipeline_data + ${where} + + diff --git a/src/main/java/com/sipai/service/pipeline/PipelineDataService.java b/src/main/java/com/sipai/service/pipeline/PipelineDataService.java new file mode 100644 index 00000000..af267eaf --- /dev/null +++ b/src/main/java/com/sipai/service/pipeline/PipelineDataService.java @@ -0,0 +1,51 @@ +package com.sipai.service.pipeline; + +import com.sipai.dao.pipeline.PipelineDataDao; +import com.sipai.entity.pipeline.PipelineData; +import com.sipai.tools.CommService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class PipelineDataService implements CommService { + @Resource + private PipelineDataDao pipelineDataDao; + + @Override + public PipelineData selectById(String id) { + PipelineData pipelineData = pipelineDataDao.selectByPrimaryKey(id); + return pipelineData; + } + + @Override + public int deleteById(String id) { + return pipelineDataDao.deleteByPrimaryKey(id); + } + + @Override + public int save(PipelineData pipelineData) { + return pipelineDataDao.insert(pipelineData); + } + + @Override + public int update(PipelineData pipelineData) { + return pipelineDataDao.updateByPrimaryKeySelective(pipelineData); + } + + @Override + public List selectListByWhere(String wherestr) { + PipelineData pipelineData = new PipelineData(); + pipelineData.setWhere(wherestr); + List list = pipelineDataDao.selectListByWhere(pipelineData); + return list; + } + + @Override + public int deleteByWhere(String wherestr) { + PipelineData pipelineData = new PipelineData(); + pipelineData.setWhere(wherestr); + return pipelineDataDao.deleteByWhere(pipelineData); + } +} diff --git a/src/main/webapp/IMG/icon_bz.png b/src/main/webapp/IMG/icon_bz.png new file mode 100644 index 00000000..0b70d41d Binary files /dev/null and b/src/main/webapp/IMG/icon_bz.png differ diff --git a/src/main/webapp/IMG/icon_gd.png b/src/main/webapp/IMG/icon_gd.png new file mode 100644 index 00000000..88229e7a Binary files /dev/null and b/src/main/webapp/IMG/icon_gd.png differ diff --git a/src/main/webapp/IMG/icon_gj.png b/src/main/webapp/IMG/icon_gj.png new file mode 100644 index 00000000..87204b71 Binary files /dev/null and b/src/main/webapp/IMG/icon_gj.png differ diff --git a/src/main/webapp/IMG/icon_jh.png b/src/main/webapp/IMG/icon_jh.png new file mode 100644 index 00000000..50bd60e3 Binary files /dev/null and b/src/main/webapp/IMG/icon_jh.png differ diff --git a/src/main/webapp/IMG/icon_jl.png b/src/main/webapp/IMG/icon_jl.png new file mode 100644 index 00000000..4652b585 Binary files /dev/null and b/src/main/webapp/IMG/icon_jl.png differ diff --git a/src/main/webapp/IMG/icon_qy.png b/src/main/webapp/IMG/icon_qy.png new file mode 100644 index 00000000..cd2a2499 Binary files /dev/null and b/src/main/webapp/IMG/icon_qy.png differ diff --git a/src/main/webapp/IMG/icon_wsc.png b/src/main/webapp/IMG/icon_wsc.png new file mode 100644 index 00000000..0b072574 Binary files /dev/null and b/src/main/webapp/IMG/icon_wsc.png differ diff --git a/src/main/webapp/IMG/screen1.png b/src/main/webapp/IMG/screen1.png index ca3c578c..fafd0ac4 100644 Binary files a/src/main/webapp/IMG/screen1.png and b/src/main/webapp/IMG/screen1.png differ diff --git a/src/main/webapp/IMG/wsgj.png b/src/main/webapp/IMG/wsgj.png new file mode 100644 index 00000000..91b4eab8 Binary files /dev/null and b/src/main/webapp/IMG/wsgj.png differ diff --git a/src/main/webapp/JS/comm.js b/src/main/webapp/JS/comm.js index 7129ee17..63447865 100644 --- a/src/main/webapp/JS/comm.js +++ b/src/main/webapp/JS/comm.js @@ -493,8 +493,95 @@ function getMpPic() { function initMenu() { var menu = $('#menu'); + + // 定义一个内部函数来执行DOM操作添加菜单 + var appendS223Menu = function() { + var $menu = $('#menu'); + + // 查找“纳管企业清单”所在的菜单项 + // 情况1: 一级菜单,名称在 span 中 + var $targetSpan = $menu.find("span").filter(function() { + return $(this).text().trim() === '纳管企业清单'; + }); + + var $targetLi = null; + + if ($targetSpan.length > 0) { + $targetLi = $targetSpan.closest('li'); + } else { + // 情况2: 二级菜单,名称直接在 a 标签中(可能是文本节点) + var $targetLink = $menu.find('a').filter(function() { + // 克隆节点,移除子元素(如图标),只获取自身的文本 + return $(this).clone().children().remove().end().text().trim() === '纳管企业清单'; + }); + if ($targetLink.length > 0) { + $targetLi = $targetLink.closest('li'); + } + } + + if ($targetLi && $targetLi.length > 0) { + var $treeviewMenu = $targetLi.find('> .treeview-menu'); + + // 确保 treeview-menu 存在 + if ($treeviewMenu.length === 0) { + $treeviewMenu = $('
    '); + $targetLi.append($treeviewMenu); + } + + // 检查是否已经添加过,防止重复添加 + // 注意:新菜单项可能直接是文本,也可能包含 i 标签 + var exists = false; + $treeviewMenu.find('li').each(function() { + if ($(this).text().indexOf('新源头GIS管理') > -1) { + exists = true; + } + }); + + if (!exists) { + // 根据层级决定样式,通常二级或三级菜单项不需要 span 包裹文字,或者保持一致 + // 这里的样式参考了 menuitems.jsp 中的 Level 3:
  • Name
  • + // 使用 addTab 函数而不是 refreshPage,以支持在 tab 页中打开(如果系统支持)或者在当前 iframe 打开 + // 检查 addTab 是否存在,如果存在则使用它,否则回退到 refreshPage + var newMenuHtml = ''; + if (typeof addTab === 'function') { + // 假设 addTab(id, name, url) + // /jsp/pipeline/pipelineDataList.jsp + // newMenuHtml = '
  • 新源头GIS管理
  • '; + newMenuHtml = '
  • 管道管理
  • '; + } else { + // 如果没有 addTab,尝试使用 iframe 加载或者直接跳转(但在框架内) + // refreshPage 通常是 location.replace,这会刷新整个页面。 + // 如果目标是内嵌,我们应该寻找 iframe 的加载方式。 + // 查看 comm.js 其他部分,发现有 refreshPage(url) 实现为 location.replace(url)。 + // 如果要内嵌,通常是设置某个 iframe 的 src。 + // 假设主内容区域是一个 iframe,或者支持通过 data-url 加载。 + // 暂时使用 refreshPage,但确认它是在当前窗口(iframe)中加载,而不是弹出新窗口。 + // 用户反馈说“不要新开特么弹窗”,可能是指 window.open 或者 target="_blank"。 + // refreshPage 使用 location.replace,是在当前窗口打开。 + // 如果当前窗口是整个 index 页面,那就会刷新整个页面。 + // 如果是 SPA 或者 iframe 架构,我们需要找到正确的方法。 + + // 观察 menuitems.jsp,发现二级菜单使用 addTab('${cumcl2.id}','${cumcl2.name}','${cumcl2.location}') + // 所以我们应该优先使用 addTab。 + // 如果 addTab 未定义(可能在 index.jsp 中定义),我们尝试模拟它。 + // 由于 comm.js 被 index.jsp 引用,addTab 应该可用。 + // newMenuHtml = '
  • 新源头GIS管理
  • '; + newMenuHtml = '
  • 管道管理
  • '; + } + $treeviewMenu.append(newMenuHtml); + + // 确保父菜单是展开状态(可选) + // $targetLi.addClass('active menu-open'); + } + } + }; + if (sessionStorage.menu != undefined) { $('#menu').html(sessionStorage.menu); + + // 即使是缓存加载,也尝试添加新菜单 + appendS223Menu(); + if (sessionStorage.m1 != undefined) { $('#' + sessionStorage.m1).addClass('treeview active menu-open') } @@ -521,8 +608,17 @@ function initMenu() { '' + ''; result = result + bigScreenHtml; + // 替换源头GIS管理页面链接为JSP + result = result.replace('newSourceGISPage.html', 'newSourceGISPage.jsp'); + result = result.replace('newGIS.html', 'newSourceGISPage.jsp'); + $('#menu').html(result); - sessionStorage.setItem("menu", result); + + // 在设置HTML后执行DOM注入 + appendS223Menu(); + + sessionStorage.setItem("menu", $('#menu').html()); // 保存修改后的HTML到sessionStorage + if (sessionStorage.m1 != undefined) { $('#' + sessionStorage.m1).addClass('treeview active menu-open') } diff --git a/src/main/webapp/jsp/bigScreen2.jsp b/src/main/webapp/jsp/bigScreen2.jsp index 0c2986a1..943a1ecc 100644 --- a/src/main/webapp/jsp/bigScreen2.jsp +++ b/src/main/webapp/jsp/bigScreen2.jsp @@ -394,7 +394,7 @@ type: 'bar', barWidth: '40%', itemStyle: { - color: 'rgba(255, 153, 0, 0.3)', + color: '#FF9900', borderColor: '#FF9900', borderWidth: 1 }, diff --git a/src/main/webapp/jsp/login.jsp b/src/main/webapp/jsp/login.jsp index 749c2a27..11c773fc 100644 --- a/src/main/webapp/jsp/login.jsp +++ b/src/main/webapp/jsp/login.jsp @@ -326,7 +326,7 @@