组织架构图,人员列表显示转换调整
This commit is contained in:
parent
c3476e3659
commit
436decbc85
|
|
@ -36,6 +36,8 @@ public class ChartPO {
|
|||
|
||||
// 人员主次账号
|
||||
private String belongto;
|
||||
// 人员工龄
|
||||
private String companyWorkYear;
|
||||
|
||||
private String id;
|
||||
private String key;
|
||||
|
|
@ -70,4 +72,11 @@ public class ChartPO {
|
|||
public String getKey() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
public String getCompanyWorkYear() {
|
||||
if (StringUtils.isNotBlank(ftype) && "4".equals(ftype)) {
|
||||
return StringUtils.isNotBlank(companyWorkYear) ? companyWorkYear : "0";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package com.engine.organization.entity.hrmresource.bo;
|
||||
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceChartPO;
|
||||
import com.engine.organization.entity.hrmresource.vo.ResourceChartVO;
|
||||
import com.engine.organization.transmethod.HrmResourceTransMethod;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/07/06
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class ResourceChartBO {
|
||||
|
||||
public static List<ResourceChartVO> convertToVO(List<ResourceChartPO> resourceChartPOS) {
|
||||
List<ResourceChartVO> resourceChartVOS = new ArrayList<>();
|
||||
for (ResourceChartPO resourceChartPO : resourceChartPOS) {
|
||||
ResourceChartVO resourceChartVO = new ResourceChartVO();
|
||||
resourceChartVO.setId(resourceChartPO.getId());
|
||||
resourceChartVO.setWorkCode(resourceChartPO.getWorkCode());
|
||||
resourceChartVO.setLastName(resourceChartPO.getLastName());
|
||||
resourceChartVO.setSex("1".equals(resourceChartPO.getSex()) ? "女" : "男");
|
||||
resourceChartVO.setDepartmentName(HrmResourceTransMethod.getDepartmentName(Util.null2String(resourceChartPO.getDepartmentId())));
|
||||
resourceChartVO.setSubcompanyName(HrmResourceTransMethod.getCompanyName(Util.null2String(resourceChartPO.getSubcompanyid1())));
|
||||
resourceChartVO.setJobTitle(HrmResourceTransMethod.getJobName(Util.null2String(resourceChartPO.getJobTitle())));
|
||||
resourceChartVO.setStatus(resourceChartPO.getStatus());
|
||||
resourceChartVO.setMobile(resourceChartPO.getMobile());
|
||||
resourceChartVOS.add(resourceChartVO);
|
||||
}
|
||||
return resourceChartVOS;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -26,11 +26,11 @@ public class ResourceChartPO {
|
|||
|
||||
private String sex;
|
||||
|
||||
private String departmentId;
|
||||
private Integer departmentId;
|
||||
|
||||
private String subcompanyid1;
|
||||
private Integer subcompanyid1;
|
||||
|
||||
private String jobTitle;
|
||||
private Integer jobTitle;
|
||||
|
||||
private Integer status;
|
||||
|
||||
|
|
|
|||
|
|
@ -444,22 +444,8 @@
|
|||
</select>
|
||||
|
||||
<select id="selectByDepartmentId" resultType="com.engine.organization.entity.hrmresource.po.ResourceChartPO">
|
||||
select a.id,
|
||||
a.workcode,
|
||||
a.lastname,
|
||||
case when (sex is null or sex = '0') then '男' else '女' End as 'sex',
|
||||
c.departmentmark as departmentid,
|
||||
b.subcompanyname as subcompanyid1,
|
||||
d.jobtitlename as jobtitle,
|
||||
a.status,
|
||||
a.mobile
|
||||
from hrmresource a
|
||||
left join hrmsubcompany b on a.subcompanyid1 = b.id
|
||||
left join hrmdepartment c on a.departmentid = c.id
|
||||
left join hrmjobtitles d on a.jobtitle = d.id
|
||||
where a.departmentid = #{departmentId}
|
||||
and a.status < 4
|
||||
order by a.id
|
||||
select id,workcode,lastname,sex,departmentid,subcompanyid1,jobtitle,status,mobile
|
||||
from hrmresource where departmentid = #{departmentId} and status < 4
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -194,9 +194,9 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
String sql;
|
||||
// 查询当当前部门下的人员
|
||||
if ("0".equals(dimension)) {
|
||||
sql = "select a.id,a.lastname as 'name' ,a.jobtitle ,a.belongto from hrmresource a where a.departmentid = '" + departmentId + "'";
|
||||
sql = "select a.id,a.lastname as 'name' ,a.jobtitle ,a.belongto ,a.companyworkyear from hrmresource a where a.departmentid = '" + departmentId + "'";
|
||||
} else {
|
||||
sql = "select a.id,a.lastname as 'name' ,a.jobtitle ,a.belongto from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where b.departmentid = '" + departmentId + "'";
|
||||
sql = "select a.id,a.lastname as 'name' ,a.jobtitle ,a.belongto ,a.companyworkyear from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where b.departmentid = '" + departmentId + "'";
|
||||
}
|
||||
rs.executeQuery(sql);
|
||||
while (rs.next()){
|
||||
|
|
@ -211,6 +211,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
chartPO.setExpand("0");
|
||||
chartPO.setHasChildren("0");
|
||||
chartPO.setBelongto(Util.null2String(rs.getString("belongto")));
|
||||
chartPO.setCompanyWorkYear(rs.getString("companyworkyear"));
|
||||
resourceList.add(chartPO);
|
||||
|
||||
jobTitleSet.add(jobTitle);
|
||||
|
|
|
|||
|
|
@ -21,10 +21,12 @@ import com.engine.organization.entity.department.po.DepartmentPO;
|
|||
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.entity.hrmresource.bo.HrmRelationBO;
|
||||
import com.engine.organization.entity.hrmresource.bo.ResourceChartBO;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
||||
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
|
||||
import com.engine.organization.entity.hrmresource.po.*;
|
||||
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
|
||||
import com.engine.organization.entity.hrmresource.vo.ResourceChartVO;
|
||||
import com.engine.organization.entity.jclimport.po.CusFormFieldPO;
|
||||
import com.engine.organization.entity.job.bo.JobBO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
|
|
@ -426,8 +428,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
Map<String, Object> dataMap = new HashMap<>();
|
||||
List<ResourceListColumns> resourceListColumns = getTableColumns();
|
||||
List<ResourceChartPO> resourceChartPOS = getHrmResourceMapper().selectByDepartmentId(departmentId);
|
||||
List<ResourceChartVO> resourceChartVOS = ResourceChartBO.convertToVO(resourceChartPOS);
|
||||
dataMap.put("columns",resourceListColumns);
|
||||
dataMap.put("dataSource",resourceChartPOS);
|
||||
dataMap.put("dataSource",resourceChartVOS);
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
|
|
@ -437,8 +440,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
list.add(ResourceListColumns.builder().title("工号").dataIndex("workCode").key("workCode").build());
|
||||
list.add(ResourceListColumns.builder().title("姓名").dataIndex("lastName").key("lastName").build());
|
||||
list.add(ResourceListColumns.builder().title("性别").dataIndex("sex").key("sex").build());
|
||||
list.add(ResourceListColumns.builder().title("部门").dataIndex("departmentId").key("departmentId").build());
|
||||
list.add(ResourceListColumns.builder().title("分部").dataIndex("subcompanyid1").key("subcompanyid1").build());
|
||||
list.add(ResourceListColumns.builder().title("部门").dataIndex("departmentName").key("departmentName").build());
|
||||
list.add(ResourceListColumns.builder().title("分部").dataIndex("subcompanyName").key("subcompanyName").build());
|
||||
list.add(ResourceListColumns.builder().title("岗位").dataIndex("jobTitle").key("jobTitle").build());
|
||||
//list.add(ResourceListColumns.builder().title("状态").dataIndex("status").key("status").build());
|
||||
list.add(ResourceListColumns.builder().title("手机号").dataIndex("mobile").key("mobile").build());
|
||||
|
|
|
|||
Loading…
Reference in New Issue