组织架构图,列表字段转换、卡片在岗数统计

pull/178/head
dxfeng 2 years ago
parent 49036ba704
commit 79f64f7f93

@ -28,7 +28,11 @@ public class ChartPO {
private String fisvitual; private String fisvitual;
private String hasChildren; private String hasChildren;
// 在岗数
private Integer fonjob;
private String id; private String id;
private String key;
public String getId() { public String getId() {
if (StringUtils.isNotBlank(ftype)) { if (StringUtils.isNotBlank(ftype)) {
@ -52,4 +56,8 @@ public class ChartPO {
public String getFisvitual() { public String getFisvitual() {
return StringUtils.isBlank(fisvitual) ? "0" : fisvitual; return StringUtils.isBlank(fisvitual) ? "0" : fisvitual;
} }
public String getKey() {
return getId();
}
} }

@ -26,11 +26,11 @@ public class ResourceChartPO {
private String sex; private String sex;
private Integer departmentId; private String departmentId;
private Integer subcompanyid1; private String subcompanyid1;
private Integer jobTitle; private String jobTitle;
private Integer status; private Integer status;

@ -444,8 +444,22 @@
</select> </select>
<select id="selectByDepartmentId" resultType="com.engine.organization.entity.hrmresource.po.ResourceChartPO"> <select id="selectByDepartmentId" resultType="com.engine.organization.entity.hrmresource.po.ResourceChartPO">
select id,workcode,lastname,sex,departmentid,subcompanyid1,jobtitle,status,mobile select a.id,
from hrmresource where departmentid = #{departmentId} and status &lt; 4 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> </select>
</mapper> </mapper>

@ -186,6 +186,7 @@ public class ChartServiceImpl extends Service implements ChartService {
List<ChartPO> dataList = new ArrayList<>(); List<ChartPO> dataList = new ArrayList<>();
List<ChartPO> resourceList = new ArrayList<>(); List<ChartPO> resourceList = new ArrayList<>();
Set<String> jobTitleSet = new HashSet<>(); Set<String> jobTitleSet = new HashSet<>();
int departmentOnJob = 0;
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
// TODO 查询当前实际的数据 // TODO 查询当前实际的数据
String sql; String sql;
@ -201,6 +202,7 @@ public class ChartServiceImpl extends Service implements ChartService {
ChartPO chartPO = new ChartPO(); ChartPO chartPO = new ChartPO();
chartPO.setFtype("4"); chartPO.setFtype("4");
chartPO.setFobjid(rs.getString("id")); chartPO.setFobjid(rs.getString("id"));
chartPO.setId(chartPO.getFobjid());
chartPO.setFname(rs.getString("name")); chartPO.setFname(rs.getString("name"));
// 岗位处理后的ID // 岗位处理后的ID
chartPO.setParentId(departmentId + "_" + jobTitle); chartPO.setParentId(departmentId + "_" + jobTitle);
@ -231,6 +233,8 @@ public class ChartServiceImpl extends Service implements ChartService {
List<ChartPO> chartPOS = resourceMap.get(chartPO.getId()); List<ChartPO> chartPOS = resourceMap.get(chartPO.getId());
if (CollectionUtils.isNotEmpty(chartPOS)) { if (CollectionUtils.isNotEmpty(chartPOS)) {
dataList.addAll(chartPOS); dataList.addAll(chartPOS);
chartPO.setFonjob(chartPOS.size());
departmentOnJob += chartPO.getFonjob();
} }
} }
} }
@ -246,6 +250,7 @@ public class ChartServiceImpl extends Service implements ChartService {
// 岗位处理后的ID // 岗位处理后的ID
chartPO.setExpand("1"); chartPO.setExpand("1");
chartPO.setHasChildren(CollectionUtils.isNotEmpty(dataList) ? "1" : "0"); chartPO.setHasChildren(CollectionUtils.isNotEmpty(dataList) ? "1" : "0");
chartPO.setFonjob(departmentOnJob);
dataList.add(chartPO); dataList.add(chartPO);
} }

@ -438,7 +438,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
list.add(ResourceListColumns.builder().title("姓名").dataIndex("lastName").key("lastName").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("sex").key("sex").build());
list.add(ResourceListColumns.builder().title("部门").dataIndex("departmentId").key("departmentId").build()); list.add(ResourceListColumns.builder().title("部门").dataIndex("departmentId").key("departmentId").build());
list.add(ResourceListColumns.builder().title("分部").dataIndex("subcompamyid1").key("subcompamyid1").build()); list.add(ResourceListColumns.builder().title("分部").dataIndex("subcompanyid1").key("subcompanyid1").build());
list.add(ResourceListColumns.builder().title("岗位").dataIndex("jobTitle").key("jobTitle").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("status").key("status").build());
list.add(ResourceListColumns.builder().title("手机号").dataIndex("mobile").key("mobile").build()); list.add(ResourceListColumns.builder().title("手机号").dataIndex("mobile").key("mobile").build());

Loading…
Cancel
Save