diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebDocumentController.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebDocumentController.java new file mode 100644 index 0000000..e7e6f7b --- /dev/null +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/controller/HwWebDocumentController.java @@ -0,0 +1,105 @@ +package com.ruoyi.portal.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.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.portal.domain.HwWebDocument; +import com.ruoyi.portal.service.IHwWebDocumentService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * Hw资料文件Controller + * + * @author zch + * @date 2025-09-22 + */ +@RestController +@RequestMapping("/hwWebDocument") +public class HwWebDocumentController extends BaseController +{ + @Autowired + private IHwWebDocumentService hwWebDocumentService; + + /** + * 查询Hw资料文件列表 + */ + @RequiresPermissions("com.ruoyi.portal:hwWebDocument:list") + @GetMapping("/list") + public TableDataInfo list(HwWebDocument hwWebDocument) + { + startPage(); + List list = hwWebDocumentService.selectHwWebDocumentList(hwWebDocument); + return getDataTable(list); + } + + /** + * 导出Hw资料文件列表 + */ + @RequiresPermissions("com.ruoyi.portal:hwWebDocument:export") + @Log(title = "Hw资料文件", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwWebDocument hwWebDocument) + { + List list = hwWebDocumentService.selectHwWebDocumentList(hwWebDocument); + ExcelUtil util = new ExcelUtil(HwWebDocument.class); + util.exportExcel(response, list, "Hw资料文件数据"); + } + + /** + * 获取Hw资料文件详细信息 + */ + @RequiresPermissions("com.ruoyi.portal:hwWebDocument:query") + @GetMapping(value = "/{documentId}") + public AjaxResult getInfo(@PathVariable("documentId") Long documentId) + { + return success(hwWebDocumentService.selectHwWebDocumentByDocumentId(documentId)); + } + + /** + * 新增Hw资料文件 + */ + @RequiresPermissions("com.ruoyi.portal:hwWebDocument:add") + @Log(title = "Hw资料文件", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwWebDocument hwWebDocument) + { + return toAjax(hwWebDocumentService.insertHwWebDocument(hwWebDocument)); + } + + /** + * 修改Hw资料文件 + */ + @RequiresPermissions("com.ruoyi.portal:hwWebDocument:edit") + @Log(title = "Hw资料文件", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwWebDocument hwWebDocument) + { + return toAjax(hwWebDocumentService.updateHwWebDocument(hwWebDocument)); + } + + /** + * 删除Hw资料文件 + */ + @RequiresPermissions("com.ruoyi.portal:hwWebDocument:remove") + @Log(title = "Hw资料文件", businessType = BusinessType.DELETE) + @DeleteMapping("/{documentIds}") + public AjaxResult remove(@PathVariable Long[] documentIds) + { + return toAjax(hwWebDocumentService.deleteHwWebDocumentByDocumentIds(documentIds)); + } +} diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/domain/HwWebDocument.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/domain/HwWebDocument.java new file mode 100644 index 0000000..10acaef --- /dev/null +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/domain/HwWebDocument.java @@ -0,0 +1,94 @@ +package com.ruoyi.portal.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * Hw资料文件对象 hw_web_document + * + * @author zch + * @date 2025-09-22 + */ +public class HwWebDocument extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long documentId; + + /** 租户id */ + @Excel(name = "租户id") + private Long tenantId; + + /** 文件存储地址 */ + @Excel(name = "文件存储地址") + private String documentAddress; + + /** 页面编码,用来连表查询 */ + @Excel(name = "页面编码,用来连表查询") + private String webCode; + + /** 密钥 */ + @Excel(name = "密钥") + private String secretKey; + + public void setDocumentId(Long documentId) + { + this.documentId = documentId; + } + + public Long getDocumentId() + { + return documentId; + } + public void setTenantId(Long tenantId) + { + this.tenantId = tenantId; + } + + public Long getTenantId() + { + return tenantId; + } + public void setDocumentAddress(String documentAddress) + { + this.documentAddress = documentAddress; + } + + public String getDocumentAddress() + { + return documentAddress; + } + public void setWebCode(String webCode) + { + this.webCode = webCode; + } + + public String getWebCode() + { + return webCode; + } + public void setSecretKey(String secretKey) + { + this.secretKey = secretKey; + } + + public String getSecretKey() + { + return secretKey; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("documentId", getDocumentId()) + .append("tenantId", getTenantId()) + .append("documentAddress", getDocumentAddress()) + .append("createTime", getCreateTime()) + .append("webCode", getWebCode()) + .append("secretKey", getSecretKey()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/mapper/HwWebDocumentMapper.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/mapper/HwWebDocumentMapper.java new file mode 100644 index 0000000..c1ae64d --- /dev/null +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/mapper/HwWebDocumentMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.portal.mapper; + +import java.util.List; +import com.ruoyi.portal.domain.HwWebDocument; + +/** + * Hw资料文件Mapper接口 + * + * @author zch + * @date 2025-09-22 + */ +public interface HwWebDocumentMapper +{ + /** + * 查询Hw资料文件 + * + * @param documentId Hw资料文件主键 + * @return Hw资料文件 + */ + public HwWebDocument selectHwWebDocumentByDocumentId(Long documentId); + + /** + * 查询Hw资料文件列表 + * + * @param hwWebDocument Hw资料文件 + * @return Hw资料文件集合 + */ + public List selectHwWebDocumentList(HwWebDocument hwWebDocument); + + /** + * 新增Hw资料文件 + * + * @param hwWebDocument Hw资料文件 + * @return 结果 + */ + public int insertHwWebDocument(HwWebDocument hwWebDocument); + + /** + * 修改Hw资料文件 + * + * @param hwWebDocument Hw资料文件 + * @return 结果 + */ + public int updateHwWebDocument(HwWebDocument hwWebDocument); + + /** + * 删除Hw资料文件 + * + * @param documentId Hw资料文件主键 + * @return 结果 + */ + public int deleteHwWebDocumentByDocumentId(Long documentId); + + /** + * 批量删除Hw资料文件 + * + * @param documentIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwWebDocumentByDocumentIds(Long[] documentIds); +} diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/IHwWebDocumentService.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/IHwWebDocumentService.java new file mode 100644 index 0000000..86bd2e7 --- /dev/null +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/IHwWebDocumentService.java @@ -0,0 +1,61 @@ +package com.ruoyi.portal.service; + +import java.util.List; +import com.ruoyi.portal.domain.HwWebDocument; + +/** + * Hw资料文件Service接口 + * + * @author zch + * @date 2025-09-22 + */ +public interface IHwWebDocumentService +{ + /** + * 查询Hw资料文件 + * + * @param documentId Hw资料文件主键 + * @return Hw资料文件 + */ + public HwWebDocument selectHwWebDocumentByDocumentId(Long documentId); + + /** + * 查询Hw资料文件列表 + * + * @param hwWebDocument Hw资料文件 + * @return Hw资料文件集合 + */ + public List selectHwWebDocumentList(HwWebDocument hwWebDocument); + + /** + * 新增Hw资料文件 + * + * @param hwWebDocument Hw资料文件 + * @return 结果 + */ + public int insertHwWebDocument(HwWebDocument hwWebDocument); + + /** + * 修改Hw资料文件 + * + * @param hwWebDocument Hw资料文件 + * @return 结果 + */ + public int updateHwWebDocument(HwWebDocument hwWebDocument); + + /** + * 批量删除Hw资料文件 + * + * @param documentIds 需要删除的Hw资料文件主键集合 + * @return 结果 + */ + public int deleteHwWebDocumentByDocumentIds(Long[] documentIds); + + /** + * 删除Hw资料文件信息 + * + * @param documentId Hw资料文件主键 + * @return 结果 + */ + public int deleteHwWebDocumentByDocumentId(Long documentId); +} diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwWebDocumentServiceImpl.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwWebDocumentServiceImpl.java new file mode 100644 index 0000000..f75ff0e --- /dev/null +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwWebDocumentServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.portal.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.portal.mapper.HwWebDocumentMapper; +import com.ruoyi.portal.domain.HwWebDocument; +import com.ruoyi.portal.service.IHwWebDocumentService; + +/** + * Hw资料文件Service业务层处理 + * + * @author zch + * @date 2025-09-22 + */ +@Service +public class HwWebDocumentServiceImpl implements IHwWebDocumentService +{ + @Autowired + private HwWebDocumentMapper hwWebDocumentMapper; + + /** + * 查询Hw资料文件 + * + * @param documentId Hw资料文件主键 + * @return Hw资料文件 + */ + @Override + public HwWebDocument selectHwWebDocumentByDocumentId(Long documentId) + { + return hwWebDocumentMapper.selectHwWebDocumentByDocumentId(documentId); + } + + /** + * 查询Hw资料文件列表 + * + * @param hwWebDocument Hw资料文件 + * @return Hw资料文件 + */ + @Override + public List selectHwWebDocumentList(HwWebDocument hwWebDocument) + { + return hwWebDocumentMapper.selectHwWebDocumentList(hwWebDocument); + } + + /** + * 新增Hw资料文件 + * + * @param hwWebDocument Hw资料文件 + * @return 结果 + */ + @Override + public int insertHwWebDocument(HwWebDocument hwWebDocument) + { + hwWebDocument.setCreateTime(DateUtils.getNowDate()); + return hwWebDocumentMapper.insertHwWebDocument(hwWebDocument); + } + + /** + * 修改Hw资料文件 + * + * @param hwWebDocument Hw资料文件 + * @return 结果 + */ + @Override + public int updateHwWebDocument(HwWebDocument hwWebDocument) + { + return hwWebDocumentMapper.updateHwWebDocument(hwWebDocument); + } + + /** + * 批量删除Hw资料文件 + * + * @param documentIds 需要删除的Hw资料文件主键 + * @return 结果 + */ + @Override + public int deleteHwWebDocumentByDocumentIds(Long[] documentIds) + { + return hwWebDocumentMapper.deleteHwWebDocumentByDocumentIds(documentIds); + } + + /** + * 删除Hw资料文件信息 + * + * @param documentId Hw资料文件主键 + * @return 结果 + */ + @Override + public int deleteHwWebDocumentByDocumentId(Long documentId) + { + return hwWebDocumentMapper.deleteHwWebDocumentByDocumentId(documentId); + } +} diff --git a/ruoyi-modules/hw-portal/src/main/resources/mapper/com.ruoyi.portal/HwWebDocumentMapper.xml b/ruoyi-modules/hw-portal/src/main/resources/mapper/com.ruoyi.portal/HwWebDocumentMapper.xml new file mode 100644 index 0000000..d7a104f --- /dev/null +++ b/ruoyi-modules/hw-portal/src/main/resources/mapper/com.ruoyi.portal/HwWebDocumentMapper.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + select document_id, tenant_id, document_address, create_time, web_code, secretKey from hw_web_document + + + + + + + + insert into hw_web_document + + tenant_id, + document_address, + create_time, + web_code, + secretKey, + + + #{tenantId}, + #{documentAddress}, + #{createTime}, + #{webCode}, + #{secretKey}, + + + + + update hw_web_document + + tenant_id = #{tenantId}, + document_address = #{documentAddress}, + create_time = #{createTime}, + web_code = #{webCode}, + secretKey = #{secretKey}, + + where document_id = #{documentId} + + + + delete from hw_web_document where document_id = #{documentId} + + + + delete from hw_web_document where document_id in + + #{documentId} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/portal/hwWebDocument.js b/ruoyi-ui/src/api/portal/hwWebDocument.js new file mode 100644 index 0000000..b86e648 --- /dev/null +++ b/ruoyi-ui/src/api/portal/hwWebDocument.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询Hw资料文件列表 +export function listHwWebDocument(query) { + return request({ + url: '/com.ruoyi.portal/hwWebDocument/list', + method: 'get', + params: query + }) +} + +// 查询Hw资料文件详细 +export function getHwWebDocument(documentId) { + return request({ + url: '/com.ruoyi.portal/hwWebDocument/' + documentId, + method: 'get' + }) +} + +// 新增Hw资料文件 +export function addHwWebDocument(data) { + return request({ + url: '/com.ruoyi.portal/hwWebDocument', + method: 'post', + data: data + }) +} + +// 修改Hw资料文件 +export function updateHwWebDocument(data) { + return request({ + url: '/com.ruoyi.portal/hwWebDocument', + method: 'put', + data: data + }) +} + +// 删除Hw资料文件 +export function delHwWebDocument(documentId) { + return request({ + url: '/com.ruoyi.portal/hwWebDocument/' + documentId, + method: 'delete' + }) +}