|
|
|
@ -34,13 +34,14 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
|
|
|
|
|
Map<String, Object> dataMap = new HashMap<>(4);
|
|
|
|
|
List<ResourceListColumns> resourceListColumns = getTableColumns();
|
|
|
|
|
List<Integer> allSupDepartment = getAllSupDepartment(param.getDepartmentId());
|
|
|
|
|
List<ResourceChartPO> resourceChartPOS = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
resourceChartPOS.addAll(selectNbPerson(allSupDepartment));
|
|
|
|
|
resourceChartPOS.addAll(selectWbPerson(allSupDepartment));
|
|
|
|
|
List<ResourceChartPO> resourceChartNb = new ArrayList<>(selectNbPerson(allSupDepartment));
|
|
|
|
|
List<ResourceChartVO> resourceChartVOS = convertToVO(resourceChartNb,"1");
|
|
|
|
|
|
|
|
|
|
List<ResourceChartPO> resourceChartWb = new ArrayList<>(selectWbPerson(allSupDepartment));
|
|
|
|
|
resourceChartVOS.addAll(convertToVO(resourceChartWb,"2"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ResourceChartVO> resourceChartVOS = convertToVO(resourceChartPOS);
|
|
|
|
|
dataMap.put("columns", resourceListColumns);
|
|
|
|
|
dataMap.put("dataSource", resourceChartVOS);
|
|
|
|
|
return dataMap;
|
|
|
|
@ -75,10 +76,11 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
|
|
|
|
|
|
|
|
|
|
//人员
|
|
|
|
|
List<Integer> allSupDepartment = getAllSupDepartment(param.getDepartmentId());
|
|
|
|
|
List<ResourceChartPO> resourceChartPOS = new ArrayList<>();
|
|
|
|
|
resourceChartPOS.addAll(selectNbPerson(allSupDepartment));
|
|
|
|
|
resourceChartPOS.addAll(selectWbPerson(allSupDepartment));
|
|
|
|
|
List<ResourceChartVO> resourceChartVOS = convertToVO(resourceChartPOS);
|
|
|
|
|
List<ResourceChartPO> resourceChartNb = new ArrayList<>(selectNbPerson(allSupDepartment));
|
|
|
|
|
List<ResourceChartVO> resourceChartVOS = convertToVO(resourceChartNb,"1");
|
|
|
|
|
|
|
|
|
|
List<ResourceChartPO> resourceChartWb = new ArrayList<>(selectWbPerson(allSupDepartment));
|
|
|
|
|
resourceChartVOS.addAll(convertToVO(resourceChartWb,"2"));
|
|
|
|
|
|
|
|
|
|
resourceChartVOS.forEach(item -> {
|
|
|
|
|
ChartPO chartPO = getResourceChartPO(item,departmentChartPO.getId());
|
|
|
|
@ -124,7 +126,7 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
List<ResourceChartPO> resourceChartPOS = new ArrayList<>();
|
|
|
|
|
String join = CollectionUtil.join(allSupDepartment, ",");
|
|
|
|
|
rs.executeQuery("select id, gh,xm,xb,bm,gw,sjhm from uf_zsygrzbdd where zt < 4 and bm in ("+join+")");
|
|
|
|
|
rs.executeQuery("select id,gh,xm,xb,bm,gw,sjhm from uf_zsygrzbdd where zt < 4 and bm in ("+join+")");
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
ResourceChartPO build = ResourceChartPO.builder()
|
|
|
|
|
.id((long) Util.getIntValue(rs.getString("id")))
|
|
|
|
@ -209,7 +211,7 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@SneakyThrows
|
|
|
|
|
private List<ResourceChartVO> convertToVO(List<ResourceChartPO> resourceChartPOS) {
|
|
|
|
|
private List<ResourceChartVO> convertToVO(List<ResourceChartPO> resourceChartPOS,String type) {
|
|
|
|
|
List<ResourceChartVO> resourceChartVOS = new ArrayList<>();
|
|
|
|
|
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
|
|
|
|
|
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
|
|
|
|
@ -224,7 +226,7 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
|
|
|
|
|
resourceChartVO.setSex("1".equals(item.getSex()) ? "女" : "男");
|
|
|
|
|
resourceChartVO.setDepartmentName(departmentComInfo.getDepartmentName(departmentId));
|
|
|
|
|
resourceChartVO.setSubcompanyName(subCompanyname);
|
|
|
|
|
resourceChartVO.setJobTitle(getJobBrowserName(item.getJobBrowser()));
|
|
|
|
|
resourceChartVO.setJobTitle(getJobBrowserName(item.getJobBrowser(),type));
|
|
|
|
|
resourceChartVO.setStatus(item.getStatus());
|
|
|
|
|
resourceChartVO.setMobile(item.getMobile());
|
|
|
|
|
resourceChartVOS.add(resourceChartVO);
|
|
|
|
@ -236,14 +238,23 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
|
|
|
|
|
/**
|
|
|
|
|
* 自定义岗位名称
|
|
|
|
|
* @param code
|
|
|
|
|
* @param code
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String getJobBrowserName(String code){
|
|
|
|
|
|
|
|
|
|
private String getJobBrowserName(String code,String type){
|
|
|
|
|
String gwmc;
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.executeQuery("select gwmc from uf_gwmc where gwbm = ?",code);
|
|
|
|
|
rs.next();
|
|
|
|
|
return Util.null2String(rs.getString("gwmc"));
|
|
|
|
|
if ("1".equals(type)) {
|
|
|
|
|
rs.executeQuery("select gwmc from uf_zsyggwbd where id = ?",code);
|
|
|
|
|
rs.next();
|
|
|
|
|
gwmc = Util.null2String(rs.getString("gwmc"));
|
|
|
|
|
}else {
|
|
|
|
|
rs.executeQuery("select gwmc from uf_gwmc where gwbm = ?",code);
|
|
|
|
|
rs.next();
|
|
|
|
|
gwmc = Util.null2String(rs.getString("gwmc"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return gwmc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -285,11 +296,24 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
|
|
|
|
|
chartPO.setExpand("1");
|
|
|
|
|
chartPO.setHasChildren("0");
|
|
|
|
|
try {
|
|
|
|
|
chartPO.setFleaderimg(new ResourceComInfo().getMessagerUrls(chartPO.getId()));
|
|
|
|
|
String resourceId = getResourceIdByWorkCode(item.getWorkCode());
|
|
|
|
|
chartPO.setFleaderimg(new ResourceComInfo().getMessagerUrls(resourceId));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
return chartPO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取人员id
|
|
|
|
|
* @param workCode
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String getResourceIdByWorkCode(String workCode) {
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.executeQuery("select id from hrmresource where workcode = ?",workCode);
|
|
|
|
|
rs.next();
|
|
|
|
|
return Util.null2String(rs.getString("id"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|