| | |
| | | package cn.iocoder.yudao.module.srm.service.tender; |
| | | |
| | | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.srm.controller.admin.tender.vo.SrmSupplierQuoteSaveReqVO; |
| | | import cn.iocoder.yudao.module.srm.controller.admin.tender.vo.SrmTenderBidSaveReqVO; |
| | | import cn.iocoder.yudao.module.srm.dal.dataobject.SrmSupplierDO; |
| | | import cn.iocoder.yudao.module.srm.dal.dataobject.SrmSupplierQuoteDO; |
| | | import cn.iocoder.yudao.module.srm.dal.dataobject.SrmTenderBidDO; |
| | | import cn.iocoder.yudao.module.srm.dal.dataobject.SrmTenderProjectDO; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmSupplierApplyMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmSupplierMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmSupplierQuoteMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmTenderBidMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmTenderProjectMapper; |
| | |
| | | private SrmTenderProjectMapper tenderProjectMapper; |
| | | |
| | | @Resource |
| | | private SrmSupplierApplyMapper supplierApplyMapper; |
| | | private SrmSupplierMapper supplierMapper; |
| | | |
| | | // ========== 投标管理 ========== |
| | | |
| | |
| | | if (project.getEndTime() != null && LocalDateTime.now().isAfter(project.getEndTime())) { |
| | | throw ServiceExceptionUtil.exception(ErrorCodeConstants.TENDER_END_TIME_PASSED); |
| | | } |
| | | // 校验供应商是否已通过准入审批 |
| | | if (!supplierApplyMapper.existsApprovedBySupplierId(createReqVO.getSupplierId())) { |
| | | throw ServiceExceptionUtil.exception(ErrorCodeConstants.BID_SUPPLIER_NOT_APPROVED); |
| | | // 校验投标供应商存在且未停用(准入状态不限制投标,中标生成采购订单时自动准入) |
| | | SrmSupplierDO supplier = supplierMapper.selectById(createReqVO.getSupplierId()); |
| | | if (supplier == null) { |
| | | throw ServiceExceptionUtil.exception(ErrorCodeConstants.SUPPLIER_NOT_EXISTS); |
| | | } |
| | | if (CommonStatusEnum.isDisable(supplier.getStatus())) { |
| | | throw ServiceExceptionUtil.exception(ErrorCodeConstants.SUPPLIER_NOT_ENABLE, supplier.getName()); |
| | | } |
| | | // 校验投标编号是否重复 |
| | | if (tenderBidMapper.existsByBidNo(createReqVO.getBidNo())) { |