From 0dbdfabe66da78ce60ea04c15ff99a4f22c565c9 Mon Sep 17 00:00:00 2001 From: yinq Date: Tue, 22 Apr 2025 11:13:20 +0800 Subject: [PATCH] =?UTF-8?q?update=20add=E9=99=84=E4=BB=B6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/SysAttachInfoController.java | 98 ++++++ .../tagApi/system/domain/SysAttachInfo.java | 134 ++++++++ .../system/mapper/SysAttachInfoMapper.java | 61 ++++ .../system/service/ISysAttachInfoService.java | 61 ++++ .../impl/SysAttachInfoServiceImpl.java | 96 ++++++ .../mapper/system/SysAttachInfoMapper.xml | 100 ++++++ .../src/views/system/attachInfo/index.vue | 323 ++++++++++++++++++ 7 files changed, 873 insertions(+) create mode 100644 tagApi-admin/src/main/java/hw/tagApi/web/controller/system/SysAttachInfoController.java create mode 100644 tagApi-system/src/main/java/hw/tagApi/system/domain/SysAttachInfo.java create mode 100644 tagApi-system/src/main/java/hw/tagApi/system/mapper/SysAttachInfoMapper.java create mode 100644 tagApi-system/src/main/java/hw/tagApi/system/service/ISysAttachInfoService.java create mode 100644 tagApi-system/src/main/java/hw/tagApi/system/service/impl/SysAttachInfoServiceImpl.java create mode 100644 tagApi-system/src/main/resources/mapper/system/SysAttachInfoMapper.xml create mode 100644 tagApi-ui/src/views/system/attachInfo/index.vue diff --git a/tagApi-admin/src/main/java/hw/tagApi/web/controller/system/SysAttachInfoController.java b/tagApi-admin/src/main/java/hw/tagApi/web/controller/system/SysAttachInfoController.java new file mode 100644 index 0000000..17de0a9 --- /dev/null +++ b/tagApi-admin/src/main/java/hw/tagApi/web/controller/system/SysAttachInfoController.java @@ -0,0 +1,98 @@ +package hw.tagApi.web.controller.system; + +import hw.tagApi.common.annotation.Log; +import hw.tagApi.common.core.controller.BaseController; +import hw.tagApi.common.core.domain.AjaxResult; +import hw.tagApi.common.core.page.TableDataInfo; +import hw.tagApi.common.enums.BusinessType; +import hw.tagApi.common.utils.poi.ExcelUtil; +import hw.tagApi.system.domain.SysAttachInfo; +import hw.tagApi.system.service.ISysAttachInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 附件信息Controller + * + * @author Yinq + * @date 2025-04-22 + */ +@RestController +@RequestMapping("/system/attachInfo") +public class SysAttachInfoController extends BaseController +{ + @Autowired + private ISysAttachInfoService sysAttachInfoService; + + /** + * 查询附件信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:attachInfo:list')") + @GetMapping("/list") + public TableDataInfo list(SysAttachInfo sysAttachInfo) + { + startPage(); + List list = sysAttachInfoService.selectSysAttachInfoList(sysAttachInfo); + return getDataTable(list); + } + + /** + * 导出附件信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:attachInfo:export')") + @Log(title = "附件信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SysAttachInfo sysAttachInfo) + { + List list = sysAttachInfoService.selectSysAttachInfoList(sysAttachInfo); + ExcelUtil util = new ExcelUtil(SysAttachInfo.class); + util.exportExcel(response, list, "附件信息数据"); + } + + /** + * 获取附件信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:attachInfo:query')") + @GetMapping(value = "/{attachId}") + public AjaxResult getInfo(@PathVariable("attachId") Long attachId) + { + return success(sysAttachInfoService.selectSysAttachInfoByAttachId(attachId)); + } + + /** + * 新增附件信息 + */ + @PreAuthorize("@ss.hasPermi('system:attachInfo:add')") + @Log(title = "附件信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysAttachInfo sysAttachInfo) + { + return toAjax(sysAttachInfoService.insertSysAttachInfo(sysAttachInfo)); + } + + /** + * 修改附件信息 + */ + @PreAuthorize("@ss.hasPermi('system:attachInfo:edit')") + @Log(title = "附件信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysAttachInfo sysAttachInfo) + { + return toAjax(sysAttachInfoService.updateSysAttachInfo(sysAttachInfo)); + } + + /** + * 删除附件信息 + */ + @PreAuthorize("@ss.hasPermi('system:attachInfo:remove')") + @Log(title = "附件信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{attachIds}") + public AjaxResult remove(@PathVariable Long[] attachIds) + { + return toAjax(sysAttachInfoService.deleteSysAttachInfoByAttachIds(attachIds)); + } +} diff --git a/tagApi-system/src/main/java/hw/tagApi/system/domain/SysAttachInfo.java b/tagApi-system/src/main/java/hw/tagApi/system/domain/SysAttachInfo.java new file mode 100644 index 0000000..77712a7 --- /dev/null +++ b/tagApi-system/src/main/java/hw/tagApi/system/domain/SysAttachInfo.java @@ -0,0 +1,134 @@ +package hw.tagApi.system.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 hw.tagApi.common.annotation.Excel; +import hw.tagApi.common.core.domain.BaseEntity; + +/** + * 附件信息对象 sys_attach_info + * + * @author Yinq + * @date 2025-04-22 + */ +public class SysAttachInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键标识 */ + private Long attachId; + + /** 附件名称 */ + @Excel(name = "附件名称") + private String attachName; + + /** 附件类别:1-excel */ + @Excel(name = "附件类别:1-excel") + private String attachType; + + /** 附件URL */ + @Excel(name = "附件URL") + private String attachRul; + + /** 附件地址 */ + @Excel(name = "附件地址") + private String attachAddress; + + /** 过期时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "过期时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date expirationTime; + + /** 删除标识(1是 0否) */ + private String delFlag; + + public void setAttachId(Long attachId) + { + this.attachId = attachId; + } + + public Long getAttachId() + { + return attachId; + } + + public void setAttachName(String attachName) + { + this.attachName = attachName; + } + + public String getAttachName() + { + return attachName; + } + + public void setAttachType(String attachType) + { + this.attachType = attachType; + } + + public String getAttachType() + { + return attachType; + } + + public void setAttachRul(String attachRul) + { + this.attachRul = attachRul; + } + + public String getAttachRul() + { + return attachRul; + } + + public void setAttachAddress(String attachAddress) + { + this.attachAddress = attachAddress; + } + + public String getAttachAddress() + { + return attachAddress; + } + + public void setExpirationTime(Date expirationTime) + { + this.expirationTime = expirationTime; + } + + public Date getExpirationTime() + { + return expirationTime; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("attachId", getAttachId()) + .append("attachName", getAttachName()) + .append("attachType", getAttachType()) + .append("attachRul", getAttachRul()) + .append("attachAddress", getAttachAddress()) + .append("expirationTime", getExpirationTime()) + .append("delFlag", getDelFlag()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/tagApi-system/src/main/java/hw/tagApi/system/mapper/SysAttachInfoMapper.java b/tagApi-system/src/main/java/hw/tagApi/system/mapper/SysAttachInfoMapper.java new file mode 100644 index 0000000..2437d40 --- /dev/null +++ b/tagApi-system/src/main/java/hw/tagApi/system/mapper/SysAttachInfoMapper.java @@ -0,0 +1,61 @@ +package hw.tagApi.system.mapper; + +import java.util.List; +import hw.tagApi.system.domain.SysAttachInfo; + +/** + * 附件信息Mapper接口 + * + * @author Yinq + * @date 2025-04-22 + */ +public interface SysAttachInfoMapper +{ + /** + * 查询附件信息 + * + * @param attachId 附件信息主键 + * @return 附件信息 + */ + public SysAttachInfo selectSysAttachInfoByAttachId(Long attachId); + + /** + * 查询附件信息列表 + * + * @param sysAttachInfo 附件信息 + * @return 附件信息集合 + */ + public List selectSysAttachInfoList(SysAttachInfo sysAttachInfo); + + /** + * 新增附件信息 + * + * @param sysAttachInfo 附件信息 + * @return 结果 + */ + public int insertSysAttachInfo(SysAttachInfo sysAttachInfo); + + /** + * 修改附件信息 + * + * @param sysAttachInfo 附件信息 + * @return 结果 + */ + public int updateSysAttachInfo(SysAttachInfo sysAttachInfo); + + /** + * 删除附件信息 + * + * @param attachId 附件信息主键 + * @return 结果 + */ + public int deleteSysAttachInfoByAttachId(Long attachId); + + /** + * 批量删除附件信息 + * + * @param attachIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSysAttachInfoByAttachIds(Long[] attachIds); +} diff --git a/tagApi-system/src/main/java/hw/tagApi/system/service/ISysAttachInfoService.java b/tagApi-system/src/main/java/hw/tagApi/system/service/ISysAttachInfoService.java new file mode 100644 index 0000000..0fb32c9 --- /dev/null +++ b/tagApi-system/src/main/java/hw/tagApi/system/service/ISysAttachInfoService.java @@ -0,0 +1,61 @@ +package hw.tagApi.system.service; + +import java.util.List; +import hw.tagApi.system.domain.SysAttachInfo; + +/** + * 附件信息Service接口 + * + * @author Yinq + * @date 2025-04-22 + */ +public interface ISysAttachInfoService +{ + /** + * 查询附件信息 + * + * @param attachId 附件信息主键 + * @return 附件信息 + */ + public SysAttachInfo selectSysAttachInfoByAttachId(Long attachId); + + /** + * 查询附件信息列表 + * + * @param sysAttachInfo 附件信息 + * @return 附件信息集合 + */ + public List selectSysAttachInfoList(SysAttachInfo sysAttachInfo); + + /** + * 新增附件信息 + * + * @param sysAttachInfo 附件信息 + * @return 结果 + */ + public int insertSysAttachInfo(SysAttachInfo sysAttachInfo); + + /** + * 修改附件信息 + * + * @param sysAttachInfo 附件信息 + * @return 结果 + */ + public int updateSysAttachInfo(SysAttachInfo sysAttachInfo); + + /** + * 批量删除附件信息 + * + * @param attachIds 需要删除的附件信息主键集合 + * @return 结果 + */ + public int deleteSysAttachInfoByAttachIds(Long[] attachIds); + + /** + * 删除附件信息信息 + * + * @param attachId 附件信息主键 + * @return 结果 + */ + public int deleteSysAttachInfoByAttachId(Long attachId); +} diff --git a/tagApi-system/src/main/java/hw/tagApi/system/service/impl/SysAttachInfoServiceImpl.java b/tagApi-system/src/main/java/hw/tagApi/system/service/impl/SysAttachInfoServiceImpl.java new file mode 100644 index 0000000..2ef2d8b --- /dev/null +++ b/tagApi-system/src/main/java/hw/tagApi/system/service/impl/SysAttachInfoServiceImpl.java @@ -0,0 +1,96 @@ +package hw.tagApi.system.service.impl; + +import java.util.List; +import hw.tagApi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import hw.tagApi.system.mapper.SysAttachInfoMapper; +import hw.tagApi.system.domain.SysAttachInfo; +import hw.tagApi.system.service.ISysAttachInfoService; + +/** + * 附件信息Service业务层处理 + * + * @author Yinq + * @date 2025-04-22 + */ +@Service +public class SysAttachInfoServiceImpl implements ISysAttachInfoService +{ + @Autowired + private SysAttachInfoMapper sysAttachInfoMapper; + + /** + * 查询附件信息 + * + * @param attachId 附件信息主键 + * @return 附件信息 + */ + @Override + public SysAttachInfo selectSysAttachInfoByAttachId(Long attachId) + { + return sysAttachInfoMapper.selectSysAttachInfoByAttachId(attachId); + } + + /** + * 查询附件信息列表 + * + * @param sysAttachInfo 附件信息 + * @return 附件信息 + */ + @Override + public List selectSysAttachInfoList(SysAttachInfo sysAttachInfo) + { + return sysAttachInfoMapper.selectSysAttachInfoList(sysAttachInfo); + } + + /** + * 新增附件信息 + * + * @param sysAttachInfo 附件信息 + * @return 结果 + */ + @Override + public int insertSysAttachInfo(SysAttachInfo sysAttachInfo) + { + sysAttachInfo.setCreateTime(DateUtils.getNowDate()); + return sysAttachInfoMapper.insertSysAttachInfo(sysAttachInfo); + } + + /** + * 修改附件信息 + * + * @param sysAttachInfo 附件信息 + * @return 结果 + */ + @Override + public int updateSysAttachInfo(SysAttachInfo sysAttachInfo) + { + sysAttachInfo.setUpdateTime(DateUtils.getNowDate()); + return sysAttachInfoMapper.updateSysAttachInfo(sysAttachInfo); + } + + /** + * 批量删除附件信息 + * + * @param attachIds 需要删除的附件信息主键 + * @return 结果 + */ + @Override + public int deleteSysAttachInfoByAttachIds(Long[] attachIds) + { + return sysAttachInfoMapper.deleteSysAttachInfoByAttachIds(attachIds); + } + + /** + * 删除附件信息信息 + * + * @param attachId 附件信息主键 + * @return 结果 + */ + @Override + public int deleteSysAttachInfoByAttachId(Long attachId) + { + return sysAttachInfoMapper.deleteSysAttachInfoByAttachId(attachId); + } +} diff --git a/tagApi-system/src/main/resources/mapper/system/SysAttachInfoMapper.xml b/tagApi-system/src/main/resources/mapper/system/SysAttachInfoMapper.xml new file mode 100644 index 0000000..05bdd92 --- /dev/null +++ b/tagApi-system/src/main/resources/mapper/system/SysAttachInfoMapper.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + select attach_id, attach_name, attach_type, attach_rul, attach_address, expiration_time, del_flag, remark, create_by, create_time, update_by, update_time from sys_attach_info + + + + + + + + insert into sys_attach_info + + attach_name, + attach_type, + attach_rul, + attach_address, + expiration_time, + del_flag, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{attachName}, + #{attachType}, + #{attachRul}, + #{attachAddress}, + #{expirationTime}, + #{delFlag}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update sys_attach_info + + attach_name = #{attachName}, + attach_type = #{attachType}, + attach_rul = #{attachRul}, + attach_address = #{attachAddress}, + expiration_time = #{expirationTime}, + del_flag = #{delFlag}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where attach_id = #{attachId} + + + + delete from sys_attach_info where attach_id = #{attachId} + + + + delete from sys_attach_info where attach_id in + + #{attachId} + + + \ No newline at end of file diff --git a/tagApi-ui/src/views/system/attachInfo/index.vue b/tagApi-ui/src/views/system/attachInfo/index.vue new file mode 100644 index 0000000..b715a81 --- /dev/null +++ b/tagApi-ui/src/views/system/attachInfo/index.vue @@ -0,0 +1,323 @@ + + +