|
@@ -3,9 +3,7 @@ package cn.ezhizao.project.business.company.controller;
|
|
|
import java.io.IOException;
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.nio.charset.Charset;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -107,6 +105,7 @@ public class BizCompanyController extends BaseController
|
|
|
setTenantId(bizCompany);
|
|
|
List<BizCompany> list = bizCompanyService.getList(bizCompany);
|
|
|
for(BizCompany company:list){
|
|
|
+ company.setArea(join("-",company.getProvince(),company.getCity(),company.getDistrict()));
|
|
|
if(company != null && company.getReferrerDataSource() != null) {
|
|
|
switch (company.getReferrerDataSource()) {
|
|
|
case "company":
|
|
@@ -134,6 +133,18 @@ public class BizCompanyController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static String join(CharSequence delimiter, CharSequence... elements) {
|
|
|
+ Objects.requireNonNull(delimiter);
|
|
|
+ Objects.requireNonNull(elements);
|
|
|
+ // Number of elements not likely worth Arrays.stream overhead.
|
|
|
+ StringJoiner joiner = new StringJoiner(delimiter);
|
|
|
+ for (CharSequence cs: elements) {
|
|
|
+ if (cs != null && !cs.toString().isEmpty() && !cs.equals("0")) {
|
|
|
+ joiner.add(cs);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return joiner.toString();
|
|
|
+ }
|
|
|
@Log(title = "客户管理", businessType = BusinessType.IMPORT)
|
|
|
@PreAuthorize("@ss.hasPermi('business:company:add')")
|
|
|
@PostMapping("/importData")
|