diff --git a/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/controller/WbProjectController.java b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/controller/WbProjectController.java new file mode 100644 index 0000000..d83790c --- /dev/null +++ b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/controller/WbProjectController.java @@ -0,0 +1,98 @@ +package com.ruoyi.abuwx.controller; + +import com.ruoyi.abuwx.domain.WbProject; +import com.ruoyi.abuwx.service.IWbProjectService; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +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 ruoyi + * @date 2024-04-08 + */ +@RestController +@RequestMapping("/abuwx/project") +public class WbProjectController extends BaseController +{ + @Autowired + private IWbProjectService wbProjectService; + + /** + * 查询项目管理列表 + */ + @PreAuthorize("@ss.hasPermi('abuwx:project:list')") + @GetMapping("/list") + public TableDataInfo list(WbProject wbProject) + { + startPage(); + List list = wbProjectService.selectWbProjectList(wbProject); + return getDataTable(list); + } + + /** + * 导出项目管理列表 + */ + @PreAuthorize("@ss.hasPermi('abuwx:project:export')") + @Log(title = "项目管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WbProject wbProject) + { + List list = wbProjectService.selectWbProjectList(wbProject); + ExcelUtil util = new ExcelUtil(WbProject.class); + util.exportExcel(response, list, "项目管理数据"); + } + + /** + * 获取项目管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('abuwx:project:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(wbProjectService.selectWbProjectById(id)); + } + + /** + * 新增项目管理 + */ + @PreAuthorize("@ss.hasPermi('abuwx:project:add')") + @Log(title = "项目管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WbProject wbProject) + { + return toAjax(wbProjectService.insertWbProject(wbProject)); + } + + /** + * 修改项目管理 + */ + @PreAuthorize("@ss.hasPermi('abuwx:project:edit')") + @Log(title = "项目管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WbProject wbProject) + { + return toAjax(wbProjectService.updateWbProject(wbProject)); + } + + /** + * 删除项目管理 + */ + @PreAuthorize("@ss.hasPermi('abuwx:project:remove')") + @Log(title = "项目管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(wbProjectService.deleteWbProjectByIds(ids)); + } +} diff --git a/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/domain/WbProject.java b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/domain/WbProject.java new file mode 100644 index 0000000..f027cd0 --- /dev/null +++ b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/domain/WbProject.java @@ -0,0 +1,65 @@ +package com.ruoyi.abuwx.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 项目管理对象 wb_project + * + * @author ruoyi + * @date 2024-04-08 + */ +public class WbProject extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键id */ + private Long id; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 项目概况 */ + @Excel(name = "项目概况") + private String projectOverview; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProjectName(String projectName) + { + this.projectName = projectName; + } + + public String getProjectName() + { + return projectName; + } + public void setProjectOverview(String projectOverview) + { + this.projectOverview = projectOverview; + } + + public String getProjectOverview() + { + return projectOverview; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("projectName", getProjectName()) + .append("projectOverview", getProjectOverview()) + .toString(); + } +} diff --git a/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/mapper/WbProjectMapper.java b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/mapper/WbProjectMapper.java new file mode 100644 index 0000000..c285f13 --- /dev/null +++ b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/mapper/WbProjectMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.abuwx.mapper; + +import com.ruoyi.abuwx.domain.WbProject; + +import java.util.List; + +/** + * 项目管理Mapper接口 + * + * @author ruoyi + * @date 2024-04-08 + */ +public interface WbProjectMapper +{ + /** + * 查询项目管理 + * + * @param id 项目管理主键 + * @return 项目管理 + */ + public WbProject selectWbProjectById(Long id); + + /** + * 查询项目管理列表 + * + * @param wbProject 项目管理 + * @return 项目管理集合 + */ + public List selectWbProjectList(WbProject wbProject); + + /** + * 新增项目管理 + * + * @param wbProject 项目管理 + * @return 结果 + */ + public int insertWbProject(WbProject wbProject); + + /** + * 修改项目管理 + * + * @param wbProject 项目管理 + * @return 结果 + */ + public int updateWbProject(WbProject wbProject); + + /** + * 删除项目管理 + * + * @param id 项目管理主键 + * @return 结果 + */ + public int deleteWbProjectById(Long id); + + /** + * 批量删除项目管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWbProjectByIds(Long[] ids); +} diff --git a/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/IWbProjectService.java b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/IWbProjectService.java new file mode 100644 index 0000000..a32098e --- /dev/null +++ b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/IWbProjectService.java @@ -0,0 +1,62 @@ +package com.ruoyi.abuwx.service; + +import com.ruoyi.abuwx.domain.WbProject; + +import java.util.List; + +/** + * 项目管理Service接口 + * + * @author ruoyi + * @date 2024-04-08 + */ +public interface IWbProjectService +{ + /** + * 查询项目管理 + * + * @param id 项目管理主键 + * @return 项目管理 + */ + public WbProject selectWbProjectById(Long id); + + /** + * 查询项目管理列表 + * + * @param wbProject 项目管理 + * @return 项目管理集合 + */ + public List selectWbProjectList(WbProject wbProject); + + /** + * 新增项目管理 + * + * @param wbProject 项目管理 + * @return 结果 + */ + public int insertWbProject(WbProject wbProject); + + /** + * 修改项目管理 + * + * @param wbProject 项目管理 + * @return 结果 + */ + public int updateWbProject(WbProject wbProject); + + /** + * 批量删除项目管理 + * + * @param ids 需要删除的项目管理主键集合 + * @return 结果 + */ + public int deleteWbProjectByIds(Long[] ids); + + /** + * 删除项目管理信息 + * + * @param id 项目管理主键 + * @return 结果 + */ + public int deleteWbProjectById(Long id); +} diff --git a/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/impl/WbProjectServiceImpl.java b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/impl/WbProjectServiceImpl.java new file mode 100644 index 0000000..753125a --- /dev/null +++ b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/impl/WbProjectServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.abuwx.service.impl; + +import com.ruoyi.abuwx.domain.WbProject; +import com.ruoyi.abuwx.mapper.WbProjectMapper; +import com.ruoyi.abuwx.service.IWbProjectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目管理Service业务层处理 + * + * @author ruoyi + * @date 2024-04-08 + */ +@Service +public class WbProjectServiceImpl implements IWbProjectService +{ + @Autowired + private WbProjectMapper wbProjectMapper; + + /** + * 查询项目管理 + * + * @param id 项目管理主键 + * @return 项目管理 + */ + @Override + public WbProject selectWbProjectById(Long id) + { + return wbProjectMapper.selectWbProjectById(id); + } + + /** + * 查询项目管理列表 + * + * @param wbProject 项目管理 + * @return 项目管理 + */ + @Override + public List selectWbProjectList(WbProject wbProject) + { + return wbProjectMapper.selectWbProjectList(wbProject); + } + + /** + * 新增项目管理 + * + * @param wbProject 项目管理 + * @return 结果 + */ + @Override + public int insertWbProject(WbProject wbProject) + { + return wbProjectMapper.insertWbProject(wbProject); + } + + /** + * 修改项目管理 + * + * @param wbProject 项目管理 + * @return 结果 + */ + @Override + public int updateWbProject(WbProject wbProject) + { + return wbProjectMapper.updateWbProject(wbProject); + } + + /** + * 批量删除项目管理 + * + * @param ids 需要删除的项目管理主键 + * @return 结果 + */ + @Override + public int deleteWbProjectByIds(Long[] ids) + { + return wbProjectMapper.deleteWbProjectByIds(ids); + } + + /** + * 删除项目管理信息 + * + * @param id 项目管理主键 + * @return 结果 + */ + @Override + public int deleteWbProjectById(Long id) + { + return wbProjectMapper.deleteWbProjectById(id); + } +} diff --git a/ruoyi-abuwx/src/main/resources/mapper/abuwx/WbProjectMapper.xml b/ruoyi-abuwx/src/main/resources/mapper/abuwx/WbProjectMapper.xml new file mode 100644 index 0000000..758ff76 --- /dev/null +++ b/ruoyi-abuwx/src/main/resources/mapper/abuwx/WbProjectMapper.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + select id, project_name, project_overview from wb_project + + + + + + + + insert into wb_project + + project_name, + project_overview, + + + #{projectName}, + #{projectOverview}, + + + + + update wb_project + + project_name = #{projectName}, + project_overview = #{projectOverview}, + + where id = #{id} + + + + delete from wb_project where id = #{id} + + + + delete from wb_project where id in + + #{id} + + + diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java index d9f2b13..4530480 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -1,11 +1,5 @@ package com.ruoyi.common.utils.file; -import java.io.File; -import java.io.IOException; -import java.nio.file.Paths; -import java.util.Objects; -import org.apache.commons.io.FilenameUtils; -import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException; @@ -14,6 +8,13 @@ import com.ruoyi.common.exception.file.InvalidExtensionException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.uuid.Seq; +import org.apache.commons.io.FilenameUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Paths; +import java.util.Objects; /** * 文件上传工具类