From d6c0b9058d4e2066c4ca66ed955609877f90b727 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Thu, 14 Nov 2024 14:48:40 +0800 Subject: [PATCH 1/8] =?UTF-8?q?feat(=E7=89=B9=E8=89=B2=E4=B8=93=E5=8C=BA?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE):=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 专项项目关联列表公开接口支持通过关联类型查询 Signed-off-by: OTTO <731554297@qq.com> --- .../zone/common/controller/OpenController.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/common/controller/OpenController.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/common/controller/OpenController.java index 7745888f7..b55fc4fe0 100644 --- a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/common/controller/OpenController.java +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/common/controller/OpenController.java @@ -38,11 +38,13 @@ import com.microservices.zone.resource.service.IZoneResourceTypeService; import com.microservices.zone.specialProject.domain.ZoneSpecialProject; import com.microservices.zone.specialProject.domain.ZoneSpecialProjectRelevancy; import com.microservices.zone.specialProject.domain.ZoneSpecialProjectType; +import com.microservices.zone.specialProject.domain.vo.ZoneSpecialProjectRelevancySearchVo; import com.microservices.zone.specialProject.service.IZoneSpecialProjectRelevancyService; import com.microservices.zone.specialProject.service.IZoneSpecialProjectService; import com.microservices.zone.specialProject.service.IZoneSpecialProjectTypeService; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; @@ -364,11 +366,11 @@ public class OpenController extends BaseController { @GetMapping("/specialProject/{specialProjectId}/specialProjectRelevancyList") @ApiOperation("获取特色专区专项项目关联关系列表") public GenericsTableDataInfo selectZoneSpecialProjectRelevancyList( - @ApiParam(name = "specialProjectId", value = "专项项目Id", required = true) @PathVariable("specialProjectId") Long specialProjectId) { - ZoneSpecialProjectRelevancy zoneSpecialProjectRelevancy = new ZoneSpecialProjectRelevancy(); - zoneSpecialProjectRelevancy.setSpecialProjectId(specialProjectId); + @ApiParam(name = "specialProjectId", value = "专项项目Id", required = true) @PathVariable("specialProjectId") Long specialProjectId, + @Validated ZoneSpecialProjectRelevancySearchVo zoneSpecialProjectRelevancySearchVo) { + zoneSpecialProjectRelevancySearchVo.setSpecialProjectId(specialProjectId); startPage(); - List list = zoneSpecialProjectRelevancyService.selectZoneSpecialProjectRelevancyList(zoneSpecialProjectRelevancy); + List list = zoneSpecialProjectRelevancyService.selectZoneSpecialProjectRelevancyList(zoneSpecialProjectRelevancySearchVo.toZoneSpecialProjectRelevancySearchVo()); return getGenericsDataTable(list); } } From 0409bcf90bcf7ae700543e7f5445c6ce6974b339 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Thu, 14 Nov 2024 15:01:18 +0800 Subject: [PATCH 2/8] =?UTF-8?q?feat(=E7=89=B9=E8=89=B2=E4=B8=93=E5=8C=BA?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE):=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增获取专项项目关联类型列表公开接口 Signed-off-by: OTTO <731554297@qq.com> --- .../zone/common/controller/OpenController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/common/controller/OpenController.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/common/controller/OpenController.java index b55fc4fe0..4cf70827f 100644 --- a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/common/controller/OpenController.java +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/common/controller/OpenController.java @@ -38,6 +38,7 @@ import com.microservices.zone.resource.service.IZoneResourceTypeService; import com.microservices.zone.specialProject.domain.ZoneSpecialProject; import com.microservices.zone.specialProject.domain.ZoneSpecialProjectRelevancy; import com.microservices.zone.specialProject.domain.ZoneSpecialProjectType; +import com.microservices.zone.specialProject.domain.vo.CommonTypeVo; import com.microservices.zone.specialProject.domain.vo.ZoneSpecialProjectRelevancySearchVo; import com.microservices.zone.specialProject.service.IZoneSpecialProjectRelevancyService; import com.microservices.zone.specialProject.service.IZoneSpecialProjectService; @@ -373,4 +374,10 @@ public class OpenController extends BaseController { List list = zoneSpecialProjectRelevancyService.selectZoneSpecialProjectRelevancyList(zoneSpecialProjectRelevancySearchVo.toZoneSpecialProjectRelevancySearchVo()); return getGenericsDataTable(list); } + + @GetMapping("/ZoneSpecialProjectRelevancyType/list") + @ApiOperation(value = "获取专项项目关联类型列表") + public List zoneSpecialProjectRelevancyTypeList() { + return zoneSpecialProjectRelevancyService.selectZoneSpecialProjectRelevancyTypeList(); + } } From 1abca3c6ec2a908afa5e4c950c3b84eb23bbac83 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Thu, 14 Nov 2024 17:04:59 +0800 Subject: [PATCH 3/8] =?UTF-8?q?feat(=E7=89=B9=E8=89=B2=E4=B8=93=E5=8C=BA?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE):=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增专项项目会议报告相关代码 Signed-off-by: OTTO <731554297@qq.com> --- .../ZoneSpecialProjectReportController.java | 91 +++++++++ .../domain/ZoneSpecialProjectReport.java | 190 ++++++++++++++++++ .../ZoneSpecialProjectReportMapper.java | 62 ++++++ .../IZoneSpecialProjectReportService.java | 61 ++++++ .../ZoneSpecialProjectReportServiceImpl.java | 90 +++++++++ .../zone/ZoneSpecialProjectReportMapper.xml | 140 +++++++++++++ 6 files changed, 634 insertions(+) create mode 100644 microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectReportController.java create mode 100644 microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java create mode 100644 microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/mapper/ZoneSpecialProjectReportMapper.java create mode 100644 microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/IZoneSpecialProjectReportService.java create mode 100644 microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/impl/ZoneSpecialProjectReportServiceImpl.java create mode 100644 microservices-modules/microservices-modules-zone/src/main/resources/mapper/zone/ZoneSpecialProjectReportMapper.xml diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectReportController.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectReportController.java new file mode 100644 index 000000000..28407f5b6 --- /dev/null +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectReportController.java @@ -0,0 +1,91 @@ +package com.microservices.zone.specialProject.controller; + +import com.microservices.common.core.utils.poi.ExcelUtil; +import com.microservices.common.core.web.controller.BaseController; +import com.microservices.common.core.web.domain.AjaxResult; +import com.microservices.common.core.web.page.TableDataInfo; +import com.microservices.common.log.annotation.Log; +import com.microservices.common.log.enums.BusinessType; +import com.microservices.common.security.annotation.RequiresPermissions; +import com.microservices.zone.specialProject.domain.ZoneSpecialProjectReport; +import com.microservices.zone.specialProject.service.IZoneSpecialProjectReportService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 专项项目会议报告Controller + * + * @author otto + * @date 2024-11-14 + */ +@RestController +@RequestMapping("/zoneSpecialProjectReport") +public class ZoneSpecialProjectReportController extends BaseController { + @Autowired + private IZoneSpecialProjectReportService zoneSpecialProjectReportService; + + /** + * 查询专项项目会议报告列表 + */ + @RequiresPermissions("zone:zoneSpecialProjectReport:list") + @GetMapping("/list") + public TableDataInfo list(ZoneSpecialProjectReport zoneSpecialProjectReport) { + startPage(); + List list = zoneSpecialProjectReportService.selectZoneSpecialProjectReportList(zoneSpecialProjectReport); + return getDataTable(list); + } + + /** + * 导出专项项目会议报告列表 + */ + @RequiresPermissions("zone:zoneSpecialProjectReport:export") + @Log(title = "专项项目会议报告", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ZoneSpecialProjectReport zoneSpecialProjectReport) { + List list = zoneSpecialProjectReportService.selectZoneSpecialProjectReportList(zoneSpecialProjectReport); + ExcelUtil util = new ExcelUtil(ZoneSpecialProjectReport.class); + util.exportExcel(response, list, "专项项目会议报告数据"); + } + + /** + * 获取专项项目会议报告详细信息 + */ + @RequiresPermissions("zone:zoneSpecialProjectReport:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(zoneSpecialProjectReportService.selectZoneSpecialProjectReportById(id)); + } + + /** + * 新增专项项目会议报告 + */ + @RequiresPermissions("zone:zoneSpecialProjectReport:add") + @Log(title = "专项项目会议报告", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ZoneSpecialProjectReport zoneSpecialProjectReport) { + return toAjax(zoneSpecialProjectReportService.insertZoneSpecialProjectReport(zoneSpecialProjectReport)); + } + + /** + * 修改专项项目会议报告 + */ + @RequiresPermissions("zone:zoneSpecialProjectReport:edit") + @Log(title = "专项项目会议报告", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ZoneSpecialProjectReport zoneSpecialProjectReport) { + return toAjax(zoneSpecialProjectReportService.updateZoneSpecialProjectReport(zoneSpecialProjectReport)); + } + + /** + * 删除专项项目会议报告 + */ + @RequiresPermissions("zone:zoneSpecialProjectReport:remove") + @Log(title = "专项项目会议报告", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(zoneSpecialProjectReportService.deleteZoneSpecialProjectReportByIds(ids)); + } +} diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java new file mode 100644 index 000000000..6d8a1015f --- /dev/null +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java @@ -0,0 +1,190 @@ +package com.microservices.zone.specialProject.domain; + +import com.microservices.common.core.annotation.Excel; +import com.microservices.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 专项项目会议报告对象 zone_special_project_report + * + * @author otto + * @date 2024-11-14 + */ +public class ZoneSpecialProjectReport extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + + /** + * 报告名称 + */ + @Excel(name = "报告名称") + private String name; + + /** + * 报告人 + */ + @Excel(name = "报告人") + private String author; + + /** + * 报告链接 + */ + @Excel(name = "报告链接") + private String link; + + /** + * 专项项目id + */ + @Excel(name = "专项项目id") + private Long specialProjectId; + + /** + * 排序 + */ + @Excel(name = "排序") + private Integer sort; + + /** + * 专区id + */ + @Excel(name = "专区id") + private Long zoneId; + + /** + * 所属组织Id + */ + @Excel(name = "所属组织Id") + private Long deptId; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private String delFlag; + + /** + * 预留字段1 + */ + @Excel(name = "预留字段1") + private String reservedField1; + + /** + * 预留字段2 + */ + @Excel(name = "预留字段2") + private String reservedField2; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public Long getSpecialProjectId() { + return specialProjectId; + } + + public void setSpecialProjectId(Long specialProjectId) { + this.specialProjectId = specialProjectId; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Long getZoneId() { + return zoneId; + } + + public void setZoneId(Long zoneId) { + this.zoneId = zoneId; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getReservedField1() { + return reservedField1; + } + + public void setReservedField1(String reservedField1) { + this.reservedField1 = reservedField1; + } + + public String getReservedField2() { + return reservedField2; + } + + public void setReservedField2(String reservedField2) { + this.reservedField2 = reservedField2; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("author", getAuthor()) + .append("remark", getRemark()) + .append("link", getLink()) + .append("specialProjectId", getSpecialProjectId()) + .append("sort", getSort()) + .append("zoneId", getZoneId()) + .append("deptId", getDeptId()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("reservedField1", getReservedField1()) + .append("reservedField2", getReservedField2()) + .toString(); + } +} diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/mapper/ZoneSpecialProjectReportMapper.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/mapper/ZoneSpecialProjectReportMapper.java new file mode 100644 index 000000000..ea12851f5 --- /dev/null +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/mapper/ZoneSpecialProjectReportMapper.java @@ -0,0 +1,62 @@ +package com.microservices.zone.specialProject.mapper; + +import com.microservices.zone.specialProject.domain.ZoneSpecialProjectReport; + +import java.util.List; + +/** + * 专项项目会议报告Mapper接口 + * + * @author otto + * @date 2024-11-14 + */ +@Mapper +public interface ZoneSpecialProjectReportMapper { + /** + * 查询专项项目会议报告 + * + * @param id 专项项目会议报告主键 + * @return 专项项目会议报告 + */ + public ZoneSpecialProjectReport selectZoneSpecialProjectReportById(Long id); + + /** + * 查询专项项目会议报告列表 + * + * @param zoneSpecialProjectReport 专项项目会议报告 + * @return 专项项目会议报告集合 + */ + public List selectZoneSpecialProjectReportList(ZoneSpecialProjectReport zoneSpecialProjectReport); + + /** + * 新增专项项目会议报告 + * + * @param zoneSpecialProjectReport 专项项目会议报告 + * @return 结果 + */ + public int insertZoneSpecialProjectReport(ZoneSpecialProjectReport zoneSpecialProjectReport); + + /** + * 修改专项项目会议报告 + * + * @param zoneSpecialProjectReport 专项项目会议报告 + * @return 结果 + */ + public int updateZoneSpecialProjectReport(ZoneSpecialProjectReport zoneSpecialProjectReport); + + /** + * 删除专项项目会议报告 + * + * @param id 专项项目会议报告主键 + * @return 结果 + */ + public int deleteZoneSpecialProjectReportById(Long id); + + /** + * 批量删除专项项目会议报告 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteZoneSpecialProjectReportByIds(Long[] ids); +} diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/IZoneSpecialProjectReportService.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/IZoneSpecialProjectReportService.java new file mode 100644 index 000000000..2aac6d6dc --- /dev/null +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/IZoneSpecialProjectReportService.java @@ -0,0 +1,61 @@ +package com.microservices.zone.specialProject.service; + +import com.microservices.zone.specialProject.domain.ZoneSpecialProjectReport; + +import java.util.List; + +/** + * 专项项目会议报告Service接口 + * + * @author otto + * @date 2024-11-14 + */ +public interface IZoneSpecialProjectReportService { + /** + * 查询专项项目会议报告 + * + * @param id 专项项目会议报告主键 + * @return 专项项目会议报告 + */ + public ZoneSpecialProjectReport selectZoneSpecialProjectReportById(Long id); + + /** + * 查询专项项目会议报告列表 + * + * @param zoneSpecialProjectReport 专项项目会议报告 + * @return 专项项目会议报告集合 + */ + public List selectZoneSpecialProjectReportList(ZoneSpecialProjectReport zoneSpecialProjectReport); + + /** + * 新增专项项目会议报告 + * + * @param zoneSpecialProjectReport 专项项目会议报告 + * @return 结果 + */ + public int insertZoneSpecialProjectReport(ZoneSpecialProjectReport zoneSpecialProjectReport); + + /** + * 修改专项项目会议报告 + * + * @param zoneSpecialProjectReport 专项项目会议报告 + * @return 结果 + */ + public int updateZoneSpecialProjectReport(ZoneSpecialProjectReport zoneSpecialProjectReport); + + /** + * 批量删除专项项目会议报告 + * + * @param ids 需要删除的专项项目会议报告主键集合 + * @return 结果 + */ + public int deleteZoneSpecialProjectReportByIds(Long[] ids); + + /** + * 删除专项项目会议报告信息 + * + * @param id 专项项目会议报告主键 + * @return 结果 + */ + public int deleteZoneSpecialProjectReportById(Long id); +} diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/impl/ZoneSpecialProjectReportServiceImpl.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/impl/ZoneSpecialProjectReportServiceImpl.java new file mode 100644 index 000000000..5e3042eb6 --- /dev/null +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/impl/ZoneSpecialProjectReportServiceImpl.java @@ -0,0 +1,90 @@ +package com.microservices.zone.specialProject.service.impl; + +import com.microservices.common.core.utils.DateUtils; +import com.microservices.zone.specialProject.domain.ZoneSpecialProjectReport; +import com.microservices.zone.specialProject.mapper.ZoneSpecialProjectReportMapper; +import com.microservices.zone.specialProject.service.IZoneSpecialProjectReportService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 专项项目会议报告Service业务层处理 + * + * @author otto + * @date 2024-11-14 + */ +@Service +public class ZoneSpecialProjectReportServiceImpl implements IZoneSpecialProjectReportService { + @Autowired + private ZoneSpecialProjectReportMapper zoneSpecialProjectReportMapper; + + /** + * 查询专项项目会议报告 + * + * @param id 专项项目会议报告主键 + * @return 专项项目会议报告 + */ + @Override + public ZoneSpecialProjectReport selectZoneSpecialProjectReportById(Long id) { + return zoneSpecialProjectReportMapper.selectZoneSpecialProjectReportById(id); + } + + /** + * 查询专项项目会议报告列表 + * + * @param zoneSpecialProjectReport 专项项目会议报告 + * @return 专项项目会议报告 + */ + @Override + public List selectZoneSpecialProjectReportList(ZoneSpecialProjectReport zoneSpecialProjectReport) { + return zoneSpecialProjectReportMapper.selectZoneSpecialProjectReportList(zoneSpecialProjectReport); + } + + /** + * 新增专项项目会议报告 + * + * @param zoneSpecialProjectReport 专项项目会议报告 + * @return 结果 + */ + @Override + public int insertZoneSpecialProjectReport(ZoneSpecialProjectReport zoneSpecialProjectReport) { + zoneSpecialProjectReport.setCreateTime(DateUtils.getNowDate()); + return zoneSpecialProjectReportMapper.insertZoneSpecialProjectReport(zoneSpecialProjectReport); + } + + /** + * 修改专项项目会议报告 + * + * @param zoneSpecialProjectReport 专项项目会议报告 + * @return 结果 + */ + @Override + public int updateZoneSpecialProjectReport(ZoneSpecialProjectReport zoneSpecialProjectReport) { + zoneSpecialProjectReport.setUpdateTime(DateUtils.getNowDate()); + return zoneSpecialProjectReportMapper.updateZoneSpecialProjectReport(zoneSpecialProjectReport); + } + + /** + * 批量删除专项项目会议报告 + * + * @param ids 需要删除的专项项目会议报告主键 + * @return 结果 + */ + @Override + public int deleteZoneSpecialProjectReportByIds(Long[] ids) { + return zoneSpecialProjectReportMapper.deleteZoneSpecialProjectReportByIds(ids); + } + + /** + * 删除专项项目会议报告信息 + * + * @param id 专项项目会议报告主键 + * @return 结果 + */ + @Override + public int deleteZoneSpecialProjectReportById(Long id) { + return zoneSpecialProjectReportMapper.deleteZoneSpecialProjectReportById(id); + } +} diff --git a/microservices-modules/microservices-modules-zone/src/main/resources/mapper/zone/ZoneSpecialProjectReportMapper.xml b/microservices-modules/microservices-modules-zone/src/main/resources/mapper/zone/ZoneSpecialProjectReportMapper.xml new file mode 100644 index 000000000..6ac9fa6da --- /dev/null +++ b/microservices-modules/microservices-modules-zone/src/main/resources/mapper/zone/ZoneSpecialProjectReportMapper.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, + name, + author, + remark, + link, + special_project_id, + sort, + zone_id, + dept_id, + del_flag, + create_by, + create_time, + update_by, + update_time, + reserved_field_1, + reserved_field_2 + from zone_special_project_report + + + + + + + + insert into zone_special_project_report + + name, + author, + remark, + link, + special_project_id, + sort, + zone_id, + dept_id, + del_flag, + create_by, + create_time, + update_by, + update_time, + reserved_field_1, + reserved_field_2, + + + #{name}, + #{author}, + #{remark}, + #{link}, + #{specialProjectId}, + #{sort}, + #{zoneId}, + #{deptId}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{reservedField1}, + #{reservedField2}, + + + + + update zone_special_project_report + + name = #{name}, + author = #{author}, + remark = #{remark}, + link = #{link}, + special_project_id = #{specialProjectId}, + sort = #{sort}, + zone_id = #{zoneId}, + dept_id = #{deptId}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + reserved_field_1 = #{reservedField1}, + reserved_field_2 = #{reservedField2}, + + where id = #{id} + + + + delete + from zone_special_project_report + where id = #{id} + + + + delete from zone_special_project_report where id in + + #{id} + + + \ No newline at end of file From 9f4a509d4b322b2ef93faa14480339bfa1b423fd Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Thu, 14 Nov 2024 17:07:59 +0800 Subject: [PATCH 4/8] =?UTF-8?q?feat(=E7=89=B9=E8=89=B2=E4=B8=93=E5=8C=BA?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE):=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补充专项项目会议报告对象swagger文档 Signed-off-by: OTTO <731554297@qq.com> --- .../domain/ZoneSpecialProjectReport.java | 149 +++--------------- 1 file changed, 18 insertions(+), 131 deletions(-) diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java index 6d8a1015f..ad3fab7a8 100644 --- a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java @@ -1,9 +1,10 @@ package com.microservices.zone.specialProject.domain; -import com.microservices.common.core.annotation.Excel; -import com.microservices.common.core.web.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.microservices.zone.detail.domain.ZoneSort; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; /** * 专项项目会议报告对象 zone_special_project_report @@ -11,8 +12,10 @@ import org.apache.commons.lang3.builder.ToStringStyle; * @author otto * @date 2024-11-14 */ -public class ZoneSpecialProjectReport extends BaseEntity { - private static final long serialVersionUID = 1L; +@Data +@ApiModel("特色专区专项项目会议报告对象") +public class ZoneSpecialProjectReport extends ZoneSort { + public static final String table_name = "zone_special_project_report"; /** * 主键 @@ -22,43 +25,43 @@ public class ZoneSpecialProjectReport extends BaseEntity { /** * 报告名称 */ - @Excel(name = "报告名称") + @ApiModelProperty(value = "报告名称") private String name; /** * 报告人 */ - @Excel(name = "报告人") + @ApiModelProperty(value = "报告人") private String author; /** * 报告链接 */ - @Excel(name = "报告链接") + @ApiModelProperty(value = "报告链接") private String link; /** * 专项项目id */ - @Excel(name = "专项项目id") + @ApiModelProperty(value = "专项项目id") private Long specialProjectId; /** * 排序 */ - @Excel(name = "排序") + @ApiModelProperty(value = "排序") private Integer sort; /** * 专区id */ - @Excel(name = "专区id") + @ApiModelProperty(value = "专区id") private Long zoneId; /** * 所属组织Id */ - @Excel(name = "所属组织Id") + @ApiModelProperty(value = "所属组织Id") private Long deptId; /** @@ -66,125 +69,9 @@ public class ZoneSpecialProjectReport extends BaseEntity { */ private String delFlag; - /** - * 预留字段1 - */ - @Excel(name = "预留字段1") + @JsonIgnore private String reservedField1; - /** - * 预留字段2 - */ - @Excel(name = "预留字段2") + @JsonIgnore private String reservedField2; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public String getLink() { - return link; - } - - public void setLink(String link) { - this.link = link; - } - - public Long getSpecialProjectId() { - return specialProjectId; - } - - public void setSpecialProjectId(Long specialProjectId) { - this.specialProjectId = specialProjectId; - } - - public Integer getSort() { - return sort; - } - - public void setSort(Integer sort) { - this.sort = sort; - } - - public Long getZoneId() { - return zoneId; - } - - public void setZoneId(Long zoneId) { - this.zoneId = zoneId; - } - - public Long getDeptId() { - return deptId; - } - - public void setDeptId(Long deptId) { - this.deptId = deptId; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getReservedField1() { - return reservedField1; - } - - public void setReservedField1(String reservedField1) { - this.reservedField1 = reservedField1; - } - - public String getReservedField2() { - return reservedField2; - } - - public void setReservedField2(String reservedField2) { - this.reservedField2 = reservedField2; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("author", getAuthor()) - .append("remark", getRemark()) - .append("link", getLink()) - .append("specialProjectId", getSpecialProjectId()) - .append("sort", getSort()) - .append("zoneId", getZoneId()) - .append("deptId", getDeptId()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("reservedField1", getReservedField1()) - .append("reservedField2", getReservedField2()) - .toString(); - } } From f28ae254779e50c767d1c16b78f6d2025a81d83d Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Thu, 14 Nov 2024 17:27:03 +0800 Subject: [PATCH 5/8] =?UTF-8?q?feat(=E7=89=B9=E8=89=B2=E4=B8=93=E5=8C=BA?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE):=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成专项项目会议报告列表查询接口、详情查询接口、新增接口开发 Signed-off-by: OTTO <731554297@qq.com> --- ...ZoneSpecialProjectRelevancyController.java | 5 ++- .../ZoneSpecialProjectReportController.java | 40 ++++++++---------- .../domain/ZoneSpecialProjectReport.java | 6 +++ .../vo/ZoneSpecialProjectReportInputVo.java | 42 +++++++++++++++++++ .../vo/ZoneSpecialProjectReportSearchVo.java | 30 +++++++++++++ .../ZoneSpecialProjectReportMapper.java | 1 + .../IZoneSpecialProjectReportService.java | 5 ++- .../ZoneSpecialProjectReportServiceImpl.java | 29 +++++++++++-- .../zone/ZoneSpecialProjectReportMapper.xml | 1 + 9 files changed, 130 insertions(+), 29 deletions(-) create mode 100644 microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/vo/ZoneSpecialProjectReportInputVo.java create mode 100644 microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/vo/ZoneSpecialProjectReportSearchVo.java diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectRelevancyController.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectRelevancyController.java index 8f74e06cb..2c2fc3e0c 100644 --- a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectRelevancyController.java +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectRelevancyController.java @@ -3,6 +3,7 @@ package com.microservices.zone.specialProject.controller; import com.alibaba.fastjson2.JSONObject; import com.microservices.common.core.web.controller.BaseController; import com.microservices.common.core.web.domain.AjaxResult; +import com.microservices.common.core.web.domain.GenericsAjaxResult; import com.microservices.common.core.web.page.GenericsTableDataInfo; import com.microservices.common.log.annotation.Log; import com.microservices.common.log.enums.BusinessType; @@ -54,8 +55,8 @@ public class ZoneSpecialProjectRelevancyController extends BaseController { @RequiresPermissions("zone:specialProjectRelevancy:query") @GetMapping(value = "/{id}") @ApiOperation("获取特色专区专项项目关联关系详细信息") - public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(zoneSpecialProjectRelevancyService.selectZoneSpecialProjectRelevancyById(id)); + public GenericsAjaxResult getInfo(@PathVariable("id") Long id) { + return genericsSuccess(zoneSpecialProjectRelevancyService.selectZoneSpecialProjectRelevancyById(id)); } /** diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectReportController.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectReportController.java index 28407f5b6..69336c870 100644 --- a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectReportController.java +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/controller/ZoneSpecialProjectReportController.java @@ -1,18 +1,22 @@ package com.microservices.zone.specialProject.controller; -import com.microservices.common.core.utils.poi.ExcelUtil; import com.microservices.common.core.web.controller.BaseController; import com.microservices.common.core.web.domain.AjaxResult; -import com.microservices.common.core.web.page.TableDataInfo; +import com.microservices.common.core.web.domain.GenericsAjaxResult; +import com.microservices.common.core.web.page.GenericsTableDataInfo; import com.microservices.common.log.annotation.Log; import com.microservices.common.log.enums.BusinessType; import com.microservices.common.security.annotation.RequiresPermissions; import com.microservices.zone.specialProject.domain.ZoneSpecialProjectReport; +import com.microservices.zone.specialProject.domain.vo.ZoneSpecialProjectReportInputVo; +import com.microservices.zone.specialProject.domain.vo.ZoneSpecialProjectReportSearchVo; import com.microservices.zone.specialProject.service.IZoneSpecialProjectReportService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -23,6 +27,7 @@ import java.util.List; */ @RestController @RequestMapping("/zoneSpecialProjectReport") +@Api(tags = "特色专区专项项目会议报告接口") public class ZoneSpecialProjectReportController extends BaseController { @Autowired private IZoneSpecialProjectReportService zoneSpecialProjectReportService; @@ -32,22 +37,11 @@ public class ZoneSpecialProjectReportController extends BaseController { */ @RequiresPermissions("zone:zoneSpecialProjectReport:list") @GetMapping("/list") - public TableDataInfo list(ZoneSpecialProjectReport zoneSpecialProjectReport) { + @ApiOperation("查询专项项目会议报告列表") + public GenericsTableDataInfo list(@Validated ZoneSpecialProjectReportSearchVo zoneSpecialProjectReportSearchVo) { startPage(); - List list = zoneSpecialProjectReportService.selectZoneSpecialProjectReportList(zoneSpecialProjectReport); - return getDataTable(list); - } - - /** - * 导出专项项目会议报告列表 - */ - @RequiresPermissions("zone:zoneSpecialProjectReport:export") - @Log(title = "专项项目会议报告", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, ZoneSpecialProjectReport zoneSpecialProjectReport) { - List list = zoneSpecialProjectReportService.selectZoneSpecialProjectReportList(zoneSpecialProjectReport); - ExcelUtil util = new ExcelUtil(ZoneSpecialProjectReport.class); - util.exportExcel(response, list, "专项项目会议报告数据"); + List list = zoneSpecialProjectReportService.selectZoneSpecialProjectReportList(zoneSpecialProjectReportSearchVo.toZoneSpecialProjectReport()); + return getGenericsDataTable(list); } /** @@ -55,8 +49,9 @@ public class ZoneSpecialProjectReportController extends BaseController { */ @RequiresPermissions("zone:zoneSpecialProjectReport:query") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(zoneSpecialProjectReportService.selectZoneSpecialProjectReportById(id)); + @ApiOperation("获取专项项目会议报告详细信息") + public GenericsAjaxResult getInfo(@PathVariable("id") Long id) { + return genericsSuccess(zoneSpecialProjectReportService.selectZoneSpecialProjectReportById(id)); } /** @@ -65,8 +60,9 @@ public class ZoneSpecialProjectReportController extends BaseController { @RequiresPermissions("zone:zoneSpecialProjectReport:add") @Log(title = "专项项目会议报告", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody ZoneSpecialProjectReport zoneSpecialProjectReport) { - return toAjax(zoneSpecialProjectReportService.insertZoneSpecialProjectReport(zoneSpecialProjectReport)); + @ApiOperation("新增专项项目会议报告") + public AjaxResult add(@RequestBody @Validated ZoneSpecialProjectReportInputVo zoneSpecialProjectReportInputVo) { + return toAjax(zoneSpecialProjectReportService.insertZoneSpecialProjectReport(zoneSpecialProjectReportInputVo)); } /** diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java index ad3fab7a8..e25a92cdb 100644 --- a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/ZoneSpecialProjectReport.java @@ -40,6 +40,12 @@ public class ZoneSpecialProjectReport extends ZoneSort { @ApiModelProperty(value = "报告链接") private String link; + /** + * 报告备注 + */ + @ApiModelProperty(value = "报告备注") + private String remark; + /** * 专项项目id */ diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/vo/ZoneSpecialProjectReportInputVo.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/vo/ZoneSpecialProjectReportInputVo.java new file mode 100644 index 000000000..da380d96f --- /dev/null +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/vo/ZoneSpecialProjectReportInputVo.java @@ -0,0 +1,42 @@ +package com.microservices.zone.specialProject.domain.vo; + +import com.microservices.common.core.utils.bean.BeanUtils; +import com.microservices.zone.specialProject.domain.ZoneSpecialProjectReport; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +/** + * @author OTTO + */ +@Data +@ApiModel("专项项目会议报告输入对象") +public class ZoneSpecialProjectReportInputVo { + @ApiModelProperty(value = "专项项目id", required = true) + @NotNull + private Long specialProjectId; + @ApiModelProperty(value = "会议报告名称", required = true) + @NotNull + private String name; + @ApiModelProperty(value = "会议报告报告人", required = true) + @Size(max = 100, message = "会议报告报告人长度不能超过100个字符") + @NotNull + private String author; + @ApiModelProperty(value = "会议报告链接", required = true) + @Size(max = 300, message = "会议报告链接长度不能超过300个字符") + @NotNull + private String link; + @ApiModelProperty(value = "会议报告备注") + @Size(max = 300, message = "会议报告备注长度不能超过300个字符") + private String remark; + + + public ZoneSpecialProjectReport toZoneSpecialProjectReport() { + ZoneSpecialProjectReport target = new ZoneSpecialProjectReport(); + BeanUtils.copyProperties(this, target); + return target; + } +} \ No newline at end of file diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/vo/ZoneSpecialProjectReportSearchVo.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/vo/ZoneSpecialProjectReportSearchVo.java new file mode 100644 index 000000000..bbbeecce2 --- /dev/null +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/domain/vo/ZoneSpecialProjectReportSearchVo.java @@ -0,0 +1,30 @@ +package com.microservices.zone.specialProject.domain.vo; + +import com.microservices.common.core.utils.bean.BeanUtils; +import com.microservices.zone.specialProject.domain.ZoneSpecialProjectReport; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author OTTO + */ +@Data +@ApiModel("专项项目会议报告搜索对象") +public class ZoneSpecialProjectReportSearchVo { + + @ApiModelProperty(value = "专项项目id", required = true) + @NotNull + private Long specialProjectId; + @ApiModelProperty(value = "报告名称") + private String name; + + + public ZoneSpecialProjectReport toZoneSpecialProjectReport() { + ZoneSpecialProjectReport target = new ZoneSpecialProjectReport(); + BeanUtils.copyProperties(this, target); + return target; + } +} \ No newline at end of file diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/mapper/ZoneSpecialProjectReportMapper.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/mapper/ZoneSpecialProjectReportMapper.java index ea12851f5..4741d98d8 100644 --- a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/mapper/ZoneSpecialProjectReportMapper.java +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/mapper/ZoneSpecialProjectReportMapper.java @@ -1,6 +1,7 @@ package com.microservices.zone.specialProject.mapper; import com.microservices.zone.specialProject.domain.ZoneSpecialProjectReport; +import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/IZoneSpecialProjectReportService.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/IZoneSpecialProjectReportService.java index 2aac6d6dc..2c5a25b29 100644 --- a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/IZoneSpecialProjectReportService.java +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/IZoneSpecialProjectReportService.java @@ -1,6 +1,7 @@ package com.microservices.zone.specialProject.service; import com.microservices.zone.specialProject.domain.ZoneSpecialProjectReport; +import com.microservices.zone.specialProject.domain.vo.ZoneSpecialProjectReportInputVo; import java.util.List; @@ -30,10 +31,10 @@ public interface IZoneSpecialProjectReportService { /** * 新增专项项目会议报告 * - * @param zoneSpecialProjectReport 专项项目会议报告 + * @param zoneSpecialProjectReportInputVo 专项项目会议报告 * @return 结果 */ - public int insertZoneSpecialProjectReport(ZoneSpecialProjectReport zoneSpecialProjectReport); + public int insertZoneSpecialProjectReport(ZoneSpecialProjectReportInputVo zoneSpecialProjectReportInputVo); /** * 修改专项项目会议报告 diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/impl/ZoneSpecialProjectReportServiceImpl.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/impl/ZoneSpecialProjectReportServiceImpl.java index 5e3042eb6..730c073a3 100644 --- a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/impl/ZoneSpecialProjectReportServiceImpl.java +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/specialProject/service/impl/ZoneSpecialProjectReportServiceImpl.java @@ -1,10 +1,17 @@ package com.microservices.zone.specialProject.service.impl; +import com.microservices.common.core.exception.ServiceException; import com.microservices.common.core.utils.DateUtils; +import com.microservices.common.security.utils.SecurityUtils; +import com.microservices.zone.common.service.IZoneSortService; +import com.microservices.zone.specialProject.domain.ZoneSpecialProject; import com.microservices.zone.specialProject.domain.ZoneSpecialProjectReport; +import com.microservices.zone.specialProject.domain.vo.ZoneSpecialProjectReportInputVo; import com.microservices.zone.specialProject.mapper.ZoneSpecialProjectReportMapper; import com.microservices.zone.specialProject.service.IZoneSpecialProjectReportService; +import com.microservices.zone.specialProject.service.IZoneSpecialProjectService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import java.util.List; @@ -19,6 +26,11 @@ import java.util.List; public class ZoneSpecialProjectReportServiceImpl implements IZoneSpecialProjectReportService { @Autowired private ZoneSpecialProjectReportMapper zoneSpecialProjectReportMapper; + @Autowired + @Lazy + private IZoneSpecialProjectService zoneSpecialProjectService; + @Autowired + private IZoneSortService zoneSortService; /** * 查询专项项目会议报告 @@ -28,7 +40,11 @@ public class ZoneSpecialProjectReportServiceImpl implements IZoneSpecialProjectR */ @Override public ZoneSpecialProjectReport selectZoneSpecialProjectReportById(Long id) { - return zoneSpecialProjectReportMapper.selectZoneSpecialProjectReportById(id); + ZoneSpecialProjectReport zoneSpecialProjectReport = zoneSpecialProjectReportMapper.selectZoneSpecialProjectReportById(id); + if (zoneSpecialProjectReport == null) { + throw new ServiceException("该专项项目会议报告不存在或无权限访问(专项项目会议报告id[" + id + "])"); + } + return zoneSpecialProjectReport; } /** @@ -45,12 +61,19 @@ public class ZoneSpecialProjectReportServiceImpl implements IZoneSpecialProjectR /** * 新增专项项目会议报告 * - * @param zoneSpecialProjectReport 专项项目会议报告 + * @param zoneSpecialProjectReportInputVo 专项项目会议报告 * @return 结果 */ @Override - public int insertZoneSpecialProjectReport(ZoneSpecialProjectReport zoneSpecialProjectReport) { + public int insertZoneSpecialProjectReport(ZoneSpecialProjectReportInputVo zoneSpecialProjectReportInputVo) { + ZoneSpecialProject zoneSpecialProject = zoneSpecialProjectService.selectZoneSpecialProjectById(zoneSpecialProjectReportInputVo.getSpecialProjectId()); + ZoneSpecialProjectReport zoneSpecialProjectReport = zoneSpecialProjectReportInputVo.toZoneSpecialProjectReport(); zoneSpecialProjectReport.setCreateTime(DateUtils.getNowDate()); + zoneSpecialProjectReport.setCreateBy(SecurityUtils.getUsername()); + zoneSpecialProjectReport.setDeptId(zoneSpecialProject.getDeptId()); + zoneSpecialProjectReport.setZoneId(zoneSpecialProject.getZoneId()); + Integer maxSort = zoneSortService.getMaxSort(zoneSpecialProject.getZoneId(), ZoneSpecialProjectReport.table_name); + zoneSpecialProjectReport.setSort(maxSort); return zoneSpecialProjectReportMapper.insertZoneSpecialProjectReport(zoneSpecialProjectReport); } diff --git a/microservices-modules/microservices-modules-zone/src/main/resources/mapper/zone/ZoneSpecialProjectReportMapper.xml b/microservices-modules/microservices-modules-zone/src/main/resources/mapper/zone/ZoneSpecialProjectReportMapper.xml index 6ac9fa6da..74d2f5716 100644 --- a/microservices-modules/microservices-modules-zone/src/main/resources/mapper/zone/ZoneSpecialProjectReportMapper.xml +++ b/microservices-modules/microservices-modules-zone/src/main/resources/mapper/zone/ZoneSpecialProjectReportMapper.xml @@ -57,6 +57,7 @@ and reserved_field_1 = #{reservedField1} and reserved_field_2 = #{reservedField2} + ORDER BY sort ASC