|
|
@@ -31,6 +31,7 @@ import com.uas.platform.b2b.search.SearchService;
|
|
|
import com.uas.platform.b2b.service.ErpProdIODetailService;
|
|
|
import com.uas.platform.b2b.service.PurchaseApCheckService;
|
|
|
import com.uas.platform.b2b.service.UserService;
|
|
|
+import com.uas.platform.b2b.service.VendorService;
|
|
|
import com.uas.platform.b2b.support.JxlsExcelView;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.b2b.support.UsageBufferedLogger;
|
|
|
@@ -63,6 +64,9 @@ public class SaleApCheckController {
|
|
|
@Autowired
|
|
|
PurchaseApCheckService purchaseApCheckService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private VendorService vendorService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private UserService userService;
|
|
|
|
|
|
@@ -131,24 +135,21 @@ public class SaleApCheckController {
|
|
|
@RequestMapping(value = "/getAllCustomers", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public Set<Object> getAllApChecksCustomers() {
|
|
|
- List<Long> distributes = null;
|
|
|
+ Set<Object> set = new HashSet<>();
|
|
|
// 判断当前用户是否被客户分配
|
|
|
if (!SystemSession.getUser().isSys()) {
|
|
|
List<Vendor> vendors = userService.findChooseVendor(SystemSession.getUser().getUserUU());
|
|
|
- distributes = new ArrayList<Long>();
|
|
|
if (!CollectionUtils.isEmpty(vendors)) {
|
|
|
for (Vendor v : vendors) {
|
|
|
- distributes.add(v.getMyEnUU());
|
|
|
+ set.add(v.getVendorEnterprise().getEnName());
|
|
|
}
|
|
|
} else {
|
|
|
return null;
|
|
|
}
|
|
|
- }
|
|
|
- List<ErpProdIODetail> erpProdIODetails = erpProdIODetailService.findAllApChecks(distributes);
|
|
|
- Set<Object> set = new HashSet<>();
|
|
|
- if (!CollectionUtils.isEmpty(erpProdIODetails)) {
|
|
|
- for (ErpProdIODetail erpProdIODetail : erpProdIODetails) {
|
|
|
- set.add(erpProdIODetail.getCustName());
|
|
|
+ } else {
|
|
|
+ List<Vendor> vendors = vendorService.findMyCustomers();
|
|
|
+ for (Vendor vendor : vendors) {
|
|
|
+ set.add(vendor.getMyEnterprise().getEnName());
|
|
|
}
|
|
|
}
|
|
|
return set;
|
|
|
@@ -172,7 +173,7 @@ public class SaleApCheckController {
|
|
|
if (!CollectionUtils.isEmpty(vendors)) {
|
|
|
for (Vendor v : vendors) {
|
|
|
distributes.add(v.getMyEnUU());
|
|
|
- }
|
|
|
+ }
|
|
|
} else {
|
|
|
return null;
|
|
|
}
|