| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | |
| | | // ========== 报价管理 ========== |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @LogRecord(type = LOG_QUOTE_TYPE, subType = LOG_QUOTE_CREATE_SUB_TYPE, |
| | | bizNo = "{{#createReqVO.bidId}}", success = LOG_QUOTE_CREATE_SUCCESS) |
| | | public Long createQuote(SrmSupplierQuoteSaveReqVO createReqVO) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateQuote(SrmSupplierQuoteSaveReqVO updateReqVO) { |
| | | // 校验投标状态(撤标后不允许报价) |
| | | SrmTenderBidDO bid = validateBidNotWithdrawn(updateReqVO.getBidId()); |
| | |
| | | return supplierQuoteMapper.selectListByBidId(bidId); |
| | | } |
| | | |
| | | // ========== 投标总金额(人工维护,可自动带出报价合计后调整) ========== |
| | | |
| | | @Override |
| | | public void updateBidTotal(Long bidId, BigDecimal bidTotalAmount) { |
| | | // 校验投标状态(撤标后不允许修改) |
| | | SrmTenderBidDO bid = validateBidNotWithdrawn(bidId); |
| | | // 校验招标项目状态:仅允许维护报价的招标状态下可修改 |
| | | SrmTenderProjectDO project = tenderProjectMapper.selectById(bid.getTenderProjectId()); |
| | | if (project == null || !TenderStatusEnum.canCreateOrUpdateQuote(project.getTenderStatus())) { |
| | | throw ServiceExceptionUtil.exception(ErrorCodeConstants.TENDER_QUOTE_FORBIDDEN); |
| | | } |
| | | // 仅在传入非 null 时更新(MyBatis-Plus updateById 会忽略 null 字段,null 视为不改) |
| | | if (bidTotalAmount != null) { |
| | | bid.setBidTotalAmount(bidTotalAmount); |
| | | tenderBidMapper.updateById(bid); |
| | | } |
| | | } |
| | | |
| | | // ========== 校验方法 ========== |
| | | |
| | | private SrmTenderBidDO validateBidExists(Long id) { |