|
|
@@ -3,7 +3,7 @@ package com.uas.platform.b2b.mobile.controller;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
@@ -13,6 +13,7 @@ import com.uas.platform.b2b.mobile.service.PurchaseService;
|
|
|
import com.uas.platform.b2b.service.PurchaseOrderService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
+import com.uas.platform.core.model.PageParams;
|
|
|
|
|
|
/**
|
|
|
* 对移动端的数据接口<br>
|
|
|
@@ -37,13 +38,25 @@ public class SaleController {
|
|
|
* @param json
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(method = RequestMethod.POST)
|
|
|
+ @RequestMapping(method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Page<Purchase> getReceivedPurchaseOrders(@RequestBody String json) {
|
|
|
- PageInfo info = new PageInfo(json);
|
|
|
+ public Page<Purchase> getReceivedPurchaseOrders(PageParams params) {
|
|
|
+ PageInfo info = new PageInfo(params);
|
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
return purchaseService.convertPurchaseOrder(purchaseOrderService.findAllDetailByPageInfo(info));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 作为卖家,根据采购单据ID查找采购订单(含明细)
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public Purchase getReceivedPurchaseOrderItemById(@PathVariable("id") Long id) {
|
|
|
+ return purchaseService.convertPurchaseOrder(purchaseOrderService.findById(id));
|
|
|
+ }
|
|
|
+
|
|
|
}
|