feat(oa): 新增设计项目汇报功能
- 添加汇报详情和汇报概述的接口和服务实现 - 创建相关的实体类、BO、VO和Mapper - 实现汇报列表查询、详情查询、新增、修改和删除功能 - 优化汇报列表展示,加入最近更新时间字段
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
package com.gear.oa.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.annotation.RepeatSubmit;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.oa.domain.bo.OaReportDetailBo;
|
||||
import com.gear.oa.domain.vo.OaReportDetailVo;
|
||||
import com.gear.oa.service.IOaReportDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/reportDetail")
|
||||
public class OaReportDetailController extends BaseController {
|
||||
|
||||
private final IOaReportDetailService iOaReportDetailService;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<OaReportDetailVo> list(OaReportDetailBo bo, PageQuery pageQuery) {
|
||||
return iOaReportDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设计项目汇报详情列表
|
||||
*/
|
||||
@Log(title = "设计项目汇报详情", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(OaReportDetailBo bo, HttpServletResponse response) {
|
||||
List<OaReportDetailVo> list = iOaReportDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "设计项目汇报详情", OaReportDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设计项目汇报详情详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<OaReportDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iOaReportDetailService.queryById(id));
|
||||
}
|
||||
/**
|
||||
* 获取设计项目汇报详情详细信息
|
||||
*
|
||||
* @param projectId 主键
|
||||
*/
|
||||
@GetMapping("/project/{projectId}")
|
||||
public R<List<OaReportDetailVo>> listReportDetailByProjectId(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(iOaReportDetailService.queryByProjectId(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报详情
|
||||
*/
|
||||
@Log(title = "设计项目汇报详情", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody OaReportDetailBo bo) {
|
||||
return toAjax(iOaReportDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报详情
|
||||
*/
|
||||
@Log(title = "设计项目汇报详情", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OaReportDetailBo bo) {
|
||||
return toAjax(iOaReportDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设计项目汇报详情
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iOaReportDetailService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.gear.oa.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.annotation.RepeatSubmit;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.oa.domain.bo.OaReportSummaryBo;
|
||||
import com.gear.oa.domain.vo.OaReportSummaryVo;
|
||||
import com.gear.oa.service.IOaReportSummaryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/reportSummary")
|
||||
public class OaReportSummaryController extends BaseController {
|
||||
|
||||
private final IOaReportSummaryService iOaReportSummaryService;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<OaReportSummaryVo> list(OaReportSummaryBo bo, PageQuery pageQuery) {
|
||||
return iOaReportSummaryService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设计项目汇报概述列表
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(OaReportSummaryBo bo, HttpServletResponse response) {
|
||||
List<OaReportSummaryVo> list = iOaReportSummaryService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "设计项目汇报概述", OaReportSummaryVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设计项目汇报概述详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<OaReportSummaryVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iOaReportSummaryService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报概述
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody OaReportSummaryBo bo) {
|
||||
return toAjax(iOaReportSummaryService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报概述
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OaReportSummaryBo bo) {
|
||||
return toAjax(iOaReportSummaryService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设计项目汇报概述
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iOaReportSummaryService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
62
gear-oa/src/main/java/com/gear/oa/domain/OaReportDetail.java
Normal file
62
gear-oa/src/main/java/com/gear/oa/domain/OaReportDetail.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package com.gear.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情对象 oa_report_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_report_detail")
|
||||
public class OaReportDetail extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "detail_id")
|
||||
private Long detailId;
|
||||
/**
|
||||
* 关联汇报概述ID(oa_report_summary.id)
|
||||
*/
|
||||
private Long summaryId;
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
private String deviceCode;
|
||||
/**
|
||||
* 设备类别
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 设备生产说明
|
||||
*/
|
||||
private String deviceDescription;
|
||||
/**
|
||||
* 汇报详情内容(含文字、图像说明等)
|
||||
*/
|
||||
private String reportDetail;
|
||||
/**
|
||||
* 关联图像 OSS ID 列表(逗号分隔)
|
||||
*/
|
||||
private String ossIds;
|
||||
/**
|
||||
* 删除标志(0 正常,1 删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.gear.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述对象 oa_report_summary
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_report_summary")
|
||||
public class OaReportSummary extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "summary_id")
|
||||
private Long summaryId;
|
||||
/**
|
||||
* 汇报标题
|
||||
*/
|
||||
private String reportTitle;
|
||||
/**
|
||||
* 汇报日期
|
||||
*/
|
||||
private Date reportDate;
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
private String reporter;
|
||||
/**
|
||||
* 删除标志(0 正常,1 删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private Long type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.gear.oa.domain.bo;
|
||||
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情业务对象 oa_report_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class OaReportDetailBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 关联汇报概述ID(oa_report_summary.id)
|
||||
*/
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 设备类别
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 设备生产说明
|
||||
*/
|
||||
private String deviceDescription;
|
||||
|
||||
/**
|
||||
* 汇报详情内容(含文字、图像说明等)
|
||||
*/
|
||||
private String reportDetail;
|
||||
|
||||
/**
|
||||
* 关联图像 OSS ID 列表(逗号分隔)
|
||||
*/
|
||||
private String ossIds;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.gear.oa.domain.bo;
|
||||
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述业务对象 oa_report_summary
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class OaReportSummaryBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 汇报标题
|
||||
*/
|
||||
@NotBlank(message = "汇报标题不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String reportTitle;
|
||||
|
||||
/**
|
||||
* 汇报日期
|
||||
*/
|
||||
@NotNull(message = "汇报日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date reportDate;
|
||||
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
@NotBlank(message = "汇报人不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String reporter;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
private Long type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.gear.oa.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.gear.common.annotation.ExcelDictFormat;
|
||||
import com.gear.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情视图对象 oa_report_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OaReportDetailVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 关联汇报概述ID(oa_report_summary.id)
|
||||
*/
|
||||
@ExcelProperty(value = "关联汇报概述ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "o=a_report_summary.id")
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
@ExcelProperty(value = "设备唯一编号")
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 设备类别
|
||||
*/
|
||||
@ExcelProperty(value = "设备类别")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 设备生产说明
|
||||
*/
|
||||
@ExcelProperty(value = "设备生产说明")
|
||||
private String deviceDescription;
|
||||
|
||||
/**
|
||||
* 汇报详情内容(含文字、图像说明等)
|
||||
*/
|
||||
@ExcelProperty(value = "汇报详情内容", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "含=文字、图像说明等")
|
||||
private String reportDetail;
|
||||
|
||||
/**
|
||||
* 关联图像 OSS ID 列表(逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "关联图像 OSS ID 列表", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "逗=号分隔")
|
||||
private String ossIds;
|
||||
|
||||
/**
|
||||
* 关联图像 OSS URL 列表
|
||||
*/
|
||||
@ExcelProperty(value = "关联图像 OSS URL 列表", converter = ExcelDictConvert.class)
|
||||
private String images;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.gear.oa.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述视图对象 oa_report_summary
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OaReportSummaryVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 汇报标题
|
||||
*/
|
||||
@ExcelProperty(value = "汇报标题")
|
||||
private String reportTitle;
|
||||
|
||||
/**
|
||||
* 汇报日期
|
||||
*/
|
||||
@ExcelProperty(value = "汇报日期")
|
||||
private Date reportDate;
|
||||
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
@ExcelProperty(value = "汇报人")
|
||||
private String reporter;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
private Long type;
|
||||
|
||||
@ExcelProperty(value = "最近更新时间")
|
||||
private Date lastUpdateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.gear.oa.mapper;
|
||||
|
||||
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||
import com.gear.oa.domain.OaReportDetail;
|
||||
import com.gear.oa.domain.vo.OaReportDetailVo;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface OaReportDetailMapper extends BaseMapperPlus<OaReportDetailMapper, OaReportDetail, OaReportDetailVo> {
|
||||
@Select("SELECT url FROM sys_oss WHERE oss_id = #{ossId}")
|
||||
String selectImageUrlByOssId(String ossId);
|
||||
|
||||
|
||||
OaReportDetailVo selectVoByIdPlus(Long id);
|
||||
|
||||
List<OaReportDetailVo> queryByProjectId(Long projectId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.gear.oa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||
import com.gear.oa.domain.OaReportSummary;
|
||||
import com.gear.oa.domain.bo.OaReportSummaryBo;
|
||||
import com.gear.oa.domain.vo.OaReportSummaryVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述Mapper接口
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface OaReportSummaryMapper extends BaseMapperPlus<OaReportSummaryMapper, OaReportSummary, OaReportSummaryVo> {
|
||||
Page<OaReportSummaryVo> selectVoPageWithProject(@Param("page") Page<?> page,
|
||||
@Param("bo") OaReportSummaryBo bo);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.gear.oa.service;
|
||||
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.oa.domain.bo.OaReportDetailBo;
|
||||
import com.gear.oa.domain.vo.OaReportDetailVo;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface IOaReportDetailService {
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情
|
||||
*/
|
||||
OaReportDetailVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
TableDataInfo<OaReportDetailVo> queryPageList(OaReportDetailBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
List<OaReportDetailVo> queryList(OaReportDetailBo bo);
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报详情
|
||||
*/
|
||||
Boolean insertByBo(OaReportDetailBo bo);
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报详情
|
||||
*/
|
||||
Boolean updateByBo(OaReportDetailBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设计项目汇报详情信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 根据项目查询细节
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
List<OaReportDetailVo> queryByProjectId(@NotNull(message = "主键不能为空") Long projectId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.gear.oa.service;
|
||||
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.oa.domain.bo.OaReportSummaryBo;
|
||||
import com.gear.oa.domain.vo.OaReportSummaryVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述Service接口
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface IOaReportSummaryService {
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述
|
||||
*/
|
||||
OaReportSummaryVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
TableDataInfo<OaReportSummaryVo> queryPageList(OaReportSummaryBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
List<OaReportSummaryVo> queryList(OaReportSummaryBo bo);
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报概述
|
||||
*/
|
||||
Boolean insertByBo(OaReportSummaryBo bo);
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报概述
|
||||
*/
|
||||
Boolean updateByBo(OaReportSummaryBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设计项目汇报概述信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.gear.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.oa.domain.OaReportDetail;
|
||||
import com.gear.oa.domain.bo.OaReportDetailBo;
|
||||
import com.gear.oa.domain.vo.OaReportDetailVo;
|
||||
import com.gear.oa.mapper.OaReportDetailMapper;
|
||||
import com.gear.oa.service.IOaReportDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaReportDetailServiceImpl implements IOaReportDetailService {
|
||||
|
||||
private final OaReportDetailMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public OaReportDetailVo queryById(Long id){
|
||||
|
||||
return baseMapper.selectVoByIdPlus(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaReportDetailVo> queryPageList(OaReportDetailBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaReportDetail> lqw = buildQueryWrapper(bo);
|
||||
Page<OaReportDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
|
||||
for(OaReportDetailVo item : result.getRecords()) {
|
||||
String ossIds = item.getOssIds();
|
||||
// 分离拿出ossIds
|
||||
String[] ossIdArray = new String[0];
|
||||
if (StringUtils.isNotBlank(ossIds)) {
|
||||
ossIdArray = ossIds.split(",");
|
||||
}
|
||||
// 准备images数组
|
||||
List<String> images = new ArrayList<>();
|
||||
// 遍历ossIdArray,添加到images中
|
||||
for (String ossId : ossIdArray) {
|
||||
// 查出图片地址
|
||||
String url = baseMapper.selectImageUrlByOssId(ossId);
|
||||
images.add(url);
|
||||
}
|
||||
// 设置images属性,将images打成,分割的字符串
|
||||
item.setImages(String.join(",", images));
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaReportDetailVo> queryList(OaReportDetailBo bo) {
|
||||
LambdaQueryWrapper<OaReportDetail> lqw = buildQueryWrapper(bo);
|
||||
List<OaReportDetailVo> result = baseMapper.selectVoList(lqw);
|
||||
for(OaReportDetailVo item : result) {
|
||||
String ossIds = item.getOssIds();
|
||||
// 分离拿出ossIds
|
||||
String[] ossIdArray = new String[0];
|
||||
if (StringUtils.isNotBlank(ossIds)) {
|
||||
ossIdArray = ossIds.split(",");
|
||||
}
|
||||
// 准备images数组
|
||||
List<String> images = new ArrayList<>();
|
||||
// 遍历ossIdArray,添加到images中
|
||||
for (String ossId : ossIdArray) {
|
||||
// 查出图片地址
|
||||
String url = baseMapper.selectImageUrlByOssId(ossId);
|
||||
images.add(url);
|
||||
}
|
||||
// 设置images属性,将images打成,分割的字符串
|
||||
item.setImages(String.join(",", images));
|
||||
}
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaReportDetail> buildQueryWrapper(OaReportDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaReportDetail> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getSummaryId() != null, OaReportDetail::getSummaryId, bo.getSummaryId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceCode()), OaReportDetail::getDeviceCode, bo.getDeviceCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCategory()), OaReportDetail::getCategory, bo.getCategory());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceDescription()), OaReportDetail::getDeviceDescription, bo.getDeviceDescription());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReportDetail()), OaReportDetail::getReportDetail, bo.getReportDetail());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOssIds()), OaReportDetail::getOssIds, bo.getOssIds());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaReportDetailBo bo) {
|
||||
OaReportDetail add = BeanUtil.toBean(bo, OaReportDetail.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setDetailId(add.getDetailId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaReportDetailBo bo) {
|
||||
OaReportDetail update = BeanUtil.toBean(bo, OaReportDetail.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaReportDetail entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaReportDetailVo> queryByProjectId(Long projectId) {
|
||||
return baseMapper.queryByProjectId(projectId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.gear.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.oa.domain.OaReportSummary;
|
||||
import com.gear.oa.domain.bo.OaReportSummaryBo;
|
||||
import com.gear.oa.domain.vo.OaReportSummaryVo;
|
||||
import com.gear.oa.mapper.OaReportSummaryMapper;
|
||||
import com.gear.oa.service.IOaReportSummaryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述Service业务层处理
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaReportSummaryServiceImpl implements IOaReportSummaryService {
|
||||
|
||||
private final OaReportSummaryMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public OaReportSummaryVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaReportSummaryVo> queryPageList(OaReportSummaryBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaReportSummary> lqw = buildQueryWrapper(bo);
|
||||
// Page<OaReportSummaryVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
Page<OaReportSummaryVo> result = baseMapper.selectVoPageWithProject(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaReportSummaryVo> queryList(OaReportSummaryBo bo) {
|
||||
LambdaQueryWrapper<OaReportSummary> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaReportSummary> buildQueryWrapper(OaReportSummaryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaReportSummary> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getReportTitle()), OaReportSummary::getReportTitle, bo.getReportTitle());
|
||||
lqw.eq(bo.getReportDate() != null, OaReportSummary::getReportDate, bo.getReportDate());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getReporter()), OaReportSummary::getReporter, bo.getReporter());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaReportSummaryBo bo) {
|
||||
OaReportSummary add = BeanUtil.toBean(bo, OaReportSummary.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setSummaryId(add.getSummaryId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaReportSummaryBo bo) {
|
||||
OaReportSummary update = BeanUtil.toBean(bo, OaReportSummary.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaReportSummary entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,7 @@ public class StoRouteQueryUtil {
|
||||
// main方法测试
|
||||
public static void main(String[] args) {
|
||||
List<String> waybillNos = new ArrayList<>();
|
||||
waybillNos.add("777326763655544"); // 测试单号
|
||||
waybillNos.add("777329412312954"); // 测试单号
|
||||
String result = queryRoute(waybillNos);
|
||||
System.out.println("申通原始返回:" + result);
|
||||
OaExpressVo vo = parseData(result);
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gear.oa.mapper.OaReportDetailMapper">
|
||||
|
||||
<resultMap type="com.gear.oa.domain.OaReportDetail" id="OaReportDetailResult">
|
||||
<result property="detailId" column="detail_id"/>
|
||||
<result property="summaryId" column="summary_id"/>
|
||||
<result property="deviceCode" column="device_code"/>
|
||||
<result property="category" column="category"/>
|
||||
<result property="deviceDescription" column="device_description"/>
|
||||
<result property="reportDetail" column="report_detail"/>
|
||||
<result property="ossIds" column="oss_ids"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
<select id="selectVoByIdPlus" parameterType="Long" resultType="com.gear.oa.domain.vo.OaReportDetailVo">
|
||||
select ord.detail_id,
|
||||
summary_id,
|
||||
device_code,
|
||||
category,
|
||||
device_description,
|
||||
report_detail,
|
||||
oss_ids,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
remark,
|
||||
(
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, ord.oss_ids) > 0
|
||||
) AS images
|
||||
from oa_report_detail ord
|
||||
where ord.detail_id = #{id}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryByProjectId" resultType="com.gear.oa.domain.vo.OaReportDetailVo">
|
||||
select ord.detail_id,
|
||||
ord.summary_id,
|
||||
ord.device_code,
|
||||
ord.category,
|
||||
ord.device_description,
|
||||
ord.report_detail,
|
||||
ord.oss_ids,
|
||||
ord.create_by,
|
||||
ord.create_time,
|
||||
ord.update_by,
|
||||
ord.update_time,
|
||||
ord.del_flag,
|
||||
ord.remark
|
||||
from oa_report_detail ord
|
||||
left join oa_report_summary ors on ors.summary_id = ord.summary_id
|
||||
where project_id = #{projectId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gear.oa.mapper.OaReportSummaryMapper">
|
||||
|
||||
<resultMap type="com.gear.oa.domain.OaReportSummary" id="OaReportSummaryResult">
|
||||
<result property="summaryId" column="summary_id"/>
|
||||
<result property="reportTitle" column="report_title"/>
|
||||
<result property="reportDate" column="report_date"/>
|
||||
<result property="reporter" column="reporter"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="type" column="type"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectVoPageWithProject" resultType="com.gear.oa.domain.vo.OaReportSummaryVo">
|
||||
SELECT
|
||||
s.summary_id as summaryId,
|
||||
s.report_title AS reportTitle,
|
||||
s.report_date AS reportDate,
|
||||
s.reporter,
|
||||
s.remark,
|
||||
s.type,
|
||||
d.latest_create_time AS lastUpdateTime
|
||||
FROM oa_report_summary s
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
summary_id,
|
||||
create_time AS latest_create_time,
|
||||
ROW_NUMBER() OVER (PARTITION BY summary_id ORDER BY create_time DESC) AS rn
|
||||
FROM oa_report_detail
|
||||
) d ON s.summary_id = d.summary_id AND d.rn = 1
|
||||
<where>
|
||||
<if test="bo.reportTitle != null and bo.reportTitle != ''">
|
||||
AND s.report_title LIKE CONCAT('%', #{bo.reportTitle}, '%')
|
||||
</if>
|
||||
<if test="bo.reportDate != null">
|
||||
AND s.report_date = #{bo.reportDate}
|
||||
</if>
|
||||
<if test="bo.reporter != null and bo.reporter != ''">
|
||||
AND s.reporter LIKE CONCAT('%', #{bo.reporter}, '%')
|
||||
</if>
|
||||
<if test="bo.type != null">
|
||||
AND s.type = #{bo.type}
|
||||
</if>
|
||||
AND s.del_flag = 0
|
||||
</where>
|
||||
ORDER BY
|
||||
COALESCE(d.latest_create_time, s.report_date) DESC,
|
||||
s.report_date DESC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user