|
|
@@ -13,7 +13,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import com.uas.platform.b2b.model.PurchaseApBill;
|
|
|
+import com.uas.platform.b2b.model.SearchFilter;
|
|
|
import com.uas.platform.b2b.service.PurchaseApBillService;
|
|
|
+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;
|
|
|
@@ -33,6 +35,9 @@ public class SaleApBillController {
|
|
|
|
|
|
@Autowired
|
|
|
private PurchaseApBillService purchaseApBillService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
|
|
|
private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
|
|
|
|
|
|
@@ -49,7 +54,12 @@ public class SaleApBillController {
|
|
|
PageInfo info = new PageInfo(params);
|
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- return purchaseApBillService.findAllByPageInfo(info, keyword, fromDate, endDate);
|
|
|
+ //判断当前用户是否被客户分配
|
|
|
+ SearchFilter filter = userService.distribute();
|
|
|
+ if(filter != null && filter.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return purchaseApBillService.findAllByPageInfo(info, keyword, fromDate, endDate, filter);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -79,7 +89,7 @@ public class SaleApBillController {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
ModelAndView modelAndView = new ModelAndView();
|
|
|
modelAndView.addObject("dateFormat", dateFormat);
|
|
|
- modelAndView.addObject("data", purchaseApBillService.findAllByPageInfo(pageInfo, keyword, fromDate, endDate).getContent());
|
|
|
+ modelAndView.addObject("data", purchaseApBillService.findAllByPageInfo(pageInfo, keyword, fromDate, endDate, null).getContent());
|
|
|
modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/faApBill", "客户应付发票列表"));
|
|
|
logger.log("客户应付发票", "导出Excel列表", "导出全部Excel列表");
|
|
|
return modelAndView;
|