人员管理:左侧树、列表接口
parent
fe0417618c
commit
187be45bdf
@ -0,0 +1,12 @@
|
||||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/bs/hrmorganization/hrmresource")
|
||||
public class HrmResourceController extends com.engine.organization.web.HrmResourceController{
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.engine.organization.entity.hrmresource.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HrmResourceSearchParam {
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String lastName;
|
||||
|
||||
/**
|
||||
* 直接上级
|
||||
*/
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private Long departmentId;
|
||||
|
||||
/**
|
||||
* 移动电话
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 办公电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 其他电话
|
||||
*/
|
||||
private String mobileCall;
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
private Long jobTitle;
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
package com.engine.organization.entity.hrmresource.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HrmResourcePO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String workCode;
|
||||
|
||||
/**
|
||||
* 登录名
|
||||
*/
|
||||
private String loginId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String lastName;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 账号类型
|
||||
*/
|
||||
private Integer accountType;
|
||||
|
||||
/**
|
||||
* 主账号
|
||||
*/
|
||||
private Long belongTo;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private Long departmentId;
|
||||
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 职务
|
||||
*/
|
||||
private Long jobActivity;
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
private Long jobTitle;
|
||||
|
||||
/**
|
||||
* 职称
|
||||
*/
|
||||
private Long jobCall;
|
||||
|
||||
/**
|
||||
* 职级
|
||||
*/
|
||||
private Long jobLevel;
|
||||
|
||||
/**
|
||||
* 职务类别
|
||||
*/
|
||||
private Long jobGroupId;
|
||||
|
||||
/**
|
||||
* 职责描述
|
||||
*/
|
||||
private String jobActivityDesc;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 系统语言
|
||||
*/
|
||||
private Integer systemLanguage;
|
||||
|
||||
/**
|
||||
* 照片
|
||||
*/
|
||||
private String resourceImageId;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String messagerUrl;
|
||||
|
||||
/**
|
||||
* 办公地点
|
||||
*/
|
||||
private Integer locationId;
|
||||
|
||||
/**
|
||||
* 直接上级
|
||||
*/
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
* 助理
|
||||
*/
|
||||
private Long assistantId;
|
||||
|
||||
/**
|
||||
* 移动电话
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 办公室电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 其他电话
|
||||
*/
|
||||
private String mobileCall;
|
||||
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
private String fax;
|
||||
|
||||
/**
|
||||
* 电子邮件
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 办公室
|
||||
*/
|
||||
private String workroom;
|
||||
|
||||
private Long creator;
|
||||
private int deleteType;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.engine.organization.entity.hrmresource.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@OrganizationTable(pageId = "c0583f20-f10c-11ec-9947-00e04c680716",
|
||||
fields = "t.id," +
|
||||
"t.last_name," +
|
||||
"t.department_id," +
|
||||
"t.company_id," +
|
||||
"t.mobile," +
|
||||
"t.telephone," +
|
||||
"t.manager_id,",
|
||||
fromSql = "FROM jcl_org_hrmresource t ",
|
||||
orderby = "id desc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "发消息"),
|
||||
@OrganizationTableOperate(index = "1", text = "发送邮件"),
|
||||
@OrganizationTableOperate(index = "1", text = "发送短信"),
|
||||
@OrganizationTableOperate(index = "1", text = "新建日程"),
|
||||
@OrganizationTableOperate(index = "1", text = "系统信息"),
|
||||
},
|
||||
tableType = WeaTableType.CHECKBOX
|
||||
)
|
||||
public class HrmResourceVO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@OrganizationTableColumn(text = "姓名", width = "25%", column = "last_name")
|
||||
private String lastName;
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@OrganizationTableColumn(text = "部门", width = "25%", column = "department_id", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getDepartmentName")
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
@OrganizationTableColumn(text = "分部", width = "25%", column = "company_id", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getCompanyName")
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 移动电话
|
||||
*/
|
||||
@OrganizationTableColumn(text = "移动电话", width = "25%", column = "mobile")
|
||||
private String mobile;
|
||||
/**
|
||||
* 办公室电话
|
||||
*/
|
||||
@OrganizationTableColumn(text = "办公室电话", width = "25%", column = "telephone")
|
||||
private String telephone;
|
||||
/**
|
||||
* 直接上级
|
||||
*/
|
||||
@OrganizationTableColumn(text = "直接上级", width = "25%", column = "manager_id", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getManagerName")
|
||||
private String managerName;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.engine.organization.transmethod;
|
||||
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.employee.EmployeeMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class HrmResourceTransMethod {
|
||||
|
||||
public static String getDepartmentName(String departmentId) {
|
||||
return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(Long.parseLong(departmentId));
|
||||
}
|
||||
|
||||
public static String getCompanyName(String companyId) {
|
||||
return MapperProxyFactory.getProxy(CompMapper.class).listById(Long.parseLong(companyId)).getCompName();
|
||||
}
|
||||
|
||||
public static String getManagerName(String managerId) {
|
||||
return MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(Long.parseLong(managerId));
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.engine.organization.web;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.HrmResourceWrapper;
|
||||
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.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class HrmResourceController {
|
||||
public HrmResourceWrapper getHrmResourceWrapper(User user) {
|
||||
return ServiceUtil.getService(HrmResourceWrapper.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 左侧树接口
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getSearchTree")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Map<String, Object> getSearchTree(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
SearchTreeParams params = JSONObject.toJavaObject((JSON) JSONObject.toJSON(map), SearchTreeParams.class);
|
||||
return getHrmResourceWrapper(user).getSearchTree(params);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取list列表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/listPage")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult listPage(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
HrmResourceSearchParam param = JSONObject.toJavaObject((JSON) JSONObject.toJSON(map), HrmResourceSearchParam.class);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).listPage(param));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.service.HrmResourceService;
|
||||
import com.engine.organization.service.impl.HrmResourceServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class HrmResourceWrapper extends Service {
|
||||
private HrmResourceService getHrmResourceService(User user) {
|
||||
return ServiceUtil.getService(HrmResourceServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
||||
return getHrmResourceService(user).getSearchTree(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> listPage(HrmResourceSearchParam params) {
|
||||
return getHrmResourceService(user).listPage(params);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue