项目列表查询增加标段总数字段
This commit is contained in:
@ -56,6 +56,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
@ -1023,9 +1024,22 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl<ProjectRecordMappe
|
||||
if(null != recordVOList && !recordVOList.isEmpty()){
|
||||
List<String> projectIds = recordVOList.stream().map(ProjectRecordVO::getId).collect(Collectors.toList());
|
||||
List<ProjectSection> sectionList = projectSectionService.getListAssembleProjectPage(projectIds);
|
||||
List<String> sectionIds = sectionList.stream().map(ProjectSection::getId).collect(Collectors.toList());
|
||||
|
||||
//分组排序 获取第一条
|
||||
Map<String,List<ProjectSection>> conversionMap = sectionList.stream().collect(Collectors.groupingBy(ProjectSection::getProjectId));
|
||||
List<ProjectSectionVO> sectionVOList = new ArrayList<>();
|
||||
for (String key: conversionMap.keySet()) {
|
||||
List<ProjectSection> tempList = conversionMap.get(key);
|
||||
if(!CollectionUtils.isEmpty(tempList)){
|
||||
tempList = tempList.stream().sorted(Comparator.comparing(ProjectSection::getBidSectCode)).collect(Collectors.toList());
|
||||
ProjectSectionVO vo = BeanUtil.toBean(tempList.get(0),ProjectSectionVO.class);
|
||||
vo.setSectionCount(tempList.size());
|
||||
sectionVOList.add(vo);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> sectionIds = sectionVOList.stream().map(ProjectSection::getId).collect(Collectors.toList());
|
||||
if(null != sectionList && !sectionList.isEmpty()){
|
||||
List<ProjectSectionVO> sectionVOList = JsonUtils.jsonToList(sectionList,ProjectSectionVO.class);
|
||||
BaseResponse<Map<String,Long>> response = tenderApi.getRegisterCountByPackage(sectionIds);
|
||||
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(response.getMessage(),!response.isSuccess());
|
||||
Map<String,Long> resultMap = response.getData();
|
||||
|
@ -92,4 +92,7 @@ public class ProjectSectionVO extends ProjectSection implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "所处环节百分比")
|
||||
private BigDecimal linkPercentage;
|
||||
|
||||
@ApiModelProperty(value = "标段总数")
|
||||
private Integer sectionCount;
|
||||
}
|
||||
|
@ -500,7 +500,6 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl<ProjectSectionMap
|
||||
public List<ProjectSection> getListAssembleProjectPage(List<String> projectIds) {
|
||||
LambdaQueryWrapper<ProjectSection> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(ProjectSection::getProjectId,projectIds);
|
||||
queryWrapper.groupBy(ProjectSection::getProjectId).groupBy(ProjectSection::getBidSectCode).having("bid_sect_code <=1");
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user