Просмотр исходного кода

客户采购询价报价增加报价判断,报价分段从0开始报价

hejq 7 лет назад
Родитель
Сommit
4b27f847ea

+ 14 - 0
src/main/java/com/uas/platform/b2b/controller/SaleInquiryController.java

@@ -592,6 +592,13 @@ public class SaleInquiryController {
 	public ResponseEntity<String> replyInquiryItem(@RequestBody String json,
 			@PathVariable("inquiryItemId") Long inquiryItemId, String token) {
 		PurchaseInquiryItem item = FlexJsonUtils.fromJson(json, PurchaseInquiryItem.class);
+		if (item.getReplies().size() == 1) {
+            item.getReplies().forEach(reply -> {
+               if (null != reply.getLapQty() && reply.getLapQty() > 0) {
+                   throw new IllegalOperatorException("报价分段数量格式不正确,请从0开始报价");
+               }
+            });
+        }
 		boolean flag = tokenService.enabled(token);
 		if (flag) {
 			item = purchaseInquiryService.reply(item);
@@ -614,6 +621,13 @@ public class SaleInquiryController {
 	public ResponseEntity<String> saveInquiryItem(@RequestBody String json,
 			@PathVariable("inquiryItemId") Long inquiryItemId, String token) {
 		PurchaseInquiryItem item = FlexJsonUtils.fromJson(json, PurchaseInquiryItem.class);
+        if (item.getReplies().size() == 1) {
+            item.getReplies().forEach(reply -> {
+                if (null != reply.getLapQty() && reply.getLapQty() > 0) {
+                    throw new IllegalOperatorException("报价分段数量格式不正确,请从0开始报价");
+                }
+            });
+        }
 		boolean flag = tokenService.enabled(token);
 		if (flag) {
 			item = purchaseInquiryService.save(item);