|
|
@@ -17,6 +17,7 @@ import com.uas.platform.b2b.service.KindService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.core.persistence.criteria.PredicateFactory;
|
|
|
import com.uas.platform.core.persistence.criteria.PredicateUtils;
|
|
|
+import com.uas.search.b2b.exception.SearchException;
|
|
|
import com.uas.search.b2b.model.PageParams;
|
|
|
import com.uas.search.b2b.model.SPage;
|
|
|
import com.uas.search.b2b.service.SearchService.Table_name;
|
|
|
@@ -1446,10 +1447,14 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<PurchaseInquiryItem> searchPurchaseInquiryItemIdsForApp(String keyword, PageParams pageParams) {
|
|
|
- SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$INQUIRYITEMS, pageParams);
|
|
|
- List<PurchaseInquiryItem> content = purchaseInquiryItemDao.findAll(idsPage.getContent());
|
|
|
- sortByProperty(content, PurchaseInquiryItem.class, "id", idsPage.getContent());
|
|
|
- return toPage(idsPage, content);
|
|
|
+ try {
|
|
|
+ SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$INQUIRYITEMS, pageParams);
|
|
|
+ List<PurchaseInquiryItem> content = purchaseInquiryItemDao.findAll(idsPage.getContent());
|
|
|
+ sortByProperty(content, PurchaseInquiryItem.class, "id", idsPage.getContent());
|
|
|
+ return toPage(idsPage, content);
|
|
|
+ } catch (SearchException e) {
|
|
|
+ return new Page<PurchaseInquiryItem>(pageParams.getPage(), pageParams.getSize(), new ArrayList<PurchaseInquiryItem>(), 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1476,10 +1481,14 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<PurchaseOrderAll> searchPurchaseOrderIdsForApp(String keyword, PageParams pageParams) {
|
|
|
- SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
- List<PurchaseOrderAll> content = purchaseOrderAllDao.findAll(idsPage.getContent());
|
|
|
- sortByProperty(content, PurchaseOrderAll.class, "id", idsPage.getContent());
|
|
|
- return toPage(idsPage, content);
|
|
|
+ try {
|
|
|
+ SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
+ List<PurchaseOrderAll> content = purchaseOrderAllDao.findAll(idsPage.getContent());
|
|
|
+ sortByProperty(content, PurchaseOrderAll.class, "id", idsPage.getContent());
|
|
|
+ return toPage(idsPage, content);
|
|
|
+ } catch (SearchException e) {
|
|
|
+ return new Page<PurchaseOrderAll>(pageParams.getPage(), pageParams.getSize(), new ArrayList<PurchaseOrderAll>(), 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1491,10 +1500,14 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<PurchaseOrderTodo> searchPurchaseTodoOrderIdsForApp(String keyword, PageParams pageParams) {
|
|
|
- SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
- List<PurchaseOrderTodo> content = purchaseOrderTodoDao.findAll(idsPage.getContent());
|
|
|
- sortByProperty(content, PurchaseOrderTodo.class, "id", idsPage.getContent());
|
|
|
- return toPage(idsPage, content);
|
|
|
+ try {
|
|
|
+ SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
+ List<PurchaseOrderTodo> content = purchaseOrderTodoDao.findAll(idsPage.getContent());
|
|
|
+ sortByProperty(content, PurchaseOrderTodo.class, "id", idsPage.getContent());
|
|
|
+ return toPage(idsPage, content);
|
|
|
+ } catch (SearchException e) {
|
|
|
+ return new Page<PurchaseOrderTodo>(pageParams.getPage(), pageParams.getSize(), new ArrayList<PurchaseOrderTodo>(), 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1506,10 +1519,14 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<PurchaseOrderDone> searchPurchaseDoneOrderIdsForApp(String keyword, PageParams pageParams) {
|
|
|
- SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
- List<PurchaseOrderDone> content = purchaseOrderDoneDao.findAll(idsPage.getContent());
|
|
|
- sortByProperty(content, PurchaseOrderDone.class, "id", idsPage.getContent());
|
|
|
- return toPage(idsPage, content);
|
|
|
+ try {
|
|
|
+ SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
+ List<PurchaseOrderDone> content = purchaseOrderDoneDao.findAll(idsPage.getContent());
|
|
|
+ sortByProperty(content, PurchaseOrderDone.class, "id", idsPage.getContent());
|
|
|
+ return toPage(idsPage, content);
|
|
|
+ } catch (SearchException e) {
|
|
|
+ return new Page<PurchaseOrderDone>(pageParams.getPage(), pageParams.getSize(), new ArrayList<PurchaseOrderDone>(), 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1521,10 +1538,14 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<PurchaseOrderWaiting> searchPurchaseWaitingOrderIdsForApp(String keyword, PageParams pageParams) {
|
|
|
- SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
- List<PurchaseOrderWaiting> content = purchaseOrderWaitingDao.findAll(idsPage.getContent());
|
|
|
- sortByProperty(content, PurchaseOrderWaiting.class, "id", idsPage.getContent());
|
|
|
- return toPage(idsPage, content);
|
|
|
+ try {
|
|
|
+ SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
+ List<PurchaseOrderWaiting> content = purchaseOrderWaitingDao.findAll(idsPage.getContent());
|
|
|
+ sortByProperty(content, PurchaseOrderWaiting.class, "id", idsPage.getContent());
|
|
|
+ return toPage(idsPage, content);
|
|
|
+ } catch (SearchException e) {
|
|
|
+ return new Page<PurchaseOrderWaiting>(pageParams.getPage(), pageParams.getSize(), new ArrayList<PurchaseOrderWaiting>(), 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1536,10 +1557,14 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<PurchaseOrderReceived> searchPurchaseReceivedOrderIdsForApp(String keyword, PageParams pageParams) {
|
|
|
- SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
- List<PurchaseOrderReceived> content = purchaseOrderReceivedDao.findAll(idsPage.getContent());
|
|
|
- sortByProperty(content, PurchaseOrderReceived.class, "id", idsPage.getContent());
|
|
|
- return toPage(idsPage, content);
|
|
|
+ try {
|
|
|
+ SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
+ List<PurchaseOrderReceived> content = purchaseOrderReceivedDao.findAll(idsPage.getContent());
|
|
|
+ sortByProperty(content, PurchaseOrderReceived.class, "id", idsPage.getContent());
|
|
|
+ return toPage(idsPage, content);
|
|
|
+ } catch (SearchException e) {
|
|
|
+ return new Page<PurchaseOrderReceived>(pageParams.getPage(), pageParams.getSize(), new ArrayList<PurchaseOrderReceived>(), 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1551,9 +1576,13 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<PurchaseOrderEnd> searchPurchaseEndOrderIdsForApp(String keyword, PageParams pageParams) {
|
|
|
- SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
- List<PurchaseOrderEnd> content = purchaseOrderEndDao.findAll(idsPage.getContent());
|
|
|
- sortByProperty(content, PurchaseOrderEnd.class, "id", idsPage.getContent());
|
|
|
- return toPage(idsPage, content);
|
|
|
+ try {
|
|
|
+ SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
|
|
|
+ List<PurchaseOrderEnd> content = purchaseOrderEndDao.findAll(idsPage.getContent());
|
|
|
+ sortByProperty(content, PurchaseOrderEnd.class, "id", idsPage.getContent());
|
|
|
+ return toPage(idsPage, content);
|
|
|
+ } catch (SearchException e) {
|
|
|
+ return new Page<PurchaseOrderEnd>(pageParams.getPage(), pageParams.getSize(), new ArrayList<PurchaseOrderEnd>(), 0);
|
|
|
+ }
|
|
|
}
|
|
|
}
|