更新代码
This commit is contained in:
@ -72,4 +72,10 @@ public class BizBidShared extends BaseEntity implements Serializable {
|
|||||||
@ApiModelProperty("逻辑删除,normal表示正常(默认),deleted表示删除")
|
@ApiModelProperty("逻辑删除,normal表示正常(默认),deleted表示删除")
|
||||||
private String deleteFlag;
|
private String deleteFlag;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String fileSuffix;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,27 @@
|
|||||||
package com.chinaunicom.mall.ebtp.extend.bizbidshared.service.impl;
|
package com.chinaunicom.mall.ebtp.extend.bizbidshared.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.chinaunicom.ebtp.mall.cloud.attachment.sdk.api.AttachmentClient;
|
||||||
|
import com.chinaunicom.ebtp.mall.cloud.attachment.sdk.model.AttachmentDetail;
|
||||||
|
import com.chinaunicom.ebtp.mall.cloud.attachment.sdk.model.AttachmentEntity;
|
||||||
import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl;
|
import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizbidshared.dao.BizBidSharedMapper;
|
import com.chinaunicom.mall.ebtp.extend.bizbidshared.dao.BizBidSharedMapper;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizbidshared.entity.BizBidShared;
|
import com.chinaunicom.mall.ebtp.extend.bizbidshared.entity.BizBidShared;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizbidshared.entity.BizBidSharedVO;
|
import com.chinaunicom.mall.ebtp.extend.bizbidshared.entity.BizBidSharedVO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizbidshared.service.IBizBidSharedService;
|
import com.chinaunicom.mall.ebtp.extend.bizbidshared.service.IBizBidSharedService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对数据表 biz_bid_shared 操作的 serviceImpl
|
* 对数据表 biz_bid_shared 操作的 serviceImpl
|
||||||
*
|
*
|
||||||
@ -22,6 +30,8 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class BizBidSharedServiceImpl extends BaseServiceImpl<BizBidSharedMapper, BizBidShared> implements IBizBidSharedService {
|
public class BizBidSharedServiceImpl extends BaseServiceImpl<BizBidSharedMapper, BizBidShared> implements IBizBidSharedService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AttachmentClient attachmentClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<BizBidShared> getList(BizBidSharedVO bizBidNotice) {
|
public IPage<BizBidShared> getList(BizBidSharedVO bizBidNotice) {
|
||||||
@ -29,7 +39,17 @@ public class BizBidSharedServiceImpl extends BaseServiceImpl<BizBidSharedMapper,
|
|||||||
wrapper.like(StrUtil.isNotEmpty(bizBidNotice.getSharedName()), BizBidShared::getSharedName, bizBidNotice.getSharedName())
|
wrapper.like(StrUtil.isNotEmpty(bizBidNotice.getSharedName()), BizBidShared::getSharedName, bizBidNotice.getSharedName())
|
||||||
.like(StrUtil.isNotEmpty(bizBidNotice.getSharedRole()), BizBidShared::getSharedRole, bizBidNotice.getSharedRole());
|
.like(StrUtil.isNotEmpty(bizBidNotice.getSharedRole()), BizBidShared::getSharedRole, bizBidNotice.getSharedRole());
|
||||||
|
|
||||||
return this.page(new Page<>(bizBidNotice.getPageNo(), bizBidNotice.getPageSize()), wrapper);
|
Page<BizBidShared> page = this.page(new Page<>(bizBidNotice.getPageNo(), bizBidNotice.getPageSize()), wrapper);
|
||||||
|
|
||||||
|
List<String> collect = page.getRecords().stream().map(BizBidShared::getSharedFile).distinct().collect(Collectors.toList());
|
||||||
|
Optional<AttachmentDetail> optional = attachmentClient.findByBusinessId(collect);
|
||||||
|
optional.ifPresent(o -> {
|
||||||
|
page.getRecords().forEach(r -> {
|
||||||
|
Optional<AttachmentEntity> first = o.get(r.getSharedFile()).stream().findFirst();
|
||||||
|
first.ifPresent(f -> r.setFileName(f.getFilename()).setFileSuffix(FileUtil.getSuffix(f.getFilename())));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -148,6 +148,7 @@ mconfig:
|
|||||||
project: biz-service-ebtp-project #项目服务
|
project: biz-service-ebtp-project #项目服务
|
||||||
resps: biz-service-ebtp-resps #应答结构化服务
|
resps: biz-service-ebtp-resps #应答结构化服务
|
||||||
rsms: biz-service-ebtp-rsms #评审结构化服务
|
rsms: biz-service-ebtp-rsms #评审结构化服务
|
||||||
|
tender: biz-service-ebtp-tender #投标服务
|
||||||
# 用户暴露给 prometheus 的健康数据
|
# 用户暴露给 prometheus 的健康数据
|
||||||
management:
|
management:
|
||||||
endpoints:
|
endpoints:
|
||||||
|
Reference in New Issue
Block a user