组织架构图,人员列表显示转换调整 #179

Merged
dxfeng merged 3 commits from feature/dxf into develop 2 years ago

@ -36,6 +36,10 @@ public class ChartPO {
// 人员主次账号
private String belongto;
// 人员工龄
private String companyWorkYear;
// 人员头像
private String fleaderimg;
private String id;
private String key;
@ -70,4 +74,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 &lt; 4
order by a.id
select id,workcode,lastname,sex,departmentid,subcompanyid1,jobtitle,status,mobile
from hrmresource where departmentid = #{departmentId} and status &lt; 4 order by id
</select>
</mapper>

@ -12,6 +12,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.hrm.resource.ResourceComInfo;
import java.util.*;
import java.util.stream.Collectors;
@ -194,9 +195,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 +212,12 @@ 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"));
try {
chartPO.setFleaderimg(new ResourceComInfo().getMessagerUrls(chartPO.getId()));
} catch (Exception e) {
throw new RuntimeException(e);
}
resourceList.add(chartPO);
jobTitleSet.add(jobTitle);
@ -242,7 +249,11 @@ public class ChartServiceImpl extends Service implements ChartService {
}
}
// 查询部门本身
sql = "select a.id,a.departmentname as 'name',b.bmfzr from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '" + departmentId + "'";
if(hasVirtualFields){
sql = "select a.id,a.departmentname as 'name',b.bmfzr,b.bmlx as 'isvitual' from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '" + departmentId + "'";
}else {
sql = "select a.id,a.departmentname as 'name',b.bmfzr from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '" + departmentId + "'";
}
rs.executeQuery(sql);
if(rs.next()){
String fLeader = Util.null2String(rs.getString("bmfzr"));
@ -255,6 +266,7 @@ public class ChartServiceImpl extends Service implements ChartService {
chartPO.setExpand("1");
chartPO.setHasChildren(CollectionUtils.isNotEmpty(dataList) ? "1" : "0");
chartPO.setFonjob(departmentOnJob);
chartPO.setFisvitual(rs.getString("isvitual"));
// 部门负责人
chartPO.setFleader(getDepartmentLeader(fLeader));

@ -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…
Cancel
Save