修改分标策划、招标计划新增接口
This commit is contained in:
@ -105,4 +105,6 @@ public interface IBusBillofquantitiesLimitListService extends IService<BusBillof
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
BusBLimitListVersionsVo getVersionDetail(Long versions);
|
BusBLimitListVersionsVo getVersionDetail(Long versions);
|
||||||
|
|
||||||
|
BusBillofquantitiesLimitListVo queryBySId(String pid);
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,6 @@ package org.dromara.tender.service.impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
|
||||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
|
||||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
|
||||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
@ -16,11 +12,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.oss.core.OssClient;
|
|
||||||
import org.dromara.common.oss.factory.OssFactory;
|
|
||||||
import org.dromara.design.domain.BusBillofquantities;
|
|
||||||
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
|
||||||
import org.dromara.formalities.domain.BusFormalitiesAnnex;
|
|
||||||
import org.dromara.system.domain.vo.SysOssUploadVo;
|
import org.dromara.system.domain.vo.SysOssUploadVo;
|
||||||
import org.dromara.system.service.ISysOssService;
|
import org.dromara.system.service.ISysOssService;
|
||||||
import org.dromara.tender.domain.*;
|
import org.dromara.tender.domain.*;
|
||||||
@ -34,7 +25,6 @@ import org.dromara.tender.service.IBusBiddingPlanAnnexService;
|
|||||||
import org.dromara.tender.service.IBusBillofquantitiesLimitListService;
|
import org.dromara.tender.service.IBusBillofquantitiesLimitListService;
|
||||||
import org.dromara.tender.service.ITenderSupplierInputService;
|
import org.dromara.tender.service.ITenderSupplierInputService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.event.EventListener;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.tender.domain.bo.BusBiddingPlanBo;
|
import org.dromara.tender.domain.bo.BusBiddingPlanBo;
|
||||||
import org.dromara.tender.domain.vo.BusBiddingPlanVo;
|
import org.dromara.tender.domain.vo.BusBiddingPlanVo;
|
||||||
@ -148,7 +138,7 @@ public class BusBiddingPlanServiceImpl extends ServiceImpl<BusBiddingPlanMapper,
|
|||||||
bo.setId(add.getId());
|
bo.setId(add.getId());
|
||||||
if (bo.getLimitListBos() != null && !bo.getLimitListBos().isEmpty()) {
|
if (bo.getLimitListBos() != null && !bo.getLimitListBos().isEmpty()) {
|
||||||
//生成分标策划-限价一览对象集合
|
//生成分标策划-限价一览对象集合
|
||||||
List<BusTenderPlanningLimitList> planningLimitListList = new ArrayList<>();
|
Set<BusTenderPlanningLimitList> planningLimitListList = new HashSet<>();
|
||||||
for (BusTenderPlanningLimitListBo limitListBo : bo.getLimitListBos()) {
|
for (BusTenderPlanningLimitListBo limitListBo : bo.getLimitListBos()) {
|
||||||
BusTenderPlanningLimitList busTenderPlanningLimitList = new BusTenderPlanningLimitList();
|
BusTenderPlanningLimitList busTenderPlanningLimitList = new BusTenderPlanningLimitList();
|
||||||
busTenderPlanningLimitList.setLimitListId(limitListBo.getLimitListId());
|
busTenderPlanningLimitList.setLimitListId(limitListBo.getLimitListId());
|
||||||
@ -167,6 +157,7 @@ public class BusBiddingPlanServiceImpl extends ServiceImpl<BusBiddingPlanMapper,
|
|||||||
}
|
}
|
||||||
busTenderPlanningLimitList.setNum(limitListBo.getNum());
|
busTenderPlanningLimitList.setNum(limitListBo.getNum());
|
||||||
planningLimitListList.add(busTenderPlanningLimitList);
|
planningLimitListList.add(busTenderPlanningLimitList);
|
||||||
|
getPidVO(busBillofquantitiesLimitListVo.getPid(),planningLimitListList,bo.getId());
|
||||||
}
|
}
|
||||||
add.setPlannedBiddingMethod(price.compareTo(BigDecimal.valueOf(10000000)) > 0 ? "公招":"邀标");
|
add.setPlannedBiddingMethod(price.compareTo(BigDecimal.valueOf(10000000)) > 0 ? "公招":"邀标");
|
||||||
add.setPrice(price);
|
add.setPrice(price);
|
||||||
@ -391,4 +382,34 @@ public class BusBiddingPlanServiceImpl extends ServiceImpl<BusBiddingPlanMapper,
|
|||||||
|
|
||||||
return children;
|
return children;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Set<BusTenderPlanningLimitList> getPidVO(String pId, Set<BusTenderPlanningLimitList> planningLimitListList, Long id) {
|
||||||
|
// 终止条件:pId 为 null 或等于 "0",表示已到达根节点
|
||||||
|
if (pId == null || Objects.equals(pId, "0")) {
|
||||||
|
return planningLimitListList;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 查询当前节点的 VO
|
||||||
|
BusBillofquantitiesLimitListVo vo = busBillofquantitiesLimitListService.queryBySId(pId);
|
||||||
|
if (vo == null) {
|
||||||
|
return planningLimitListList; // 当前节点不存在,直接返回已有集合
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建关联对象并添加到集合
|
||||||
|
BusTenderPlanningLimitList tenderPlanningLimitList = new BusTenderPlanningLimitList();
|
||||||
|
tenderPlanningLimitList.setBiddingPlanId(id);
|
||||||
|
tenderPlanningLimitList.setLimitListId(vo.getId());
|
||||||
|
planningLimitListList.add(tenderPlanningLimitList);
|
||||||
|
|
||||||
|
// 递归处理父节点
|
||||||
|
return getPidVO(vo.getPid(), planningLimitListList, id);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 异常处理(可选)
|
||||||
|
log.error("Error while getting parent nodes: ", e);
|
||||||
|
return planningLimitListList;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -267,15 +267,9 @@ public class BusBillofquantitiesLimitListServiceImpl extends ServiceImpl<BusBill
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BusBillofquantitiesLimitListVo> getListByIds(List<Long> ids) {
|
public List<BusBillofquantitiesLimitListVo> getListByIds(List<Long> ids) {
|
||||||
List<BusBillofquantitiesLimitList> limitListList = baseMapper.selectBatchIds(ids);
|
List<BusBillofquantitiesLimitListVo> listVoList = baseMapper.selectVoList(new LambdaQueryWrapper<BusBillofquantitiesLimitList>()
|
||||||
List<String> sids = new ArrayList<>();
|
.in(BusBillofquantitiesLimitList::getId, ids)
|
||||||
limitListList.forEach(item -> {
|
.orderByAsc(BusBillofquantitiesLimitList::getSid));
|
||||||
sids.add(item.getSid());
|
|
||||||
});
|
|
||||||
if (sids.isEmpty()) {
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
List<BusBillofquantitiesLimitListVo> listVoList = baseMapper.selectListBySids(sids);
|
|
||||||
|
|
||||||
return listVoList;
|
return listVoList;
|
||||||
}
|
}
|
||||||
@ -285,6 +279,11 @@ public class BusBillofquantitiesLimitListServiceImpl extends ServiceImpl<BusBill
|
|||||||
return busBLimitListVersionsService.queryById(id);
|
return busBLimitListVersionsService.queryById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusBillofquantitiesLimitListVo queryBySId(String pid) {
|
||||||
|
return baseMapper.selectVoOne(new LambdaQueryWrapper<BusBillofquantitiesLimitList>().eq(BusBillofquantitiesLimitList::getSid, pid));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 递归构建树形结构
|
* 递归构建树形结构
|
||||||
*
|
*
|
||||||
|
@ -4,19 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
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.dromara.common.translation.annotation.Translation;
|
|
||||||
import org.dromara.tender.domain.BusBillofquantitiesLimitList;
|
|
||||||
import org.dromara.tender.domain.BusIndicatorPlanningLimitList;
|
import org.dromara.tender.domain.BusIndicatorPlanningLimitList;
|
||||||
import org.dromara.tender.domain.BusSegmentedIndicatorPlanning;
|
import org.dromara.tender.domain.BusSegmentedIndicatorPlanning;
|
||||||
import org.dromara.tender.domain.bo.BusIndicatorPlanningLimitListBo;
|
import org.dromara.tender.domain.bo.BusIndicatorPlanningLimitListBo;
|
||||||
@ -29,11 +23,6 @@ import org.dromara.tender.service.IBusBillofquantitiesLimitListService;
|
|||||||
import org.dromara.tender.service.IBusSegmentedIndicatorPlanningService;
|
import org.dromara.tender.service.IBusSegmentedIndicatorPlanningService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.tender.domain.bo.BusSegmentedIndicatorPlanningBo;
|
|
||||||
import org.dromara.tender.domain.vo.BusSegmentedIndicatorPlanningVo;
|
|
||||||
import org.dromara.tender.domain.BusSegmentedIndicatorPlanning;
|
|
||||||
import org.dromara.tender.mapper.BusSegmentedIndicatorPlanningMapper;
|
|
||||||
import org.dromara.tender.service.IBusSegmentedIndicatorPlanningService;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -124,7 +113,7 @@ public class BusSegmentedIndicatorPlanningServiceImpl extends ServiceImpl<BusSeg
|
|||||||
bo.setId(add.getId());
|
bo.setId(add.getId());
|
||||||
if (bo.getLimitListBos() != null && !bo.getLimitListBos().isEmpty()) {
|
if (bo.getLimitListBos() != null && !bo.getLimitListBos().isEmpty()) {
|
||||||
//生成分标策划-限价一览对象集合
|
//生成分标策划-限价一览对象集合
|
||||||
List<BusIndicatorPlanningLimitList> planningLimitListList = new ArrayList<>();
|
Set<BusIndicatorPlanningLimitList> planningLimitListList = new HashSet<>();
|
||||||
for (BusIndicatorPlanningLimitListBo limitListBo : bo.getLimitListBos()) {
|
for (BusIndicatorPlanningLimitListBo limitListBo : bo.getLimitListBos()) {
|
||||||
BusIndicatorPlanningLimitList busIndicatorPlanningLimitList = new BusIndicatorPlanningLimitList();
|
BusIndicatorPlanningLimitList busIndicatorPlanningLimitList = new BusIndicatorPlanningLimitList();
|
||||||
busIndicatorPlanningLimitList.setLimitListId(limitListBo.getLimitListId());
|
busIndicatorPlanningLimitList.setLimitListId(limitListBo.getLimitListId());
|
||||||
@ -139,6 +128,7 @@ public class BusSegmentedIndicatorPlanningServiceImpl extends ServiceImpl<BusSeg
|
|||||||
}
|
}
|
||||||
busIndicatorPlanningLimitList.setNum(limitListBo.getNum());
|
busIndicatorPlanningLimitList.setNum(limitListBo.getNum());
|
||||||
planningLimitListList.add(busIndicatorPlanningLimitList);
|
planningLimitListList.add(busIndicatorPlanningLimitList);
|
||||||
|
getPidVO(busBillofquantitiesLimitListVo.getPid(),planningLimitListList,bo.getId());
|
||||||
if (busBillofquantitiesLimitListVo.getUnitPrice() != null && limitListBo.getNum() != null){
|
if (busBillofquantitiesLimitListVo.getUnitPrice() != null && limitListBo.getNum() != null){
|
||||||
price = price.add(busBillofquantitiesLimitListVo.getUnitPrice().multiply(limitListBo.getNum()).setScale(2, RoundingMode.HALF_UP));
|
price = price.add(busBillofquantitiesLimitListVo.getUnitPrice().multiply(limitListBo.getNum()).setScale(2, RoundingMode.HALF_UP));
|
||||||
}
|
}
|
||||||
@ -296,4 +286,33 @@ public class BusSegmentedIndicatorPlanningServiceImpl extends ServiceImpl<BusSeg
|
|||||||
|
|
||||||
return children;
|
return children;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Set<BusIndicatorPlanningLimitList> getPidVO(String pId, Set<BusIndicatorPlanningLimitList> planningLimitListList, Long id) {
|
||||||
|
// 终止条件:pId 为 null 或等于 "0",表示已到达根节点
|
||||||
|
if (pId == null || Objects.equals(pId, "0")) {
|
||||||
|
return planningLimitListList;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 查询当前节点的 VO
|
||||||
|
BusBillofquantitiesLimitListVo vo = busBillofquantitiesLimitListService.queryBySId(pId);
|
||||||
|
if (vo == null) {
|
||||||
|
return planningLimitListList; // 当前节点不存在,直接返回已有集合
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建关联对象并添加到集合
|
||||||
|
BusIndicatorPlanningLimitList busIndicatorPlanningLimitList = new BusIndicatorPlanningLimitList();
|
||||||
|
busIndicatorPlanningLimitList.setSegmentedIndicatorId(id);
|
||||||
|
busIndicatorPlanningLimitList.setLimitListId(vo.getId());
|
||||||
|
planningLimitListList.add(busIndicatorPlanningLimitList);
|
||||||
|
|
||||||
|
// 递归处理父节点
|
||||||
|
return getPidVO(vo.getPid(), planningLimitListList, id);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 异常处理(可选)
|
||||||
|
log.error("Error while getting parent nodes: ", e);
|
||||||
|
return planningLimitListList;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user