Просмотр исходного кода

时间筛选

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@1172 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
suntg 10 лет назад
Родитель
Сommit
00c4fd1ca0

+ 4 - 4
src/main/java/com/uas/platform/b2b/controller/SaleApBillController.java

@@ -44,12 +44,12 @@ public class SaleApBillController {
 	 */
 	@RequestMapping(method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseApBill> getReceivedPurchaseApBills(PageParams params, String keyword) {
+	public Page<PurchaseApBill> getReceivedPurchaseApBills(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户应付发票", "获取全部客户应付发票");
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseApBillService.findAllByPageInfo(info, keyword);
+		return purchaseApBillService.findAllByPageInfo(info, keyword, fromDate, endDate);
 	}
 
 	/**
@@ -72,14 +72,14 @@ public class SaleApBillController {
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)
-	public ModelAndView export(String keyword) {
+	public ModelAndView export(String keyword, Long fromDate, Long endDate) {
 		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", purchaseApBillService.findAllByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseApBillService.findAllByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/faApBill", "客户应付发票列表"));
 		logger.log("客户应付发票", "导出Excel列表", "导出全部Excel列表");
 		return modelAndView;

+ 32 - 32
src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java

@@ -58,12 +58,12 @@ public class SaleNoticeController {
 	 */
 	@RequestMapping(method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseNotice> getReceivedPurchaseNotices(PageParams params, String keyword) throws UnsupportedEncodingException {
+	public Page<PurchaseNotice> getReceivedPurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) throws UnsupportedEncodingException {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(全部)");
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseNoticeService.findAllByPageInfo(info, SearchKeyUtils.decodeURL(keyword));
+		return purchaseNoticeService.findAllByPageInfo(info, SearchKeyUtils.decodeURL(keyword), fromDate, endDate);
 	}
 
 	/**
@@ -101,7 +101,7 @@ public class SaleNoticeController {
 	 */
 	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseNotice> getTodoPurchaseNotices(PageParams params, String keyword) throws UnsupportedEncodingException {
+	public Page<PurchaseNotice> getTodoPurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) throws UnsupportedEncodingException {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(待发货)");
 		PageInfo info = new PageInfo(params);
 		// 送货提醒状态为待发货
@@ -110,7 +110,7 @@ public class SaleNoticeController {
 		info.filter("waiting", Constant.NO);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseNoticeService.findAllByPageInfo(info, SearchKeyUtils.decodeURL(keyword));
+		return purchaseNoticeService.findAllByPageInfo(info, SearchKeyUtils.decodeURL(keyword), fromDate, endDate);
 	}
 
 	/**
@@ -122,14 +122,14 @@ public class SaleNoticeController {
 	 */
 	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseNotice> getDonePurchaseNotices(PageParams params, String keyword) throws UnsupportedEncodingException {
+	public Page<PurchaseNotice> getDonePurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) throws UnsupportedEncodingException {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(已发货)");
 		PageInfo info = new PageInfo(params);
 		// 送货提醒状态为已发货
 		info.filter("status", Status.REPLIED.value());
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseNoticeService.findDoneByPageInfo(info, SearchKeyUtils.decodeURL(keyword));
+		return purchaseNoticeService.findDoneByPageInfo(info, SearchKeyUtils.decodeURL(keyword), fromDate, endDate);
 	}
 
 	/**
@@ -141,14 +141,14 @@ public class SaleNoticeController {
 	 */
 	@RequestMapping(params = "_state=waiting", method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseNotice> getWaitingPurchaseNotices(PageParams params, String keyword) throws UnsupportedEncodingException {
+	public Page<PurchaseNotice> getWaitingPurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) throws UnsupportedEncodingException {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(备料中)");
 		PageInfo info = new PageInfo(params);
 		// 需要等待发货
 		info.filter("waiting", Constant.YES);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseNoticeService.findAllByPageInfo(info, SearchKeyUtils.decodeURL(keyword));
+		return purchaseNoticeService.findAllByPageInfo(info, SearchKeyUtils.decodeURL(keyword), fromDate, endDate);
 	}
 
 	/**
@@ -160,14 +160,14 @@ public class SaleNoticeController {
 	 */
 	@RequestMapping(params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseNotice> getEndPurchaseNotices(PageParams params, String keyword) throws UnsupportedEncodingException {
+	public Page<PurchaseNotice> getEndPurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) throws UnsupportedEncodingException {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(已结案)");
 		PageInfo info = new PageInfo(params);
 		// 询价单状态为已结案
 		info.filter("end", (short) Constant.YES);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseNoticeService.findAllByPageInfo(info, SearchKeyUtils.decodeURL(keyword));
+		return purchaseNoticeService.findAllByPageInfo(info, SearchKeyUtils.decodeURL(keyword), fromDate, endDate);
 	}
 
 	/**
@@ -209,12 +209,12 @@ public class SaleNoticeController {
 	 */
 	@RequestMapping(value = "/sends", method = RequestMethod.GET)
 	@ResponseBody
-	public Page<SaleSendAll> getSaleSends(PageParams params, String keyword) {
+	public Page<SaleSendAll> getSaleSends(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("发货单", "查看全部的送货单");
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseNoticeService.findSendsByPageInfo(info, keyword);
+		return purchaseNoticeService.findSendsByPageInfo(info, keyword, fromDate, endDate);
 	}
 
 	/**
@@ -225,13 +225,13 @@ public class SaleNoticeController {
 	 */
 	@RequestMapping(value = "/sends", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
-	public Page<SaleSendAll> getReceivedSaleSends(PageParams params, String keyword) {
+	public Page<SaleSendAll> getReceivedSaleSends(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("发货单", "查看全部的送货单");
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		info.filter("verifystatus", Constant.YES);
-		return purchaseNoticeService.findSendsByPageInfo(info, keyword);
+		return purchaseNoticeService.findSendsByPageInfo(info, keyword, fromDate, endDate);
 	}
 
 	/**
@@ -242,13 +242,13 @@ public class SaleNoticeController {
 	 */
 	@RequestMapping(value = "/sends", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
-	public Page<SaleSendAll> getUnReceivedSaleSends(PageParams params, String keyword) {
+	public Page<SaleSendAll> getUnReceivedSaleSends(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("发货单", "查看全部的送货单");
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		info.filter("verifystatus", Constant.NO);
-		return purchaseNoticeService.findSendsByPageInfo(info, keyword);
+		return purchaseNoticeService.findSendsByPageInfo(info, keyword, fromDate, endDate);
 	}
 
 	/**
@@ -258,7 +258,7 @@ public class SaleNoticeController {
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)
-	public ModelAndView exportVendors(String keyword) {
+	public ModelAndView exportVendors(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
@@ -266,7 +266,7 @@ public class SaleNoticeController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("type", "全部");
-		modelAndView.addObject("data", purchaseNoticeService.findAllByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseNoticeService.findAllByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleNotice", "客户发货提醒列表_全部"));
 		logger.log("客户送货提醒", "导出Excel列表", "导出全部Excel列表");
 		return modelAndView;
@@ -279,7 +279,7 @@ public class SaleNoticeController {
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", params = RequestState.TODO, method = RequestMethod.GET)
-	public ModelAndView exportUndoVendors(String keyword) {
+	public ModelAndView exportUndoVendors(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
@@ -289,7 +289,7 @@ public class SaleNoticeController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("type", "待发货");
-		modelAndView.addObject("data", purchaseNoticeService.findAllByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseNoticeService.findAllByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleNotice", "客户发货提醒列表_待发货"));
 		logger.log("客户送货提醒", "导出Excel列表", "导出待发货Excel列表");
 		return modelAndView;
@@ -302,7 +302,7 @@ public class SaleNoticeController {
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", params = RequestState.DONE, method = RequestMethod.GET)
-	public ModelAndView exportDoneVendors(String keyword) {
+	public ModelAndView exportDoneVendors(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
@@ -312,7 +312,7 @@ public class SaleNoticeController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("type", "已发货");
-		modelAndView.addObject("data", purchaseNoticeService.findDoneByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseNoticeService.findDoneByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleNotice", "客户发货提醒列表_已发货"));
 		logger.log("客户送货提醒", "导出Excel列表", "导出已发货Excel列表");
 		return modelAndView;
@@ -325,7 +325,7 @@ public class SaleNoticeController {
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", params = RequestState.END, method = RequestMethod.GET)
-	public ModelAndView exporEndtVendors(String keyword) {
+	public ModelAndView exporEndtVendors(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
@@ -335,7 +335,7 @@ public class SaleNoticeController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("type", "已结案");
-		modelAndView.addObject("data", purchaseNoticeService.findAllByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseNoticeService.findAllByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleNotice", "客户发货提醒列表_已结案"));
 		logger.log("客户送货提醒", "导出Excel列表", "导出已结案Excel列表");
 		return modelAndView;
@@ -348,7 +348,7 @@ public class SaleNoticeController {
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", params = "_state=waiting", method = RequestMethod.GET)
-	public ModelAndView exportWaitingVendors(String keyword) {
+	public ModelAndView exportWaitingVendors(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
@@ -358,7 +358,7 @@ public class SaleNoticeController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("type", "备料中");
-		modelAndView.addObject("data", purchaseNoticeService.findAllByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseNoticeService.findAllByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleNotice", "客户发货提醒列表_备料中"));
 		logger.log("客户送货提醒", "导出Excel列表", "导出备料中Excel列表");
 		return modelAndView;
@@ -371,7 +371,7 @@ public class SaleNoticeController {
 	 * @return
 	 */
 	@RequestMapping(value = "/sends/xls", params = RequestState.ALL, method = RequestMethod.GET)
-	public ModelAndView exportSends(String keyword) {
+	public ModelAndView exportSends(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
@@ -379,7 +379,7 @@ public class SaleNoticeController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("state", "全部");
-		modelAndView.addObject("data", purchaseNoticeService.findSendsByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseNoticeService.findSendsByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleSend", "发货单列表_全部"));
 		logger.log("发货单", "导出Excel列表", "导出全部Excel列表");
 		return modelAndView;
@@ -392,7 +392,7 @@ public class SaleNoticeController {
 	 * @return
 	 */
 	@RequestMapping(value = "/sends/xls", params = RequestState.TODO, method = RequestMethod.GET)
-	public ModelAndView exportTodoSends(String keyword) {
+	public ModelAndView exportTodoSends(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
@@ -401,7 +401,7 @@ public class SaleNoticeController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("state", "未收料");
-		modelAndView.addObject("data", purchaseNoticeService.findSendsByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseNoticeService.findSendsByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleSend", "发货单列表_未收料"));
 		logger.log("发货单", "导出Excel列表", "导出未收料Excel列表");
 		return modelAndView;
@@ -414,7 +414,7 @@ public class SaleNoticeController {
 	 * @return
 	 */
 	@RequestMapping(value = "/sends/xls", params = RequestState.DONE, method = RequestMethod.GET)
-	public ModelAndView exportDoneSends(String keyword) {
+	public ModelAndView exportDoneSends(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
@@ -423,7 +423,7 @@ public class SaleNoticeController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("state", "已收料");
-		modelAndView.addObject("data", purchaseNoticeService.findSendsByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseNoticeService.findSendsByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleSend", "发货单列表_已收料"));
 		logger.log("发货单", "导出Excel列表", "导出已收料Excel列表");
 		return modelAndView;

+ 16 - 16
src/main/java/com/uas/platform/b2b/controller/SaleOrderController.java

@@ -100,12 +100,12 @@ public class SaleOrderController {
 	 */
 	@RequestMapping(value = "/items", method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseOrderAll> getReceivedPurchaseOrderItems(PageParams params, String keyword) {
+	public Page<PurchaseOrderAll> getReceivedPurchaseOrderItems(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(全部)");
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseOrderService.findAllDetailByPageInfo(info, keyword);
+		return purchaseOrderService.findAllDetailByPageInfo(info, keyword, fromDate, endDate);
 	}
 
 	/**
@@ -116,12 +116,12 @@ public class SaleOrderController {
 	 */
 	@RequestMapping(value = "/items", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseOrderTodo> getTodoPurchaseOrderItems(PageParams params, String keyword) {
+	public Page<PurchaseOrderTodo> getTodoPurchaseOrderItems(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(待回复)");
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseOrderService.findTodoByPageInfo(info, keyword);
+		return purchaseOrderService.findTodoByPageInfo(info, keyword, fromDate, endDate);
 	}
 
 	/**
@@ -132,12 +132,12 @@ public class SaleOrderController {
 	 */
 	@RequestMapping(value = "/items", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseOrderDone> getDonePurchaseOrderItems(PageParams params, String keyword) {
+	public Page<PurchaseOrderDone> getDonePurchaseOrderItems(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(已回复)");
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseOrderService.findDoneByPageInfo(info, keyword);
+		return purchaseOrderService.findDoneByPageInfo(info, keyword, fromDate, endDate);
 	}
 
 	/**
@@ -148,12 +148,12 @@ public class SaleOrderController {
 	 */
 	@RequestMapping(value = "/items", params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseOrderEnd> getEndPurchaseOrderItems(PageParams params, String keyword) {
+	public Page<PurchaseOrderEnd> getEndPurchaseOrderItems(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(已结案)");
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseOrderService.findEndByPageInfo(info, keyword);
+		return purchaseOrderService.findEndByPageInfo(info, keyword, fromDate, endDate);
 	}
 
 	/**
@@ -255,7 +255,7 @@ public class SaleOrderController {
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)
-	public ModelAndView exportOrders(String keyword) {
+	public ModelAndView exportOrders(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
@@ -263,7 +263,7 @@ public class SaleOrderController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("state", "全部");
-		modelAndView.addObject("data", purchaseOrderService.findAllDetailByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseOrderService.findAllDetailByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleOrder", "客户采购单列表_全部"));
 		logger.log("客户采购单", "导出Excel列表", "导出全部Excel列表");
 		return modelAndView;
@@ -276,7 +276,7 @@ public class SaleOrderController {
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", params = RequestState.TODO, method = RequestMethod.GET)
-	public ModelAndView exportTodoOrders(String keyword) {
+	public ModelAndView exportTodoOrders(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
@@ -284,7 +284,7 @@ public class SaleOrderController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("state", "待回复");
-		modelAndView.addObject("data", purchaseOrderService.findTodoByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseOrderService.findTodoByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleOrder", "客户采购单列表 _待回复"));
 		logger.log("客户采购单", "导出Excel列表", "导出待回复Excel列表");
 		return modelAndView;
@@ -297,7 +297,7 @@ public class SaleOrderController {
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", params = RequestState.DONE, method = RequestMethod.GET)
-	public ModelAndView exportDoneOrders(String keyword) {
+	public ModelAndView exportDoneOrders(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
@@ -305,7 +305,7 @@ public class SaleOrderController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("state", "已回复");
-		modelAndView.addObject("data", purchaseOrderService.findDoneByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseOrderService.findDoneByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleOrder", "客户采购单列表_已回复"));
 		logger.log("客户采购单", "导出Excel列表", "导出已回复Excel列表");
 		return modelAndView;
@@ -318,7 +318,7 @@ public class SaleOrderController {
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", params = RequestState.END, method = RequestMethod.GET)
-	public ModelAndView exportEndOrders(String keyword) {
+	public ModelAndView exportEndOrders(String keyword, Long fromDate, Long endDate) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("date", Direction.DESC);
 		pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
@@ -326,7 +326,7 @@ public class SaleOrderController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("state", "已结案");
-		modelAndView.addObject("data", purchaseOrderService.findEndByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.addObject("data", purchaseOrderService.findEndByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleOrder", "客户采购单列表_已结案"));
 		logger.log("客户采购单", "导出Excel列表", "导出已结案Excel列表");
 		return modelAndView;

+ 21 - 0
src/main/java/com/uas/platform/b2b/dao/PurchaseApBillDao.java

@@ -1,9 +1,12 @@
 package com.uas.platform.b2b.dao;
 
+import java.util.Date;
 import java.util.List;
 
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
 import com.uas.platform.b2b.model.PurchaseApBill;
@@ -34,5 +37,23 @@ public interface PurchaseApBillDao extends JpaSpecificationExecutor<PurchaseApBi
 	 * @return
 	 */
 	public List<PurchaseApBill> findByVendUUAndNonPosting(Long vendUU, Short nonPosting);
+	
+	/**
+	 * 根据截止日期获取(发票日期)
+	 * @param formDate
+	 * @param endDate
+	 * @return
+	 */
+	@Query("select p.id from PurchaseApBill p where p.date <= :endDate")
+	public List<Long> findByEndDate(@Param("endDate")Date endDate);
+	
+	/**
+	 * 根据起始日期获取(发票日期)
+	 * @param formDate
+	 * @param endDate
+	 * @return
+	 */
+	@Query("select p.id from PurchaseApBill p where p.date >= :fromDate")
+	public List<Long> findByFromDate(@Param("fromDate")Date formDate);
 
 }

+ 19 - 0
src/main/java/com/uas/platform/b2b/dao/PurchaseNoticeDao.java

@@ -1,5 +1,6 @@
 package com.uas.platform.b2b.dao;
 
+import java.util.Date;
 import java.util.List;
 
 import org.springframework.data.jpa.repository.JpaRepository;
@@ -62,5 +63,23 @@ public interface PurchaseNoticeDao extends JpaSpecificationExecutor<PurchaseNoti
 	@Modifying(clearAutomatically = true)
 	@Query("update PurchaseNotice n set n.endQty=(select sum(s.qty) from SaleSendItem s where s.notice=n) where n.id= :id")
 	public void updateBySend(@Param("id") long id);
+	
+	/**
+	 * 根据截止日期获取(交货日期)
+	 * @param formDate
+	 * @param endDate
+	 * @return
+	 */
+	@Query("select p.id from PurchaseNotice p where p.delivery <= :endDate")
+	public List<Long> findByEndDate(@Param("endDate")Date endDate);
+	
+	/**
+	 * 根据起始日期获取(交货日期)
+	 * @param formDate
+	 * @param endDate
+	 * @return
+	 */
+	@Query("select p.id from PurchaseNotice p where p.delivery >= :fromDate")
+	public List<Long> findByFromDate(@Param("fromDate")Date formDate);
 
 }

+ 21 - 0
src/main/java/com/uas/platform/b2b/dao/PurchaseOrderAllDao.java

@@ -1,9 +1,12 @@
 package com.uas.platform.b2b.dao;
 
+import java.util.Date;
 import java.util.List;
 
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
 import com.uas.platform.b2b.model.PurchaseOrderAll;
@@ -37,5 +40,23 @@ public interface PurchaseOrderAllDao extends JpaSpecificationExecutor<PurchaseOr
 	 * @return
 	 */
 	public List<PurchaseOrderAll> findByVendUUAndSendStatus(long vendUU, short sendStatus);
+	
+	/**
+	 * 根据截止日期获取
+	 * @param formDate
+	 * @param endDate
+	 * @return
+	 */
+	@Query("select p.id from PurchaseOrderAll p where p.date <= :endDate")
+	public List<Long> findByEndDate(@Param("endDate")Date endDate);
+	
+	/**
+	 * 根据起始日期获取
+	 * @param formDate
+	 * @param endDate
+	 * @return
+	 */
+	@Query("select p.id from PurchaseOrderAll p where p.date >= :fromDate")
+	public List<Long> findByFromDate(@Param("fromDate")Date formDate);
 
 }

+ 22 - 1
src/main/java/com/uas/platform/b2b/dao/SaleSendAllDao.java

@@ -1,13 +1,34 @@
 package com.uas.platform.b2b.dao;
 
+import java.util.Date;
+import java.util.List;
+
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
 import com.uas.platform.b2b.model.SaleSendAll;
 
 @Repository
 public interface SaleSendAllDao extends JpaSpecificationExecutor<SaleSendAll>, JpaRepository<SaleSendAll, Long> {
-
 	
+	/**
+	 * 根据截止日期获取(发货日期)
+	 * @param formDate
+	 * @param endDate
+	 * @return
+	 */
+	@Query("select s.id from SaleSendAll s where s.date <= :endDate")
+	public List<Long> findByEndDate(@Param("endDate")Date endDate);
+	
+	/**
+	 * 根据起始日期获取(发货日期)
+	 * @param formDate
+	 * @param endDate
+	 * @return
+	 */
+	@Query("select s.id from SaleSendAll s where s.date >= :fromDate")
+	public List<Long> findByFromDate(@Param("fromDate")Date formDate);
 }

+ 3 - 3
src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseNotifyServiceImpl.java

@@ -60,8 +60,8 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 				PurchaseNotice existNotice = existNotices.get(0);
 				SimpleDateFormat dateFormat = new SimpleDateFormat("MM月dd日");
 				existNotice.setSendStatus((short) Status.NOT_UPLOAD.value());//对卖家传输状态 待上传
-				if(existNotice.getEndQty() <= notice.getQty()) {
-					// 已发货数小于或等于新的需求数,修改平台上的需求数为已发货数,将已发货数量传回买家ERP修改发货提醒的数量
+				if(existNotice.getEndQty() > notice.getQty()) {
+					// 已发货数于新的需求数,修改平台上的需求数为已发货数,将已发货数量传回买家ERP修改发货提醒的数量
 					if(StringUtils.hasText(existNotice.getRemark())) {
 						existNotice.setRemark(existNotice.getRemark() + ";" + 
 								dateFormat.format(new Date()) + "修改需求数量" + 
@@ -75,7 +75,7 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 					oppNotices.add(existNotice);
 					notices.add(existNotice);
 				} else {
-					// 已发货数于新的需求数,修改平台上的需求数为新的需求数
+					// 已发货数小于或等于新的需求数,修改平台上的需求数为新的需求数
 					if(StringUtils.hasText(existNotice.getRemark())) {
 						existNotice.setRemark(existNotice.getRemark() + ";" + 
 								dateFormat.format(new Date()) + "修改需求数量" + 

+ 2 - 2
src/main/java/com/uas/platform/b2b/mobile/controller/NoticeController.java

@@ -40,11 +40,11 @@ public class NoticeController {
 	 */
 	@RequestMapping(method = RequestMethod.GET)
 	@ResponseBody
-	public Page<Notice> getNotices(PageParams params, String keyword) {
+	public Page<Notice> getNotices(PageParams params, String keyword, Long fromDate, Long endDate) {
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return noticeService.convertNotice(purchaseNoticeService.findAllByPageInfo(info, keyword));
+		return noticeService.convertNotice(purchaseNoticeService.findAllByPageInfo(info, keyword, fromDate, endDate));
 	}
 
 	/**

+ 2 - 2
src/main/java/com/uas/platform/b2b/mobile/controller/SaleController.java

@@ -40,11 +40,11 @@ public class SaleController {
 	 */
 	@RequestMapping(method = RequestMethod.GET)
 	@ResponseBody
-	public Page<Purchase> getReceivedPurchaseOrders(PageParams params, String keyword) {
+	public Page<Purchase> getReceivedPurchaseOrders(PageParams params, String keyword, Long fromDate, Long endDate) {
 		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
-		return purchaseService.convertPurchaseOrder(purchaseOrderService.findAllDetailByPageInfo(info, keyword));
+		return purchaseService.convertPurchaseOrder(purchaseOrderService.findAllDetailByPageInfo(info, keyword, fromDate, endDate));
 	}
 
 	/**

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/PurchaseApBillService.java

@@ -60,7 +60,7 @@ public interface PurchaseApBillService {
 	 *            查找关键字
 	 * @return
 	 */
-	public Page<PurchaseApBill> findAllByPageInfo(PageInfo pageInfo, String keyword);
+	public Page<PurchaseApBill> findAllByPageInfo(PageInfo pageInfo, String keyword, Long fromDate, Long endDate);
 
 	/**
 	 * 用不良品入库单ID查找客户应付票据

+ 3 - 3
src/main/java/com/uas/platform/b2b/service/PurchaseNoticeService.java

@@ -50,7 +50,7 @@ public interface PurchaseNoticeService {
 	 *            查找关键词
 	 * @return
 	 */
-	public Page<PurchaseNotice> findAllByPageInfo(PageInfo pageInfo, String keyword);
+	public Page<PurchaseNotice> findAllByPageInfo(PageInfo pageInfo, String keyword, Long fromDate, Long endDate);
 
 	/**
 	 * 分页查找送货单
@@ -58,7 +58,7 @@ public interface PurchaseNoticeService {
 	 * @param pageInfo
 	 * @return
 	 */
-	public Page<SaleSendAll> findSendsByPageInfo(PageInfo pageInfo, String keyword);
+	public Page<SaleSendAll> findSendsByPageInfo(PageInfo pageInfo, String keyword, Long fromDate, Long endDate);
 
 	/**
 	 * 分页查找送货提醒单
@@ -68,7 +68,7 @@ public interface PurchaseNoticeService {
 	 *            查找关键词
 	 * @return
 	 */
-	public Page<PurchaseNotice> findDoneByPageInfo(PageInfo pageInfo, String keyword);
+	public Page<PurchaseNotice> findDoneByPageInfo(PageInfo pageInfo, String keyword, Long fromDate, Long endDate);
 
 	/**
 	 * 用单据ID查找送货提醒单

+ 4 - 4
src/main/java/com/uas/platform/b2b/service/PurchaseOrderService.java

@@ -47,7 +47,7 @@ public interface PurchaseOrderService {
 	 * @param keyword
 	 * @return
 	 */
-	public Page<PurchaseOrderAll> findAllDetailByPageInfo(PageInfo pageInfo, String keyword);
+	public Page<PurchaseOrderAll> findAllDetailByPageInfo(PageInfo pageInfo, String keyword, Long fromDate, Long endDate);
 
 	/**
 	 * 分页查找待回复订单,包括明细
@@ -55,7 +55,7 @@ public interface PurchaseOrderService {
 	 * @param pageInfo
 	 * @return
 	 */
-	public Page<PurchaseOrderTodo> findTodoByPageInfo(PageInfo pageInfo, String keyword);
+	public Page<PurchaseOrderTodo> findTodoByPageInfo(PageInfo pageInfo, String keyword, Long fromDate, Long endDate);
 
 	/**
 	 * 分页查找已回复订单,包括明细
@@ -63,7 +63,7 @@ public interface PurchaseOrderService {
 	 * @param pageInfo
 	 * @return
 	 */
-	public Page<PurchaseOrderDone> findDoneByPageInfo(PageInfo pageInfo, String keyword);
+	public Page<PurchaseOrderDone> findDoneByPageInfo(PageInfo pageInfo, String keyword, Long fromDate, Long endDate);
 
 	/**
 	 * 分页查找已结案订单明细
@@ -71,7 +71,7 @@ public interface PurchaseOrderService {
 	 * @param pageInfo
 	 * @return
 	 */
-	public Page<PurchaseOrderEnd> findEndByPageInfo(PageInfo pageInfo, String keyword);
+	public Page<PurchaseOrderEnd> findEndByPageInfo(PageInfo pageInfo, String keyword, Long fromDate, Long endDate);
 
 	/**
 	 * 用订单号查找订单

+ 6 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurchaseApBillServiceImpl.java

@@ -1,5 +1,6 @@
 package com.uas.platform.b2b.service.impl;
 
+import java.util.Date;
 import java.util.List;
 
 import javax.persistence.criteria.CriteriaBuilder;
@@ -70,13 +71,17 @@ public class PurchaseApBillServiceImpl implements PurchaseApBillService {
 	}
 
 	@Override
-	public Page<PurchaseApBill> findAllByPageInfo(final PageInfo pageInfo, final String keyword) {
+	public Page<PurchaseApBill> findAllByPageInfo(final PageInfo pageInfo, final String keyword, final Long fromDate, final Long endDate) {
 		return purchaseApBillDao.findAll(new Specification<PurchaseApBill>() {
 
 			public Predicate toPredicate(Root<PurchaseApBill> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
 				if (StringUtils.hasText(keyword))
 					pageInfo.expression(PredicateUtils.in("id", purchaseApBillIndexDao.findByKeyword(SystemSession
 							.getUser().getEnterprise().getUu(), keyword), false));
+				if (fromDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseApBillDao.findByFromDate(new Date(fromDate)), false));
+				if(endDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseApBillDao.findByEndDate(new Date(endDate)), false));
 				query.where(pageInfo.getPredicates(root, query, builder));
 				return null;
 			}

+ 26 - 17
src/main/java/com/uas/platform/b2b/service/impl/PurchaseNoticeServiceImpl.java

@@ -74,29 +74,35 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 	}
 
 	@Override
-	public Page<PurchaseNotice> findAllByPageInfo(final PageInfo pageInfo, final String keyword) {
-		if (StringUtils.hasText(keyword))
-			pageInfo.expression(PredicateUtils.in("id",
-					purchaseNoticeIndexDao.findByKeyword(SystemSession.getUser().getEnterprise().getUu(), keyword), false));
+	public Page<PurchaseNotice> findAllByPageInfo(final PageInfo pageInfo, final String keyword, final Long fromDate, final Long endDate) {
 		return purchaseNoticeDao.findAll(new Specification<PurchaseNotice>() {
-
 			@Override
 			public Predicate toPredicate(Root<PurchaseNotice> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
+				if (StringUtils.hasText(keyword))
+					pageInfo.expression(PredicateUtils.in("id",
+							purchaseNoticeIndexDao.findByKeyword(SystemSession.getUser().getEnterprise().getUu(), keyword), false));
+				if (fromDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseNoticeDao.findByFromDate(new Date(fromDate)), false));
+				if(endDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseNoticeDao.findByEndDate(new Date(endDate)), false));
 				return query.where(pageInfo.getPredicates(root, query, builder)).getRestriction();
 			}
 		}, pageInfo);
 	}
 
 	@Override
-	public Page<PurchaseNotice> findDoneByPageInfo(final PageInfo pageInfo, final String keyword) {
-		pageInfo.filter("status", Status.REPLIED.value());
-		pageInfo.expression(PredicateUtils.or(PredicateUtils.isNull("end"), PredicateUtils.ne("end", Constant.YES, false)));
-		if (StringUtils.hasText(keyword))
-			pageInfo.expression(PredicateUtils.in("id",
-					purchaseNoticeIndexDao.findByKeyword(SystemSession.getUser().getEnterprise().getUu(), keyword), false));
+	public Page<PurchaseNotice> findDoneByPageInfo(final PageInfo pageInfo, final String keyword, final Long fromDate, final Long endDate) {
 		return purchaseNoticeDao.findAll(new Specification<PurchaseNotice>() {
-
 			public Predicate toPredicate(Root<PurchaseNotice> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
+				pageInfo.filter("status", Status.REPLIED.value());
+				pageInfo.expression(PredicateUtils.or(PredicateUtils.isNull("end"), PredicateUtils.ne("end", Constant.YES, false)));
+				if (StringUtils.hasText(keyword))
+					pageInfo.expression(PredicateUtils.in("id",
+							purchaseNoticeIndexDao.findByKeyword(SystemSession.getUser().getEnterprise().getUu(), keyword), false));
+				if (fromDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseNoticeDao.findByFromDate(new Date(fromDate)), false));
+				if(endDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseNoticeDao.findByEndDate(new Date(endDate)), false));
 				return query.where(pageInfo.getPredicates(root, query, builder)).getRestriction();
 			}
 		}, pageInfo);
@@ -319,14 +325,17 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 	}
 
 	@Override
-	public Page<SaleSendAll> findSendsByPageInfo(final PageInfo pageInfo, String keyword) {
-		if (StringUtils.hasText(keyword))
-			pageInfo.expression(PredicateUtils.in("id",
-					saleSendIndexDao.findByKeyword(SystemSession.getUser().getEnterprise().getUu(), keyword), false));
+	public Page<SaleSendAll> findSendsByPageInfo(final PageInfo pageInfo, final String keyword, final Long fromDate, final Long endDate) {
 		return saleSendAllDao.findAll(new Specification<SaleSendAll>() {
-
 			@Override
 			public Predicate toPredicate(Root<SaleSendAll> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
+				if (StringUtils.hasText(keyword))
+					pageInfo.expression(PredicateUtils.in("id",
+							saleSendIndexDao.findByKeyword(SystemSession.getUser().getEnterprise().getUu(), keyword), false));
+				if (fromDate != null)
+					pageInfo.expression(PredicateUtils.in("id", saleSendAllDao.findByFromDate(new Date(fromDate)), false));
+				if(endDate != null)
+					pageInfo.expression(PredicateUtils.in("id", saleSendAllDao.findByEndDate(new Date(endDate)), false));
 				return query.where(pageInfo.getPredicates(root, query, builder)).getRestriction();
 			}
 		}, pageInfo);

+ 26 - 10
src/main/java/com/uas/platform/b2b/service/impl/PurchaseOrderServiceImpl.java

@@ -95,15 +95,19 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 	}
 
 	@Override
-	public Page<PurchaseOrderAll> findAllDetailByPageInfo(final PageInfo pageInfo, final String keyword) {
+	public Page<PurchaseOrderAll> findAllDetailByPageInfo(final PageInfo pageInfo, final String keyword, final Long fromDate, final Long endDate) {
+		if (StringUtils.hasText(keyword))
+			pageInfo.expression(PredicateUtils.in("id", purchaseOrderIndexDao.findByKeyword(SystemSession
+					.getUser().getEnterprise().getUu(), keyword), false));
+		System.out.println("fromDate == " + fromDate);
+		System.out.println("endDate == " + endDate);
+		if (fromDate != null)
+			pageInfo.expression(PredicateUtils.in("id", purchaseOrderAllDao.findByFromDate(new Date(fromDate)), false));
+		if(endDate != null)
+			pageInfo.expression(PredicateUtils.in("id", purchaseOrderAllDao.findByEndDate(new Date(endDate)), false));
 		return purchaseOrderAllDao.findAll(new Specification<PurchaseOrderAll>() {
-
 			public Predicate toPredicate(Root<PurchaseOrderAll> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-				if (StringUtils.hasText(keyword))
-					pageInfo.expression(PredicateUtils.in("id", purchaseOrderIndexDao.findByKeyword(SystemSession
-							.getUser().getEnterprise().getUu(), keyword), false));
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
+				return query.where(pageInfo.getPredicates(root, query, builder)).getRestriction();
 			}
 		}, pageInfo);
 	}
@@ -298,13 +302,17 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 	}
 
 	@Override
-	public Page<PurchaseOrderTodo> findTodoByPageInfo(final PageInfo pageInfo, final String keyword) {
+	public Page<PurchaseOrderTodo> findTodoByPageInfo(final PageInfo pageInfo, final String keyword, final Long fromDate, final Long endDate) {
 		return purchaseOrderTodoDao.findAll(new Specification<PurchaseOrderTodo>() {
 
 			public Predicate toPredicate(Root<PurchaseOrderTodo> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
 				if (StringUtils.hasText(keyword))
 					pageInfo.expression(PredicateUtils.in("id", purchaseOrderIndexDao.findByKeyword(SystemSession
 							.getUser().getEnterprise().getUu(), keyword), false));
+				if (fromDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseOrderAllDao.findByFromDate(new Date(fromDate)), false));
+				if(endDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseOrderAllDao.findByEndDate(new Date(endDate)), false));
 				query.where(pageInfo.getPredicates(root, query, builder));
 				return null;
 			}
@@ -312,13 +320,17 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 	}
 
 	@Override
-	public Page<PurchaseOrderDone> findDoneByPageInfo(final PageInfo pageInfo, final String keyword) {
+	public Page<PurchaseOrderDone> findDoneByPageInfo(final PageInfo pageInfo, final String keyword, final Long fromDate, final Long endDate) {
 		return purchaseOrderDoneDao.findAll(new Specification<PurchaseOrderDone>() {
 
 			public Predicate toPredicate(Root<PurchaseOrderDone> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
 				if (StringUtils.hasText(keyword))
 					pageInfo.expression(PredicateUtils.in("id", purchaseOrderIndexDao.findByKeyword(SystemSession
 							.getUser().getEnterprise().getUu(), keyword), false));
+				if (fromDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseOrderAllDao.findByFromDate(new Date(fromDate)), false));
+				if(endDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseOrderAllDao.findByEndDate(new Date(endDate)), false));
 				query.where(pageInfo.getPredicates(root, query, builder));
 				return null;
 			}
@@ -326,13 +338,17 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 	}
 
 	@Override
-	public Page<PurchaseOrderEnd> findEndByPageInfo(final PageInfo pageInfo, final String keyword) {
+	public Page<PurchaseOrderEnd> findEndByPageInfo(final PageInfo pageInfo, final String keyword, final Long fromDate, final Long endDate) {
 		return purchaseOrderEndDao.findAll(new Specification<PurchaseOrderEnd>() {
 
 			public Predicate toPredicate(Root<PurchaseOrderEnd> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
 				if (StringUtils.hasText(keyword))
 					pageInfo.expression(PredicateUtils.in("id", purchaseOrderIndexDao.findByKeyword(SystemSession
 							.getUser().getEnterprise().getUu(), keyword), false));
+				if (fromDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseOrderAllDao.findByFromDate(new Date(fromDate)), false));
+				if(endDate != null)
+					pageInfo.expression(PredicateUtils.in("id", purchaseOrderAllDao.findByEndDate(new Date(endDate)), false));
 				query.where(pageInfo.getPredicates(root, query, builder));
 				return null;
 			}