| | |
| | | package cn.iocoder.yudao.module.srm.controller.admin.tender; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.srm.controller.admin.tender.vo.*; |
| | | import cn.iocoder.yudao.module.srm.dal.dataobject.SrmSupplierDO; |
| | | import cn.iocoder.yudao.module.srm.service.supplier.SrmSupplierService; |
| | | import cn.iocoder.yudao.module.srm.service.tender.SrmBidEvaluationService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| | | |
| | |
| | | @Resource |
| | | private SrmBidEvaluationService bidEvaluationService; |
| | | |
| | | @Resource |
| | | private SrmSupplierService supplierService; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建评标记录") |
| | | @PreAuthorize("@ss.hasPermission('srm:bid-evaluation:create')") |
| | |
| | | @Operation(summary = "按招标项目获取评标列表") |
| | | @PreAuthorize("@ss.hasPermission('srm:bid-evaluation:query')") |
| | | public CommonResult<List<SrmBidEvaluationRespVO>> getEvaluationList(@RequestParam("tenderProjectId") Long tenderProjectId) { |
| | | return success(BeanUtils.toBean(bidEvaluationService.getEvaluationList(tenderProjectId), SrmBidEvaluationRespVO.class)); |
| | | List<SrmBidEvaluationRespVO> list = BeanUtils.toBean(bidEvaluationService.getEvaluationList(tenderProjectId), SrmBidEvaluationRespVO.class); |
| | | enrichEvaluationSupplierNames(list); |
| | | return success(list); |
| | | } |
| | | |
| | | private void enrichEvaluationSupplierNames(List<SrmBidEvaluationRespVO> list) { |
| | | if (list == null || list.isEmpty()) return; |
| | | Set<Long> supplierIds = CollectionUtils.convertSet(list, SrmBidEvaluationRespVO::getSupplierId); |
| | | Map<Long, SrmSupplierDO> supplierMap = supplierService.getSupplierMap(supplierIds); |
| | | list.forEach(vo -> { |
| | | SrmSupplierDO supplier = supplierMap.get(vo.getSupplierId()); |
| | | if (supplier != null) { |
| | | vo.setSupplierName(supplier.getName()); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @PutMapping("/calculate-ranking") |