|
@@ -12,6 +12,7 @@ import com.jeeplus.business.bid.domain.TenderBidBasic;
|
|
|
import com.jeeplus.business.bid.mapper.TenderBidBasicMapper;
|
|
|
import com.jeeplus.business.bid.mapper.TenderBidDetailMapper;
|
|
|
import com.jeeplus.business.bid.service.dto.TenderBidDTO;
|
|
|
+import com.jeeplus.business.notify.service.dto.WorkAttachmentDto;
|
|
|
import com.jeeplus.business.tender.domain.BidDetail;
|
|
|
import com.jeeplus.business.tender.domain.Tender;
|
|
|
import com.jeeplus.business.tender.mapper.BidDetailMapper;
|
|
@@ -19,14 +20,14 @@ import com.jeeplus.business.tender.service.DTO.TenderDTO;
|
|
|
import com.jeeplus.common.TokenProvider;
|
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
import com.jeeplus.flowable.feign.IFlowableApi;
|
|
|
-import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
|
|
|
-import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
|
|
|
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
|
|
|
import com.jeeplus.sys.feign.IPostApi;
|
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.feign.IWorkAttachmentApi;
|
|
|
import com.jeeplus.sys.service.dto.FlowCopy;
|
|
|
import com.jeeplus.sys.service.dto.PostDTO;
|
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
+import com.jeeplus.sys.service.dto.WorkAttachmentInfoDTO;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -66,9 +67,9 @@ public class TenderBidService {
|
|
|
if (CollectionUtils.isNotEmpty(bidDetails)){
|
|
|
bidDetails.stream().forEach(detail->{
|
|
|
//附件信息
|
|
|
- List<WorkAttachmentDto> acList = detailMapper.getByAttachmentId(detail.getId());
|
|
|
+ List<WorkAttachmentInfoDTO> acList = detailMapper.getByAttachmentId(detail.getId());
|
|
|
if (CollectionUtils.isNotEmpty(acList)) {
|
|
|
- for (WorkAttachmentDto i : acList) {
|
|
|
+ for (WorkAttachmentInfoDTO i : acList) {
|
|
|
i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
}
|
|
|
}
|
|
@@ -81,9 +82,9 @@ public class TenderBidService {
|
|
|
List<JyTenderBidDetail> details=detailMapper.findByBasicId(id);
|
|
|
for (JyTenderBidDetail bidDetail : details) {
|
|
|
//附件信息
|
|
|
- List<WorkAttachmentDto> acList = detailMapper.getByAttachmentId(bidDetail.getId());
|
|
|
+ List<WorkAttachmentInfoDTO> acList = detailMapper.getByAttachmentId(bidDetail.getId());
|
|
|
if (CollectionUtils.isNotEmpty(acList)) {
|
|
|
- for (WorkAttachmentDto i : acList) {
|
|
|
+ for (WorkAttachmentInfoDTO i : acList) {
|
|
|
i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
}
|
|
|
}
|
|
@@ -92,9 +93,9 @@ public class TenderBidService {
|
|
|
}
|
|
|
tenderBidDTO.setBidDetails(details); //中标详情
|
|
|
//附件信息
|
|
|
- List<WorkAttachmentDto> files = detailMapper.getByAttachmentId(tender.getId());
|
|
|
+ List<WorkAttachmentInfoDTO> files = detailMapper.getByAttachmentId(tender.getId());
|
|
|
if (CollectionUtils.isNotEmpty(files)) {
|
|
|
- for (WorkAttachmentDto i : files) {
|
|
|
+ for (WorkAttachmentInfoDTO i : files) {
|
|
|
i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
}
|
|
|
}
|
|
@@ -333,17 +334,17 @@ public class TenderBidService {
|
|
|
* @param id 关联id
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void updateFiles(List<WorkAttachmentDto> list, UserDTO userDTO, String id) {
|
|
|
+ public void updateFiles(List<WorkAttachmentInfoDTO> list, UserDTO userDTO, String id) {
|
|
|
int j = 1;
|
|
|
String names = new String();
|
|
|
//表中存在,但是传过来不存在,说明已删除,表中数据也要删除
|
|
|
- for (WorkAttachmentDto dto : list) {
|
|
|
+ for (WorkAttachmentInfoDTO dto : list) {
|
|
|
names = names + "," +dto.getUrl();
|
|
|
}
|
|
|
//查询保存的附件信息
|
|
|
- List<WorkAttachment> infoList = basicMapper.findFileList(id);
|
|
|
+ List<WorkAttachmentInfo> infoList = basicMapper.findFileList(id);
|
|
|
if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
|
|
|
- for (WorkAttachment i : infoList) {
|
|
|
+ for (WorkAttachmentInfo i : infoList) {
|
|
|
if (!names.contains(i.getUrl())) {
|
|
|
// ossServiceMapper.deleteById(i.getId());
|
|
|
SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
|
|
@@ -351,11 +352,11 @@ public class TenderBidService {
|
|
|
}
|
|
|
}
|
|
|
//保存信息
|
|
|
- for (WorkAttachmentDto dto : list) {
|
|
|
+ for (WorkAttachmentInfoDTO dto : list) {
|
|
|
//判断是否存在
|
|
|
Integer isExit = basicMapper.findIsExit(id, dto.getName());
|
|
|
if (isExit == 0) {
|
|
|
- WorkAttachment i = new WorkAttachment();
|
|
|
+ WorkAttachmentInfo i = new WorkAttachmentInfo();
|
|
|
//包含了url、size、name
|
|
|
i.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
// i.getCreateBy().setId(userDTO.getId());
|
|
@@ -393,10 +394,10 @@ public class TenderBidService {
|
|
|
* @param id 关联id
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void saveFiles(List<WorkAttachmentDto> list, UserDTO userDTO, String id) {
|
|
|
+ public void saveFiles(List<WorkAttachmentInfoDTO> list, UserDTO userDTO, String id) {
|
|
|
int j = 1;
|
|
|
- for (WorkAttachmentDto dto : list) {
|
|
|
- WorkAttachment i = new WorkAttachment();
|
|
|
+ for (WorkAttachmentInfoDTO dto : list) {
|
|
|
+ WorkAttachmentInfo i = new WorkAttachmentInfo();
|
|
|
//包含了url、size、name
|
|
|
i.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
// i.getCreateBy().setId(userDTO.getId());
|
|
@@ -485,7 +486,7 @@ public class TenderBidService {
|
|
|
if (null != detailedList){
|
|
|
detailedList.forEach(de->{
|
|
|
//附件
|
|
|
- List<WorkAttachmentDto> fileList = detailMapper.getByAttachmentId(de.getId());
|
|
|
+ List<WorkAttachmentInfoDTO> fileList = detailMapper.getByAttachmentId(de.getId());
|
|
|
if ( null != fileList ){
|
|
|
fileList.forEach(f->{
|
|
|
SpringUtil.getBean(IWorkAttachmentApi.class).deleteById(f.getId());
|