|
|
@@ -1,16 +1,23 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+
|
|
|
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.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;
|
|
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import com.uas.platform.b2b.model.PurchaseReturn;
|
|
|
import com.uas.platform.b2b.service.PurchaseReturnService;
|
|
|
+import com.uas.platform.b2b.support.JxlsExcelView;
|
|
|
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;
|
|
|
|
|
|
@@ -26,6 +33,9 @@ public class SaleReturnController {
|
|
|
|
|
|
@Autowired
|
|
|
private PurchaseReturnService purchaseReturnService;
|
|
|
+
|
|
|
+ private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 作为卖家,客户的采购验退单(全部)
|
|
|
@@ -36,6 +46,7 @@ public class SaleReturnController {
|
|
|
@RequestMapping(method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public Page<PurchaseReturn> getReceivedPurchaseReturns(PageParams params) {
|
|
|
+ logger.log("客户验退单", "获取全部客户验退单");
|
|
|
PageInfo info = new PageInfo(params);
|
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
@@ -51,7 +62,28 @@ public class SaleReturnController {
|
|
|
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public PurchaseReturn getReceivedPurchaseReturnById(@PathVariable("id") Long id) {
|
|
|
+ logger.log("客户验退单", "获取单个客户采购验退单,id:" + id);
|
|
|
return purchaseReturnService.findById(id);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/xls", method = RequestMethod.GET)
|
|
|
+ public ModelAndView exportApprovals() {
|
|
|
+ PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
|
|
|
+ pageInfo.sorting("date", Direction.DESC);
|
|
|
+ pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
+ ModelAndView modelAndView = new ModelAndView();
|
|
|
+ modelAndView.addObject("dateFormat", dateFormat);
|
|
|
+ modelAndView.addObject("data", purchaseReturnService.findAllByPageInfo(pageInfo).getContent());
|
|
|
+ modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleReturn", "客户验退单列表"));
|
|
|
+ logger.log("客户验退单", "导出Excel列表", "导出全部Excel列表");
|
|
|
+ return modelAndView;
|
|
|
+ }
|
|
|
|
|
|
}
|