|
|
@@ -6,14 +6,12 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
-import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -21,14 +19,14 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
-import com.uas.platform.b2b.model.ErpProdIODetail;
|
|
|
import com.uas.platform.b2b.model.PurchaseApCheck;
|
|
|
import com.uas.platform.b2b.model.PurchaseApCheckDone;
|
|
|
import com.uas.platform.b2b.model.PurchaseApCheckEnd;
|
|
|
import com.uas.platform.b2b.model.PurchaseApCheckItem;
|
|
|
-import com.uas.platform.b2b.model.PurchaseApCheckTodo;
|
|
|
+import com.uas.platform.b2b.model.SaleARCheck;
|
|
|
import com.uas.platform.b2b.model.SearchFilter;
|
|
|
import com.uas.platform.b2b.model.Vendor;
|
|
|
+import com.uas.platform.b2b.search.SearchService;
|
|
|
import com.uas.platform.b2b.service.ErpProdIODetailService;
|
|
|
import com.uas.platform.b2b.service.PurchaseApCheckService;
|
|
|
import com.uas.platform.b2b.service.UserService;
|
|
|
@@ -41,7 +39,15 @@ import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
import com.uas.platform.core.web.bind.RequestState;
|
|
|
+import com.uas.search.b2b.model.SPage;
|
|
|
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * 应收对账单
|
|
|
+ *
|
|
|
+ */
|
|
|
+
|
|
|
+@SuppressWarnings("deprecation")
|
|
|
@Controller
|
|
|
@RequestMapping("/sale/apCheck")
|
|
|
public class SaleApCheckController {
|
|
|
@@ -55,6 +61,9 @@ public class SaleApCheckController {
|
|
|
@Autowired
|
|
|
private UserService userService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SearchService searchService;
|
|
|
+
|
|
|
private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
|
|
|
|
|
|
/**
|
|
|
@@ -85,28 +94,21 @@ public class SaleApCheckController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 作为卖家,获取应收对账单(全部)
|
|
|
+ * 作为卖家,获取应付对账单(全部)
|
|
|
*
|
|
|
* @param json
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/getAll", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public List<ErpProdIODetail> getAllApChecks() {
|
|
|
- List<Long> distributes = null;
|
|
|
- // 判断当前用户是否被客户分配
|
|
|
- if (!SystemSession.getUser().isSys()) {
|
|
|
- List<Vendor> vendors = userService.findChooseVendor(SystemSession.getUser().getUserUU());
|
|
|
- distributes = new ArrayList<Long>();
|
|
|
- if (!CollectionUtils.isEmpty(vendors)) {
|
|
|
- for (Vendor v : vendors) {
|
|
|
- distributes.add(v.getMyEnUU());
|
|
|
- }
|
|
|
- } else {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
- return erpProdIODetailService.findAllApChecks(distributes);
|
|
|
+ public SPage<SaleARCheck> getAllApChecks(PageParams params, String keyword) {
|
|
|
+ logger.log("应付对账单", "作为卖家获取全部应付对账单");
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
+ // 当前登录企业作为供应商
|
|
|
+ pageParams.getFilters().put("sac_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ // TODO 其他过滤条件
|
|
|
+
|
|
|
+ return searchService.searchSaleARCheckIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -196,16 +198,14 @@ public class SaleApCheckController {
|
|
|
*/
|
|
|
@RequestMapping(method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Page<PurchaseApCheck> getPurchaseApChecks(PageParams params, String keyword, String searchFilter) {
|
|
|
- logger.log("应收对账单", "获取全部应收对账单");
|
|
|
- PageInfo info = new PageInfo(params);
|
|
|
- // 我作为卖家,把我的企业ID作为买方ID传入
|
|
|
- info.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- SearchFilter filter = null;
|
|
|
- if (StringUtils.hasText(searchFilter)) {
|
|
|
- filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
|
- }
|
|
|
- return purchaseApCheckService.findAllByPageInfo(info, keyword, filter);
|
|
|
+ public SPage<PurchaseApCheck> getPurchaseApChecks(PageParams params, String keyword) {
|
|
|
+ logger.log("应收对账单", "作为买家,获取全部应收对账单");
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
+ // 当前登录企业作为买家
|
|
|
+ pageParams.getFilters().put("pa_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ // TODO 其他过滤条件
|
|
|
+
|
|
|
+ return searchService.searchPurchaseApCheckIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -213,16 +213,14 @@ public class SaleApCheckController {
|
|
|
*/
|
|
|
@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Page<PurchaseApCheckTodo> getTodoApChecks(PageParams params, String keyword, String searchFilter) {
|
|
|
+ public SPage<PurchaseApCheck> getTodoApChecks(PageParams params, String keyword) {
|
|
|
logger.log("应收对账单", "获取未对账应收对账单");
|
|
|
- PageInfo info = new PageInfo(params);
|
|
|
- // 我作为卖家,把我的企业ID作为买方ID传入
|
|
|
- info.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- SearchFilter filter = null;
|
|
|
- if (StringUtils.hasText(searchFilter)) {
|
|
|
- filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
|
- }
|
|
|
- return purchaseApCheckService.findTodoByPageInfo(info, keyword, filter);
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
+ // 当前登录企业作为买家
|
|
|
+ pageParams.getFilters().put("pa_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ // TODO 其他过滤条件
|
|
|
+ pageParams.getFilters().put("pa_checkstatus", String.valueOf("未对账"));
|
|
|
+ return searchService.searchPurchaseApCheckIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -230,16 +228,14 @@ public class SaleApCheckController {
|
|
|
*/
|
|
|
@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Page<PurchaseApCheckDone> getDoneApChecks(PageParams params, String keyword, String searchFilter) {
|
|
|
+ public SPage<PurchaseApCheckDone> getDoneApChecks(PageParams params, String keyword) {
|
|
|
logger.log("应收对账单", "获取已确认应收对账单");
|
|
|
- PageInfo info = new PageInfo(params);
|
|
|
- // 我作为卖家,把我的企业ID作为买方ID传入
|
|
|
- info.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- SearchFilter filter = null;
|
|
|
- if (StringUtils.hasText(searchFilter)) {
|
|
|
- filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
|
- }
|
|
|
- return purchaseApCheckService.findDoneByPageInfo(info, keyword, filter);
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
+ // 当前登录企业作为买家
|
|
|
+ pageParams.getFilters().put("pa_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ // TODO 其他过滤条件
|
|
|
+ // pageParams.getFilters().put("pa_checkstatus", "已确认");
|
|
|
+ return searchService.searchPurchaseApCheckDoneIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -247,16 +243,14 @@ public class SaleApCheckController {
|
|
|
*/
|
|
|
@RequestMapping(params = RequestState.END, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Page<PurchaseApCheckEnd> getEndApChecks(PageParams params, String keyword, String searchFilter) {
|
|
|
+ public SPage<PurchaseApCheckEnd> getEndApChecks(PageParams params, String keyword) {
|
|
|
logger.log("应收对账单", "获取不同意,已作废应收对账单");
|
|
|
- PageInfo info = new PageInfo(params);
|
|
|
- // 我作为卖家,把我的企业ID作为买方ID传入
|
|
|
- info.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- SearchFilter filter = null;
|
|
|
- if (StringUtils.hasText(searchFilter)) {
|
|
|
- filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
|
- }
|
|
|
- return purchaseApCheckService.findEndByPageInfo(info, keyword, filter);
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
+ // 当前登录企业作为买家
|
|
|
+ pageParams.getFilters().put("pa_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ // TODO 其他过滤条件
|
|
|
+
|
|
|
+ return searchService.searchPurchaseApCheckEndIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|