|
|
@@ -1,17 +1,18 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
+import com.alibaba.dubbo.common.utils.StringUtils;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2b.model.FileUpload;
|
|
|
import com.uas.platform.b2b.model.PurchaseTenderAnswer;
|
|
|
import com.uas.platform.b2b.model.SaleTenderQuestion;
|
|
|
import com.uas.platform.b2b.model.SearchFilter;
|
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
|
-import com.uas.platform.b2b.service.AttachService;
|
|
|
import com.uas.platform.b2b.service.PurchaseTenderService;
|
|
|
import com.uas.platform.b2b.service.UserService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.b2b.support.UsageBufferedLogger;
|
|
|
import com.uas.platform.core.logging.BufferedLoggerManager;
|
|
|
+import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
import com.uas.platform.core.model.Status;
|
|
|
import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
@@ -42,9 +43,6 @@ public class SaleTenderQuestionController {
|
|
|
@Autowired
|
|
|
private SearchService searchService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private AttachService attachService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private UserService userService;
|
|
|
|
|
|
@@ -118,19 +116,23 @@ public class SaleTenderQuestionController {
|
|
|
if (logger != null) {
|
|
|
logger.log("招标提问单", "查看发出的招标提问(全部)");
|
|
|
}
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
- String keyword = jsonObject.getString("keyword");
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ if (StringUtils.isEmpty(filter.getKeyword())) {
|
|
|
+ pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ return purchaseTenderService.findByPageInfo(pageInfo, filter);
|
|
|
+ }
|
|
|
com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
// 判断当前用户是否被客户分配
|
|
|
- SearchFilter filter = userService.distribute();
|
|
|
- if (filter != null && filter.getDistribute() == null) {
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
|
}
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("stq_id", false, Sort.Type.LONG, 1L));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("stq_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- return searchService.searchSaleTenderQuestion(keyword, pageParams);
|
|
|
+ return searchService.searchSaleTenderQuestion(filter.getKeyword(), pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -145,12 +147,17 @@ public class SaleTenderQuestionController {
|
|
|
if (logger != null) {
|
|
|
logger.log("招标提问单", "查看发出的招标提问(已回复)");
|
|
|
}
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
- String keyword = jsonObject.getString("keyword");
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ if (StringUtils.isEmpty(filter.getKeyword())) {
|
|
|
+ pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ pageInfo.filter("status", Status.REPLIED.value());
|
|
|
+ return purchaseTenderService.findByPageInfo(pageInfo, filter);
|
|
|
+ }
|
|
|
com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
// 判断当前用户是否被客户分配
|
|
|
- SearchFilter filter = userService.distribute();
|
|
|
- if (filter != null && filter.getDistribute() == null) {
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
|
}
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
@@ -158,7 +165,7 @@ public class SaleTenderQuestionController {
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("stq_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageParams.getFilters().put("stq_status", Status.REPLIED.value());
|
|
|
- return searchService.searchSaleTenderQuestion(keyword, pageParams);
|
|
|
+ return searchService.searchSaleTenderQuestion(filter.getKeyword(), pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -173,12 +180,17 @@ public class SaleTenderQuestionController {
|
|
|
if (logger != null) {
|
|
|
logger.log("招标提问单", "查看发出的招标提问(未回复)");
|
|
|
}
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
- String keyword = jsonObject.getString("keyword");
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ if (StringUtils.isEmpty(filter.getKeyword())) {
|
|
|
+ pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ pageInfo.filter("satatus", Status.NOT_REPLY.value());
|
|
|
+ return purchaseTenderService.findByPageInfo(pageInfo, filter);
|
|
|
+ }
|
|
|
com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
// 判断当前用户是否被客户分配
|
|
|
- SearchFilter filter = userService.distribute();
|
|
|
- if (filter != null && filter.getDistribute() == null) {
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
|
}
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
@@ -186,7 +198,7 @@ public class SaleTenderQuestionController {
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("stq_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageParams.getFilters().put("stq_status", Status.NOT_REPLY.value());
|
|
|
- return searchService.searchSaleTenderQuestion(keyword, pageParams);
|
|
|
+ return searchService.searchSaleTenderQuestion(filter.getKeyword(), pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -201,19 +213,23 @@ public class SaleTenderQuestionController {
|
|
|
if (logger != null) {
|
|
|
logger.log("招标提问单", "查看收到的招标提问(全部)");
|
|
|
}
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
- String keyword = jsonObject.getString("keyword");
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ if (StringUtils.isEmpty(filter.getKeyword())) {
|
|
|
+ pageInfo.filter("saleTender.enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ return purchaseTenderService.findByPageInfo(pageInfo, filter);
|
|
|
+ }
|
|
|
com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
// 判断当前用户是否被客户分配
|
|
|
- SearchFilter filter = userService.distribute();
|
|
|
- if (filter != null && filter.getDistribute() == null) {
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
|
}
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("stq_id", false, Sort.Type.LONG, 1L));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("stq_ptaid", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- return searchService.searchSaleTenderQuestion(keyword, pageParams);
|
|
|
+ return searchService.searchSaleTenderQuestion(filter.getKeyword(), pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -228,19 +244,24 @@ public class SaleTenderQuestionController {
|
|
|
if (logger != null) {
|
|
|
logger.log("招标提问单", "查看收到的招标提问(已回复)");
|
|
|
}
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
- String keyword = jsonObject.getString("keyword");
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ if (StringUtils.isEmpty(filter.getKeyword())) {
|
|
|
+ pageInfo.filter("saleTender.enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ pageInfo.filter("status", Status.REPLIED.value());
|
|
|
+ return purchaseTenderService.findByPageInfo(pageInfo, filter);
|
|
|
+ }
|
|
|
com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
// 判断当前用户是否被客户分配
|
|
|
- SearchFilter filter = userService.distribute();
|
|
|
- if (filter != null && filter.getDistribute() == null) {
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
|
}
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("stq_id", false, Sort.Type.LONG, 1L));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("stq_ptaid", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- return searchService.searchSaleTenderQuestion(keyword, pageParams);
|
|
|
+ return searchService.searchSaleTenderQuestion(filter.getKeyword(), pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -255,18 +276,23 @@ public class SaleTenderQuestionController {
|
|
|
if (logger != null) {
|
|
|
logger.log("招标提问单", "查看收到的招标提问(未回复)");
|
|
|
}
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
- String keyword = jsonObject.getString("keyword");
|
|
|
- com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
// 判断当前用户是否被客户分配
|
|
|
- SearchFilter filter = userService.distribute();
|
|
|
- if (filter != null && filter.getDistribute() == null) {
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
|
}
|
|
|
+ if (StringUtils.isEmpty(filter.getKeyword())) {
|
|
|
+ pageInfo.filter("saleTender.enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ pageInfo.filter("status", Status.NOT_REPLY.value());
|
|
|
+ return purchaseTenderService.findByPageInfo(pageInfo, filter);
|
|
|
+ }
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("stq_id", false, Sort.Type.LONG, 1L));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("stq_ptaid", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- return searchService.searchSaleTenderQuestion(keyword, pageParams);
|
|
|
+ return searchService.searchSaleTenderQuestion(filter.getKeyword(), pageParams);
|
|
|
}
|
|
|
}
|