Commit 4c3addbf2a01773366af252fe87ac18af7c76fad

Authored by 房远帅
1 parent e452e93b

采购-报价管理:已成交的不允许再报价

@@ -130,7 +130,7 @@ public class SalesmanQuotationController extends DefaultBaseController { @@ -130,7 +130,7 @@ public class SalesmanQuotationController extends DefaultBaseController {
130 /** 130 /**
131 * 成交/终止 131 * 成交/终止
132 */ 132 */
133 - @ApiOperation("完成/终止") 133 + @ApiOperation("成交/终止")
134 @PostMapping("/updateStatus") 134 @PostMapping("/updateStatus")
135 public InvokeResult<Void> updateStatus(@NotBlank(message = "id不能为空!") String id, 135 public InvokeResult<Void> updateStatus(@NotBlank(message = "id不能为空!") String id,
136 @NotBlank(message = "状态不能为空!") String status) { 136 @NotBlank(message = "状态不能为空!") String status) {
@@ -104,6 +104,7 @@ public class SupplierQuotationProjectQuoteServiceImpl @@ -104,6 +104,7 @@ public class SupplierQuotationProjectQuoteServiceImpl
104 data.setBidStatus(null); 104 data.setBidStatus(null);
105 getBaseMapper().insert(data); 105 getBaseMapper().insert(data);
106 } else { 106 } else {
  107 + validateQuoteCanRequote(exist.getBidStatus());
107 LambdaUpdateWrapper<SupplierQuotationProjectQuote> updateWrapper = Wrappers.lambdaUpdate(SupplierQuotationProjectQuote.class) 108 LambdaUpdateWrapper<SupplierQuotationProjectQuote> updateWrapper = Wrappers.lambdaUpdate(SupplierQuotationProjectQuote.class)
108 .set(SupplierQuotationProjectQuote::getSupplierName, currentUser.getName()) 109 .set(SupplierQuotationProjectQuote::getSupplierName, currentUser.getName())
109 .set(SupplierQuotationProjectQuote::getQuoteTime, now) 110 .set(SupplierQuotationProjectQuote::getQuoteTime, now)
@@ -217,6 +218,21 @@ public class SupplierQuotationProjectQuoteServiceImpl @@ -217,6 +218,21 @@ public class SupplierQuotationProjectQuoteServiceImpl
217 } 218 }
218 } 219 }
219 220
  221 + private void validateQuoteCanRequote(String bidStatus) {
  222 + if (StringUtils.isBlank(bidStatus)) {
  223 + return;
  224 + }
  225 + if (BID_STATUS_WIN.equalsIgnoreCase(bidStatus)) {
  226 + throw new DefaultClientException("该报价已中标,不允许再次报价!");
  227 + }
  228 + if (BID_STATUS_LOSE.equalsIgnoreCase(bidStatus)) {
  229 + throw new DefaultClientException("该报价已未中标,不允许再次报价!");
  230 + }
  231 + if (BID_STATUS_ABORT.equalsIgnoreCase(bidStatus)) {
  232 + throw new DefaultClientException("该报价已废标,不允许再次报价!");
  233 + }
  234 + }
  235 +
220 private void validateProduct(String productId) { 236 private void validateProduct(String productId) {
221 BreedRelationship breedRelationship = breedRelationshipService.findById(productId); 237 BreedRelationship breedRelationship = breedRelationshipService.findById(productId);
222 if (breedRelationship == null) { 238 if (breedRelationship == null) {