Merge branch 'feature/gongfu' into feature/data-permission
# Conflicts: # nflg-mobilebroken-admin/src/test/java/TTest.java
This commit is contained in:
commit
5bf26c76d5
|
|
@ -22,7 +22,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -99,10 +98,10 @@ public class AdminCustomerService {
|
||||||
*/
|
*/
|
||||||
public void syncFromCrm(SyncFromCrmDTO dateParam) {
|
public void syncFromCrm(SyncFromCrmDTO dateParam) {
|
||||||
|
|
||||||
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
// DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
|
||||||
// 循环从起始日期到结束日期,每次增加一天
|
// 循环从起始日期到结束日期,每次增加一天
|
||||||
List<TBaseCustomer> result = new ArrayList<>();
|
// List<TBaseCustomer> result = new ArrayList<>();
|
||||||
// for (LocalDate date = stDate; !date.isAfter(edDate); date = date.plusDays(1)) {
|
// for (LocalDate date = stDate; !date.isAfter(edDate); date = date.plusDays(1)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -110,12 +109,19 @@ public class AdminCustomerService {
|
||||||
if (CollUtil.isEmpty(agentList)) {
|
if (CollUtil.isEmpty(agentList)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Set<String> crmComanyCodes = agentList.stream().map(u -> u.getId()).collect(Collectors.toSet());
|
List<TBaseCustomer> result = new ArrayList<>();
|
||||||
List<TBaseCustomer> crmCompanyList = baseCustomerService.lambdaQuery().in(TBaseCustomer::getAgencyCompanyCode, crmComanyCodes).list();
|
// Set<String> crmComanyCodes = agentList.stream().map(u -> u.getId()).collect(Collectors.toSet());
|
||||||
Map<String, TBaseCustomer> crmCompanyMap = crmCompanyList.stream().collect(Collectors.toMap(TBaseCustomer::getAgencyCompanyCode, cm -> cm));
|
// List<TBaseCustomer> crmCompanyList = baseCustomerService.lambdaQuery().in(TBaseCustomer::getAgencyCompanyCode, crmComanyCodes).list();
|
||||||
|
// Map<String, TBaseCustomer> crmCompanyMap = crmCompanyList.stream().collect(Collectors.toMap(TBaseCustomer::getAgencyCompanyCode, cm -> cm));
|
||||||
|
List<TBaseCustomer> customers = baseCustomerService.list();
|
||||||
|
|
||||||
agentList.forEach(u -> {
|
agentList.forEach(u -> {
|
||||||
TBaseCustomer ent = crmCompanyMap.get(u.getId());
|
// TBaseCustomer ent = crmCompanyMap.get(u.getId());
|
||||||
|
TBaseCustomer ent = customers.stream()
|
||||||
|
.filter(c -> Objects.equals(c.getAgencyCompanyCode(), u.getId())
|
||||||
|
|| StrUtil.equals(convertName(c.getAgencyCompanyName()), convertName(u.getName())))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
if (Objects.nonNull(ent)) {
|
if (Objects.nonNull(ent)) {
|
||||||
ent.setDataModifyTime(LocalDateTime.now());
|
ent.setDataModifyTime(LocalDateTime.now());
|
||||||
|
|
@ -150,5 +156,7 @@ public class AdminCustomerService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String convertName(String name) {
|
||||||
|
return name.replaceAll("\\s+", "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,9 @@ public class TTest {
|
||||||
public void test2() {
|
public void test2() {
|
||||||
System.out.println(StrUtil.toCamelCase("user_name"));
|
System.out.println(StrUtil.toCamelCase("user_name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test3() {
|
||||||
|
System.out.println("【" + " 打 撒sfc dffd发多少分多少 分多少分的d f ".replaceAll("\\s+", "") + "】");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -30,6 +30,7 @@ import javax.validation.Valid;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -58,8 +59,9 @@ public class DeviceTypeController extends ControllerBase {
|
||||||
.eq(GongfuDeviceType::getParentId, 0)
|
.eq(GongfuDeviceType::getParentId, 0)
|
||||||
.orderByDesc(GongfuDeviceType::getId)
|
.orderByDesc(GongfuDeviceType::getId)
|
||||||
.page(new Page<>(query.getPage(), query.getPageSize()));
|
.page(new Page<>(query.getPage(), query.getPageSize()));
|
||||||
|
Set<Long> ids = result.getRecords().stream().map(GongfuDeviceType::getId).collect(Collectors.toSet());
|
||||||
List<GongfuDeviceType> children = deviceTypeService.lambdaQuery()
|
List<GongfuDeviceType> children = deviceTypeService.lambdaQuery()
|
||||||
.in(GongfuDeviceType::getParentId, result.getRecords().stream().map(GongfuDeviceType::getId).collect(Collectors.toList()))
|
.in(CollectionUtil.isNotEmpty(ids), GongfuDeviceType::getParentId, ids)
|
||||||
.list();
|
.list();
|
||||||
return ApiResult.success(convert(query, result, children));
|
return ApiResult.success(convert(query, result, children));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -70,8 +72,9 @@ public class DeviceTypeController extends ControllerBase {
|
||||||
if (CollectionUtil.isEmpty(children)) {
|
if (CollectionUtil.isEmpty(children)) {
|
||||||
return ApiResult.success(new PageData<>());
|
return ApiResult.success(new PageData<>());
|
||||||
}
|
}
|
||||||
|
Set<Long> ids = children.stream().map(GongfuDeviceType::getParentId).collect(Collectors.toSet());
|
||||||
Page<GongfuDeviceType> result = deviceTypeService.lambdaQuery()
|
Page<GongfuDeviceType> result = deviceTypeService.lambdaQuery()
|
||||||
.in(GongfuDeviceType::getId, children.stream().map(GongfuDeviceType::getParentId).collect(Collectors.toSet()))
|
.in(CollectionUtil.isNotEmpty(ids), GongfuDeviceType::getId, ids)
|
||||||
.orderByDesc(GongfuDeviceType::getId)
|
.orderByDesc(GongfuDeviceType::getId)
|
||||||
.page(new Page<>(query.getPage(), query.getPageSize()));
|
.page(new Page<>(query.getPage(), query.getPageSize()));
|
||||||
return ApiResult.success(convert(query, result, children));
|
return ApiResult.success(convert(query, result, children));
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ public class AppVersionFilter extends OncePerRequestFilter {
|
||||||
/**
|
/**
|
||||||
* 因前端部分接口遗漏App-Version参数,ios打包重新审核需要很久,所以需要排除掉,否则会导致接口无法访问
|
* 因前端部分接口遗漏App-Version参数,ios打包重新审核需要很久,所以需要排除掉,否则会导致接口无法访问
|
||||||
*/
|
*/
|
||||||
private static final Set<String> WHITE_LIST = Set.of("getTicket", "uploadSingleFile", "getInfoById");
|
private static final Set<String> WHITE_LIST = Set.of("getTicket", "uploadSingleFile", "getInfoById", "hangUp", "exportPdf");
|
||||||
|
|
||||||
private static final String MIN_SUPPER_VERSION = "1.0.9";
|
private static final String MIN_SUPPER_VERSION = "1.0.9";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue