diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/SysPointRouterController.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/SysPointRouterController.java new file mode 100644 index 0000000..86bb305 --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/SysPointRouterController.java @@ -0,0 +1,109 @@ +package com.hw.system.common.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.common.security.annotation.RequiresPermissions; +import com.hw.system.common.domain.SysPointRouter; +import com.hw.system.common.service.ISysPointRouterService; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.page.TableDataInfo; + +/** + * 提示路由信息Controller + * + * @author Yinq + * @date 2024-04-22 + */ +@RestController +@RequestMapping("/pointRouter") +public class SysPointRouterController extends BaseController { + @Autowired + private ISysPointRouterService sysPointRouterService; + + /** + * 查询提示路由信息列表 + */ + @RequiresPermissions("system:pointRouter:list") + @GetMapping("/list") + public TableDataInfo list(SysPointRouter sysPointRouter) { + startPage(); + List list = sysPointRouterService.selectSysPointRouterList(sysPointRouter); + return getDataTable(list); + } + + /** + * 导出提示路由信息列表 + */ + @RequiresPermissions("system:pointRouter:export") + @Log(title = "提示路由信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SysPointRouter sysPointRouter) { + List list = sysPointRouterService.selectSysPointRouterList(sysPointRouter); + ExcelUtil util = new ExcelUtil(SysPointRouter.class); + util.exportExcel(response, list, "提示路由信息数据"); + } + + /** + * 获取提示路由信息详细信息 + */ + @RequiresPermissions("system:pointRouter:query") + @GetMapping(value = "/{pointRouterId}") + public AjaxResult getInfo(@PathVariable("pointRouterId") Long pointRouterId) { + return success(sysPointRouterService.selectSysPointRouterByPointRouterId(pointRouterId)); + } + + /** + * 新增提示路由信息 + */ + @RequiresPermissions("system:pointRouter:add") + @Log(title = "提示路由信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysPointRouter sysPointRouter) { + return toAjax(sysPointRouterService.insertSysPointRouter(sysPointRouter)); + } + + /** + * 修改提示路由信息 + */ + @RequiresPermissions("system:pointRouter:edit") + @Log(title = "提示路由信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysPointRouter sysPointRouter) { + return toAjax(sysPointRouterService.updateSysPointRouter(sysPointRouter)); + } + + /** + * 删除提示路由信息 + */ + @RequiresPermissions("system:pointRouter:remove") + @Log(title = "提示路由信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{pointRouterIds}") + public AjaxResult remove(@PathVariable Long[] pointRouterIds) { + return toAjax(sysPointRouterService.deleteSysPointRouterByPointRouterIds(pointRouterIds)); + } + + /** + * 通用存入提示路由信息 + * @param sysPointRouter + * @return + */ + @PostMapping("/insertPointRouterInfo") + public AjaxResult insertPointRouterInfo(@RequestBody SysPointRouter sysPointRouter) { + return toAjax(sysPointRouterService.insertSysPointRouter(sysPointRouter)); + } +} diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/domain/SysPointRouter.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/domain/SysPointRouter.java new file mode 100644 index 0000000..9be2afc --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/domain/SysPointRouter.java @@ -0,0 +1,133 @@ +package com.hw.system.common.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 提示路由信息对象 sys_point_router + * + * @author Yinq + * @date 2024-04-22 + */ +public class SysPointRouter extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 提示路由ID + */ + private Long pointRouterId; + + /** + * 功能模块 + */ + @Excel(name = "功能模块") + private String moduleCode; + + /** + * 提示类型(1=报警;2=审核) + */ + @Excel(name = "提示类型(1=报警;2=审核)") + private String pointType; + + /** + * 路由地址 + */ + @Excel(name = "路由地址") + private String routerAddress; + + /** + * 路由地址详情 + */ + @Excel(name = "路由地址详情") + private String routerAddressDetail; + + /** + * 跳转标识(0=未跳转;1=已跳转) + */ + @Excel(name = "跳转标识(0=未跳转;1=已跳转)") + private String routerFlag; + + /** 提示信息 */ + @Excel(name = "提示信息") + private String remark; + + @Override + public String getRemark() { + return remark; + } + + @Override + public void setRemark(String remark) { + this.remark = remark; + } + + public void setPointRouterId(Long pointRouterId) { + this.pointRouterId = pointRouterId; + } + + public Long getPointRouterId() { + return pointRouterId; + } + + public void setModuleCode(String moduleCode) { + this.moduleCode = moduleCode; + } + + public String getModuleCode() { + return moduleCode; + } + + public void setPointType(String pointType) { + this.pointType = pointType; + } + + public String getPointType() { + return pointType; + } + + public void setRouterAddress(String routerAddress) { + this.routerAddress = routerAddress; + } + + public String getRouterAddress() { + return routerAddress; + } + + public void setRouterAddressDetail(String routerAddressDetail) { + this.routerAddressDetail = routerAddressDetail; + } + + public String getRouterAddressDetail() { + return routerAddressDetail; + } + + public void setRouterFlag(String routerFlag) { + this.routerFlag = routerFlag; + } + + public String getRouterFlag() { + return routerFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("pointRouterId", getPointRouterId()) + .append("moduleCode", getModuleCode()) + .append("pointType", getPointType()) + .append("routerAddress", getRouterAddress()) + .append("routerAddressDetail", getRouterAddressDetail()) + .append("routerFlag", getRouterFlag()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("updateBy", getUpdateBy()) + .toString(); + } + + +} diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/SysPointRouterMapper.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/SysPointRouterMapper.java new file mode 100644 index 0000000..3fe8f35 --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/SysPointRouterMapper.java @@ -0,0 +1,61 @@ +package com.hw.system.common.mapper; + +import java.util.List; +import com.hw.system.common.domain.SysPointRouter; + +/** + * 提示路由信息Mapper接口 + * + * @author Yinq + * @date 2024-04-22 + */ +public interface SysPointRouterMapper +{ + /** + * 查询提示路由信息 + * + * @param pointRouterId 提示路由信息主键 + * @return 提示路由信息 + */ + public SysPointRouter selectSysPointRouterByPointRouterId(Long pointRouterId); + + /** + * 查询提示路由信息列表 + * + * @param sysPointRouter 提示路由信息 + * @return 提示路由信息集合 + */ + public List selectSysPointRouterList(SysPointRouter sysPointRouter); + + /** + * 新增提示路由信息 + * + * @param sysPointRouter 提示路由信息 + * @return 结果 + */ + public int insertSysPointRouter(SysPointRouter sysPointRouter); + + /** + * 修改提示路由信息 + * + * @param sysPointRouter 提示路由信息 + * @return 结果 + */ + public int updateSysPointRouter(SysPointRouter sysPointRouter); + + /** + * 删除提示路由信息 + * + * @param pointRouterId 提示路由信息主键 + * @return 结果 + */ + public int deleteSysPointRouterByPointRouterId(Long pointRouterId); + + /** + * 批量删除提示路由信息 + * + * @param pointRouterIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds); +} diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/ISysPointRouterService.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/ISysPointRouterService.java new file mode 100644 index 0000000..5e16217 --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/ISysPointRouterService.java @@ -0,0 +1,61 @@ +package com.hw.system.common.service; + +import java.util.List; +import com.hw.system.common.domain.SysPointRouter; + +/** + * 提示路由信息Service接口 + * + * @author Yinq + * @date 2024-04-22 + */ +public interface ISysPointRouterService +{ + /** + * 查询提示路由信息 + * + * @param pointRouterId 提示路由信息主键 + * @return 提示路由信息 + */ + public SysPointRouter selectSysPointRouterByPointRouterId(Long pointRouterId); + + /** + * 查询提示路由信息列表 + * + * @param sysPointRouter 提示路由信息 + * @return 提示路由信息集合 + */ + public List selectSysPointRouterList(SysPointRouter sysPointRouter); + + /** + * 新增提示路由信息 + * + * @param sysPointRouter 提示路由信息 + * @return 结果 + */ + public int insertSysPointRouter(SysPointRouter sysPointRouter); + + /** + * 修改提示路由信息 + * + * @param sysPointRouter 提示路由信息 + * @return 结果 + */ + public int updateSysPointRouter(SysPointRouter sysPointRouter); + + /** + * 批量删除提示路由信息 + * + * @param pointRouterIds 需要删除的提示路由信息主键集合 + * @return 结果 + */ + public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds); + + /** + * 删除提示路由信息信息 + * + * @param pointRouterId 提示路由信息主键 + * @return 结果 + */ + public int deleteSysPointRouterByPointRouterId(Long pointRouterId); +} diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/SysPointRouterServiceImpl.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/SysPointRouterServiceImpl.java new file mode 100644 index 0000000..70e5fed --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/SysPointRouterServiceImpl.java @@ -0,0 +1,95 @@ +package com.hw.system.common.service.impl; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.List; + +import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hw.system.common.mapper.SysPointRouterMapper; +import com.hw.system.common.domain.SysPointRouter; +import com.hw.system.common.service.ISysPointRouterService; + +/** + * 提示路由信息Service业务层处理 + * + * @author Yinq + * @date 2024-04-22 + */ +@Service +public class SysPointRouterServiceImpl implements ISysPointRouterService { + @Autowired + private static SysPointRouterMapper sysPointRouterMapper; + + /** + * 查询提示路由信息 + * + * @param pointRouterId 提示路由信息主键 + * @return 提示路由信息 + */ + @Override + public SysPointRouter selectSysPointRouterByPointRouterId(Long pointRouterId) { + return sysPointRouterMapper.selectSysPointRouterByPointRouterId(pointRouterId); + } + + /** + * 查询提示路由信息列表 + * + * @param sysPointRouter 提示路由信息 + * @return 提示路由信息 + */ + @Override + public List selectSysPointRouterList(SysPointRouter sysPointRouter) { + return sysPointRouterMapper.selectSysPointRouterList(sysPointRouter); + } + + /** + * 新增提示路由信息 + * + * @param sysPointRouter 提示路由信息 + * @return 结果 + */ + @Override + public int insertSysPointRouter(SysPointRouter sysPointRouter) { + sysPointRouter.setCreateBy(SecurityUtils.getUsername()); + sysPointRouter.setCreateTime(DateUtils.getNowDate()); + return sysPointRouterMapper.insertSysPointRouter(sysPointRouter); + } + + /** + * 修改提示路由信息 + * + * @param sysPointRouter 提示路由信息 + * @return 结果 + */ + @Override + public int updateSysPointRouter(SysPointRouter sysPointRouter) { + sysPointRouter.setUpdateBy(SecurityUtils.getUsername()); + sysPointRouter.setUpdateTime(DateUtils.getNowDate()); + return sysPointRouterMapper.updateSysPointRouter(sysPointRouter); + } + + /** + * 批量删除提示路由信息 + * + * @param pointRouterIds 需要删除的提示路由信息主键 + * @return 结果 + */ + @Override + public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds) { + return sysPointRouterMapper.deleteSysPointRouterByPointRouterIds(pointRouterIds); + } + + /** + * 删除提示路由信息信息 + * + * @param pointRouterId 提示路由信息主键 + * @return 结果 + */ + @Override + public int deleteSysPointRouterByPointRouterId(Long pointRouterId) { + return sysPointRouterMapper.deleteSysPointRouterByPointRouterId(pointRouterId); + } +} diff --git a/hw-modules/hw-system/src/main/resources/mapper/system/common/SysPointRouterMapper.xml b/hw-modules/hw-system/src/main/resources/mapper/system/common/SysPointRouterMapper.xml new file mode 100644 index 0000000..6309187 --- /dev/null +++ b/hw-modules/hw-system/src/main/resources/mapper/system/common/SysPointRouterMapper.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + select point_router_id, + module_code, + point_type, + router_address, + router_address_detail, + router_flag, + remark, + create_by, + create_time, + update_by, + update_time + from sys_point_router + + + + + + + + insert into sys_point_router + + module_code, + point_type, + router_address, + router_address_detail, + router_flag, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{moduleCode}, + #{pointType}, + #{routerAddress}, + #{routerAddressDetail}, + #{routerFlag}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update sys_point_router + + module_code = #{moduleCode}, + point_type = #{pointType}, + router_address = #{routerAddress}, + router_address_detail = #{routerAddressDetail}, + router_flag = #{routerFlag}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where point_router_id = #{pointRouterId} + + + + delete + from sys_point_router + where point_router_id = #{pointRouterId} + + + + delete from sys_point_router where point_router_id in + + #{pointRouterId} + + + \ No newline at end of file diff --git a/hw-ui/src/api/system/common/pointRouter.js b/hw-ui/src/api/system/common/pointRouter.js new file mode 100644 index 0000000..d49085f --- /dev/null +++ b/hw-ui/src/api/system/common/pointRouter.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询提示路由信息列表 +export function listPointRouter(query) { + return request({ + url: '/system/pointRouter/list', + method: 'get', + params: query + }) +} + +// 查询提示路由信息详细 +export function getPointRouter(pointRouterId) { + return request({ + url: '/system/pointRouter/' + pointRouterId, + method: 'get' + }) +} + +// 新增提示路由信息 +export function addPointRouter(data) { + return request({ + url: '/system/pointRouter', + method: 'post', + data: data + }) +} + +// 修改提示路由信息 +export function updatePointRouter(data) { + return request({ + url: '/system/pointRouter', + method: 'put', + data: data + }) +} + +// 删除提示路由信息 +export function delPointRouter(pointRouterId) { + return request({ + url: '/system/pointRouter/' + pointRouterId, + method: 'delete' + }) +} diff --git a/hw-ui/src/layout/components/Navbar.vue b/hw-ui/src/layout/components/Navbar.vue index 0ba58ae..6195667 100644 --- a/hw-ui/src/layout/components/Navbar.vue +++ b/hw-ui/src/layout/components/Navbar.vue @@ -9,25 +9,25 @@