Commit 53300920 by 穆龙飞

modify:增加部门信息

parent 15632bf8
...@@ -16,6 +16,11 @@ import java.util.stream.Collectors; ...@@ -16,6 +16,11 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import com.netease.mail.yanxuan.change.integration.flow.OrgPosDTO;
import com.netease.mail.yanxuan.change.integration.flow.UserQueryDTO;
import com.netease.mail.yanxuan.change.integration.flow.ius.IusRpcService;
import com.netease.mail.yanxuan.change.integration.flow.ius.rsp.IusUserInfoRsp;
import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
...@@ -147,6 +152,9 @@ public class ChangeFlowBiz { ...@@ -147,6 +152,9 @@ public class ChangeFlowBiz {
private IusService iusService; private IusService iusService;
@Autowired @Autowired
private IusRpcService iusRpcService;
@Autowired
private SupplierSendService sendSupplierEmail; private SupplierSendService sendSupplierEmail;
public String createAndSubmit(ChangeFlowCreateReq changeFlowCreateReq) { public String createAndSubmit(ChangeFlowCreateReq changeFlowCreateReq) {
...@@ -877,6 +885,35 @@ public class ChangeFlowBiz { ...@@ -877,6 +885,35 @@ public class ChangeFlowBiz {
PageVO pageVO = buildPageVo(changeRecordPageInfo.getTotal(), pageSize, page); PageVO pageVO = buildPageVo(changeRecordPageInfo.getTotal(), pageSize, page);
ChangeFlowListVO changeFlowListVO = new ChangeFlowListVO(); ChangeFlowListVO changeFlowListVO = new ChangeFlowListVO();
changeFlowListVO.setPageVo(pageVO); changeFlowListVO.setPageVo(pageVO);
try {
Set<String> commanderList = list.stream().map(ChangeFlowVO::getChangeCommander).collect(Collectors.toSet());
Set<String> creatorList = list.stream().map(ChangeFlowVO::getChangeCreator).collect(Collectors.toSet());
commanderList.addAll(creatorList);
AjaxResponse<List<IusUserInfoRsp>> userListInfo = iusRpcService.queryUserListInfo(UserQueryDTO.builder().uids(new ArrayList<>(commanderList)).build());
List<IusUserInfoRsp> data = userListInfo.getData();
list.forEach(i -> {
Optional<IusUserInfoRsp> commander = data.stream().filter(u -> u.getUid().equals(i.getChangeCommander())).findAny();
Optional<IusUserInfoRsp> creator = data.stream().filter(u -> u.getUid().equals(i.getChangeCreator())).findAny();
if (commander.isPresent()) {
Optional<OrgPosDTO> anyOrg = commander.get().getOrgPosList().stream().filter(o -> o.getLevel() == 3).findAny();
String orgName = "无三级部门";
if (anyOrg.isPresent()) {
orgName = anyOrg.get().getOrgPosName();
}
i.setChangeCommander(commander.get().getName() + "(" + orgName + ")");
}
if (creator.isPresent()) {
Optional<OrgPosDTO> anyOrg = creator.get().getOrgPosList().stream().filter(o -> o.getLevel() == 3).findAny();
String orgName = "无三级部门";
if (anyOrg.isPresent()) {
orgName = anyOrg.get().getOrgPosName();
}
i.setChangeCommander(commander.get().getName() + "(" + orgName + ")");
}
});
} catch (Exception ex) {
log.error("add org has ex", ex);
}
changeFlowListVO.setChangeFlowList(list); changeFlowListVO.setChangeFlowList(list);
return changeFlowListVO; return changeFlowListVO;
} }
......
package com.netease.mail.yanxuan.change.integration.flow;
import lombok.Data;
@Data
public class OrgPosDTO {
/**
*部门id
*/
private Long orgPosId;
/**
*部门名称
*/
private String orgPosName;
/**
*上一级部门id
*/
private Long parentOrgPosId;
/**
*部门结构类型 0:职能部门,1:项目部门
*/
private Integer posStructType;
/**
*部门的级别
*/
private Integer level;
/**
* 对应oa
*/
private String deptId;
}
package com.netease.mail.yanxuan.change.integration.flow;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class UserQueryDTO {
/**
* 邮箱集合
*/
private List<String> uids;
/**
* 用户邮箱类型 0 严选员工,1 非严选员工
*/
private Integer userType = 0;
}
package com.netease.mail.yanxuan.change.integration.flow.ius; package com.netease.mail.yanxuan.change.integration.flow.ius;
import com.netease.mail.yanxuan.change.integration.flow.UserQueryDTO;
import com.netease.mail.yanxuan.change.integration.flow.ius.req.IusDepartmentReq; import com.netease.mail.yanxuan.change.integration.flow.ius.req.IusDepartmentReq;
import com.netease.mail.yanxuan.change.integration.flow.ius.rsp.IusUserInfoRsp; import com.netease.mail.yanxuan.change.integration.flow.ius.rsp.IusUserInfoRsp;
import com.netease.mail.yanxuan.change.integration.flow.ius.rsp.OrgPosLeaderChainRsp; import com.netease.mail.yanxuan.change.integration.flow.ius.rsp.OrgPosLeaderChainRsp;
...@@ -32,6 +33,14 @@ public interface IusRpcService { ...@@ -32,6 +33,14 @@ public interface IusRpcService {
AjaxResponse<IusUserInfoRsp> queryUserInfo(@RequestParam(name = "uid")String uid); AjaxResponse<IusUserInfoRsp> queryUserInfo(@RequestParam(name = "uid")String uid);
/** /**
* 获取指定用户信息,是否返回操作记录、关联的角色信息。当uid和userId都传时,需保证指向同一个用户。
* @param query
* @return
*/
@GetMapping("/v1/qc/user/query")
AjaxResponse<List<IusUserInfoRsp>> queryUserListInfo(@RequestBody UserQueryDTO query);
/**
* 查询指定用户部门下的上级部门(含本部门)负责人链(支持一级或多级) * 查询指定用户部门下的上级部门(含本部门)负责人链(支持一级或多级)
* @param uid * @param uid
* @return * @return
......
package com.netease.mail.yanxuan.change.integration.flow.ius.rsp; package com.netease.mail.yanxuan.change.integration.flow.ius.rsp;
import com.netease.mail.yanxuan.change.integration.flow.OrgPosDTO;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/** /**
* @author WangJiaXiang * @author WangJiaXiang
* @date 2022/11/25/025$ * @date 2022/11/25/025$
...@@ -33,4 +37,9 @@ public class IusUserInfoRsp { ...@@ -33,4 +37,9 @@ public class IusUserInfoRsp {
private String userId; private String userId;
private String virtual; private String virtual;
/**
* 部门信息列表
*/
private List<OrgPosDTO> orgPosList = new ArrayList<>();
} }
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