|
|
@@ -1,5 +1,6 @@
|
|
|
package org.springblade.client.corps.controller;
|
|
|
|
|
|
+import com.alibaba.druid.sql.ast.statement.SQLForeignKeyImpl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
@@ -39,9 +40,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -422,5 +421,46 @@ public class CorpsDescController extends BladeController {
|
|
|
}
|
|
|
return corpsDescService.importFactoryData(excelList, false);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 获取分管员
|
|
|
+ */
|
|
|
+ @GetMapping("/adminProfiles")
|
|
|
+ @ApiOperationSupport(order = 10)
|
|
|
+ @ApiOperation(value = "获取分管员", notes = "客户类别必传")
|
|
|
+ public R<List<Map<String,Object>>> adminProfiles(CorpsDescVO corpsDesc) {
|
|
|
+ if (StringUtils.isBlank(corpsDesc.getCorpType())){
|
|
|
+ throw new SecurityException("请选择要查询的客户类别");
|
|
|
+ }
|
|
|
+ if (corpsDesc.getId() == null){
|
|
|
+ throw new SecurityException("请选择要查询的客户");
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
+ LambdaQueryWrapper<CorpsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(CorpsDesc::getIsDeleted,0);
|
|
|
+ lambdaQueryWrapper.eq(CorpsDesc::getId,corpsDesc.getId());
|
|
|
+ lambdaQueryWrapper.eq(CorpsDesc::getTenantId,SecureUtil.getTenantId());
|
|
|
+ lambdaQueryWrapper.eq(CorpsDesc::getCorpType,corpsDesc.getCorpType());
|
|
|
+ List<CorpsDesc> corpsDescList = corpsDescService.list(lambdaQueryWrapper);
|
|
|
+ if (CollectionUtils.isNotEmpty(corpsDescList)) {
|
|
|
+ corpsDescList.forEach(item -> {
|
|
|
+ if (StringUtils.isNotBlank(item.getAdminProfiles())) {
|
|
|
+ List<String> list = Arrays.asList(item.getAdminProfiles().split(","));
|
|
|
+ StringBuffer stringBuffer = new StringBuffer();
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ list.forEach(items -> {
|
|
|
+ R<User> user = userClient.userInfoById(Long.valueOf(items));
|
|
|
+ if (user.isSuccess() && user.getData() != null) {
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("id",items);
|
|
|
+ map.put("cname",user.getData().getName());
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return R.data(mapList);
|
|
|
+ }
|
|
|
|
|
|
}
|