Browse Source

【商务平台】 更新搜索

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@6543 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
9b64112d24

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

@@ -4,6 +4,7 @@ import java.text.SimpleDateFormat;
 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.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -16,7 +17,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.uas.platform.b2b.model.PurchaseInquiryItem;
-import com.uas.platform.b2b.search.SearchService;
+import com.uas.platform.b2b.model.SearchFilter;
 import com.uas.platform.b2b.service.PurchaseInquiryService;
 import com.uas.platform.b2b.service.UserService;
 import com.uas.platform.b2b.support.JxlsExcelView;
@@ -29,7 +30,6 @@ import com.uas.platform.core.model.PageParams;
 import com.uas.platform.core.model.Status;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import com.uas.platform.core.web.bind.RequestState;
-import com.uas.search.b2b.model.SPage;
 
 /**
  * 卖家对询价单的操作
@@ -43,13 +43,10 @@ public class SaleInquiryController {
 
 	@Autowired
 	private PurchaseInquiryService purchaseInquiryService;
-
+	
 	@Autowired
 	private UserService userService;
 
-	@Autowired
-	private SearchService searchService;
-
 	private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
 
 	/**
@@ -60,12 +57,17 @@ public class SaleInquiryController {
 	 */
 	@RequestMapping(method = RequestMethod.GET)
 	@ResponseBody
-	public SPage<PurchaseInquiryItem> getReceivedPurchaseInquiries(PageParams params, String keyword) {
+	public Page<PurchaseInquiryItem> getReceivedPurchaseInquiries(PageParams params, String keyword) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(全部)");
-		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
-		// 当前登录企业作为供应商
-		pageParams.getFilters().put("id_venduu", SystemSession.getUser().getEnterprise().getUu());
-		return searchService.searchPurchaseInquiryIds(keyword, pageParams);
+		PageInfo info = new PageInfo(params);
+		// 我作为卖家,把我的企业ID作为供应商ID传入
+		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
+		//判断当前用户是否被客户分配
+		SearchFilter filter = userService.distribute();
+		if(filter != null && filter.getDistribute() == null) {
+			return null;
+		}
+		return purchaseInquiryService.findAllByPageInfo(info, keyword, filter);
 	}
 
 	/**
@@ -76,16 +78,22 @@ public class SaleInquiryController {
 	 */
 	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
-	public SPage<PurchaseInquiryItem> getTodoInquiries(PageParams params, String keyword) {
+	public Page<PurchaseInquiryItem> getTodoInquiries(PageParams params, String keyword) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(待回复)");
-		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
-		// 当前登录企业作为供应商
-		pageParams.getFilters().put("id_venduu", SystemSession.getUser().getEnterprise().getUu());
-		pageParams.getFilters().put("id_status", Status.NOT_REPLY.value());
-		pageParams.getFilters().put("in_overdue", (short) Constant.NO);
-		return searchService.searchPurchaseInquiryIds(keyword, pageParams);
+		PageInfo info = new PageInfo(params);
+		// 询价单状态为未回复
+		info.filter("status", Status.NOT_REPLY.value());
+		// 我作为卖家,把我的企业ID作为供应商ID传入
+		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
+		info.filter("inquiry.overdue", Constant.NO);
+		//判断当前用户是否被客户分配
+		SearchFilter filter = userService.distribute();
+		if(filter != null && filter.getDistribute() == null) {
+			return null;
+		}
+		return purchaseInquiryService.findAllByPageInfo(info, keyword, filter);
 	}
-
+	
 	/**
 	 * 作为卖家,收到的采购询价(已过期)
 	 * 
@@ -94,14 +102,21 @@ public class SaleInquiryController {
 	 */
 	@RequestMapping(params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
-	public SPage<PurchaseInquiryItem> getEndInquiries(PageParams params, String keyword) {
+	public Page<PurchaseInquiryItem> getEndInquiries(PageParams params, String keyword) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(已过期)");
-		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
-		// 当前登录企业作为供应商
-		pageParams.getFilters().put("id_venduu", SystemSession.getUser().getEnterprise().getUu());
-		pageParams.getFilters().put("id_status", Status.NOT_REPLY.value());
-		pageParams.getFilters().put("in_overdue", (short) Constant.YES);
-		return searchService.searchPurchaseInquiryIds(keyword, pageParams);
+		PageInfo info = new PageInfo(params);
+		// 询价单状态为未回复
+		info.filter("status", Status.NOT_REPLY.value());
+		// 我作为卖家,把我的企业ID作为供应商ID传入
+		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
+		//已过期
+		info.filter("inquiry.overdue", Constant.YES);
+		//判断当前用户是否被客户分配
+		SearchFilter filter = userService.distribute();
+		if(filter != null && filter.getDistribute() == null) {
+			return null;
+		}
+		return purchaseInquiryService.findAllByPageInfo(info, keyword, filter);
 	}
 
 	/**
@@ -112,13 +127,19 @@ public class SaleInquiryController {
 	 */
 	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
-	public SPage<PurchaseInquiryItem> getDoneInquiries(PageParams params, String keyword) {
+	public Page<PurchaseInquiryItem> getDoneInquiries(PageParams params, String keyword) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(已回复)");
-		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
-		// 当前登录企业作为供应商
-		pageParams.getFilters().put("id_venduu", SystemSession.getUser().getEnterprise().getUu());
-		pageParams.getFilters().put("id_status", Status.REPLIED.value());
-		return searchService.searchPurchaseInquiryIds(keyword, pageParams);
+		PageInfo info = new PageInfo(params);
+		// 询价单状态为已回复
+		info.filter("status", Status.REPLIED.value());
+		// 我作为卖家,把我的企业ID作为供应商ID传入
+		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
+		//判断当前用户是否被客户分配
+		SearchFilter filter = userService.distribute();
+		if(filter != null && filter.getDistribute() == null) {
+			return null;
+		}
+		return purchaseInquiryService.findAllByPageInfo(info, keyword, filter);
 	}
 
 	/**

+ 42 - 42
src/main/java/com/uas/platform/b2b/controller/SaleQuotationController.java

@@ -3,7 +3,6 @@ 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.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -16,8 +15,9 @@ 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.SaleQuotation;
 import com.uas.platform.b2b.model.SaleQuotationItem;
-import com.uas.platform.b2b.model.SearchFilter;
+import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.SaleQuotationService;
 import com.uas.platform.b2b.service.UserService;
 import com.uas.platform.b2b.support.JxlsExcelView;
@@ -29,6 +29,7 @@ import com.uas.platform.core.model.PageParams;
 import com.uas.platform.core.model.Status;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import com.uas.platform.core.web.bind.RequestState;
+import com.uas.search.b2b.model.SPage;
 
 /**
  * 卖家主动报价
@@ -42,7 +43,10 @@ public class SaleQuotationController {
 
 	@Autowired
 	private SaleQuotationService saleQuotationService;
-	
+
+	@Autowired
+	private SearchService searchService;
+
 	@Autowired
 	private UserService userService;
 
@@ -56,18 +60,14 @@ public class SaleQuotationController {
 	 */
 	@RequestMapping(method = RequestMethod.GET)
 	@ResponseBody
-	public Page<SaleQuotationItem> getSalQuotationItems(PageParams params, String keyword) {
+	public SPage<SaleQuotation> getSalQuotationItems(PageParams params, String keyword) {
 		logger.log("主动报价单", "查看主动报价单-全部");
-		PageInfo info = new PageInfo(params);
-		info.filter("quotation.enUU", SystemSession.getUser().getEnterprise().getUu());
-		//判断当前用户是否被客户分配
-		SearchFilter filter = userService.distribute();
-		if(filter != null && filter.getDistribute() == null) {
-			return null;
-		}
-		return saleQuotationService.findAllDetailByPageInfo(info, keyword, filter);
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("qu_enuu", SystemSession.getUser().getEnterprise().getUu());
+		return searchService.searchSaleQuotationIds(keyword, pageParams);
 	}
-	
+
 	/**
 	 * 作为卖家,查看自己的主动报价(已提交)
 	 * 
@@ -76,20 +76,21 @@ public class SaleQuotationController {
 	 */
 	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
-	public Page<SaleQuotationItem> getSubmitedQuotationItems(PageParams params, String keyword) {
+	public SPage<SaleQuotation> getSubmitedQuotationItems(PageParams params, String keyword) {
 		logger.log("主动报价单", "查看主动报价单-已提交");
-		PageInfo info = new PageInfo(params);
-		// 已提交
-		info.filter("quotation.enUU", SystemSession.getUser().getEnterprise().getUu());
-		info.filter("quotation.status", Status.SUBMITTED.value());
-		//判断当前用户是否被客户分配
-		SearchFilter filter = userService.distribute();
-		if(filter != null && filter.getDistribute() == null) {
-			return null;
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("qu_enuu", SystemSession.getUser().getEnterprise().getUu());
+		pageParams.getFilters().put("qu_status", Status.SUBMITTED.value());
+		SPage<SaleQuotation> sale = searchService.searchSaleQuotationIds(keyword, pageParams);
+		System.out.println(FlexJsonUtils.toJson(sale.getContent()));
+		for (SaleQuotation sa : sale.getContent()) {
+			System.out.println(FlexJsonUtils.toJson(sa));
+			System.out.println("---");
 		}
-		return saleQuotationService.findAllDetailByPageInfo(info, keyword, filter);
+		return sale;
 	}
-	
+
 	/**
 	 * 作为卖家,查看自己的主动报价(未提交)
 	 * 
@@ -98,18 +99,13 @@ public class SaleQuotationController {
 	 */
 	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
-	public Page<SaleQuotationItem> getUnSubmitedQuotationItems(PageParams params, String keyword) {
+	public SPage<SaleQuotation> getUnSubmitedQuotationItems(PageParams params, String keyword) {
 		logger.log("主动报价单", "查看主动报价单-未提交");
-		PageInfo info = new PageInfo(params);
-		// 未提交
-		info.filter("quotation.enUU", SystemSession.getUser().getEnterprise().getUu());
-		info.filter("quotation.status", Status.INPUTTING.value());
-		//判断当前用户是否被客户分配
-		SearchFilter filter = userService.distribute();
-		if(filter != null && filter.getDistribute() == null) {
-			return null;
-		}
-		return saleQuotationService.findAllDetailByPageInfo(info, keyword, filter);
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("qd_enuu", SystemSession.getUser().getEnterprise().getUu());
+		pageParams.getFilters().put("qd_decidestatus", Status.INPUTTING.value());
+		return searchService.searchSaleQuotationIds(keyword, pageParams);
 	}
 
 	/**
@@ -123,7 +119,8 @@ public class SaleQuotationController {
 	public ResponseEntity<ModelMap> save(@RequestBody String json) {
 		SaleQuotationItem item = FlexJsonUtils.fromJson(json, SaleQuotationItem.class);
 		item = saleQuotationService.save(item);
-		logger.log("主动报价单", "在平台上录入主动报价单", item.replyDescription(), item.getQuotation().getCode(), item.getQuotation().getId());
+		logger.log("主动报价单", "在平台上录入主动报价单", item.replyDescription(), item.getQuotation().getCode(),
+				item.getQuotation().getId());
 		ModelMap map = new ModelMap();
 		map.put("id", item.getQuotation().getId());
 		return new ResponseEntity<ModelMap>(map, HttpStatus.OK);
@@ -142,7 +139,7 @@ public class SaleQuotationController {
 		logger.log("主动报价单", "查找主动报价明细", id.toString());
 		return saleQuotationService.findItemById(id);
 	}
-	
+
 	/**
 	 * 导出Excel - 全部
 	 * 
@@ -158,12 +155,13 @@ public class SaleQuotationController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("state", "全部");
 		modelAndView.addObject("dateFormat", dateFormat);
-		modelAndView.addObject("data", saleQuotationService.findAllDetailByPageInfo(pageInfo, keyword, null).getContent());
+		modelAndView.addObject("data",
+				saleQuotationService.findAllDetailByPageInfo(pageInfo, keyword, null).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleQuotation", "主动报价单列表_全部"));
 		logger.log("主动报价单", "导出Excel列表", "导出全部Excel列表");
 		return modelAndView;
 	}
-	
+
 	/**
 	 * 导出Excel - 未提交
 	 * 
@@ -180,12 +178,13 @@ public class SaleQuotationController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("state", "未提交");
 		modelAndView.addObject("dateFormat", dateFormat);
-		modelAndView.addObject("data", saleQuotationService.findAllDetailByPageInfo(pageInfo, keyword, null).getContent());
+		modelAndView.addObject("data",
+				saleQuotationService.findAllDetailByPageInfo(pageInfo, keyword, null).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleQuotation", "主动报价单列表_未提交"));
 		logger.log("主动报价单", "导出Excel列表", "导出未提交Excel列表");
 		return modelAndView;
 	}
-	
+
 	/**
 	 * 导出Excel - 已提交
 	 * 
@@ -202,7 +201,8 @@ public class SaleQuotationController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("state", "已提交");
 		modelAndView.addObject("dateFormat", dateFormat);
-		modelAndView.addObject("data", saleQuotationService.findAllDetailByPageInfo(pageInfo, keyword, null).getContent());
+		modelAndView.addObject("data",
+				saleQuotationService.findAllDetailByPageInfo(pageInfo, keyword, null).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleQuotation", "主动报价单列表_已提交"));
 		logger.log("主动报价单", "导出Excel列表", "导出已提交Excel列表");
 		return modelAndView;

+ 53 - 48
src/main/java/com/uas/platform/b2b/controller/SaleSampleController.java

@@ -1,10 +1,10 @@
 package com.uas.platform.b2b.controller;
 
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 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.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -17,12 +17,11 @@ import org.springframework.web.servlet.ModelAndView;
 
 import com.uas.platform.b2b.model.Attach;
 import com.uas.platform.b2b.model.FileUpload;
+import com.uas.platform.b2b.model.PurchaseProofing;
 import com.uas.platform.b2b.model.PurchaseProofingApproval;
 import com.uas.platform.b2b.model.PurchaseProofingItem;
-import com.uas.platform.b2b.model.PurchaseProofingItemDone;
-import com.uas.platform.b2b.model.PurchaseProofingItemTodo;
 import com.uas.platform.b2b.model.PurchaseProofingSend;
-import com.uas.platform.b2b.model.SearchFilter;
+import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.AttachService;
 import com.uas.platform.b2b.service.PurchaseProofingService;
 import com.uas.platform.b2b.service.UserService;
@@ -32,8 +31,11 @@ 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;
+import com.uas.platform.core.model.Status;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import com.uas.platform.core.web.bind.RequestState;
+import com.uas.search.b2b.model.SPage;
+import com.uas.search.b2b.util.SearchConstants;
 
 /**
  * 卖家获取对应的客户打样申请单
@@ -50,10 +52,13 @@ public class SaleSampleController {
 
 	@Autowired
 	private AttachService attachService;
-	
+
 	@Autowired
 	private UserService userService;
 
+	@Autowired
+	private SearchService searchService;
+
 	private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
 
 	/**
@@ -64,17 +69,13 @@ public class SaleSampleController {
 	 */
 	@RequestMapping(method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseProofingItem> getProofingItems(PageParams params, String keyword) {
-		PageInfo info = new PageInfo(params);
-		// 我作为卖家,把我的企业ID作为供应商ID传入
-		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
+	public SPage<PurchaseProofing> getProofingItems(PageParams params, String keyword) {
 		logger.log("客户打样申请", "查看所有客户打样申请");
-		//判断当前用户是否被客户分配
-		SearchFilter filter = userService.distribute();
-		if(filter != null && filter.getDistribute() == null) {
-			return null;
-		}
-		return purchaseProofingService.findAllByPageInfo(info, keyword, filter);
+		// // 判断当前用户是否被客户分配
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("ppi_ppid", SystemSession.getUser().getEnterprise().getUu());
+		return searchService.searchPurchaseProofingIds(keyword, pageParams);
 	}
 
 	/**
@@ -85,17 +86,16 @@ public class SaleSampleController {
 	 */
 	@RequestMapping(method = RequestMethod.GET, params = RequestState.TODO)
 	@ResponseBody
-	public Page<PurchaseProofingItemTodo> getTodoProofingItems(PageParams params, String keyword) {
-		PageInfo info = new PageInfo(params);
+	public SPage<PurchaseProofing> getTodoProofingItems(PageParams params, String keyword) {
 		// 我作为卖家,把我的企业ID作为供应商ID传入
-		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
 		logger.log("客户打样申请", "查看所有客户打样申请(待处理)");
-		//判断当前用户是否被客户分配
-		SearchFilter filter = userService.distribute();
-		if(filter != null && filter.getDistribute() == null) {
-			return null;
-		}
-		return purchaseProofingService.findTodoByPageInfo(info, keyword, filter);
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, keyword);
+		// 当前登录企业作为供应商
+		List<Object> list = new ArrayList<Object>();
+		list.add(SystemSession.getUser().getEnterprise().getUu());
+		list.add(Status.UNSEND.value());
+		pageParams.getFilters().put("ppi_ppid", list);
+		return searchService.searchPurchaseProofingIds(keyword, pageParams);
 	}
 
 	/**
@@ -106,17 +106,16 @@ public class SaleSampleController {
 	 */
 	@RequestMapping(method = RequestMethod.GET, params = RequestState.DONE)
 	@ResponseBody
-	public Page<PurchaseProofingItemDone> getDoneProofingItems(PageParams params, String keyword) {
-		PageInfo info = new PageInfo(params);
+	public SPage<PurchaseProofing> getDoneProofingItems(PageParams params, String keyword) {
 		// 我作为卖家,把我的企业ID作为供应商ID传入
-		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
 		logger.log("客户打样申请", "查看所有客户打样申请(已处理)");
-		//判断当前用户是否被客户分配
-		SearchFilter filter = userService.distribute();
-		if(filter != null && filter.getDistribute() == null) {
-			return null;
-		}
-		return purchaseProofingService.findDoneByPageInfo(info, keyword, filter);
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		List<Object> list = new ArrayList<Object>();
+		list.add(SystemSession.getUser().getEnterprise().getUu());
+		list.add(Status.SEND.value());
+		pageParams.getFilters().put("ppi_ppid", list);
+		return searchService.searchPurchaseProofingIds(keyword, pageParams);
 	}
 
 	/**
@@ -183,17 +182,19 @@ public class SaleSampleController {
 	 */
 	@RequestMapping(value = "/approval", method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseProofingApproval> getProofingApprovals(PageParams params, String keyword,Long fromDate,Long endDate) {
-		PageInfo info = new PageInfo(params);
-		// 我作为卖家,把我的企业ID作为供应商ID传入
-		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
+	public SPage<PurchaseProofingApproval> getProofingApprovals(PageParams params, String keyword, Long fromDate,
+			Long endDate) {
 		logger.log("客户认定单", "查看所有客户认定单");
-		//判断当前用户是否被客户分配
-		SearchFilter filter = userService.distribute();
-		if(filter != null && filter.getDistribute() == null) {
-			return null;
+		// 判断当前用户是否被客户分配
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		pageParams.getFilters().put("psa_venduu", SystemSession.getUser().getEnterprise().getUu());
+		if (fromDate != null) {
+			pageParams.getFilters().put(SearchConstants.FROM_DATE_KEY, fromDate);
 		}
-		return purchaseProofingService.findApprovalsByPageInfo(info, keyword, fromDate, endDate, filter);
+		if (endDate != null) {
+			pageParams.getFilters().put(SearchConstants.END_DATE_KEY, endDate);
+		}
+		return searchService.searchPurchaseProofingApprovalIds(keyword, pageParams);
 	}
 
 	/**
@@ -208,9 +209,10 @@ public class SaleSampleController {
 		logger.log("客户认定单", "查看所有客户认定单详情界面");
 		return purchaseProofingService.findByidApproval(id);
 	}
-	
+
 	/**
 	 * 记录打样申请单的打印次数
+	 * 
 	 * @param id
 	 * @return
 	 */
@@ -218,10 +220,10 @@ public class SaleSampleController {
 	@ResponseBody
 	public ResponseEntity<String> printCount(@PathVariable("id") Long id) {
 		purchaseProofingService.print(id);
-		logger.log("客户采购单", "打印客户采购订单",id.toString());
+		logger.log("客户采购单", "打印客户采购订单", id.toString());
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}
-	
+
 	/**
 	 * 导出打样申请 - 全部
 	 * 
@@ -258,7 +260,8 @@ public class SaleSampleController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("state", "待送样");
-		modelAndView.addObject("data", purchaseProofingService.findTodoByPageInfo(pageInfo, keyword, null).getContent());
+		modelAndView.addObject("data",
+				purchaseProofingService.findTodoByPageInfo(pageInfo, keyword, null).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleProofing", "客户打样申请单列表_待送样"));
 		logger.log("客户打样申请单", "导出Excel列表", "导出待送样Excel列表");
 		return modelAndView;
@@ -279,7 +282,8 @@ public class SaleSampleController {
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
 		modelAndView.addObject("state", "已送样");
-		modelAndView.addObject("data", purchaseProofingService.findDoneByPageInfo(pageInfo, keyword, null).getContent());
+		modelAndView.addObject("data",
+				purchaseProofingService.findDoneByPageInfo(pageInfo, keyword, null).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleProofing", "客户打样申请单列表_已送样"));
 		logger.log("客户打样申请单", "导出Excel列表", "导出已送样Excel列表");
 		return modelAndView;
@@ -299,7 +303,8 @@ public class SaleSampleController {
 		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
 		ModelAndView modelAndView = new ModelAndView();
 		modelAndView.addObject("dateFormat", dateFormat);
-		modelAndView.addObject("data", purchaseProofingService.findApprovalsByPageInfo(pageInfo, keyword, fromDate, endDate, null).getContent());
+		modelAndView.addObject("data", purchaseProofingService
+				.findApprovalsByPageInfo(pageInfo, keyword, fromDate, endDate, null).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleApproval", "客户认定单列表"));
 		logger.log("客户认定单", "导出Excel列表", "导出全部Excel列表");
 		return modelAndView;

+ 2 - 1
src/main/webapp/resources/js/index/app.js

@@ -3217,8 +3217,9 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 		};
 		//打印  样品采购单
 		$scope.print = function(sample) {
+			console.log(sample);
 			PurcSample.printCount({id: sample.id},{});//增加打印此次
-			ReportService.print(sample.proofing.enUU, 'PURCPROOFING',"where purc$proofingitems.ppi_id =" + sample.id);
+			ReportService.print(sample.enUU, 'PURCPROOFING',"where purc$proofingitems.ppi_id =" + sample.proofingItems[0].id);
 		};
 		
 		$scope.getSend = function(proofing){

+ 40 - 36
src/main/webapp/resources/tpl/index/sale/quotation_list.html

@@ -152,21 +152,21 @@
 					<span> <input type="checkbox" class="selector"
 						ng-model="quotationItem.$selected">
 					</span> <span class="text-num text-bold"
-						title="{{quotationItem.quotation.date}}"
-						ng-bind="::quotationItem.quotation.date | date:'yyyy-MM-dd'"></span> <span>流水号:<a
-						class="text-num" ng-bind="::quotationItem.quotation.code" ui-sref="sale.quotation.item({id:quotationItem.quotation.id})" target="_self"></a></span>
+						title="{{quotationItem.date}}"
+						ng-bind="::quotationItem.date | date:'yyyy-MM-dd'"></span> <span>流水号:<a
+						class="text-num" ng-bind="::quotationItem.code" ui-sref="sale.quotation.item({id:quotationItem.id})" target="_self"></a></span>
 				</div>
 			</td>
 			<td colspan="2"><span
-				ng-bind="::quotationItem.quotation.cust.enName"></span></td>
+				ng-bind="::quotationItem.cust.enName"></span></td>
 			<td>
-				币别:<span ng-bind="::quotationItem.quotation.currency"></span>
+				币别:<span ng-bind="::quotationItem.currency"></span>
 			</td>
 			<td>
-				税率:<span ng-bind="::quotationItem.quotation.taxrate || 0"></span>%
+				税率:<span ng-bind="::quotationItem.taxrate || 0"></span>%
 			</td>
 			<td class="text-left" colspan="1" title="录入人">
-				<i class="fa fa-user text-muted"></i>  {{::quotationItem.quotation.user.userName}}
+				<i class="fa fa-user text-muted"></i>  {{::quotationItem.user.userName}}
 			</td>
 			<td class="text-center">
 				<div class="operates">
@@ -176,32 +176,36 @@
 			</td>
 		</tr>
 		<tr class="order-bd">
-			<td class="product">
-				<div class="text-num text-bold" ng-bind="::quotationItem.product.code"></div>
-				<div ng-bind="::quotationItem.product.title"></div>
-				<div class="text-muted" ng-bind="::quotationItem.product.spec"></div>
-				<div ng-if="::quotationItem.brand && !quotationItem.$editing" class="text-muted">
-					品牌:<spans ng-bind="::quotationItem.brand"></span>
+			<td class="product" ng-repeat="pro in quotationItem.quotationItems">
+				<div class="text-num text-bold" ng-bind="::pro.product.code"></div>
+				<div ng-bind="::pro.product.title"></div>
+				<div class="text-muted" ng-bind="::pro.product.spec"></div>
+				<div ng-if="::pro.brand && !pro.$editing" class="text-muted">
+					品牌:<span ng-bind="::pro.brand"></span>
 				</div>
-				<div ng-if="::quotationItem.vendorprodcode && !quotationItem.$editing" class="text-muted">
-					供应商物料编号:<spans ng-bind="::quotationItem.vendorprodcode"></span>
+				<div ng-if="::pro.vendorprodcode && !pro.$editing" class="text-muted">
+					供应商物料编号:<span ng-bind="::pro.vendorprodcode"></span>
 				</div>
-				<div ng-if="::quotationItem.leadtime && !quotationItem.$editing" class="text-muted">
-					交货周期:<span ng-bind="::quotationItem.leadtime"></span> 天
+				<div ng-if="::pro.leadtime && !pro.$editing" class="text-muted">
+					交货周期:<span ng-bind="::pro.leadtime"></span> 天
 				</div>
 			</td>
 			<td class="text-center">
 				<div ng-show="!quotationItem.$editing">
-					<div ng-repeat="price in quotationItem.prices">
-						<span ng-bind="price.lapQty"></span>
+					<div ng-repeat="price in quotationItem.quotationItems">
+						<div ng-repeat="pricedetail in price.prices">
+							<span ng-bind="::pricedetail.lapQty"></span>
+						</div>
 					</div>
 				</div>
 			</td>
 			<td class="text-center br-l">
 				<div ng-show="!quotationItem.$editing">
-					<div ng-repeat="price in quotationItem.prices">
-						<span ng-bind="price.price | number:6"></span> <span
-							ng-show="price.price == null" class="text-muted">-</span>
+					<div ng-repeat="price in quotationItem.quotationItems">
+						<div ng-repeat="pricedetail in price.prices">
+							<span ng-bind="pricedetail.price | number:6"></span> <span
+								ng-show="pricedetail.price == null" class="text-muted">-</span>
+						</div>
 					</div>
 					<div class="dropdown">
 						<a href="javascript:void(0);" class="dropdown-toggle text-default"
@@ -231,42 +235,42 @@
 				</div>
 			</td>
 			<td class="text-center br-l">
-				<div ng-show="!quotationItem.$editing">
-					<span ng-bind="quotationItem.minOrderQty"></span> <span
-						ng-show="quotationItem.minOrderQty == null" class="text-muted">-</span>
+				<div ng-show="!quotationItem.$editing" ng-repeat="detail in quotationItem.quotationItems">
+					<span ng-bind="detail.minOrderQty"></span> <span
+						ng-show="detail.minOrderQty == null" class="text-muted">-</span>
 				</div>
 			</td>
 			<td class="text-center br-l">
-				<div ng-show="!quotationItem.$editing">
-					<span ng-bind="quotationItem.minPackQty"></span> <span
-						ng-show="quotationItem.minPackQty == null" class="text-muted">-</span>
+				<div ng-show="!quotationItem.$editing" ng-repeat="detail in quotationItem.quotationItems">
+					<span ng-bind="detail.minPackQty"></span> <span
+						ng-show="detail.minPackQty == null" class="text-muted">-</span>
 				</div>
 			</td>
 			<td class="text-center br-l">
 				<div ng-show="!quotationItem.$editing"
 					ng-init="parseDate(quotationItem)">
-					<div ng-show="quotationItem.quotation.endDate">
+					<div ng-show="quotationItem.endDate">
 						<span class="text-muted">从 </span><span
-							ng-bind="quotationItem.quotation.date | date:'yyyy-MM-dd'"></span> <span
+							ng-bind="quotationItem.date | date:'yyyy-MM-dd'"></span> <span
 							class="text-muted">到 </span><span
-							ng-bind="quotationItem.quotation.endDate | date:'yyyy-MM-dd'"></span>
+							ng-bind="quotationItem.endDate | date:'yyyy-MM-dd'"></span>
 					</div>
-					<div ng-show="!quotationItem.quotation.endDate">
+					<div ng-show="!quotationItem.endDate">
 						<span class="text-muted">-</span>
 					</div>
 				</div>
 			</td>
 			<td class="text-center br-l">
-				<div ng-if="quotationItem.quotation.status == 101 && quotationItem.quotation.agreed == null" class="block">
+				<div ng-if="quotationItem.status == 101 && quotationItem.agreed == null" class="block">
 					<span class="text-trans warning">已提交</span>
 				</div>
-				<div ng-if="quotationItem.quotation.status == 101 && quotationItem.quotation.agreed == 1" class="block">
+				<div ng-if="quotationItem.status == 101 && quotationItem.agreed == 1" class="block">
 					<span class="text-trans success">报价已采纳</span>
 				</div>
-				<div ng-if="quotationItem.quotation.status == 101 && quotationItem.quotation.agreed == 0" class="block">
+				<div ng-if="quotationItem.status == 101 && quotationItem.agreed == 0" class="block">
 					<span class="text-trans error">报价未采纳</span>
 				</div>
-				<div ng-if="quotationItem.quotation.status == 100">
+				<div ng-if="quotationItem.status == 100">
 					<a ui-sref="sale.quotation.item({id:quotationItem.quotation.id})">详情>></a>
 				</div>
 			</td>

+ 20 - 20
src/main/webapp/resources/tpl/index/sale/sample.html

@@ -250,14 +250,14 @@
 				<div class="order-main">
 					<span> <input type="checkbox" class="selector"
 						ng-model="sample.$selected">
-					</span> <span class="text-num text-bold" title="{{sample.proofing.date | date: 'yyyy年MM月dd日 hh:mm'}}"
-						ng-bind="sample.proofing.date | date:'yyyy-MM-dd'"></span>
+					</span> <span class="text-num text-bold" title="{{sample.date | date: 'yyyy年MM月dd日 hh:mm'}}"
+						ng-bind="sample.date | date:'yyyy-MM-dd'"></span>
 				</div>
 			</td>
 			<td colspan="3"><span title="客户名称"
-				ng-bind="sample.proofing.enterprise.enName"><span></td>
+				ng-bind="sample.enterprise.enName"><span></td>
 			<td colspan="1" class="order-sum" title="是否收费">
-				<div ng-show="sample.proofing.isCharge == '是'" class="label label-success">收&nbsp;&nbsp;&nbsp;费</div>
+				<div ng-show="sample.isCharge == '是'" class="label label-success">收&nbsp;&nbsp;&nbsp;费</div>
 				
 			</td>
 			<td colspan="1" class="text-center">
@@ -273,39 +273,39 @@
 		<tr class="order-bd">
 			<td class="product">
 				<div class="text-num text-bold">
-					<a ng-bind="sample.proofing.product.code"></a>
+					<a ng-bind="sample.product.code"></a>
 				</div>
 				<div>
-					<a ng-bind="sample.proofing.product.title"></a>
+					<a ng-bind="sample.product.title"></a>
 				</div>
-				<div class="text-muted" title="{{sample.proofing.product.spec}}"
-					ng-bind="sample.proofing.product.spec"></div>
-				<div ng-if="sample.proofing.envrequiry" title="环保要求">
-					<i class="fa fa-tree fa-fw" style="color: #33CC33;"></i> 环保要求:<span ng-bind="::sample.proofing.envrequiry"></span>
+				<div class="text-muted" title="{{sample.product.spec}}"
+					ng-bind="sample.product.spec"></div>
+				<div ng-if="sample.envrequiry" title="环保要求">
+					<i class="fa fa-tree fa-fw" style="color: #33CC33;"></i> 环保要求:<span ng-bind="::sample.envrequiry"></span>
 				</div>
 			</td>
 			<td class="text-center">
 				<div class="text-num text-bold"
 					title="{{sample.qty}}" ng-bind="sample.qty"></div>
-				<div class="text-muted" ng-bind="sample.proofing.product.unit"></div>
+				<div class="text-muted" ng-bind="sample.product.unit"></div>
 			</td>
 			<td class="text-center">
-				<div ng-show="sample.proofing.isCharge != '是'" class="label label-default">不收费</div>
-				<div ng-show="sample.proofing.isCharge == '是'" class="text-num">
+				<div ng-show="sample.isCharge != '是'" class="label label-default">不收费</div>
+				<div ng-show="sample.isCharge == '是'" class="text-num">
 					<span ng-bind="::currency(sample.currency)"></span>
 					<span ng-bind="::sample.price | number:6"></span>
 				</div>
-				<div ng-show="sample.proofing.isCharge == '是'" class="text-muted">
+				<div ng-show="sample.isCharge == '是'" class="text-muted">
 					税率:<span class="text-num" ng-bind="::sample.taxrate"></span>%
 				</div>
-				<div ng-show="sample.proofing.isCharge == '是'">
+				<div ng-show="sample.isCharge == '是'">
 					<br>
 					总额:<span class="text-num" ng-bind="sample.amount | currency: currency(sample.currency)"></span>
 				</div>
 			</td>
 			<td class="text-center br-l">
 				<div class="text-num" title="交货日期"
-					ng-bind="sample.proofing.delivery | date: 'yyyy-MM-dd'"></div><br>
+					ng-bind="sample.delivery | date: 'yyyy-MM-dd'"></div><br>
 				<div ng-if="sample.status == 400" class="dropdown text-center">
 					<a href="javascript:void(0);"
 						class="dropdown-toggle text-default"
@@ -347,12 +347,12 @@
 				
 			</td>
 			<td class="br-l">
-				<div><span>编号:<a class="text-num" ng-bind="::sample.proofing.code"
+				<div><span>编号:<a class="text-num" ng-bind="::sample.code"
 						ui-sref="sale.sample_detail({id:sample.id})" target="_self"></a></span></div>
 				<div>第 <span ng-bind="sample.number"></span> 行</div>
-				<div>附件:<span ng-if="sample.proofing.attachs.length == 0">无</span></div>
-				<div ng-if="sample.proofing.attachs.length > 0">
-					<div ng-repeat="attach in sample.proofing.attachs">
+				<div>附件:<span ng-if="sample.attachs.length == 0">无</span></div>
+				<div ng-if="sample.attachs.length > 0">
+					<div ng-repeat="attach in sample.attachs">
 						<a class="file" href="file/{{attach.id}}" ng-bind="::attach.name"></a>
 					</div>
 				</div>