drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/controller/GdSupplyDemandAuditAttachmentController.java
@@ -60,24 +60,35 @@ private final IGdSupplyDemandAuditAttachmentService gdSupplyDemandAuditAttachmentService; /** * 供需需求审核附件表 列表 */ @GetMapping("/list") @ApiOperationSupport(order = 1) @ApiOperation(value = "列表", notes = "传入demandId") public R<List<GdSupplyDemandAuditAttachmentVO>> list(@ApiParam(value = "供需需求ID", required = true) @RequestParam Long demandId) { return R.data(gdSupplyDemandAuditAttachmentService.listSupplyDemandAuditAttachments(demandId)); } /** * 供需需求审核附件表 详情 */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入demandId") public R<List<GdSupplyDemandAuditAttachmentVO>> detail(@ApiParam(value = "供需需求ID", required = true) @RequestParam Long demandId) { return R.data(gdSupplyDemandAuditAttachmentService.listSupplyDemandAuditAttachments(demandId)); } /** * 供需需求审核附件表 分页 */ @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入gdSupplyDemandAuditAttachment") public R<IPage<GdSupplyDemandAuditAttachmentVO>> list(@ApiIgnore @RequestParam Map<String, Object> gdSupplyDemandAuditAttachment, Query query) { IPage<GdSupplyDemandAuditAttachmentEntity> pages = gdSupplyDemandAuditAttachmentService.page(Condition.getPage(query), Condition.getQueryWrapper(gdSupplyDemandAuditAttachment, GdSupplyDemandAuditAttachmentEntity.class)); return R.data(GdSupplyDemandAuditAttachmentWrapper.build().pageVO(pages)); @ApiOperation(value = "详情", notes = "传入id") public R<GdSupplyDemandAuditAttachmentVO> detail(@ApiParam(value = "主键ID", required = true) @RequestParam Long id) { GdSupplyDemandAuditAttachmentEntity detail = gdSupplyDemandAuditAttachmentService.getById(id); return R.data(GdSupplyDemandAuditAttachmentWrapper.build().entityVO(detail)); } // /** // * 供需需求审核附件表 分页 // */ // @GetMapping("/list") // @ApiOperationSupport(order = 2) // @ApiOperation(value = "分页", notes = "传入gdSupplyDemandAuditAttachment") // public R<IPage<GdSupplyDemandAuditAttachmentVO>> list(@ApiIgnore @RequestParam Map<String, Object> gdSupplyDemandAuditAttachment, Query query) { // IPage<GdSupplyDemandAuditAttachmentEntity> pages = gdSupplyDemandAuditAttachmentService.page(Condition.getPage(query), Condition.getQueryWrapper(gdSupplyDemandAuditAttachment, GdSupplyDemandAuditAttachmentEntity.class)); // return R.data(GdSupplyDemandAuditAttachmentWrapper.build().pageVO(pages)); // } /** * 供需需求审核附件表 自定义分页 drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/controller/GdSupplyDemandAuditController.java
@@ -60,24 +60,35 @@ private final IGdSupplyDemandAuditService gdSupplyDemandAuditService; /** * 供需需求审核记录表 列表 */ @GetMapping("/list") @ApiOperationSupport(order = 1) @ApiOperation(value = "列表", notes = "传入demandId") public R<List<GdSupplyDemandAuditVO>> list(@ApiParam(value = "供需需求ID", required = true) @RequestParam Long demandId) { return R.data(gdSupplyDemandAuditService.listSupplyDemandAudit(demandId)); } /** * 供需需求审核记录表 详情 */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入demandId") public R<List<GdSupplyDemandAuditVO>> detail(@ApiParam(value = "供需需求ID", required = true) @RequestParam Long demandId) { return R.data(gdSupplyDemandAuditService.listSupplyDemandAudit(demandId)); } /** * 供需需求审核记录表 分页 */ @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入gdSupplyDemandAudit") public R<IPage<GdSupplyDemandAuditVO>> list(@ApiIgnore @RequestParam Map<String, Object> gdSupplyDemandAudit, Query query) { IPage<GdSupplyDemandAuditEntity> pages = gdSupplyDemandAuditService.page(Condition.getPage(query), Condition.getQueryWrapper(gdSupplyDemandAudit, GdSupplyDemandAuditEntity.class)); return R.data(GdSupplyDemandAuditWrapper.build().pageVO(pages)); @ApiOperation(value = "详情", notes = "传入id") public R<GdSupplyDemandAuditVO> detail(@ApiParam(value = "主键ID", required = true) @RequestParam Long id) { GdSupplyDemandAuditEntity detail = gdSupplyDemandAuditService.getById(id); return R.data(GdSupplyDemandAuditWrapper.build().entityVO(detail)); } // /** // * 供需需求审核记录表 分页 // */ // @GetMapping("/list") // @ApiOperationSupport(order = 2) // @ApiOperation(value = "分页", notes = "传入gdSupplyDemandAudit") // public R<IPage<GdSupplyDemandAuditVO>> list(@ApiIgnore @RequestParam Map<String, Object> gdSupplyDemandAudit, Query query) { // IPage<GdSupplyDemandAuditEntity> pages = gdSupplyDemandAuditService.page(Condition.getPage(query), Condition.getQueryWrapper(gdSupplyDemandAudit, GdSupplyDemandAuditEntity.class)); // return R.data(GdSupplyDemandAuditWrapper.build().pageVO(pages)); // } /** * 供需需求审核记录表 自定义分页 drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/mapper/GdSupplyDemandAuditAttachmentMapper.java
@@ -65,6 +65,6 @@ * @param demandId * @return */ List<GdSupplyDemandAuditAttachmentEntity> selectSupplyDemandAuditAttachmentList(@Param("demandId") Long demandId); List<GdSupplyDemandAuditAttachmentVO> selectSupplyDemandAuditAttachmentList(@Param("demandId") Long demandId); } drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/mapper/GdSupplyDemandAuditAttachmentMapper.xml
@@ -17,6 +17,11 @@ <result column="is_deleted" property="isDeleted"/> </resultMap> <resultMap id="gdSupplyDemandAuditAttachmentVOResultMap" type="org.sxkj.gd.orderdata.vo.GdSupplyDemandAuditAttachmentVO" extends="gdSupplyDemandAuditAttachmentResultMap"> <result column="file_url" property="fileUrl"/> <result column="file_size" property="fileSize"/> </resultMap> <select id="selectGdSupplyDemandAuditAttachmentPage" resultMap="gdSupplyDemandAuditAttachmentResultMap"> select * from ja_gd_supply_demand_audit_attachment where is_deleted = 0 @@ -41,12 +46,17 @@ </foreach> </insert> <select id="selectSupplyDemandAuditAttachmentList" resultMap="gdSupplyDemandAuditAttachmentResultMap"> select * from ja_gd_supply_demand_audit_attachment <select id="selectSupplyDemandAuditAttachmentList" resultMap="gdSupplyDemandAuditAttachmentVOResultMap"> select audit_attachment.*, attach.link as file_url, round(attach.attach_size / 1024 / 1024, 2) as file_size from ja_gd_supply_demand_audit_attachment audit_attachment left join blade_attach attach on attach.id = audit_attachment.attach_id and attach.is_deleted = 0 <where> is_deleted = 0 audit_attachment.is_deleted = 0 <if test="demandId != null"> AND demand_id = #{demandId} AND audit_attachment.demand_id = #{demandId} </if> </where> </select> drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/service/impl/GdSupplyDemandAuditAttachmentServiceImpl.java
@@ -27,10 +27,8 @@ import org.sxkj.gd.orderdata.mapper.GdSupplyDemandAuditAttachmentMapper; import org.sxkj.gd.orderdata.service.IGdSupplyDemandAuditAttachmentService; import org.sxkj.gd.orderdata.vo.GdSupplyDemandAuditAttachmentVO; import org.sxkj.gd.orderdata.wrapper.GdSupplyDemandAuditAttachmentWrapper; import java.util.List; import java.util.stream.Collectors; /** * 供需需求审核附件表 服务实现类 @@ -69,14 +67,11 @@ if (demandId == null) { throw new ServiceException("需求编号不能为空"); } List<GdSupplyDemandAuditAttachmentEntity> entities = baseMapper.selectSupplyDemandAuditAttachmentList(demandId); if (Func.isEmpty(entities)) { List<GdSupplyDemandAuditAttachmentVO> attachments = baseMapper.selectSupplyDemandAuditAttachmentList(demandId); if (Func.isEmpty(attachments)) { return java.util.Collections.emptyList(); } GdSupplyDemandAuditAttachmentWrapper wrapper = GdSupplyDemandAuditAttachmentWrapper.build(); return entities.stream() .map(wrapper::entityVO) .collect(Collectors.toList()); return attachments; } } drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/vo/GdSupplyDemandAuditAttachmentVO.java
@@ -16,10 +16,12 @@ */ package org.sxkj.gd.orderdata.vo; import io.swagger.annotations.ApiModelProperty; import org.sxkj.gd.orderdata.entity.GdSupplyDemandAuditAttachmentEntity; import org.springblade.core.tool.node.INode; import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; /** * 供需需求审核附件表 视图实体类 @@ -32,4 +34,10 @@ public class GdSupplyDemandAuditAttachmentVO extends GdSupplyDemandAuditAttachmentEntity { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "文件下载地址") private String fileUrl; @ApiModelProperty(value = "文件大小(MB)") private BigDecimal fileSize; }