From 333fbe21d54e2f882d341996bde25bbf5f334470 Mon Sep 17 00:00:00 2001 From: lc <15038716315@163.com> Date: Tue, 9 Apr 2024 10:51:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E4=BF=9D=E8=AE=B0=E5=BD=95=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WbMaintenanceInformationController.java | 98 +++++++++++++++++++ .../domain/WbMaintenanceInformation.java | 98 +++++++++++++++++++ .../WbMaintenanceInformationMapper.java | 62 ++++++++++++ .../IWbMaintenanceInformationService.java | 62 ++++++++++++ .../WbMaintenanceInformationServiceImpl.java | 97 ++++++++++++++++++ .../abuwx/WbMaintenanceInformationMapper.xml | 91 +++++++++++++++++ 6 files changed, 508 insertions(+) create mode 100644 ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/controller/WbMaintenanceInformationController.java create mode 100644 ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/domain/WbMaintenanceInformation.java create mode 100644 ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/mapper/WbMaintenanceInformationMapper.java create mode 100644 ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/IWbMaintenanceInformationService.java create mode 100644 ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/impl/WbMaintenanceInformationServiceImpl.java create mode 100644 ruoyi-abuwx/src/main/resources/mapper/abuwx/WbMaintenanceInformationMapper.xml diff --git a/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/controller/WbMaintenanceInformationController.java b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/controller/WbMaintenanceInformationController.java new file mode 100644 index 0000000..a97fde8 --- /dev/null +++ b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/controller/WbMaintenanceInformationController.java @@ -0,0 +1,98 @@ +package com.ruoyi.abuwx.controller; + +import com.ruoyi.abuwx.domain.WbMaintenanceInformation; +import com.ruoyi.abuwx.service.IWbMaintenanceInformationService; +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-09 + */ +@RestController +@RequestMapping("/abuwx/information") +public class WbMaintenanceInformationController extends BaseController +{ + @Autowired + private IWbMaintenanceInformationService wbMaintenanceInformationService; + + /** + * 查询维保记录列表 + */ + @PreAuthorize("@ss.hasPermi('abuwx:information:list')") + @GetMapping("/list") + public TableDataInfo list(WbMaintenanceInformation wbMaintenanceInformation) + { + startPage(); + List list = wbMaintenanceInformationService.selectWbMaintenanceInformationList(wbMaintenanceInformation); + return getDataTable(list); + } + + /** + * 导出维保记录列表 + */ + @PreAuthorize("@ss.hasPermi('abuwx:information:export')") + @Log(title = "维保记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WbMaintenanceInformation wbMaintenanceInformation) + { + List list = wbMaintenanceInformationService.selectWbMaintenanceInformationList(wbMaintenanceInformation); + ExcelUtil util = new ExcelUtil(WbMaintenanceInformation.class); + util.exportExcel(response, list, "维保记录数据"); + } + + /** + * 获取维保记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('abuwx:information:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(wbMaintenanceInformationService.selectWbMaintenanceInformationById(id)); + } + + /** + * 新增维保记录 + */ + @PreAuthorize("@ss.hasPermi('abuwx:information:add')") + @Log(title = "维保记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WbMaintenanceInformation wbMaintenanceInformation) + { + return toAjax(wbMaintenanceInformationService.insertWbMaintenanceInformation(wbMaintenanceInformation)); + } + + /** + * 修改维保记录 + */ + @PreAuthorize("@ss.hasPermi('abuwx:information:edit')") + @Log(title = "维保记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WbMaintenanceInformation wbMaintenanceInformation) + { + return toAjax(wbMaintenanceInformationService.updateWbMaintenanceInformation(wbMaintenanceInformation)); + } + + /** + * 删除维保记录 + */ + @PreAuthorize("@ss.hasPermi('abuwx:information:remove')") + @Log(title = "维保记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(wbMaintenanceInformationService.deleteWbMaintenanceInformationByIds(ids)); + } +} diff --git a/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/domain/WbMaintenanceInformation.java b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/domain/WbMaintenanceInformation.java new file mode 100644 index 0000000..bab6dfc --- /dev/null +++ b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/domain/WbMaintenanceInformation.java @@ -0,0 +1,98 @@ +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_maintenance_information + * + * @author ruoyi + * @date 2024-04-09 + */ +public class WbMaintenanceInformation extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键id */ + private Long id; + + /** 项目管理表id */ + @Excel(name = "项目管理表id") + private Long projectId; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 图片 */ + @Excel(name = "图片") + private String imageUrl; + + /** 附件 */ + @Excel(name = "附件") + private String fileUrl; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProjectId(Long projectId) + { + this.projectId = projectId; + } + + public Long getProjectId() + { + return projectId; + } + public void setProjectName(String projectName) + { + this.projectName = projectName; + } + + public String getProjectName() + { + return projectName; + } + public void setImageUrl(String imageUrl) + { + this.imageUrl = imageUrl; + } + + public String getImageUrl() + { + return imageUrl; + } + public void setFileUrl(String fileUrl) + { + this.fileUrl = fileUrl; + } + + public String getFileUrl() + { + return fileUrl; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("projectId", getProjectId()) + .append("projectName", getProjectName()) + .append("imageUrl", getImageUrl()) + .append("fileUrl", getFileUrl()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/mapper/WbMaintenanceInformationMapper.java b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/mapper/WbMaintenanceInformationMapper.java new file mode 100644 index 0000000..3d1d4c1 --- /dev/null +++ b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/mapper/WbMaintenanceInformationMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.abuwx.mapper; + +import com.ruoyi.abuwx.domain.WbMaintenanceInformation; + +import java.util.List; + +/** + * 维保记录Mapper接口 + * + * @author ruoyi + * @date 2024-04-09 + */ +public interface WbMaintenanceInformationMapper +{ + /** + * 查询维保记录 + * + * @param id 维保记录主键 + * @return 维保记录 + */ + public WbMaintenanceInformation selectWbMaintenanceInformationById(Long id); + + /** + * 查询维保记录列表 + * + * @param wbMaintenanceInformation 维保记录 + * @return 维保记录集合 + */ + public List selectWbMaintenanceInformationList(WbMaintenanceInformation wbMaintenanceInformation); + + /** + * 新增维保记录 + * + * @param wbMaintenanceInformation 维保记录 + * @return 结果 + */ + public int insertWbMaintenanceInformation(WbMaintenanceInformation wbMaintenanceInformation); + + /** + * 修改维保记录 + * + * @param wbMaintenanceInformation 维保记录 + * @return 结果 + */ + public int updateWbMaintenanceInformation(WbMaintenanceInformation wbMaintenanceInformation); + + /** + * 删除维保记录 + * + * @param id 维保记录主键 + * @return 结果 + */ + public int deleteWbMaintenanceInformationById(Long id); + + /** + * 批量删除维保记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWbMaintenanceInformationByIds(Long[] ids); +} diff --git a/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/IWbMaintenanceInformationService.java b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/IWbMaintenanceInformationService.java new file mode 100644 index 0000000..ba1b34e --- /dev/null +++ b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/IWbMaintenanceInformationService.java @@ -0,0 +1,62 @@ +package com.ruoyi.abuwx.service; + +import com.ruoyi.abuwx.domain.WbMaintenanceInformation; + +import java.util.List; + +/** + * 维保记录Service接口 + * + * @author ruoyi + * @date 2024-04-09 + */ +public interface IWbMaintenanceInformationService +{ + /** + * 查询维保记录 + * + * @param id 维保记录主键 + * @return 维保记录 + */ + public WbMaintenanceInformation selectWbMaintenanceInformationById(Long id); + + /** + * 查询维保记录列表 + * + * @param wbMaintenanceInformation 维保记录 + * @return 维保记录集合 + */ + public List selectWbMaintenanceInformationList(WbMaintenanceInformation wbMaintenanceInformation); + + /** + * 新增维保记录 + * + * @param wbMaintenanceInformation 维保记录 + * @return 结果 + */ + public int insertWbMaintenanceInformation(WbMaintenanceInformation wbMaintenanceInformation); + + /** + * 修改维保记录 + * + * @param wbMaintenanceInformation 维保记录 + * @return 结果 + */ + public int updateWbMaintenanceInformation(WbMaintenanceInformation wbMaintenanceInformation); + + /** + * 批量删除维保记录 + * + * @param ids 需要删除的维保记录主键集合 + * @return 结果 + */ + public int deleteWbMaintenanceInformationByIds(Long[] ids); + + /** + * 删除维保记录信息 + * + * @param id 维保记录主键 + * @return 结果 + */ + public int deleteWbMaintenanceInformationById(Long id); +} diff --git a/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/impl/WbMaintenanceInformationServiceImpl.java b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/impl/WbMaintenanceInformationServiceImpl.java new file mode 100644 index 0000000..fadebf1 --- /dev/null +++ b/ruoyi-abuwx/src/main/java/com/ruoyi/abuwx/service/impl/WbMaintenanceInformationServiceImpl.java @@ -0,0 +1,97 @@ +package com.ruoyi.abuwx.service.impl; + +import com.ruoyi.abuwx.domain.WbMaintenanceInformation; +import com.ruoyi.abuwx.mapper.WbMaintenanceInformationMapper; +import com.ruoyi.abuwx.service.IWbMaintenanceInformationService; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 维保记录Service业务层处理 + * + * @author ruoyi + * @date 2024-04-09 + */ +@Service +public class WbMaintenanceInformationServiceImpl implements IWbMaintenanceInformationService +{ + @Autowired + private WbMaintenanceInformationMapper wbMaintenanceInformationMapper; + + /** + * 查询维保记录 + * + * @param id 维保记录主键 + * @return 维保记录 + */ + @Override + public WbMaintenanceInformation selectWbMaintenanceInformationById(Long id) + { + return wbMaintenanceInformationMapper.selectWbMaintenanceInformationById(id); + } + + /** + * 查询维保记录列表 + * + * @param wbMaintenanceInformation 维保记录 + * @return 维保记录 + */ + @Override + public List selectWbMaintenanceInformationList(WbMaintenanceInformation wbMaintenanceInformation) + { + return wbMaintenanceInformationMapper.selectWbMaintenanceInformationList(wbMaintenanceInformation); + } + + /** + * 新增维保记录 + * + * @param wbMaintenanceInformation 维保记录 + * @return 结果 + */ + @Override + public int insertWbMaintenanceInformation(WbMaintenanceInformation wbMaintenanceInformation) + { + wbMaintenanceInformation.setCreateTime(DateUtils.getNowDate()); + return wbMaintenanceInformationMapper.insertWbMaintenanceInformation(wbMaintenanceInformation); + } + + /** + * 修改维保记录 + * + * @param wbMaintenanceInformation 维保记录 + * @return 结果 + */ + @Override + public int updateWbMaintenanceInformation(WbMaintenanceInformation wbMaintenanceInformation) + { + wbMaintenanceInformation.setUpdateTime(DateUtils.getNowDate()); + return wbMaintenanceInformationMapper.updateWbMaintenanceInformation(wbMaintenanceInformation); + } + + /** + * 批量删除维保记录 + * + * @param ids 需要删除的维保记录主键 + * @return 结果 + */ + @Override + public int deleteWbMaintenanceInformationByIds(Long[] ids) + { + return wbMaintenanceInformationMapper.deleteWbMaintenanceInformationByIds(ids); + } + + /** + * 删除维保记录信息 + * + * @param id 维保记录主键 + * @return 结果 + */ + @Override + public int deleteWbMaintenanceInformationById(Long id) + { + return wbMaintenanceInformationMapper.deleteWbMaintenanceInformationById(id); + } +} diff --git a/ruoyi-abuwx/src/main/resources/mapper/abuwx/WbMaintenanceInformationMapper.xml b/ruoyi-abuwx/src/main/resources/mapper/abuwx/WbMaintenanceInformationMapper.xml new file mode 100644 index 0000000..3558193 --- /dev/null +++ b/ruoyi-abuwx/src/main/resources/mapper/abuwx/WbMaintenanceInformationMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + select id, project_id, project_name, image_url, file_url, create_by, create_time, update_by, update_time, remark from wb_maintenance_information + + + + + + + + insert into wb_maintenance_information + + project_id, + project_name, + image_url, + file_url, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{projectId}, + #{projectName}, + #{imageUrl}, + #{fileUrl}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update wb_maintenance_information + + project_id = #{projectId}, + project_name = #{projectName}, + image_url = #{imageUrl}, + file_url = #{fileUrl}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from wb_maintenance_information where id = #{id} + + + + delete from wb_maintenance_information where id in + + #{id} + + + \ No newline at end of file