|
|
@@ -1,12 +1,14 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
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.stereotype.Controller;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
@@ -16,6 +18,7 @@ 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.ResponseBody;
|
|
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import com.uas.platform.b2b.model.ErpProdIODetail;
|
|
|
import com.uas.platform.b2b.model.PurchaseApCheck;
|
|
|
@@ -24,6 +27,7 @@ import com.uas.platform.b2b.model.Vendor;
|
|
|
import com.uas.platform.b2b.service.ErpProdIODetailService;
|
|
|
import com.uas.platform.b2b.service.PurchaseApCheckService;
|
|
|
import com.uas.platform.b2b.service.UserService;
|
|
|
+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.exception.IllegalOperatorException;
|
|
|
@@ -168,4 +172,34 @@ public class SaleApCheckController {
|
|
|
return purchaseApCheckService.findAllByPageInfo(info, keyword, filter);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 全部导出
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/xls", method = RequestMethod.GET)
|
|
|
+ public ModelAndView export() {
|
|
|
+ List<Long> distributes = null;
|
|
|
+ //判断当前用户是否被客户分配
|
|
|
+ if (!userService.IsNotadmin()) {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ModelAndView modelAndView = new ModelAndView();
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
+ modelAndView.addObject("dateFormat", dateFormat);
|
|
|
+ modelAndView.addObject("data",erpProdIODetailService.findAllApChecks(distributes));
|
|
|
+ modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/faApCheck", "客户应收对账单"));
|
|
|
+ logger.log("客户应收对账单", "导出Excel列表", "导出全部Excel列表");
|
|
|
+ return modelAndView;
|
|
|
+ }
|
|
|
}
|