Browse Source

【对账单导出Excel】

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@4381 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
aof 10 years ago
parent
commit
c455e0415a

+ 91 - 0
src/main/java/com/uas/platform/b2b/controller/SaleApCheckController.java

@@ -7,6 +7,7 @@ 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;
@@ -223,6 +224,96 @@ public class SaleApCheckController {
 		}
 		return purchaseApCheckService.findEndByPageInfo(info, keyword, filter);
 	}
+	
+	/**
+	 * 导出 - 全部
+	 * 
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping(value = "/allxls",method = RequestMethod.GET)
+	public ModelAndView exportApCheck(String searchFilter) {
+		SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
+		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
+		pageInfo.sorting("recordDate", Direction.DESC);
+		pageInfo.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
+		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.addObject("dateFormat", dateFormat);
+		modelAndView.addObject("state", "全部");
+		modelAndView.addObject("data", purchaseApCheckService.findAllByPageInfo(pageInfo, filter.getKeyword(), filter).getContent());
+		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/saleApCheck", "应收对账单列表_全部"));
+		logger.log("应收对账单", "导出Excel列表", "导出全部Excel列表");
+		return modelAndView;
+	}
+	
+	/**
+	 * 导出 - 已确认
+	 * 
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping(value = "/allxls",  params = RequestState.DONE, method = RequestMethod.GET)
+	public ModelAndView exportApCheckDone(String searchFilter) {
+		SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
+		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
+		pageInfo.sorting("recordDate", Direction.DESC);
+		pageInfo.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
+		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.addObject("dateFormat", dateFormat);
+		modelAndView.addObject("state", "已确认");
+		System.out.println(filter.toString());
+		modelAndView.addObject("data", purchaseApCheckService.findDoneByPageInfo(pageInfo, filter.getKeyword(), filter).getContent());
+		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/saleApCheck", "应收对账单列表_已确认"));
+		logger.log("应收对账单", "导出Excel列表", "导出已确认Excel列表");
+		return modelAndView;
+	}
+	
+	/**
+	 * 导出 - 未对账
+	 * 
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping(value = "/allxls",  params = RequestState.TODO, method = RequestMethod.GET)
+	public ModelAndView exportApCheckTodo(String searchFilter) {
+		SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
+		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
+		pageInfo.sorting("recordDate", Direction.DESC);
+		pageInfo.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
+		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.addObject("dateFormat", dateFormat);
+		modelAndView.addObject("state", "未对账");
+		modelAndView.addObject("data", purchaseApCheckService.findTodoByPageInfo(pageInfo, filter.getKeyword(), filter).getContent());
+		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/saleApCheck", "应收对账单列表_未对账"));
+		logger.log("应收对账单", "导出Excel列表", "导出未对账Excel列表");
+		return modelAndView;
+	}
+	
+	/**
+	 * 导出 - 已做废
+	 * 
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping(value = "/allxls",  params = RequestState.END, method = RequestMethod.GET)
+	public ModelAndView exportApChecks(String searchFilter) {
+		SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
+		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
+		pageInfo.sorting("recordDate", Direction.DESC);
+		pageInfo.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
+		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.addObject("dateFormat", dateFormat);
+		modelAndView.addObject("state", "已做废");
+		modelAndView.addObject("data", purchaseApCheckService.findEndByPageInfo(pageInfo, filter.getKeyword(), filter).getContent());
+		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/saleApCheck", "应收对账单列表_已做废"));
+		logger.log("应收对账单", "导出Excel列表", "导出已做废Excel列表");
+		return modelAndView;
+	}
+	
 	/**
 	 * 全部导出
 	 *