08-20-招标计划,招标多文件处理
This commit is contained in:
@ -263,6 +263,8 @@ springdoc:
|
||||
packages-to-scan: org.dromara.message
|
||||
- group: 20.合同模块
|
||||
packages-to-scan: org.dromara.ctr
|
||||
- group: 21.招标模块
|
||||
packages-to-scan: org.dromara.tender
|
||||
# knife4j的增强配置,不需要增强可以不配
|
||||
knife4j:
|
||||
enable: true
|
||||
|
@ -43,9 +43,9 @@ public class BusSegmentedIndicatorPlanningController extends BaseController {
|
||||
@SaCheckPermission("tender:segmentedIndicatorPlanning:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusSegmentedIndicatorPlanningVo> list(BusSegmentedIndicatorPlanningBo bo, PageQuery pageQuery) {
|
||||
if (bo.getProjectId() == null) {
|
||||
throw new ServiceException("项目id不能为空");
|
||||
}
|
||||
// if (bo.getProjectId() == null) {
|
||||
// throw new ServiceException("项目id不能为空");
|
||||
// }
|
||||
if (bo.getDictName() == null) {
|
||||
throw new ServiceException("分包类型不能为空");
|
||||
}
|
||||
|
@ -0,0 +1,88 @@
|
||||
package org.dromara.tender.controller;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
|
||||
/**
|
||||
* 招标计划-招标文件
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/planFile")
|
||||
public class TenderPlanFileController extends BaseController {
|
||||
|
||||
// private final ITenderPlanFileService tenderPlanFileService;
|
||||
//
|
||||
// /**
|
||||
// * 查询招标计划-招标文件列表
|
||||
// */
|
||||
// @SaCheckPermission("/:planFile:list")
|
||||
// @GetMapping("/list")
|
||||
// public TableDataInfo<TenderPlanFileVo> list(TenderPlanFileBo bo, PageQuery pageQuery) {
|
||||
// return tenderPlanFileService.queryPageList(bo, pageQuery);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导出招标计划-招标文件列表
|
||||
// */
|
||||
// @SaCheckPermission("/:planFile:export")
|
||||
// @Log(title = "招标计划-招标文件", businessType = BusinessType.EXPORT)
|
||||
// @PostMapping("/export")
|
||||
// public void export(TenderPlanFileBo bo, HttpServletResponse response) {
|
||||
// List<TenderPlanFileVo> list = tenderPlanFileService.queryList(bo);
|
||||
// ExcelUtil.exportExcel(list, "招标计划-招标文件", TenderPlanFileVo.class, response);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取招标计划-招标文件详细信息
|
||||
// *
|
||||
// * @param id 主键
|
||||
// */
|
||||
// @SaCheckPermission("/:planFile:query")
|
||||
// @GetMapping("/{id}")
|
||||
// public R<TenderPlanFileVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
// @PathVariable Long id) {
|
||||
// return R.ok(tenderPlanFileService.queryById(id));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增招标计划-招标文件
|
||||
// */
|
||||
// @SaCheckPermission("/:planFile:add")
|
||||
// @Log(title = "招标计划-招标文件", businessType = BusinessType.INSERT)
|
||||
// @RepeatSubmit()
|
||||
// @PostMapping()
|
||||
// public R<Void> add(@Validated(AddGroup.class) @RequestBody TenderPlanFileBo bo) {
|
||||
// return toAjax(tenderPlanFileService.insertByBo(bo));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改招标计划-招标文件
|
||||
// */
|
||||
// @SaCheckPermission("/:planFile:edit")
|
||||
// @Log(title = "招标计划-招标文件", businessType = BusinessType.UPDATE)
|
||||
// @RepeatSubmit()
|
||||
// @PutMapping()
|
||||
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody TenderPlanFileBo bo) {
|
||||
// return toAjax(tenderPlanFileService.updateByBo(bo));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除招标计划-招标文件
|
||||
// *
|
||||
// * @param ids 主键串
|
||||
// */
|
||||
// @SaCheckPermission("/:planFile:remove")
|
||||
// @Log(title = "招标计划-招标文件", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
// @PathVariable Long[] ids) {
|
||||
// return toAjax(tenderPlanFileService.deleteWithValidByIds(List.of(ids), true));
|
||||
// }
|
||||
}
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@ -62,5 +63,24 @@ public class BusSegmentedIndicatorPlanning extends BaseEntity {
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 计划招标方式
|
||||
*/
|
||||
private String plannedBiddingMethod;
|
||||
|
||||
/**
|
||||
* 限价
|
||||
*/
|
||||
private BigDecimal limitPrice;
|
||||
|
||||
/**
|
||||
* 合同额
|
||||
*/
|
||||
private BigDecimal contractPrice;
|
||||
|
||||
/**
|
||||
* 中标通知书
|
||||
*/
|
||||
private String bidFile;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
package org.dromara.tender.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 招标计划-招标文件对象 tender_plan_file
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("tender_plan_file")
|
||||
public class TenderPlanFile extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 招标计划ID(bus_segmented_indicator_planning)
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String fileUrl;
|
||||
|
||||
|
||||
}
|
@ -36,8 +36,8 @@ public class BusSegmentedIndicatorPlanningBo extends BaseEntity {
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@NotNull(message = "项目Id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
// @NotNull(message = "项目Id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// private Long projectId;
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,44 @@
|
||||
package org.dromara.tender.domain.bo;
|
||||
|
||||
import org.dromara.tender.domain.TenderPlanFile;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 招标计划-招标文件业务对象 tender_plan_file
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = TenderPlanFile.class, reverseConvertGenerate = false)
|
||||
public class TenderPlanFileBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 招标计划ID(bus_segmented_indicator_planning)
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String fileUrl;
|
||||
|
||||
|
||||
}
|
@ -41,8 +41,8 @@ public class BusSegmentedIndicatorPlanningVo implements Serializable {
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@ExcelProperty(value = "项目Id")
|
||||
private Long projectId;
|
||||
// @ExcelProperty(value = "项目Id")
|
||||
// private Long projectId;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,55 @@
|
||||
package org.dromara.tender.domain.vo;
|
||||
|
||||
import org.dromara.tender.domain.TenderPlanFile;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 招标计划-招标文件视图对象 tender_plan_file
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = TenderPlanFile.class)
|
||||
public class TenderPlanFileVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 招标计划ID(bus_segmented_indicator_planning)
|
||||
*/
|
||||
@ExcelProperty(value = "招标计划ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "b=us_segmented_indicator_planning")
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
@ExcelProperty(value = "文件ID")
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
@ExcelProperty(value = "文件地址")
|
||||
private String fileUrl;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.tender.mapper;
|
||||
|
||||
import org.dromara.tender.domain.TenderPlanFile;
|
||||
import org.dromara.tender.domain.vo.TenderPlanFileVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 招标计划-招标文件Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public interface TenderPlanFileMapper extends BaseMapperPlus<TenderPlanFile, TenderPlanFileVo> {
|
||||
|
||||
}
|
@ -7,6 +7,8 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.tender.service;
|
||||
|
||||
import org.dromara.tender.domain.vo.TenderPlanFileVo;
|
||||
import org.dromara.tender.domain.bo.TenderPlanFileBo;
|
||||
import org.dromara.tender.domain.TenderPlanFile;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招标计划-招标文件Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public interface ITenderPlanFileService extends IService<TenderPlanFile>{
|
||||
|
||||
/**
|
||||
* 查询招标计划-招标文件
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 招标计划-招标文件
|
||||
*/
|
||||
TenderPlanFileVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询招标计划-招标文件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 招标计划-招标文件分页列表
|
||||
*/
|
||||
TableDataInfo<TenderPlanFileVo> queryPageList(TenderPlanFileBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的招标计划-招标文件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 招标计划-招标文件列表
|
||||
*/
|
||||
List<TenderPlanFileVo> queryList(TenderPlanFileBo bo);
|
||||
|
||||
/**
|
||||
* 新增招标计划-招标文件
|
||||
*
|
||||
* @param bo 招标计划-招标文件
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(TenderPlanFileBo bo);
|
||||
|
||||
/**
|
||||
* 修改招标计划-招标文件
|
||||
*
|
||||
* @param bo 招标计划-招标文件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(TenderPlanFileBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除招标计划-招标文件信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -89,7 +89,7 @@ public class BusSegmentedIndicatorPlanningServiceImpl extends ServiceImpl<BusSeg
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusSegmentedIndicatorPlanning> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusSegmentedIndicatorPlanning::getPlannedBiddingTime);
|
||||
lqw.eq(bo.getProjectId() != null, BusSegmentedIndicatorPlanning::getProjectId, bo.getProjectId());
|
||||
// lqw.eq(bo.getProjectId() != null, BusSegmentedIndicatorPlanning::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDictName()), BusSegmentedIndicatorPlanning::getDictName, bo.getDictName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BusSegmentedIndicatorPlanning::getName, bo.getName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContent()), BusSegmentedIndicatorPlanning::getContent, bo.getContent());
|
||||
|
@ -0,0 +1,133 @@
|
||||
package org.dromara.tender.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.tender.domain.bo.TenderPlanFileBo;
|
||||
import org.dromara.tender.domain.vo.TenderPlanFileVo;
|
||||
import org.dromara.tender.domain.TenderPlanFile;
|
||||
import org.dromara.tender.mapper.TenderPlanFileMapper;
|
||||
import org.dromara.tender.service.ITenderPlanFileService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 招标计划-招标文件Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class TenderPlanFileServiceImpl extends ServiceImpl<TenderPlanFileMapper, TenderPlanFile> implements ITenderPlanFileService {
|
||||
|
||||
private final TenderPlanFileMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询招标计划-招标文件
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 招标计划-招标文件
|
||||
*/
|
||||
@Override
|
||||
public TenderPlanFileVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询招标计划-招标文件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 招标计划-招标文件分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<TenderPlanFileVo> queryPageList(TenderPlanFileBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<TenderPlanFile> lqw = buildQueryWrapper(bo);
|
||||
Page<TenderPlanFileVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的招标计划-招标文件列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 招标计划-招标文件列表
|
||||
*/
|
||||
@Override
|
||||
public List<TenderPlanFileVo> queryList(TenderPlanFileBo bo) {
|
||||
LambdaQueryWrapper<TenderPlanFile> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<TenderPlanFile> buildQueryWrapper(TenderPlanFileBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<TenderPlanFile> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(TenderPlanFile::getId);
|
||||
lqw.eq(bo.getPlanId() != null, TenderPlanFile::getPlanId, bo.getPlanId());
|
||||
lqw.eq(bo.getFileId() != null, TenderPlanFile::getFileId, bo.getFileId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileUrl()), TenderPlanFile::getFileUrl, bo.getFileUrl());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增招标计划-招标文件
|
||||
*
|
||||
* @param bo 招标计划-招标文件
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(TenderPlanFileBo bo) {
|
||||
TenderPlanFile add = MapstructUtils.convert(bo, TenderPlanFile.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改招标计划-招标文件
|
||||
*
|
||||
* @param bo 招标计划-招标文件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(TenderPlanFileBo bo) {
|
||||
TenderPlanFile update = MapstructUtils.convert(bo, TenderPlanFile.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(TenderPlanFile entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除招标计划-招标文件信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.system.domain.vo.SysOssUploadVo;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -102,9 +103,9 @@ public class TenderSupplierInputServiceImpl extends ServiceImpl<TenderSupplierIn
|
||||
@Override
|
||||
public Boolean insertByBo(TenderSupplierInputBo bo, MultipartFile file) {
|
||||
TenderSupplierInput add = MapstructUtils.convert(bo, TenderSupplierInput.class);
|
||||
SysOssUploadVo sysOssUploadVo = ossService.uploadWithNoSave(file, ossService.minioFileName(SupplierInput, file));
|
||||
add.setInputFile(sysOssUploadVo.getUrl());
|
||||
// add.setFileId(Long.valueOf(sysOssUploadVo.getOssId()));
|
||||
SysOssVo upload = ossService.upload(file, ossService.minioFileName(SupplierInput, file));
|
||||
add.setInputFile(upload.getUrl());
|
||||
add.setFileId(Long.valueOf(upload.getOssId()));
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
@ -123,11 +124,11 @@ public class TenderSupplierInputServiceImpl extends ServiceImpl<TenderSupplierIn
|
||||
public Boolean updateByBo(TenderSupplierInputBo bo,MultipartFile file) {
|
||||
TenderSupplierInput update = MapstructUtils.convert(bo, TenderSupplierInput.class);
|
||||
TenderSupplierInput byId = getById(update.getId());
|
||||
// ossService.deleteWithValidByIds(List.of(byId.getFileId()), false);
|
||||
ossService.deleteWithValidByIds(List.of(byId.getFileId()), false);
|
||||
|
||||
SysOssUploadVo sysOssUploadVo = ossService.uploadWithNoSave(file, ossService.minioFileName(SupplierInput, file));
|
||||
SysOssVo sysOssUploadVo = ossService.upload(file, ossService.minioFileName(SupplierInput, file));
|
||||
update.setInputFile(sysOssUploadVo.getUrl());
|
||||
// update.setFileId(Long.valueOf(sysOssUploadVo.getOssId()));
|
||||
update.setFileId(Long.valueOf(sysOssUploadVo.getOssId()));
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
@ -150,14 +151,16 @@ public class TenderSupplierInputServiceImpl extends ServiceImpl<TenderSupplierIn
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
// List<Long> fileIds = new ArrayList<>();
|
||||
// for (Long id : ids) {
|
||||
// TenderSupplierInput byId = getById(id);
|
||||
// if (byId.getFileId() != null){
|
||||
// fileIds.add(byId.getFileId());
|
||||
// }
|
||||
// }
|
||||
// ossService.deleteWithValidByIds(fileIds, false);
|
||||
List<Long> fileIds = new ArrayList<>();
|
||||
for (Long id : ids) {
|
||||
TenderSupplierInput byId = getById(id);
|
||||
if (byId.getFileId() != null){
|
||||
fileIds.add(byId.getFileId());
|
||||
}
|
||||
}
|
||||
if (!fileIds.isEmpty()) {
|
||||
ossService.deleteWithValidByIds(fileIds, false);
|
||||
}
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user