|
@@ -106,6 +106,26 @@ public class BizCompanyController extends BaseController
|
|
public void export(HttpServletResponse response, BizCompany bizCompany) throws NoSuchFieldException, IllegalAccessException, InterruptedException {
|
|
public void export(HttpServletResponse response, BizCompany bizCompany) throws NoSuchFieldException, IllegalAccessException, InterruptedException {
|
|
setTenantId(bizCompany);
|
|
setTenantId(bizCompany);
|
|
List<BizCompany> list = bizCompanyService.getList(bizCompany);
|
|
List<BizCompany> list = bizCompanyService.getList(bizCompany);
|
|
|
|
+ for(BizCompany company:list){
|
|
|
|
+ if(company != null && company.getReferrerDataSource() != null) {
|
|
|
|
+ switch (company.getReferrerDataSource()) {
|
|
|
|
+ case "company":
|
|
|
|
+ BizCompany source = bizCompanyService.getById(company.getSourceId());
|
|
|
|
+ company.setSourceName(source != null ? source.getName() : "");
|
|
|
|
+ break;
|
|
|
|
+ case "employee":
|
|
|
|
+ SysUser sysUser = sysUserService.selectUserById(company.getSourceId());
|
|
|
|
+ company.setSourceName(sysUser != null ? sysUser.getNickName() : "");
|
|
|
|
+ break;
|
|
|
|
+ case "channel":
|
|
|
|
+ BizChannel channel = bizChannelService.getById(company.getSourceId());
|
|
|
|
+ company.setSourceName(channel != null ? channel.getName() : "");
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
ExcelUtil<BizCompany> util = new ExcelUtil<BizCompany>(BizCompany.class);
|
|
ExcelUtil<BizCompany> util = new ExcelUtil<BizCompany>(BizCompany.class);
|
|
if (bizCompany.getColumns() != null && !bizCompany.getColumns().isEmpty()) {
|
|
if (bizCompany.getColumns() != null && !bizCompany.getColumns().isEmpty()) {
|
|
util.exportExcel(response, list, "客户数据", "客户信息导出", bizCompany.getColumns().toArray(new String[0]));
|
|
util.exportExcel(response, list, "客户数据", "客户信息导出", bizCompany.getColumns().toArray(new String[0]));
|