|
|
@@ -1,11 +1,15 @@
|
|
|
package com.uas.platform.b2b.service.impl;
|
|
|
|
|
|
-import com.uas.platform.b2b.dao.PagingReleaseCountDao;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.uas.platform.b2b.dao.EnterpriseDao;
|
|
|
import com.uas.platform.b2b.dao.SaleARCheckDao;
|
|
|
import com.uas.platform.b2b.dao.SaleARCheckItemDao;
|
|
|
import com.uas.platform.b2b.dao.SaleARCheckReplyDao;
|
|
|
+import com.uas.platform.b2b.model.Enterprise;
|
|
|
import com.uas.platform.b2b.model.OrderRedDotAll;
|
|
|
import com.uas.platform.b2b.model.OrderType;
|
|
|
+import com.uas.platform.b2b.model.PurchaseApCheck;
|
|
|
import com.uas.platform.b2b.model.SaleARCheck;
|
|
|
import com.uas.platform.b2b.model.SaleARCheckItem;
|
|
|
import com.uas.platform.b2b.model.SaleARCheckReply;
|
|
|
@@ -19,6 +23,9 @@ import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.Status;
|
|
|
import com.uas.platform.core.persistence.criteria.PredicateUtils;
|
|
|
import com.uas.search.b2b.model.PageParams;
|
|
|
+import com.uas.search.b2b.model.SPage;
|
|
|
+import com.uas.search.b2b.model.Sort;
|
|
|
+import com.uas.search.b2b.util.SearchConstants;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
@@ -58,10 +65,10 @@ public class SaleARCheckServiceImpl implements SaleARCheckService {
|
|
|
private SearchService searchService;
|
|
|
|
|
|
@Autowired
|
|
|
- private PagingReleaseCountDao pagingReleaseCountDao;
|
|
|
+ private OrderRedDotService redDotService;
|
|
|
|
|
|
@Autowired
|
|
|
- private OrderRedDotService redDotService;
|
|
|
+ private EnterpriseDao enterpriseDao;
|
|
|
|
|
|
@Override
|
|
|
public void save(List<SaleARCheckItem> checkItems) {
|
|
|
@@ -237,16 +244,32 @@ public class SaleARCheckServiceImpl implements SaleARCheckService {
|
|
|
return saleARCheckDao.countByVendUU(SystemSession.getUser().getEnterprise().getUu());
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public long getCountByenUUAndStatus() {
|
|
|
- return saleARCheckDao.getCountByenUUAndStatus(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
- (short) Status.NOT_REPLY.value());
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Integer getArCheckUnreadCount() {
|
|
|
- return pagingReleaseCountDao.getUnreadCount(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
- SystemSession.getUser().getUserUU(), "purc", "SALE$ARCHECK");
|
|
|
- }
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 作为买家,获取应付对账单(全部)
|
|
|
+ *
|
|
|
+ * @param params 分页参数
|
|
|
+ * @param searchFilter 过滤条件
|
|
|
+ * @return 搜索结果
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public SPage<PurchaseApCheck> getApCheck(com.uas.platform.core.model.PageParams params, String searchFilter) {
|
|
|
+ JSONObject jsonObject = JSON.parseObject(searchFilter);
|
|
|
+ String keyword = null;
|
|
|
+ if (jsonObject != null) {
|
|
|
+ keyword = jsonObject.getString("keyword");
|
|
|
+ }
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
+ // 当前登录企业作为买家
|
|
|
+ pageParams.getFilters().put("pa_custuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ // 排序条件
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("pa_id", false, Sort.Type.INT, 1));
|
|
|
+ pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+ SPage<PurchaseApCheck> sPage = searchService.searchPurchaseApCheckIds(keyword, pageParams);
|
|
|
+ sPage.getContent().forEach(apCheck -> {
|
|
|
+ Enterprise enterprise = enterpriseDao.findOne(apCheck.getEnUu());
|
|
|
+ apCheck.setVendorName(enterprise.getEnName());
|
|
|
+ });
|
|
|
+ return sPage;
|
|
|
+ }
|
|
|
}
|