|
|
@@ -4,6 +4,7 @@ import com.alibaba.dubbo.common.utils.CollectionUtils;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2b.core.util.DateFormatUtils;
|
|
|
+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;
|
|
|
@@ -26,9 +27,12 @@ import com.uas.search.b2b.util.SearchConstants;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
@@ -42,7 +46,7 @@ import java.util.List;
|
|
|
*
|
|
|
*/
|
|
|
@SuppressWarnings("deprecation")
|
|
|
-@Controller
|
|
|
+@RestController
|
|
|
@RequestMapping("/purchase/arCheck")
|
|
|
public class PurchaseARCheckController {
|
|
|
|
|
|
@@ -65,7 +69,6 @@ public class PurchaseARCheckController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(method = RequestMethod.GET)
|
|
|
- @ResponseBody
|
|
|
public SPage<SaleARCheck> getReceivedPurchaseApBills(PageParams params, String searchFilter) {
|
|
|
logger.log("应付对账单", "获取全部应付对账单");
|
|
|
JSONObject jsonObject = JSON.parseObject(searchFilter);
|
|
|
@@ -95,6 +98,31 @@ public class PurchaseARCheckController {
|
|
|
return searchService.searchSaleARCheckIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 作为买家,获取应付对账单(全部)
|
|
|
+ *
|
|
|
+ * @param params 分页参数
|
|
|
+ * @param searchFilter 过滤条件
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/list",method = RequestMethod.GET)
|
|
|
+ public SPage<PurchaseApCheck> getApcheck(PageParams params, String searchFilter) {
|
|
|
+ logger.log("应付对账单", "获取全部应付对账单");
|
|
|
+ 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("sac_id", false, Type.INT, new Long(1)));
|
|
|
+ pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+ return searchService.searchPurchaseApCheckIds(keyword, pageParams);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 作为买家,根据ID查找应付对账单(含明细)
|
|
|
*
|
|
|
@@ -102,7 +130,6 @@ public class PurchaseARCheckController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
|
|
- @ResponseBody
|
|
|
public SaleARCheck getReceivedPurchaseApBillById(@PathVariable("id") Long id) {
|
|
|
logger.log("应付对账单", "获取单个应付对账单,id:" + id);
|
|
|
return saleARCheckService.findById(id);
|
|
|
@@ -114,7 +141,6 @@ public class PurchaseARCheckController {
|
|
|
* @return SaleARCheck
|
|
|
*/
|
|
|
@RequestMapping(value = "/page/done", method = RequestMethod.GET)
|
|
|
- @ResponseBody
|
|
|
public Page<SaleARCheck> getAllDoneCheck(PageParams params, String keyword, String searchFilter) {
|
|
|
logger.log("应付对账单", "获取全部已确认应付对账单");
|
|
|
PageInfo info = new PageInfo(params);
|
|
|
@@ -134,7 +160,6 @@ public class PurchaseARCheckController {
|
|
|
* @return SaleARCheck
|
|
|
*/
|
|
|
@RequestMapping(value = "/page/todo", method = RequestMethod.GET)
|
|
|
- @ResponseBody
|
|
|
public Page<SaleARCheck> getAllTodoCheck(PageParams params, String keyword, String searchFilter) {
|
|
|
logger.log("应付对账单", "获取全部已确认应付对账单");
|
|
|
PageInfo info = new PageInfo(params);
|
|
|
@@ -155,7 +180,6 @@ public class PurchaseARCheckController {
|
|
|
* @param itemId
|
|
|
*/
|
|
|
@RequestMapping(value = "/items/{itemId}/reply", method = RequestMethod.POST, params = "agreed=true")
|
|
|
- @ResponseBody
|
|
|
public void agreeCheckItem(@RequestBody String json, @PathVariable("itemId") Long itemId) {
|
|
|
SaleARCheckReply reply = FlexJsonUtils.fromJson(json, SaleARCheckReply.class);
|
|
|
SaleARCheckItem item = new SaleARCheckItem();
|
|
|
@@ -173,7 +197,6 @@ public class PurchaseARCheckController {
|
|
|
* @param itemId
|
|
|
*/
|
|
|
@RequestMapping(value = "/items/{itemId}/reply", method = RequestMethod.POST, params = "agreed=false")
|
|
|
- @ResponseBody
|
|
|
public void disAgreeCheckItem(@RequestBody String json, @PathVariable("itemId") Long itemId) {
|
|
|
SaleARCheckReply reply = FlexJsonUtils.fromJson(json, SaleARCheckReply.class);
|
|
|
SaleARCheckItem item = new SaleARCheckItem();
|
|
|
@@ -191,7 +214,6 @@ public class PurchaseARCheckController {
|
|
|
* @param itemId
|
|
|
*/
|
|
|
@RequestMapping(value = "/items/{itemId}/reply", method = RequestMethod.GET)
|
|
|
- @ResponseBody
|
|
|
public List<SaleARCheckReply> getReplies(@PathVariable("itemId") Long itemId) {
|
|
|
List<SaleARCheckReply> replies = saleARCheckService.getReplies(itemId);
|
|
|
return replies;
|