From ed5cd44dc8a3c84f1e8c4a1eebba456fb5624179 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Mon, 22 Sep 2025 09:50:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(hw-portal):=E4=B8=BAHwWeb1=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E6=B7=BB=E5=8A=A0deviceId=E5=AD=97=E6=AE=B5=E5=8F=8A?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增了deviceId字段,并在HwWeb1相关的controller、service、mapper及XML映射文件中 同步更新,同时添加了获取列表的新接口。此外,调整了部分命名不规范的参数名称,统一为 小驼峰格式以提升代码可读性与一致性。 --- .../portal/controller/HwWebController.java | 10 ++++++++- .../portal/controller/HwWebController1.java | 13 +++++++++-- .../java/com/ruoyi/portal/domain/HwWeb1.java | 10 +++++++++ .../com/ruoyi/portal/mapper/HwWebMapper1.java | 7 +++--- .../ruoyi/portal/service/IHwWebService1.java | 8 +++---- .../service/impl/HwWebServiceImpl1.java | 22 +++++++++---------- .../resources/mapper/portal/HwWebMapper1.xml | 9 +++++++- 7 files changed, 54 insertions(+), 25 deletions(-) diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebController.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebController.java index 764d74d..c242648 100644 --- a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebController.java +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebController.java @@ -3,6 +3,8 @@ package com.ruoyi.portal.controller; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.portal.domain.HwWeb1; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -42,7 +44,7 @@ public class HwWebController extends BaseController @GetMapping("/list") public TableDataInfo list(HwWeb hwWeb) { - startPage(); +// startPage(); List list = hwWebService.selectHwWebList(hwWeb); return getDataTable(list); } @@ -103,4 +105,10 @@ public class HwWebController extends BaseController { return toAjax(hwWebService.deleteHwWebByWebIds(webIds)); } + + @GetMapping("/getHwWebList") + public AjaxResult getHwWebList(HwWeb HwWeb) + { + return success(hwWebService.selectHwWebList(HwWeb)) ; + } } diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebController1.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebController1.java index 621bdcb..621fb15 100644 --- a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebController1.java +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebController1.java @@ -21,9 +21,10 @@ import java.util.List; * @date 2025-08-18 */ @RestController -@RequestMapping("/HwWeb1") +@RequestMapping("/hwWeb1") public class HwWebController1 extends BaseController { + @Autowired private IHwWebService1 hwWebService1; @@ -34,7 +35,7 @@ public class HwWebController1 extends BaseController @GetMapping("/list") public TableDataInfo list(HwWeb1 HwWeb1) { - startPage(); +// startPage(); List list = hwWebService1.selectHwWebList(HwWeb1); return getDataTable(list); } @@ -95,4 +96,12 @@ public class HwWebController1 extends BaseController { return toAjax(hwWebService1.deleteHwWebByWebIds(webIds)); } + + + @GetMapping("/getHwWeb1List") + public AjaxResult getHwWeb1List(HwWeb1 HwWeb1) + { + return success(hwWebService1.selectHwWebList(HwWeb1)) ; + } + } diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/domain/HwWeb1.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/domain/HwWeb1.java index 84f8600..ff6e245 100644 --- a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/domain/HwWeb1.java +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/domain/HwWeb1.java @@ -30,6 +30,7 @@ public class HwWeb1 extends BaseEntity @Excel(name = "页面") private Long webCode; + private Long deviceId; public void setWebId(Long webId) { @@ -68,6 +69,14 @@ public class HwWeb1 extends BaseEntity return webCode; } + public Long getDeviceId() { + return deviceId; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -75,6 +84,7 @@ public class HwWeb1 extends BaseEntity .append("webJson", getWebJson()) .append("webJsonString", getWebJsonString()) .append("webCode", getWebCode()) + .append("deviceId", getDeviceId()) .toString(); } } diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/mapper/HwWebMapper1.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/mapper/HwWebMapper1.java index b38da82..cf48bc9 100644 --- a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/mapper/HwWebMapper1.java +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/mapper/HwWebMapper1.java @@ -1,6 +1,5 @@ package com.ruoyi.portal.mapper; -import com.ruoyi.portal.domain.HwWeb1; import com.ruoyi.portal.domain.HwWeb1; import java.util.List; @@ -27,7 +26,7 @@ public interface HwWebMapper1 * @param HwWeb1 haiwei官网json * @return haiwei官网json集合 */ - public List selectHwWebList(HwWeb1 HwWeb1); + public List selectHwWebList(HwWeb1 hwWeb1); /** * 新增haiwei官网json @@ -35,7 +34,7 @@ public interface HwWebMapper1 * @param HwWeb1 haiwei官网json * @return 结果 */ - public int insertHwWeb(HwWeb1 HwWeb1); + public int insertHwWeb(HwWeb1 hwWeb1); /** * 修改haiwei官网json @@ -43,7 +42,7 @@ public interface HwWebMapper1 * @param HwWeb1 haiwei官网json * @return 结果 */ - public int updateHwWeb(HwWeb1 HwWeb1); + public int updateHwWeb(HwWeb1 hwWeb1); /** * 删除haiwei官网json diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/IHwWebService1.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/IHwWebService1.java index 84602be..076d0ee 100644 --- a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/IHwWebService1.java +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/IHwWebService1.java @@ -1,8 +1,6 @@ package com.ruoyi.portal.service; import com.ruoyi.portal.domain.HwWeb1; -import com.ruoyi.portal.domain.HwWeb1; - import java.util.List; /** @@ -27,7 +25,7 @@ public interface IHwWebService1 * @param HwWeb1 haiwei官网json * @return haiwei官网json集合 */ - public List selectHwWebList(HwWeb1 HwWeb1); + public List selectHwWebList(HwWeb1 hwWeb1); /** * 新增haiwei官网json @@ -35,7 +33,7 @@ public interface IHwWebService1 * @param HwWeb1 haiwei官网json * @return 结果 */ - public int insertHwWeb(HwWeb1 HwWeb1); + public int insertHwWeb(HwWeb1 hwWeb1); /** * 修改haiwei官网json @@ -43,7 +41,7 @@ public interface IHwWebService1 * @param HwWeb1 haiwei官网json * @return 结果 */ - public int updateHwWeb(HwWeb1 HwWeb1); + public int updateHwWeb(HwWeb1 hwWeb1); /** * 批量删除haiwei官网json diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwWebServiceImpl1.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwWebServiceImpl1.java index 95965c4..17e5f37 100644 --- a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwWebServiceImpl1.java +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwWebServiceImpl1.java @@ -1,15 +1,13 @@ package com.ruoyi.portal.service.impl; -import com.ruoyi.portal.domain.HwWeb1; import com.ruoyi.portal.mapper.HwWebMapper1; - import com.ruoyi.portal.service.IHwWebService1; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - import java.util.List; +import com.ruoyi.portal.domain.HwWeb1; +import com.ruoyi.portal.domain.HwWeb; /** * haiwei官网jsonService业务层处理 @@ -43,9 +41,9 @@ public class HwWebServiceImpl1 implements IHwWebService1 * @return haiwei官网json */ @Override - public List selectHwWebList(HwWeb1 HwWeb1) + public List selectHwWebList(HwWeb1 hwWeb1) { - return hwWebMapper1.selectHwWebList(HwWeb1); + return hwWebMapper1.selectHwWebList(hwWeb1); } /** @@ -55,9 +53,9 @@ public class HwWebServiceImpl1 implements IHwWebService1 * @return 结果 */ @Override - public int insertHwWeb(HwWeb1 HwWeb1) + public int insertHwWeb(HwWeb1 hwWeb1) { - return hwWebMapper1.insertHwWeb(HwWeb1); + return hwWebMapper1.insertHwWeb(hwWeb1); } /** @@ -67,15 +65,15 @@ public class HwWebServiceImpl1 implements IHwWebService1 * @return 结果 */ @Override - public int updateHwWeb(HwWeb1 HwWeb1) + public int updateHwWeb(HwWeb1 hwWeb1) { HwWeb1 codeWeb = new HwWeb1(); //编号唯一 - codeWeb.setWebCode(HwWeb1.getWebCode()); + codeWeb.setWebCode(hwWeb1.getWebCode()); if(hwWebMapper1.selectHwWebList(codeWeb).isEmpty()){ - return hwWebMapper1.insertHwWeb(HwWeb1); + return hwWebMapper1.insertHwWeb(hwWeb1); } - return hwWebMapper1.updateHwWeb(HwWeb1); + return hwWebMapper1.updateHwWeb(hwWeb1); } /** diff --git a/ruoyi-modules/hw-portal/src/main/resources/mapper/portal/HwWebMapper1.xml b/ruoyi-modules/hw-portal/src/main/resources/mapper/portal/HwWebMapper1.xml index 28e0c97..b1b907d 100644 --- a/ruoyi-modules/hw-portal/src/main/resources/mapper/portal/HwWebMapper1.xml +++ b/ruoyi-modules/hw-portal/src/main/resources/mapper/portal/HwWebMapper1.xml @@ -9,10 +9,13 @@ + - select web_id, web_json, web_json_string, web_code from hw_web1 + select web_id, web_json, web_json_string, web_code, + device_id + from hw_web1 @@ -36,11 +40,13 @@ web_json, web_json_string, web_code, + device_id, #{webJson}, #{webJsonString}, #{webCode}, + #{deviceId}, @@ -50,6 +56,7 @@ web_json = #{webJson}, web_json_string = #{webJsonString}, web_code = #{webCode}, + device_id = #{deviceId}, where web_code = #{webCode}