Commit 76690757 by zcwang2020

modify:上级主管查询测试

parent e8e2df9b
......@@ -25,6 +25,7 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import com.netease.mail.yanxuan.change.integration.flow.ius.rsp.leaderChain;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
......@@ -366,7 +367,7 @@ public class ChangeFlowBiz {
return flowId;
}
private List<String> getDepartmentInfo(List<String> receiver) {
public List<String> getDepartmentInfo(List<String> receiver) {
IusDepartmentReq iusDepartmentReq = new IusDepartmentReq();
iusDepartmentReq.setHasOrgPos(true);
iusDepartmentReq.setIcac(true);
......@@ -375,8 +376,14 @@ public class ChangeFlowBiz {
ArrayList<List<SecondaryDepartments>> secondaryDepartments = new ArrayList<>(map.values());
List<String> ccList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(secondaryDepartments)) {
// 外层循环是不同人,内层循环是相同人不同部门
for (List<SecondaryDepartments> secondaryDepartment : secondaryDepartments) {
ccList.addAll(secondaryDepartment.stream().map(SecondaryDepartments::getUid).collect(Collectors.toList()));
for (SecondaryDepartments dep : secondaryDepartment) {
List<leaderChain> leaderChainList = dep.getLeaderChainList();
if (CollectionUtils.isNotEmpty(leaderChainList)) {
ccList.add(leaderChainList.get(leaderChainList.size()-1).getUid());
}
}
}
}
return ccList;
......
......@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
......@@ -122,4 +123,9 @@ public class TestController {
emailTemplateEnum, JSON.parseObject(mapToJson, Map.class));
}
}
@GetMapping("/ccList")
public AjaxResult<List<String>> ccList(@RequestParam List<String> receiver){
return AjaxResult.success(changeFlowBiz.getDepartmentInfo(receiver));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment