|
|
@@ -19,11 +19,9 @@ 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.SaleARCheck;
|
|
|
import com.uas.platform.b2b.model.SearchFilter;
|
|
|
import com.uas.platform.b2b.model.Vendor;
|
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
|
@@ -94,21 +92,28 @@ public class SaleApCheckController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 作为卖家,获取应付对账单(全部)
|
|
|
+ * 作为卖家,获取应收对账单(全部)
|
|
|
*
|
|
|
* @param json
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/getAll", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- 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);
|
|
|
+ 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);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -219,7 +224,7 @@ public class SaleApCheckController {
|
|
|
// 当前登录企业作为买家
|
|
|
pageParams.getFilters().put("pa_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
// TODO 其他过滤条件
|
|
|
- pageParams.getFilters().put("pa_checkstatus", String.valueOf("未对账"));
|
|
|
+ pageParams.getFilters().put("pa_checkstatus", "未对账");
|
|
|
return searchService.searchPurchaseApCheckIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
@@ -228,14 +233,14 @@ public class SaleApCheckController {
|
|
|
*/
|
|
|
@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseApCheckDone> getDoneApChecks(PageParams params, String keyword) {
|
|
|
+ public SPage<PurchaseApCheck> getDoneApChecks(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 其他过滤条件
|
|
|
- // pageParams.getFilters().put("pa_checkstatus", "已确认");
|
|
|
- return searchService.searchPurchaseApCheckDoneIds(keyword, pageParams);
|
|
|
+ pageParams.getFilters().put("pa_checkstatus", "已确认");
|
|
|
+ return searchService.searchPurchaseApCheckIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -243,14 +248,14 @@ public class SaleApCheckController {
|
|
|
*/
|
|
|
@RequestMapping(params = RequestState.END, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseApCheckEnd> getEndApChecks(PageParams params, String keyword) {
|
|
|
+ public SPage<PurchaseApCheck> getEndApChecks(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.searchPurchaseApCheckEndIds(keyword, pageParams);
|
|
|
+ pageParams.getFilters().put("pa_checkstatus", "已作废");
|
|
|
+ return searchService.searchPurchaseApCheckIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|