|
|
@@ -17,7 +17,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import com.uas.platform.b2b.model.SaleQuotationItem;
|
|
|
+import com.uas.platform.b2b.model.SearchFilter;
|
|
|
import com.uas.platform.b2b.service.SaleQuotationService;
|
|
|
+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;
|
|
|
@@ -40,6 +42,9 @@ public class SaleQuotationController {
|
|
|
|
|
|
@Autowired
|
|
|
private SaleQuotationService saleQuotationService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
|
|
|
private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
|
|
|
|
|
|
@@ -55,7 +60,12 @@ public class SaleQuotationController {
|
|
|
logger.log("主动报价单", "查看主动报价单-全部");
|
|
|
PageInfo info = new PageInfo(params);
|
|
|
info.filter("quotation.enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- return saleQuotationService.findAllDetailByPageInfo(info, keyword);
|
|
|
+ //判断当前用户是否被客户分配
|
|
|
+ SearchFilter filter = userService.distribute();
|
|
|
+ if(filter != null && filter.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return saleQuotationService.findAllDetailByPageInfo(info, keyword, filter);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -72,7 +82,12 @@ public class SaleQuotationController {
|
|
|
// 已提交
|
|
|
info.filter("quotation.enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
info.filter("quotation.status", Status.SUBMITTED.value());
|
|
|
- return saleQuotationService.findAllDetailByPageInfo(info, keyword);
|
|
|
+ //判断当前用户是否被客户分配
|
|
|
+ SearchFilter filter = userService.distribute();
|
|
|
+ if(filter != null && filter.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return saleQuotationService.findAllDetailByPageInfo(info, keyword, filter);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -89,7 +104,12 @@ public class SaleQuotationController {
|
|
|
// 未提交
|
|
|
info.filter("quotation.enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
info.filter("quotation.status", Status.INPUTTING.value());
|
|
|
- return saleQuotationService.findAllDetailByPageInfo(info, keyword);
|
|
|
+ //判断当前用户是否被客户分配
|
|
|
+ SearchFilter filter = userService.distribute();
|
|
|
+ if(filter != null && filter.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return saleQuotationService.findAllDetailByPageInfo(info, keyword, filter);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -138,7 +158,7 @@ public class SaleQuotationController {
|
|
|
ModelAndView modelAndView = new ModelAndView();
|
|
|
modelAndView.addObject("state", "全部");
|
|
|
modelAndView.addObject("dateFormat", dateFormat);
|
|
|
- modelAndView.addObject("data", saleQuotationService.findAllDetailByPageInfo(pageInfo, keyword).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;
|
|
|
@@ -160,7 +180,7 @@ public class SaleQuotationController {
|
|
|
ModelAndView modelAndView = new ModelAndView();
|
|
|
modelAndView.addObject("state", "未提交");
|
|
|
modelAndView.addObject("dateFormat", dateFormat);
|
|
|
- modelAndView.addObject("data", saleQuotationService.findAllDetailByPageInfo(pageInfo, keyword).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;
|
|
|
@@ -182,7 +202,7 @@ public class SaleQuotationController {
|
|
|
ModelAndView modelAndView = new ModelAndView();
|
|
|
modelAndView.addObject("state", "已提交");
|
|
|
modelAndView.addObject("dateFormat", dateFormat);
|
|
|
- modelAndView.addObject("data", saleQuotationService.findAllDetailByPageInfo(pageInfo, keyword).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;
|