Compare commits
19 Commits
master
...
18880demo环
Author | SHA1 | Date |
---|---|---|
|
22f7c55354 | 1 year ago |
|
caafa04769 | 1 year ago |
|
ceefda492e | 1 year ago |
|
b7a60f6b9e | 1 year ago |
|
3cbb2100f3 | 1 year ago |
|
0183570629 | 1 year ago |
|
f13c42ab6e | 1 year ago |
|
2431ba5edc | 1 year ago |
|
89ff0ea423 | 1 year ago |
|
a8ff1c021c | 1 year ago |
|
21012a17f3 | 1 year ago |
|
b1dd8815d7 | 1 year ago |
|
c0a44c5c5f | 2 years ago |
|
3046781b4e | 2 years ago |
|
db45ec244e | 2 years ago |
|
82c7d7bea0 | 2 years ago |
|
652a96125e | 2 years ago |
|
2ccfed4f0c | 2 years ago |
|
8f69331512 | 2 years ago |
@ -0,0 +1,3 @@
|
||||
roleId=67
|
||||
rolelevel=2
|
||||
fieldid=field19
|
@ -1,13 +0,0 @@
|
||||
package com.api.jygf.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Path("/mobile/permission")
|
||||
public class MobilePermissionsAction extends com.engine.jygf.web.MobilePermissionsAction {
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.api.sship.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author liang.cheng
|
||||
*/
|
||||
@Path("/sship/organization/chart")
|
||||
public class OrgChartController extends com.engine.sship.web.OrgChartController {
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
package com.engine.jygf.cmd;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.User;
|
||||
import weaver.wechat.util.Utils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class MobilePermissionsCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
private static final String FIELDID = "field100043"; //移动电话自定义字段field100026
|
||||
|
||||
private static final String SCOPE = "HrmCustomFieldByInfoType";
|
||||
|
||||
private static final String SCOPEID = "-1";
|
||||
|
||||
public MobilePermissionsCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
String uid = Utils.null2String(user.getUID());
|
||||
RecordSet rs = new RecordSet();
|
||||
HashSet<String> ids = new HashSet<>();
|
||||
ids.add(uid);
|
||||
rs.executeQuery("select ckr,bckr from uf_yddhqx_dt1");
|
||||
while (rs.next()) {
|
||||
String ckr = Utils.null2String(rs.getString("ckr"));
|
||||
String bckr = Utils.null2String(rs.getString("bckr"));
|
||||
if (Arrays.asList(ckr.split(",")).contains(uid)) {
|
||||
ids.addAll(Arrays.asList(bckr.split(",")));
|
||||
}
|
||||
}
|
||||
|
||||
Map<String,String> mobileInfo = new HashMap<>();
|
||||
String value = StringUtils.join(ids,",");
|
||||
rs.executeQuery("select id,"+FIELDID+" from cus_fielddata where scope = ? and scopeid = ?" +
|
||||
" and id in ("+value+")",SCOPE,SCOPEID);
|
||||
while (rs.next()){
|
||||
mobileInfo.put(Utils.null2String(rs.getString("id")),rs.getString(FIELDID));
|
||||
}
|
||||
|
||||
data.put("ids",ids);
|
||||
data.put("mobileInfo",mobileInfo);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package com.engine.jygf.service;
|
||||
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface MobilePermissionsService {
|
||||
|
||||
Map<String, Object> getPermissionInfo(Map<String, Object> params, User user);
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package com.engine.jygf.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.jygf.cmd.MobilePermissionsCmd;
|
||||
import com.engine.jygf.service.MobilePermissionsService;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class MobilePermissionsServiceImpl extends Service implements MobilePermissionsService {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getPermissionInfo(Map<String, Object> params, User user) {
|
||||
return commandExecutor.execute(new MobilePermissionsCmd(params,user));
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
package com.engine.jygf.web;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.jygf.service.MobilePermissionsService;
|
||||
import com.engine.jygf.service.impl.MobilePermissionsServiceImpl;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class MobilePermissionsAction {
|
||||
|
||||
public MobilePermissionsService getMobilePermissionsService(User user) {
|
||||
return ServiceUtil.getService(MobilePermissionsServiceImpl.class,user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 晶优光伏 移动电话通过建模控制权限 通讯录显示
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/controller")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getPermissionInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
//实例化Service 并调用业务类处理
|
||||
apidatas = getMobilePermissionsService(user).getPermissionInfo(ParamUtil.request2Map(request), user);
|
||||
} catch (Exception e) {
|
||||
//异常处理
|
||||
apidatas.put("api_status", false);
|
||||
}
|
||||
return JSONObject.toJSONString(apidatas);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.engine.sship.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liang.cheng
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ChartChildrensVO {
|
||||
|
||||
private String id;
|
||||
|
||||
private String pid;
|
||||
|
||||
private String label;
|
||||
|
||||
private List<ChartChildrensVO> childrens;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.engine.sship.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author xxy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DropTreeDataVO {
|
||||
|
||||
private String value;
|
||||
|
||||
private String label;
|
||||
|
||||
private List<DropTreeDataVO> children;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.engine.sship.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author xxy
|
||||
* @Date 2024/2/22 15:26 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrgTreeParam {
|
||||
|
||||
private String root;
|
||||
|
||||
private String virtualType;
|
||||
|
||||
private String level;
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.engine.sship.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/1/4 3:22 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PersonTablePO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String lastname;
|
||||
|
||||
private String workcode;
|
||||
|
||||
private Integer sex;
|
||||
|
||||
private Integer managerid;
|
||||
|
||||
private String loginid;
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.engine.sship.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/1/4 3:26 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PersonTableParam {
|
||||
|
||||
//todo 分页参数
|
||||
|
||||
private String id;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.engine.sship.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/1/4 3:17 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PersonTableVO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String lastname;
|
||||
|
||||
private String workcode;
|
||||
|
||||
private String sex;
|
||||
|
||||
private String manager;
|
||||
|
||||
private String loginid;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.engine.sship.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/1/8 3:33 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SelectVO {
|
||||
|
||||
private String value;
|
||||
|
||||
private String label;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.engine.sship.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author apple
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TreeDataVO {
|
||||
|
||||
private String id;
|
||||
|
||||
private String label;
|
||||
|
||||
private int num;
|
||||
|
||||
private List<ChartChildrensVO> childrens;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.engine.sship.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author xxy
|
||||
* @Date 2024/1/31 15:26 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class VirtualTopParam {
|
||||
|
||||
private String id;
|
||||
|
||||
private String virtualType;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.engine.sship.exception;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2023/2/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class CustomizeRunTimeException extends RuntimeException{
|
||||
|
||||
public CustomizeRunTimeException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public CustomizeRunTimeException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public CustomizeRunTimeException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.engine.sship.service;
|
||||
|
||||
|
||||
import com.engine.sship.entity.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @author apple
|
||||
*/
|
||||
public interface OrgChartService {
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 根据角色Id判断当前人员是否在成员信息
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/1/3 3:16 PM
|
||||
* @param: [roleId, rolelevel]
|
||||
* @return: int
|
||||
*/
|
||||
boolean selectIdsByRole(String roleId,String rolelevel);
|
||||
|
||||
/**
|
||||
* @Description: 集团组织图 人员汇报关系
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/1/3 10:07 AM
|
||||
* @param: []
|
||||
* @return: com.engine.sship.entity.ChartChildrensVO
|
||||
*/
|
||||
TreeDataVO selectResourceChart();
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 获取SiteHead人员集合
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/1/3 4:23 PM
|
||||
* @param: []
|
||||
* @return: java.util.List<java.lang.Integer>
|
||||
*/
|
||||
List<Integer> selectCusSiteHead();
|
||||
|
||||
/**
|
||||
* @Description: 人员信息
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/1/4 3:29 PM
|
||||
* @param: [personTableParam]
|
||||
* @return: com.engine.sship.entity.PersonTableVO
|
||||
*/
|
||||
List<PersonTableVO> selectPerson(PersonTableParam personTableParam);
|
||||
|
||||
/**
|
||||
* @Description: 组织架构图虚拟维度
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/1/8 10:44 AM
|
||||
* @param: []
|
||||
* @return: com.engine.sship.entity.TreeDataVO
|
||||
*/
|
||||
TreeDataVO selectOrganizationChart(OrgTreeParam orgTreeParam);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 虚拟维度 部门是否存在下级部门
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/1/8 1:52 PM
|
||||
* @param: [supdepid]
|
||||
* @return: boolean
|
||||
*/
|
||||
boolean isVirtualSubDepartment(String supdepid,String virtualType);
|
||||
|
||||
/**
|
||||
* @Description: 虚拟维度下人员信息
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/1/8 2:59 PM
|
||||
* @param: [personTableParam]
|
||||
* @return: java.util.List<com.engine.sship.entity.PersonTableVO>
|
||||
*/
|
||||
List<PersonTableVO> selectVirtualPerson(PersonTableParam personTableParam);
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/1/8 3:41 PM
|
||||
* @param: []
|
||||
* @return: java.util.List<com.engine.sship.entity.PersonTableVO>
|
||||
*/
|
||||
List<SelectVO> selectVirtualTop();
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: xxy
|
||||
* @Date: 2024/1/31 14:26 PM
|
||||
* @param: [virtualType]
|
||||
* @return: java.util.List<com.engine.sship.entity.TreeDataVO>
|
||||
*/
|
||||
List<DropTreeDataVO> selectVirtualTopTwo(String virtualType);
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: xxy
|
||||
* @Date: 2024/1/31 15:26 PM
|
||||
* @param: [virtualTopParam]
|
||||
* @return: java.util.List<com.engine.sship.entity.SelectVO>
|
||||
*/
|
||||
List<SelectVO> selectVirtualTopThree(VirtualTopParam virtualTopParam);
|
||||
}
|
@ -0,0 +1,910 @@
|
||||
package com.engine.sship.service.impl;
|
||||
|
||||
import com.engine.common.service.HrmCommonService;
|
||||
import com.engine.common.service.impl.HrmCommonServiceImpl;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.sship.entity.*;
|
||||
import com.engine.sship.service.OrgChartService;
|
||||
import com.weaver.general.BaseBean;
|
||||
import com.weaver.general.Util;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2023/9/26 5:52 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class OrgChartServiceImpl extends Service implements OrgChartService {
|
||||
|
||||
private final HrmCommonService hrmCommonService = new HrmCommonServiceImpl();
|
||||
@Override
|
||||
public boolean selectIdsByRole(String roleId,String rolelevel) {
|
||||
String roleMemberIds = hrmCommonService.getRoleMemberIds(roleId, rolelevel);
|
||||
List<String> roleMemberList = Arrays.stream(roleMemberIds.split(","))
|
||||
.filter(s -> !s.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
return roleMemberList.stream()
|
||||
.anyMatch(s -> Integer.parseInt(s) == user.getUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreeDataVO selectResourceChart() {
|
||||
BaseBean bb = new BaseBean();
|
||||
String roleId = bb.getPropValue("sship", "roleId");
|
||||
String rolelevel = bb.getPropValue("sship", "rolelevel");
|
||||
boolean isExsit = selectIdsByRole(roleId, rolelevel);
|
||||
if (isExsit || (user.getUID() == 1)) {
|
||||
return getAllTreeData();
|
||||
}
|
||||
|
||||
return getBaseTreeData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> selectCusSiteHead() {
|
||||
RecordSet rs = new RecordSet();
|
||||
BaseBean bb = new BaseBean();
|
||||
String fieldid = bb.getPropValue("sship", "fieldid");
|
||||
String sitehead = bb.getPropValue("sship", "sitehead");
|
||||
List<Integer> ids = new ArrayList<>();
|
||||
rs.executeQuery("select id from cus_fielddata where "+fieldid+" = ? and scopeid = 3 and scope = 'HrmCustomFieldByInfoType'",sitehead);
|
||||
while (rs.next()) {
|
||||
ids.add(Util.getIntValue(rs.getString("id")));
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public List<PersonTableVO> selectPerson(PersonTableParam personTableParam) {
|
||||
List<PersonTablePO> poList;
|
||||
ResourceComInfo rInfo = new ResourceComInfo();
|
||||
BaseBean bb = new BaseBean();
|
||||
String shareholder = bb.getPropValue("sship", "shareholder");
|
||||
String committee = bb.getPropValue("sship", "committee");
|
||||
switch(personTableParam.getId()){
|
||||
case "S-1":
|
||||
poList = selectByLevel(Integer.valueOf(shareholder));
|
||||
break;
|
||||
case "C-1":
|
||||
poList = selectByLevel(Integer.valueOf(committee));
|
||||
break;
|
||||
default:
|
||||
poList = selectByDeptId(personTableParam.getId());
|
||||
}
|
||||
|
||||
return poList.stream()
|
||||
.map(po -> new PersonTableVO(po.getId(), po.getLastname(), po.getWorkcode(),
|
||||
po.getSex() == 0 ? "男" : "女",
|
||||
po.getManagerid() != null ? rInfo.getLastname(String.valueOf(po.getManagerid())) : "",
|
||||
po.getLoginid()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreeDataVO selectOrganizationChart(OrgTreeParam orgTreeParam) {
|
||||
RecordSet rs = new RecordSet();
|
||||
String virtualType = orgTreeParam.getVirtualType();
|
||||
String root = orgTreeParam.getRoot();
|
||||
String level = orgTreeParam.getLevel();
|
||||
log.info("selectVirtualTopTwo.orgTreeParam:{}",orgTreeParam);
|
||||
TreeDataVO build;
|
||||
String id;
|
||||
//判断参数是总部、分部、部门id
|
||||
if (StringUtils.isBlank(root)) {
|
||||
build = getBaseTree(virtualType);
|
||||
} else {
|
||||
//判断入参类型
|
||||
int judgeId = judgeId(root);
|
||||
log.info("selectOrganizationChart.judgeId:{}",judgeId);
|
||||
switch(judgeId){
|
||||
case 1:
|
||||
rs.executeQuery("select id,subcompanyname from hrmsubcompany where id = ? and SUPSUBCOMID = '0' ", root.contains("fenbu")?root.substring(8):root.substring(3));
|
||||
rs.next();
|
||||
id = rs.getString("id");
|
||||
build = TreeDataVO.builder()
|
||||
.id(id)
|
||||
.label(Util.null2String(rs.getString("subcompanyname")))
|
||||
.build();
|
||||
if (isSubDepartment(id)) {
|
||||
build.setChildrens(getSubDeptBase(id));
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
rs.executeQuery("select id,departmentmark from hrmdepartment where id = ? and SUPDEPID = 0 ", root.substring(3));
|
||||
rs.next();
|
||||
id = rs.getString("id");
|
||||
build = TreeDataVO.builder()
|
||||
.id(id)
|
||||
.label(Util.null2String(rs.getString("departmentmark")))
|
||||
.build();
|
||||
if (isSubDepartmentChildren(id)) {
|
||||
build.setChildrens(getSubDeptChildrenBase(id));
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
rs.executeQuery("select id,departmentmark from hrmdepartment where id = ? ", root.substring(3));
|
||||
rs.next();
|
||||
id = rs.getString("id");
|
||||
build = TreeDataVO.builder()
|
||||
.id(id)
|
||||
.label(Util.null2String(rs.getString("departmentmark")))
|
||||
.build();
|
||||
if (isSubDepartmentChildren(id)) {
|
||||
build.setChildrens(getSubDeptChildrenBase(id));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
build = getBaseTree(virtualType);
|
||||
}
|
||||
}
|
||||
//level等于1
|
||||
if(StringUtils.isNotBlank(level)){
|
||||
if(Integer.parseInt(level)==1){
|
||||
build.setChildrens(null);
|
||||
}else {
|
||||
build.setChildrens(setTreeStructure(build.getChildrens(),Integer.parseInt(level)));
|
||||
}
|
||||
}
|
||||
return build;
|
||||
}
|
||||
private TreeDataVO getBaseTree(String virtualType){
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id,companyname from hrmcompany where id =? ", virtualType);
|
||||
rs.next();
|
||||
String id = rs.getString("id");
|
||||
log.info("getBaseTree.hrmcompany:{}",id);
|
||||
TreeDataVO build = TreeDataVO.builder()
|
||||
.id(id)
|
||||
.label(Util.null2String(rs.getString("companyname")))
|
||||
.build();
|
||||
if (isSubCompany(id)) {
|
||||
build.setChildrens(getSubCompanyBase(id));
|
||||
}
|
||||
return build;
|
||||
}
|
||||
|
||||
private static int judgeId(String root){
|
||||
log.info("judgeId88888888.root:{}",root);
|
||||
RecordSet rs = new RecordSet();
|
||||
int id = 0;
|
||||
if(root.contains("fenbu")){
|
||||
rs.executeQuery("select count(1) from hrmsubcompany where id = ? ",root.substring(8));
|
||||
if (rs.next()) {
|
||||
if(rs.getInt(1) > 0){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//root为总部
|
||||
rs.executeQuery("select count(1) from hrmcompany where id = ?",root.substring(3));
|
||||
if (rs.next()) {
|
||||
if(rs.getInt(1) > 0){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
//root为分部
|
||||
rs.executeQuery("select count(1) from hrmsubcompany where id = ? ",root.substring(3));
|
||||
if (rs.next()) {
|
||||
if(rs.getInt(1) > 0){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
//root为上级部门
|
||||
rs.executeQuery("select count(1) from hrmdepartment where id = ? and SUPDEPID = 0",root.substring(3));
|
||||
if (rs.next()) {
|
||||
if(rs.getInt(1) > 0){
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
//root为下级部门
|
||||
rs.executeQuery("select count(1) from hrmdepartment where id = ?",root.substring(3));
|
||||
if (rs.next()) {
|
||||
if(rs.getInt(1) > 0){
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
private List<ChartChildrensVO> getSubCompanyBase(String companyId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<ChartChildrensVO> voList = new ArrayList<>();
|
||||
rs.executeQuery("select id,subcompanyname from hrmsubcompany where COMPANYID = ? and SUPSUBCOMID = '0' order by showorder",companyId);
|
||||
while (rs.next()) {
|
||||
String id = Util.null2String(rs.getString("id"));
|
||||
log.info("getSubCompanyBase.hrmsubcompany:{}",id);
|
||||
ChartChildrensVO build = ChartChildrensVO.builder()
|
||||
.id(id.equals(companyId)?"fenbu"+getRandomData()+id:getRandomData()+id)
|
||||
.pid(companyId)
|
||||
.label(StringUtils.isBlank(rs.getString("subcompanyname"))?"无名称":rs.getString("subcompanyname"))
|
||||
.build();
|
||||
if (isSubDepartment(id)) {
|
||||
build.setChildrens(getSubDeptBase(id));
|
||||
}
|
||||
voList.add(build);
|
||||
}
|
||||
return voList;
|
||||
|
||||
}
|
||||
private List<ChartChildrensVO> getSubDeptBase(String id) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<ChartChildrensVO> voList = new ArrayList<>();
|
||||
rs.executeQuery("select id,departmentmark from hrmdepartment where subcompanyid1 = ? and SUPDEPID = 0 order by showorder",id);
|
||||
while (rs.next()) {
|
||||
String deptId = Util.null2String(rs.getString("id"));
|
||||
log.info("getSubDeptBase.hrmdepartment:{}",deptId);
|
||||
ChartChildrensVO build = ChartChildrensVO.builder()
|
||||
.id(getRandomData()+deptId)
|
||||
.pid(id)
|
||||
.label(Util.null2String(rs.getString("departmentmark")))
|
||||
.build();
|
||||
if (isSubDepartmentChildren(deptId)) {
|
||||
build.setChildrens(getSubDeptChildrenBase(deptId));
|
||||
}
|
||||
voList.add(build);
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
private List<ChartChildrensVO> getSubDeptChildrenBase(String id) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<ChartChildrensVO> voList = new ArrayList<>();
|
||||
rs.executeQuery("select id,departmentmark from hrmdepartment where SUPDEPID = ? order by showorder",id);
|
||||
while (rs.next()) {
|
||||
String deptId = Util.null2String(rs.getString("id"));
|
||||
log.info("getSubDeptChildrenBase.hrmdepartment:{}",deptId);
|
||||
ChartChildrensVO build = ChartChildrensVO.builder()
|
||||
.id(getRandomData()+deptId)
|
||||
.pid(id)
|
||||
.label(Util.null2String(rs.getString("departmentmark")))
|
||||
.build();
|
||||
if (isSubDepartmentChildren(deptId)) {
|
||||
build.setChildrens(getSubDeptChildrenBase(deptId));
|
||||
}
|
||||
voList.add(build);
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据层级修改树结构
|
||||
* @param childrens
|
||||
*/
|
||||
public static List<ChartChildrensVO> setTreeStructure(List<ChartChildrensVO> childrens, int level) {
|
||||
log.info("setTreeStructure.data:{},level:{}", childrens, level);
|
||||
switch (level) {
|
||||
case 2:
|
||||
childrens.forEach(childrensVO -> {
|
||||
childrensVO.setChildrens(null);
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
childrens.forEach(childrensVO -> {
|
||||
if (childrensVO.getChildrens() != null) {
|
||||
childrensVO.getChildrens().forEach(childrensVO1 -> childrensVO1.setChildrens(null));
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 4:
|
||||
childrens.forEach(childrensVO -> {
|
||||
if (childrensVO.getChildrens() != null) {
|
||||
childrensVO.getChildrens().forEach(childrensVO1 -> {
|
||||
if (childrensVO1.getChildrens() != null) {
|
||||
childrensVO1.getChildrens().forEach(childrensVO2 -> childrensVO2.setChildrens(null));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
case 5:
|
||||
childrens.forEach(childrensVO -> {
|
||||
if (childrensVO.getChildrens() != null) {
|
||||
childrensVO.getChildrens().forEach(childrensVO1 -> {
|
||||
if (childrensVO1.getChildrens() != null) {
|
||||
childrensVO1.getChildrens().forEach(childrensVO2 -> {
|
||||
if (childrensVO2.getChildrens() != null) {
|
||||
childrensVO2.getChildrens().forEach(childrensVO3 -> childrensVO3.setChildrens(null));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 6:
|
||||
childrens.forEach(childrensVO -> {
|
||||
if (childrensVO.getChildrens() != null) {
|
||||
childrensVO.getChildrens().forEach(childrensVO1 -> {
|
||||
if (childrensVO1.getChildrens() != null) {
|
||||
childrensVO1.getChildrens().forEach(childrensVO2 -> {
|
||||
if (childrensVO2.getChildrens() != null) {
|
||||
childrensVO2.getChildrens().forEach(childrensVO3 -> {
|
||||
if (childrensVO3.getChildrens() != null) {
|
||||
childrensVO3.getChildrens().forEach(childrensVO4 -> childrensVO4.setChildrens(null));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 7:
|
||||
childrens.forEach(childrensVO -> {
|
||||
if (childrensVO.getChildrens() != null) {
|
||||
childrensVO.getChildrens().forEach(childrensVO1 -> {
|
||||
if (childrensVO1.getChildrens() != null) {
|
||||
childrensVO1.getChildrens().forEach(childrensVO2 -> {
|
||||
if (childrensVO2.getChildrens() != null) {
|
||||
childrensVO2.getChildrens().forEach(childrensVO3 -> {
|
||||
if (childrensVO3.getChildrens() != null) {
|
||||
childrensVO3.getChildrens().forEach(childrensVO4 -> {
|
||||
if (childrensVO4.getChildrens() != null) {
|
||||
childrensVO4.getChildrens().forEach(childrensVO5 -> childrensVO5.setChildrens(null));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 8:
|
||||
childrens.forEach(childrensVO -> {
|
||||
if (childrensVO.getChildrens() != null) {
|
||||
childrensVO.getChildrens().forEach(childrensVO1 -> {
|
||||
if (childrensVO1.getChildrens() != null) {
|
||||
childrensVO1.getChildrens().forEach(childrensVO2 -> {
|
||||
if (childrensVO2.getChildrens() != null) {
|
||||
childrensVO2.getChildrens().forEach(childrensVO3 -> {
|
||||
if (childrensVO3.getChildrens() != null) {
|
||||
childrensVO3.getChildrens().forEach(childrensVO4 -> {
|
||||
if (childrensVO4.getChildrens() != null) {
|
||||
childrensVO4.getChildrens().forEach(childrensVO5 -> {
|
||||
if (childrensVO5.getChildrens() != null) {
|
||||
childrensVO5.getChildrens().forEach(childrensVO6 -> childrensVO6.setChildrens(null));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 9:
|
||||
childrens.forEach(childrensVO -> {
|
||||
if (childrensVO.getChildrens() != null) {
|
||||
childrensVO.getChildrens().forEach(childrensVO1 -> {
|
||||
if (childrensVO1.getChildrens() != null) {
|
||||
childrensVO1.getChildrens().forEach(childrensVO2 -> {
|
||||
if (childrensVO2.getChildrens() != null) {
|
||||
childrensVO2.getChildrens().forEach(childrensVO3 -> {
|
||||
if (childrensVO3.getChildrens() != null) {
|
||||
childrensVO3.getChildrens().forEach(childrensVO4 -> {
|
||||
if (childrensVO4.getChildrens() != null) {
|
||||
childrensVO4.getChildrens().forEach(childrensVO5 -> {
|
||||
if (childrensVO5.getChildrens() != null) {
|
||||
childrensVO5.getChildrens().forEach(childrensVO6 -> {
|
||||
if (childrensVO6.getChildrens() != null) {
|
||||
childrensVO6.getChildrens().forEach(childrensVO7 -> childrensVO7.setChildrens(null));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 10:
|
||||
childrens.forEach(childrensVO -> {
|
||||
if (childrensVO.getChildrens() != null) {
|
||||
childrensVO.getChildrens().forEach(childrensVO1 -> {
|
||||
if (childrensVO1.getChildrens() != null) {
|
||||
childrensVO1.getChildrens().forEach(childrensVO2 -> {
|
||||
if (childrensVO2.getChildrens() != null) {
|
||||
childrensVO2.getChildrens().forEach(childrensVO3 -> {
|
||||
if (childrensVO3.getChildrens() != null) {
|
||||
childrensVO3.getChildrens().forEach(childrensVO4 -> {
|
||||
if (childrensVO4.getChildrens() != null) {
|
||||
childrensVO4.getChildrens().forEach(childrensVO5 -> {
|
||||
if (childrensVO5.getChildrens() != null) {
|
||||
childrensVO5.getChildrens().forEach(childrensVO6 -> {
|
||||
if (childrensVO6.getChildrens() != null) {
|
||||
childrensVO6.getChildrens().forEach(childrensVO7 -> {
|
||||
if (childrensVO7.getChildrens() != null) {
|
||||
childrensVO7.getChildrens().forEach(childrensVO8 -> childrensVO8.setChildrens(null));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
childrens.forEach(childrensVO -> childrensVO.setChildrens(null));
|
||||
}
|
||||
return childrens;
|
||||
}
|
||||
|
||||
/**
|
||||
* 遍历n叉树最大深度
|
||||
* @param root
|
||||
*/
|
||||
public static int maxDepth(ChartChildrensVO root) {
|
||||
if(CollectionUtils.isEmpty(root.getChildrens())){
|
||||
return 0;
|
||||
}
|
||||
int num = 0;
|
||||
if(!CollectionUtils.isEmpty(root.getChildrens())){
|
||||
for (int i = 0; i < root.getChildrens().size(); i++) {
|
||||
num = Math.max(num, 1 + maxDepth(root.getChildrens().get(i)));
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
private List<ChartChildrensVO> getVirtualSub(String supdepid,String virtualType) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<ChartChildrensVO> voList = new ArrayList<>();
|
||||
rs.executeQuery("select id,departmentmark from hrmdepartmentvirtual where supdepid <> '' and supdepid = ? and virtualtype = ? order by showorder", supdepid, virtualType);
|
||||
while (rs.next()) {
|
||||
String id = Util.null2String(rs.getString("id"));
|
||||
ChartChildrensVO build = ChartChildrensVO.builder()
|
||||
.pid(supdepid)
|
||||
.id(id)
|
||||
.label(Util.null2String(rs.getString("departmentmark")))
|
||||
.build();
|
||||
if (isVirtualSubDepartment(id, virtualType)) {
|
||||
build.setChildrens(getVirtualSub(id, virtualType));
|
||||
}
|
||||
voList.add(build);
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
private String getRandomData() {
|
||||
String name="";//先定义空字符串
|
||||
for (int i=0;i<3;i++){
|
||||
char n=(char)(new Random().nextInt(26)+97) ;
|
||||
name += n;//name=name+n;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isVirtualSubDepartment(String supdepid,String virtualType) {
|
||||
RecordSet rs = new RecordSet();
|
||||
boolean isSupdepid = false;
|
||||
rs.executeQuery("select count(1) from hrmdepartmentvirtual where supdepid <> '' and supdepid = ? and virtualtype = ? ",supdepid,virtualType);
|
||||
if (rs.next()) {
|
||||
isSupdepid = rs.getInt(1) > 0;
|
||||
}
|
||||
return isSupdepid;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public List<PersonTableVO> selectVirtualPerson(PersonTableParam personTableParam) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<Integer> idList = new ArrayList<>();
|
||||
ResourceComInfo rInfo = new ResourceComInfo();
|
||||
List<PersonTableVO> voList = new ArrayList<>();
|
||||
List<PersonTablePO> poList = new ArrayList<>();
|
||||
rs.executeQuery("select resourceid from hrmresourcevirtual where departmentid = ?",personTableParam.getId());
|
||||
while (rs.next()) {
|
||||
idList.add(Util.getIntValue(rs.getString("resourceid")));
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(idList)) {
|
||||
rs.executeQuery("select id,lastname,workcode,sex,managerid,loginid from hrmresource where status < 4 and id in ("+ StringUtils.join(idList,",")+")");
|
||||
while (rs.next()) {
|
||||
poList.add(
|
||||
PersonTablePO.builder()
|
||||
.id(Util.getIntValue(rs.getString("id")))
|
||||
.lastname(Util.null2String(rs.getString("lastname")))
|
||||
.workcode(Util.null2String(rs.getString("workcode")))
|
||||
.sex(Util.getIntValue(rs.getString("sex")))
|
||||
.managerid(Util.getIntValue(rs.getString("managerid")))
|
||||
.loginid(Util.null2String(rs.getString("loginid")))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
voList = poList.stream()
|
||||
.map(po -> new PersonTableVO(po.getId(), po.getLastname(), po.getWorkcode(),
|
||||
po.getSex() == 0 ? "男" : "女",
|
||||
po.getManagerid() != null ? rInfo.getLastname(String.valueOf(po.getManagerid())) : "",
|
||||
po.getLoginid()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return voList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SelectVO> selectVirtualTop() {
|
||||
List<SelectVO> voList = new ArrayList<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id,companyname from hrmcompany");
|
||||
while (rs.next()) {
|
||||
voList.add(SelectVO.builder()
|
||||
.value(Util.null2String(rs.getString("id")))
|
||||
.label(Util.null2String(rs.getString("companyname"))).build());
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DropTreeDataVO> selectVirtualTopTwo(String virtualType) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<DropTreeDataVO> dataVOS = new ArrayList<>();
|
||||
DropTreeDataVO build;
|
||||
rs.executeQuery("select id,companyname from hrmcompany where id = ?",virtualType);
|
||||
rs.next();
|
||||
String id = Util.null2String(rs.getString("id"));
|
||||
log.info("selectVirtualTopTwo.companyname:{}",id);
|
||||
build = DropTreeDataVO.builder()
|
||||
.value(getRandomData()+id)
|
||||
.label(Util.null2String(rs.getString("companyname")))
|
||||
.build();
|
||||
if (isSubCompany(id)) {
|
||||
build.setChildren(getSubCompany(id));
|
||||
}
|
||||
dataVOS.add(build);
|
||||
return dataVOS;
|
||||
}
|
||||
|
||||
private List<DropTreeDataVO> getSubCompany(String companyId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<DropTreeDataVO> voList = new ArrayList<>();
|
||||
rs.executeQuery("select id,subcompanyname from hrmsubcompany where COMPANYID = ? and SUPSUBCOMID = '0' order by showorder",companyId);
|
||||
while (rs.next()) {
|
||||
String id = Util.null2String(rs.getString("id"));
|
||||
log.info("selectVirtualTopTwo.hrmsubcompany:{}",id);
|
||||
DropTreeDataVO build = DropTreeDataVO.builder()
|
||||
.value(id.equals(companyId)?"fenbu"+getRandomData()+id:getRandomData()+id)
|
||||
.label(StringUtils.isBlank(rs.getString("subcompanyname"))?"无名称":rs.getString("subcompanyname"))
|
||||
.build();
|
||||
if (isSubDepartment(id)) {
|
||||
build.setChildren(getSubDept(id));
|
||||
}
|
||||
voList.add(build);
|
||||
}
|
||||
return voList;
|
||||
|
||||
}
|
||||
public boolean isSubCompany(String id) {
|
||||
RecordSet rs = new RecordSet();
|
||||
boolean isSubCompanyid = false;
|
||||
rs.executeQuery("select count(1) from hrmsubcompany where COMPANYID = ? and SUPSUBCOMID = '0' ",id);
|
||||
if (rs.next()) {
|
||||
isSubCompanyid = rs.getInt(1) > 0;
|
||||
}
|
||||
return isSubCompanyid;
|
||||
}
|
||||
public boolean isSubDepartment(String id) {
|
||||
RecordSet rs = new RecordSet();
|
||||
boolean isSubDepartment = false;
|
||||
rs.executeQuery("select count(1) from hrmdepartment where subcompanyid1 = ? and SUPDEPID = '0' ",id);
|
||||
if (rs.next()) {
|
||||
isSubDepartment = rs.getInt(1) > 0;
|
||||
}
|
||||
return isSubDepartment;
|
||||
}
|
||||
public boolean isSubDepartmentChildren(String id) {
|
||||
RecordSet rs = new RecordSet();
|
||||
boolean isSubDepartmentChildren = false;
|
||||
rs.executeQuery("select count(1) from hrmdepartment where SUPDEPID = ? ",id);
|
||||
if (rs.next()) {
|
||||
isSubDepartmentChildren = rs.getInt(1) > 0;
|
||||
}
|
||||
return isSubDepartmentChildren;
|
||||
}
|
||||
private List<DropTreeDataVO> getSubDept(String id) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<DropTreeDataVO> voList = new ArrayList<>();
|
||||
rs.executeQuery("select id,departmentmark from hrmdepartment where subcompanyid1 = ? and SUPDEPID = 0 order by showorder",id);
|
||||
while (rs.next()) {
|
||||
String deptId = Util.null2String(rs.getString("id"));
|
||||
log.info("selectVirtualTopTwo.hrmdepartment1:{}",deptId);
|
||||
DropTreeDataVO build = DropTreeDataVO.builder()
|
||||
.value(getRandomData()+deptId)
|
||||
.label(Util.null2String(rs.getString("departmentmark")))
|
||||
.build();
|
||||
if (isSubDepartmentChildren(deptId)) {
|
||||
build.setChildren(getSubDeptChildren(deptId));
|
||||
}
|
||||
voList.add(build);
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
private List<DropTreeDataVO> getSubDeptChildren(String id) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<DropTreeDataVO> voList = new ArrayList<>();
|
||||
rs.executeQuery("select id,departmentmark from hrmdepartment where SUPDEPID = ? order by showorder",id);
|
||||
while (rs.next()) {
|
||||
String deptId = Util.null2String(rs.getString("id"));
|
||||
log.info("selectVirtualTopTwo.hrmdepartment2:{}",deptId);
|
||||
DropTreeDataVO build = DropTreeDataVO.builder()
|
||||
.value(getRandomData()+deptId)
|
||||
.label(Util.null2String(rs.getString("departmentmark")))
|
||||
.build();
|
||||
if (isSubDepartmentChildren(deptId)) {
|
||||
build.setChildren(getSubDeptChildren(deptId));
|
||||
}
|
||||
voList.add(build);
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SelectVO> selectVirtualTopThree(VirtualTopParam virtualTopParam) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<SelectVO> voList = assembleSelectVOList();
|
||||
TreeDataVO build;
|
||||
String root = virtualTopParam.getId();
|
||||
String virtualType = virtualTopParam.getVirtualType();
|
||||
String id;
|
||||
int num = 1;
|
||||
List<Integer> list = new ArrayList<>();
|
||||
list.add(num);
|
||||
//判断入参类型
|
||||
switch(judgeId(root)){
|
||||
case 1:
|
||||
rs.executeQuery("select id,subcompanyname from hrmsubcompany where id = ? and SUPSUBCOMID = '0' ", root.contains("fenbu")?root.substring(8):root.substring(3));
|
||||
rs.next();
|
||||
id = rs.getString("id");
|
||||
build = TreeDataVO.builder()
|
||||
.id(id)
|
||||
.label(Util.null2String(rs.getString("subcompanyname")))
|
||||
.build();
|
||||
if (isSubDepartment(id)) {
|
||||
build.setChildrens(getSubDeptBase(id));
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
rs.executeQuery("select id,departmentmark from hrmdepartment where id = ? and SUPDEPID = 0 ", root.substring(3));
|
||||
rs.next();
|
||||
id = rs.getString("id");
|
||||
build = TreeDataVO.builder()
|
||||
.id(id)
|
||||
.label(Util.null2String(rs.getString("departmentmark")))
|
||||
.build();
|
||||
if (isSubDepartmentChildren(id)) {
|
||||
build.setChildrens(getSubDeptChildrenBase(id));
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
rs.executeQuery("select id,departmentmark from hrmdepartment where id = ? ", root.substring(3));
|
||||
rs.next();
|
||||
id = rs.getString("id");
|
||||
build = TreeDataVO.builder()
|
||||
.id(id)
|
||||
.label(Util.null2String(rs.getString("departmentmark")))
|
||||
.build();
|
||||
if (isSubDepartmentChildren(id)) {
|
||||
build.setChildrens(getSubDeptChildrenBase(id));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
build = getBaseTree(virtualType);
|
||||
}
|
||||
if(null!=build.getChildrens()&&build.getChildrens().size()>0){
|
||||
for (ChartChildrensVO children : build.getChildrens()) {
|
||||
num = maxDepth(children)+1;
|
||||
list.add(num);
|
||||
}
|
||||
build.setNum(Collections.max(list)+1);
|
||||
}else{
|
||||
build.setNum(num);
|
||||
}
|
||||
// 判断是否满足删除条件
|
||||
for (int i = voList.size() - 1; i >= 0; i--) {
|
||||
if(Integer.parseInt(voList.get(i).getValue())>build.getNum()){
|
||||
voList.remove(i);
|
||||
}
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
private static List<SelectVO> assembleSelectVOList() {
|
||||
List<SelectVO> voList = new ArrayList<>();
|
||||
voList.add(SelectVO.builder().value("1").label("一级").build());
|
||||
voList.add(SelectVO.builder().value("2").label("二级").build());
|
||||
voList.add(SelectVO.builder().value("3").label("三级").build());
|
||||
voList.add(SelectVO.builder().value("4").label("四级").build());
|
||||
voList.add(SelectVO.builder().value("5").label("五级").build());
|
||||
voList.add(SelectVO.builder().value("6").label("六级").build());
|
||||
voList.add(SelectVO.builder().value("7").label("七级").build());
|
||||
voList.add(SelectVO.builder().value("8").label("八级").build());
|
||||
voList.add(SelectVO.builder().value("9").label("九级").build());
|
||||
voList.add(SelectVO.builder().value("10").label("十级").build());
|
||||
return voList;
|
||||
}
|
||||
|
||||
|
||||
private List<PersonTablePO> selectByLevel(Integer level) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<PersonTablePO> poList = new ArrayList<>();
|
||||
BaseBean bb = new BaseBean();
|
||||
String fieldid = bb.getPropValue("sship", "fieldid");
|
||||
rs.executeQuery("select h.id,h.lastname,h.workcode,h.sex,h.managerid,h.loginid from hrmresource h\n" +
|
||||
" left join cus_fielddata c on h.id = c.id\n" +
|
||||
" where c.scopeid = 3 and c.scope = 'HrmCustomFieldByInfoType' and c."+fieldid+" = ?",level);
|
||||
while (rs.next()) {
|
||||
poList.add(
|
||||
PersonTablePO.builder()
|
||||
.id(Util.getIntValue(rs.getString("id")))
|
||||
.lastname(Util.null2String(rs.getString("lastname")))
|
||||
.workcode(Util.null2String(rs.getString("workcode")))
|
||||
.sex(Util.getIntValue(rs.getString("sex")))
|
||||
.managerid(Util.getIntValue(rs.getString("managerid")))
|
||||
.loginid(Util.null2String(rs.getString("loginid")))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
return poList;
|
||||
}
|
||||
|
||||
private List<PersonTablePO> selectByDeptId(String id) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<PersonTablePO> poList = new ArrayList<>();
|
||||
rs.executeQuery("select id,lastname,workcode,sex,managerid,loginid from hrmresource where status < 4 and departmentid = ?",id);
|
||||
while (rs.next()) {
|
||||
poList.add(
|
||||
PersonTablePO.builder()
|
||||
.id(Util.getIntValue(rs.getString("id")))
|
||||
.lastname(Util.null2String(rs.getString("lastname")))
|
||||
.workcode(Util.null2String(rs.getString("workcode")))
|
||||
.sex(Util.getIntValue(rs.getString("sex")))
|
||||
.managerid(Util.getIntValue(rs.getString("managerid")))
|
||||
.loginid(Util.null2String(rs.getString("loginid")))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
return poList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定组织树
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
private TreeDataVO getBaseTreeData() {
|
||||
int uid = user.getUID();
|
||||
DepartmentComInfo dInfo = new DepartmentComInfo();
|
||||
ResourceComInfo rInfo = new ResourceComInfo();
|
||||
String departmentId = rInfo.getDepartmentID(String.valueOf(uid));
|
||||
TreeDataVO build = TreeDataVO.builder()
|
||||
.id(departmentId)
|
||||
.label(dInfo.getDepartmentName(departmentId))
|
||||
.build();
|
||||
boolean manager = hrmCommonService.isManager(uid);
|
||||
if (manager) {
|
||||
build.setChildrens(recursionDepartment(uid));
|
||||
}
|
||||
return build;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全量组织树
|
||||
* @return
|
||||
*/
|
||||
private TreeDataVO getAllTreeData() {
|
||||
//1.股东及委员会层级指定
|
||||
ChartChildrensVO committee = ChartChildrensVO.builder().id("C-1")
|
||||
.pid("S-1")
|
||||
.label("Committee")
|
||||
.childrens(getSiteHead())
|
||||
.build();
|
||||
List<ChartChildrensVO> committeeList = Collections.singletonList(committee);
|
||||
|
||||
return TreeDataVO.builder().id("S-1")
|
||||
.label("Shareholder")
|
||||
.childrens(committeeList)
|
||||
.build();
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
private List<ChartChildrensVO> getSiteHead() {
|
||||
List<Integer> idList = selectCusSiteHead();
|
||||
List<ChartChildrensVO> siteHeadList = new ArrayList<>();
|
||||
DepartmentComInfo dInfo = new DepartmentComInfo();
|
||||
ResourceComInfo rInfo = new ResourceComInfo();
|
||||
idList.forEach(item -> {
|
||||
String departmentId = rInfo.getDepartmentID(String.valueOf(item));
|
||||
ChartChildrensVO build = ChartChildrensVO.builder()
|
||||
.id(departmentId)
|
||||
.pid("C-1")
|
||||
.label(dInfo.getDepartmentmark(departmentId))
|
||||
.build();
|
||||
boolean manager = hrmCommonService.isManager(item);
|
||||
if (manager) {
|
||||
build.setChildrens(recursionDepartment(item));
|
||||
}
|
||||
siteHeadList.add(build);
|
||||
});
|
||||
|
||||
|
||||
return siteHeadList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归获取
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
private List<ChartChildrensVO> recursionDepartment(Integer id) {
|
||||
List<ChartChildrensVO> vos = new ArrayList<>();
|
||||
DepartmentComInfo dInfo = new DepartmentComInfo();
|
||||
ResourceComInfo rInfo = new ResourceComInfo();
|
||||
String underling = hrmCommonService.getUnderling(id);
|
||||
String localId = rInfo.getDepartmentID(String.valueOf(id));
|
||||
//获取直接下属
|
||||
List<String> underList = Arrays.stream(underling.split(","))
|
||||
.filter(s -> !s.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (String item : underList) {
|
||||
String departmentId = rInfo.getDepartmentID(String.valueOf(item));
|
||||
//过滤同部门和子部门
|
||||
boolean exists = vos.stream()
|
||||
.anyMatch(e -> e.getId().equals(departmentId));
|
||||
if (departmentId.equals(localId) || exists){
|
||||
continue;
|
||||
}
|
||||
ChartChildrensVO build = ChartChildrensVO.builder()
|
||||
.id(departmentId)
|
||||
.pid(item)
|
||||
.label(dInfo.getDepartmentmark(departmentId))
|
||||
.build();
|
||||
boolean manager = hrmCommonService.isManager(Integer.valueOf(item));
|
||||
if (manager) {
|
||||
build.setChildrens(recursionDepartment(Integer.valueOf(item)));
|
||||
}
|
||||
vos.add(build);
|
||||
}
|
||||
|
||||
|
||||
return vos;
|
||||
}
|
||||
}
|
@ -0,0 +1,175 @@
|
||||
package com.engine.sship.util;
|
||||
|
||||
import com.engine.sship.exception.CustomizeRunTimeException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @description:
|
||||
* @Date 2022/4/26
|
||||
* @Version V1.0
|
||||
**/
|
||||
public abstract class CommonAssert {
|
||||
/**
|
||||
* 判断入参不为null
|
||||
*
|
||||
* @param object 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notNull(Object object, String message) {
|
||||
if (object == null) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断入参不为null
|
||||
*
|
||||
* @param string 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notNull(String string, String message) {
|
||||
if (StringUtils.isBlank(string)) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断多个入参不为null
|
||||
*
|
||||
* @param message 检查失败返回的异常信息
|
||||
* @param objects 待检查参数
|
||||
*/
|
||||
public static void notNull(String message, Object... objects) {
|
||||
for (Object obj : objects) {
|
||||
if (obj == null) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断入参为null
|
||||
*
|
||||
* @param object 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void isNull(Object object, String message) {
|
||||
if (object != null) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断集合是否为空
|
||||
*
|
||||
* @param collection 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void isEmpty(Collection<?> collection, String message) {
|
||||
if (!CollectionUtils.isEmpty(collection)) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断集合不为空
|
||||
*
|
||||
* @param collection 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notEmpty(Collection<?> collection, String message) {
|
||||
if (CollectionUtils.isEmpty(collection)) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断数组是否为空
|
||||
*
|
||||
* @param arr 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notEmpty(Object[] arr, String message) {
|
||||
if (ObjectUtils.isEmpty(arr)) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断map是否为空
|
||||
*
|
||||
* @param map 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notEmpty(Map<?, ?> map, String message) {
|
||||
if (CollectionUtils.isEmpty(map)) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断数组元素是否为空
|
||||
*
|
||||
* @param arr 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notNullElement(Object[] arr, String message) {
|
||||
if (arr != null) {
|
||||
for (Object obj : arr) {
|
||||
if (obj == null) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断boolean
|
||||
*
|
||||
* @param expression 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void isTrue(boolean expression, String message) {
|
||||
if (!expression) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isFalse(boolean expression, String message) {
|
||||
if (expression) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isBlank(CharSequence cs, String message) {
|
||||
int strLen;
|
||||
if (cs != null && (strLen = cs.length()) != 0) {
|
||||
for (int i = 0; i < strLen; ++i) {
|
||||
if (!Character.isWhitespace(cs.charAt(i))) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void notBlank(CharSequence cs, String message) {
|
||||
int strLen;
|
||||
if (cs != null && (strLen = cs.length()) != 0) {
|
||||
for (int i = 0; i < strLen; ++i) {
|
||||
if (Character.isWhitespace(cs.charAt(i))) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cs == null || cs.length() == 0) {
|
||||
throw new CustomizeRunTimeException(message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.engine.sship.util;
|
||||
|
||||
|
||||
/**
|
||||
* @author apple
|
||||
*/
|
||||
public class ExceptionUtil {
|
||||
public static String getRealMessage(Throwable e) {
|
||||
while (e != null) {
|
||||
Throwable cause = e.getCause();
|
||||
if (cause == null) {
|
||||
return e.getMessage();
|
||||
}
|
||||
e = cause;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.engine.sship.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.sship.entity.*;
|
||||
import com.engine.sship.service.OrgChartService;
|
||||
import com.engine.sship.service.impl.OrgChartServiceImpl;
|
||||
import com.engine.sship.util.ResponseResult;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2023/9/26 5:51 PM
|
||||
* @Description: 组织架构图
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class OrgChartController {
|
||||
|
||||
private OrgChartService getOrgChartService(User user) {
|
||||
return ServiceUtil.getService(OrgChartServiceImpl.class,user);
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/resource-tree")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String selectResourceChart(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<String, TreeDataVO>(user).run(getOrgChartService(user) :: selectResourceChart);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/organization-tree")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String selectOrganizationChart(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@QueryParam("virtualType") String virtualType,
|
||||
@QueryParam("root") String root,
|
||||
@QueryParam("level") String level) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
OrgTreeParam build = OrgTreeParam.builder().virtualType(virtualType).root(root).level(level).build();
|
||||
return new ResponseResult<OrgTreeParam, TreeDataVO>(user).run(getOrgChartService(user) :: selectOrganizationChart,build);
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/person")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String selectPerson(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam("id") String id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
PersonTableParam build = PersonTableParam.builder().id(id).build();
|
||||
return new ResponseResult<PersonTableParam, List<PersonTableVO>>(user).run(getOrgChartService(user) :: selectPerson,build);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/virtual-person")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String selectVirtualPerson(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam("id") String id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
PersonTableParam build = PersonTableParam.builder().id(id).build();
|
||||
return new ResponseResult<PersonTableParam, List<PersonTableVO>>(user).run(getOrgChartService(user) :: selectVirtualPerson,build);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/virtual-top")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String selectVirtualTop(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PersonTableParam, List<SelectVO>>(user).run(getOrgChartService(user) :: selectVirtualTop);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/virtual-top-two")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String selectVirtualTopTwo(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam("virtualType") String virtualType) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<String, List<DropTreeDataVO>>(user).run(getOrgChartService(user) :: selectVirtualTopTwo,virtualType);
|
||||
}
|
||||
@GET
|
||||
@Path("/virtual-top-three")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String selectVirtualTopThree(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@QueryParam("id") String id,
|
||||
@QueryParam("virtualType") String virtualType) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
VirtualTopParam build = VirtualTopParam.builder().id(id).virtualType(virtualType).build();
|
||||
return new ResponseResult<VirtualTopParam, List<SelectVO>>(user).run(getOrgChartService(user) :: selectVirtualTopThree,build);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue