diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/BizExportDictServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/BizExportDictServiceImpl.java deleted file mode 100644 index e2ff4f4..0000000 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/BizExportDictServiceImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.chinaunicom.mall.ebtp.extend.export.service.impl; - - -import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl; -import com.chinaunicom.mall.ebtp.common.constant.CommonConstants; -import com.chinaunicom.mall.ebtp.common.util.JsonUtils; -import com.chinaunicom.mall.ebtp.extend.export.bean.*; -import com.chinaunicom.mall.ebtp.extend.export.dao.BizExportDictMapper; -import com.chinaunicom.mall.ebtp.extend.export.feign.ProcessFeignClient; -import com.chinaunicom.mall.ebtp.extend.export.feign.ProjectFeignService; -import com.chinaunicom.mall.ebtp.extend.export.feign.RsmsFeignService; -import com.chinaunicom.mall.ebtp.extend.export.service.IBizExportDictService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * 对数据表 biz_export_dict 操作的 serviceImpl - * - * @author Auto create - */ -@Service -@Slf4j -public class BizExportDictServiceImpl extends BaseServiceImpl implements IBizExportDictService { - - @Autowired - private ProcessFeignClient processFeignClient; - @Autowired - private ProjectFeignService projectFeignService; - @Autowired - private RsmsFeignService rsmsFeignService; - - /** - * 查询list - * - * @param roomId - */ - @Override - public Map> getList(String roomId) { - BizAssessRoom room = processFeignClient.getById(roomId).getData(); - //查询项目名称 - ProjectRecordVO proj = projectFeignService.getProjById(room.getTpId()).getData(); - //包 - ProjectSectionVO projectSectionVO = new ProjectSectionVO(); - projectSectionVO.setId(room.getSectionId()); - ProjectSectionVO section = projectFeignService.selectById(projectSectionVO).getData(); - - List list = baseMapper.selectDictList(proj.getBidMethodDict()); - - List level1 = list.stream().filter(f -> f.getLevel().equals(1)).sorted(Comparator.comparing(BizExportDict::getId)) - .collect(Collectors.toList()); - List level2 = list.stream().filter(f -> f.getLevel().equals(2)).sorted(Comparator.comparing(BizExportDict::getId)) - .collect(Collectors.toList()); - - Map> resultsMap = new HashMap<>(); - - //是否包含开标阶段 - boolean toInitialOpenRoom = room.getRoomType().equals(CommonConstants.ROOM_TYPE_2); - - for (BizExportDict bizExportDict : level1) { - //不含开标阶段 100 = 开标阶段 - if (!toInitialOpenRoom && bizExportDict.getId().equals(100)) { - continue; - } - // 评审室未结束 不拼接评审打分等数据表 - if (room.getStatus() < 3 && !bizExportDict.getId().equals(100)) { - continue; - } - resultsMap.put( - bizExportDict.getDicName(), - level2.stream() - .filter(f -> f.getPath().equals(String.valueOf(bizExportDict.getId()))) - .collect(Collectors.toList()) - ); - } - //初审数据url - String isReviewMethod = room.getRoomType().equals(CommonConstants.ROOM_TYPE_1) ? "1" : "0"; - List archiveLinks = getFirstArchiveLinks(); - Map> firstRvwMap = rsmsFeignService.findEarlyArchiveList(room.getSectionId(), isReviewMethod, archiveLinks).getData(); - //详审数据url - archiveLinks = getDetailArchiveLinks(); - Map> detailRvwMap = rsmsFeignService.findDetailArchiveList(room.getSectionId(), isReviewMethod, archiveLinks).getData(); - - - resultsMap.forEach((key, value) -> { - value.forEach(bizExportDict -> { - if ("1".equals(bizExportDict.getUrl())) { - //查询初审报表 - Optional opt = firstRvwMap.get(bizExportDict.getUrl()).stream().filter(f -> f.getAssessRoomId().equals(roomId)).findFirst(); - opt.ifPresent(o -> bizExportDict.setUrl(o.getArchiveFileUrl())); - } else if (bizExportDict.getUrl().length() < 5) { - //查询详审报表 - Optional opt = detailRvwMap.get(bizExportDict.getUrl()).stream().filter(f -> f.getAssessRoomId().equals(roomId)).findFirst(); - opt.ifPresent(o -> bizExportDict.setUrl(o.getArchiveFileUrl())); - } else { - String sbl = bizExportDict.getUrl() + - "?assessRoomId=" + roomId + -// "&reviewTurnId=" + v.getReviewTurnId() + - "&projectId=" + proj.getId() + - "§ionId=" + section.getId(); - bizExportDict.setUrl(sbl); - } - }); - //如果没进行初审或详审 则删除相关报表 length < 5 为虚数 - value.removeIf(bizExportDict -> bizExportDict.getUrl().length() < 5); - }); - //删除value为空的key - resultsMap.values().removeIf(List::isEmpty); - return resultsMap; - } - - private List getFirstArchiveLinks() { - List archiveLinks = new ArrayList<>(); - //初步评审表URL - archiveLinks.add(new ArchiveLink().setId("1").setArchiveDirectory("1")); - return archiveLinks; - } - - private List getDetailArchiveLinks() { - List archiveLinks = new ArrayList<>(); - //详细评审表URL -// archiveLinks.add(new ArchiveLink().setId("2").setArchiveDirectory("2")); - //专家打分表URL - archiveLinks.add(new ArchiveLink().setId("3").setArchiveDirectory("3")); - //价格打分表URL - archiveLinks.add(new ArchiveLink().setId("4").setArchiveDirectory("4")); - //打分汇总表URL - archiveLinks.add(new ArchiveLink().setId("5").setArchiveDirectory("5")); - //评审报告URL -// archiveLinks.add(new ArchiveLink().setId("6").setArchiveDirectory("6")); - return archiveLinks; - } - - -}