|
|
@@ -1,7 +1,6 @@
|
|
|
package com.uas.platform.b2b.mobile.controller;
|
|
|
|
|
|
import com.uas.account.support.Page;
|
|
|
-import com.uas.platform.b2b.model.PurchaseInquiry;
|
|
|
import com.uas.platform.b2b.model.PurchaseInquiryItem;
|
|
|
import com.uas.platform.b2b.model.PurchaseInquiryReply;
|
|
|
import com.uas.platform.b2b.model.SearchFilter;
|
|
|
@@ -24,7 +23,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
@@ -81,6 +83,7 @@ public class AppInquiryController {
|
|
|
pageParams.getFilters().put("id_inid", new MultiValue(list, true));
|
|
|
}
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("id_status", true, Sort.Type.LONG, new Long(1)));
|
|
|
sortList.add(new Sort("id_id", false, Sort.Type.LONG, new Long(1)));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
Page<PurchaseInquiryItem> purchaseInquiryItemPage = searchService.searchPurchaseInquiryItemIdsForApp(keyword, pageParams);
|
|
|
@@ -90,6 +93,12 @@ public class AppInquiryController {
|
|
|
} else {
|
|
|
PageInfo pageInfo = new PageInfo(page, size);
|
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ org.springframework.data.domain.Sort.Order statusOrder = new org.springframework.data.domain.Sort.Order(org.springframework.data.domain.Sort.Direction.ASC, "status");
|
|
|
+ org.springframework.data.domain.Sort.Order idOrder = new org.springframework.data.domain.Sort.Order(org.springframework.data.domain.Sort.Direction.DESC, "id");
|
|
|
+ List<org.springframework.data.domain.Sort.Order> orders = new ArrayList<>();
|
|
|
+ orders.add(statusOrder);
|
|
|
+ orders.add(idOrder);
|
|
|
+ pageInfo.setSort(new org.springframework.data.domain.Sort(orders));
|
|
|
SearchFilter filter = new SearchFilter();
|
|
|
SearchFilter distribute = userService.distribute();
|
|
|
if (distribute != null && distribute.getDistribute() == null) {
|
|
|
@@ -457,9 +466,9 @@ public class AppInquiryController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 作为卖家,根据询价单ID查找询价单(含明细)
|
|
|
+ * 作为卖家,根据询价单明细ID查找询价单(含明细)
|
|
|
*
|
|
|
- * @param id 询价单id
|
|
|
+ * @param itemId 询价单明细id
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/{itemId}/info", method = RequestMethod.GET)
|
|
|
@@ -497,9 +506,15 @@ public class AppInquiryController {
|
|
|
private PurchaseInquiryItem toItem(Long inquiryItemId, String replies, Long leadtime, Double minOrderQty, Double minPackQty) {
|
|
|
List<PurchaseInquiryReply> replyList = FlexJsonUtils.fromJsonArray(replies, PurchaseInquiryReply.class);
|
|
|
PurchaseInquiryItem item = purchaseInquiryService.findItemByItemId(inquiryItemId);
|
|
|
- item.setLeadtime(leadtime);
|
|
|
- item.setMinPackQty(minPackQty);
|
|
|
- item.setMinOrderQty(minOrderQty);
|
|
|
+ if (null != leadtime) {
|
|
|
+ item.setLeadtime(leadtime);
|
|
|
+ }
|
|
|
+ if (null != minPackQty) {
|
|
|
+ item.setMinPackQty(minPackQty);
|
|
|
+ }
|
|
|
+ if (null != minOrderQty) {
|
|
|
+ item.setMinOrderQty(minOrderQty);
|
|
|
+ }
|
|
|
HashSet<PurchaseInquiryReply> replyHashSet = new HashSet<>(replyList);
|
|
|
item.setReplies(replyHashSet);
|
|
|
return item;
|