Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | <!-- 获取设备类型统计数据 --> |
| | | <select id="getDeviceTypeStatistics" resultType="org.sxkj.fw.device.vo.DeviceTypeStatisticsVO"> |
| | | SELECT a.device_type,b.dict_value AS device_type_value,count(*) device_count, (SELECT COUNT(*) FROM ja_fw_device) as total_devices |
| | | SELECT a.device_type,b.dict_value AS device_type_value,count(*) device_count, (SELECT COUNT(*) FROM ja_fw_device where is_deleted = 0) as total_devices |
| | | FROM ja_fw_device a |
| | | LEFT JOIN blade_dict_biz b ON ( |
| | | a.device_type = b.dict_key |
| | |
| | | import org.sxkj.fw.device.vo.FwDeviceScrapVO; |
| | | import org.sxkj.fw.device.wrapper.FwDeviceScrapWrapper; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | FwDeviceEntity fwDevice = new FwDeviceEntity(); |
| | | fwDevice.setId(dto.getDeviceId()); |
| | | fwDevice.setStatus(3); |
| | | fwDevice.setIsDeleted(1); |
| | | isSuccess = fwDeviceService.updateById(fwDevice); |
| | | isSuccess = fwDeviceService.updateById(fwDevice) && fwDeviceService.deleteLogic(Collections.singletonList(fwDevice.getId())); |
| | | } |
| | | return isSuccess; |
| | | } |
| | |
| | | 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)); |
| | | // } |
| | | |
| | | /** |
| | | * 供需需求审核附件表 自定义分页 |
| | |
| | | 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)); |
| | | // } |
| | | |
| | | /** |
| | | * 供需需求审核记录表 自定义分页 |
| | |
| | | * @param demandId |
| | | * @return |
| | | */ |
| | | List<GdSupplyDemandAuditAttachmentEntity> selectSupplyDemandAuditAttachmentList(@Param("demandId") Long demandId); |
| | | List<GdSupplyDemandAuditAttachmentVO> selectSupplyDemandAuditAttachmentList(@Param("demandId") Long demandId); |
| | | |
| | | } |
| | |
| | | <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 |
| | |
| | | </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> |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 供需需求审核附件表 服务实现类 |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | 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; |
| | | |
| | | /** |
| | | * 供需需求审核附件表 视图实体类 |
| | |
| | | public class GdSupplyDemandAuditAttachmentVO extends GdSupplyDemandAuditAttachmentEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "文件下载地址") |
| | | private String fileUrl; |
| | | |
| | | @ApiModelProperty(value = "文件大小(MB)") |
| | | private BigDecimal fileSize; |
| | | |
| | | } |