Compare commits

...

10 Commits

Author SHA1 Message Date
chenxu1234 5bda2ce0ba Merge branch 'master' of http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization into cx0418hd 11 months ago
chenxu1234 7c99465352 * 京福项目组织架构图需求
1.人员按照上下级展示,并控制人员默认平铺。
2.人员数量根据自定义字段过滤机器人类型。
3.部门自定义表部门说明书关联关系,支持点击部门跳转部门说明书页面,人员卡片样式调整。
4.一级分部文字支持换行显示
11 months ago
liang.cheng e5ab4b9363 Merge pull request 'develop' (#238) from develop into master
Reviewed-on: #238
12 months ago
chenxu1234 6e1f39f8bc 京福项目组织架构图调整需求 1 year ago
liang.cheng 65e1e6e904 Merge pull request 'develop' (#236) from develop into master
Reviewed-on: #236
1 year ago
liang.cheng ad2ee1ed0f Merge pull request 'develop' (#234) from develop into master
Reviewed-on: #234
1 year ago
liang.cheng b2dfb60622 Merge pull request 'develop' (#227) from develop into master
Reviewed-on: #227
1 year ago
liang.cheng c3b30a4844 Merge pull request 'develop' (#209) from develop into master
Reviewed-on: #209
2 years ago
liang.cheng 87f3f99cd8 Merge pull request 'develop' (#202) from develop into master
Reviewed-on: #202
2 years ago
liang.cheng e76432ae1a Merge pull request 'develop' (#169) from develop into master
Reviewed-on: #169
2 years ago

@ -41,6 +41,13 @@ public class ChartPO {
// 人员头像
private String fleaderimg;
private String jobTitle;
private String jobFj;
private String smsFj;
private String managerId;
private String id;
private String key;

@ -26,6 +26,7 @@ import weaver.general.Util;
import weaver.hrm.User;
import weaver.hrm.company.DepartmentComInfo;
import weaver.hrm.company.SubCompanyComInfo;
import weaver.hrm.job.JobTitlesComInfo;
import weaver.hrm.resource.ResourceComInfo;
import java.time.LocalDate;
@ -266,12 +267,17 @@ public class ChartServiceImpl extends Service implements ChartService {
departmentChartPO.setFobjid(departmentId);
departmentChartPO.setId(rootId);
departmentChartPO.setFname(rs.getString("name"));
// 岗位处理后的ID
// 岗位处理后的IDfonjob
departmentChartPO.setExpand("1");
departmentChartPO.setFisvitual(rs.getString("isvitual"));
// 部门负责人
departmentChartPO.setFleader(getDepartmentLeader(fLeader));
//二开部门说明书
String smsFj = getBmsmsFj(departmentId);
if(StringUtils.isBlank(smsFj)){
smsFj = "0";
}
departmentChartPO.setSmsFj(smsFj);
dataList.add(departmentChartPO);
}
@ -324,19 +330,44 @@ public class ChartServiceImpl extends Service implements ChartService {
// 直接查询岗位下的人员
if (isRealTime) {
if (isRealDimension) {
sql = "select a.id,a.lastname as name ,a.belongto ,a.companyworkyear from hrmresource a where a.status < 4 and a.departmentid = ? ";
sql = "select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,a.managerid from hrmresource a where a.status < 4 and a.departmentid = ? ";
} else {
sql = "select a.id,a.lastname as name ,a.belongto ,a.companyworkyear from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where a.status < 4 and b.departmentid = ? ";
sql = "select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,a.managerid from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where a.status < 4 and b.departmentid = ? ";
}
} else {
sql = "select a.resourceid as id,a.lastname as name ,a.belongto ,a.companyworkyear from jcl_chart_resource a where a.status < 4 and a.departmentid = ? and versionid = " + versionId;
sql = "select a.resourceid as id,a.lastname as name ,a.belongto ,a.companyworkyear,a.manager from jcl_chart_resource a where a.status < 4 and a.departmentid = ? and versionid = " + versionId;
}
List<ChartPO> personList = new ArrayList<>();
rs.executeQuery(sql, departmentId);
while (rs.next()) {
String managerId;
if (isRealTime) {
managerId = Util.null2String(rs.getString("managerid"));
}else {
managerId = Util.null2String(rs.getString("manager"));
}
ChartPO chartPO = getResourceChartPO(rs.getString("id"), rs.getString("name"), rootId, rs.getString("belongto"), rs.getString("companyworkyear"));
dataList.add(chartPO);
departmentOnJob++;
chartPO.setManagerId(managerId);
personList.add(chartPO);
String bzzyCheck = checkBzzy(rs.getString("id"));
if(StringUtils.isBlank(bzzyCheck)){
//不是机器人才计数
departmentOnJob++;
}
}
Map<String, String> managerToFobjidMap = personList.stream()
.collect(Collectors.toMap(ChartPO::getFobjid, ChartPO::getManagerId));
personList.forEach(chart -> {
String managerId = managerToFobjidMap.get(chart.getManagerId());
if (StringUtils.isNotEmpty(managerId)) {
chart.setParentId(chart.getManagerId());
}
});
dataList.addAll(personList);
}
departmentChartPO.setFonjob(departmentOnJob);
@ -347,6 +378,25 @@ public class ChartServiceImpl extends Service implements ChartService {
return result;
}
/**
*
* @param userid
* @return
*/
private static String checkBzzy(String userid){
RecordSet rs = new RecordSet();
BaseBean bb = new BaseBean();
String bzzy = bb.getPropValue("jgKq_main","bzzy");
bb.writeLog("bzzy:"+bzzy);
String sql = "select "+bzzy+" from cus_fielddata where id = "+userid+" and scope = 'HrmCustomFieldByInfoType' and scopeid = 3";
rs.executeQuery(sql);
String field28 = "";
if (rs.next()){
field28 = Util.null2String(rs.getString(bzzy));
}
return field28;
}
@Override
public String selectVersionDate(String id) {
RecordSet rs = new RecordSet();
@ -367,6 +417,9 @@ public class ChartServiceImpl extends Service implements ChartService {
*/
private ChartPO getResourceChartPO(String id, String name, String parentId, String belongTo, String companyWorkYear) {
ChartPO chartPO = new ChartPO();
try {
ResourceComInfo comInfo = new ResourceComInfo();
JobTitlesComInfo jobInfo = new JobTitlesComInfo();
chartPO.setFtype("4");
chartPO.setFobjid(id);
chartPO.setId(chartPO.getFobjid());
@ -377,7 +430,12 @@ public class ChartServiceImpl extends Service implements ChartService {
chartPO.setHasChildren("0");
chartPO.setBelongto(Util.null2String(belongTo));
chartPO.setCompanyWorkYear(companyWorkYear);
try {
chartPO.setJobTitle(jobInfo.getJobTitlesname(comInfo.getJobTitle(id)));
String jobFj = getJobFj(comInfo.getJobTitle(id));
if(StringUtils.isBlank(jobFj)){
jobFj = "0";
}
chartPO.setJobFj(jobFj);
chartPO.setFleaderimg(new ResourceComInfo().getMessagerUrls(chartPO.getId()));
} catch (Exception e) {
throw new RuntimeException(e);
@ -385,6 +443,39 @@ public class ChartServiceImpl extends Service implements ChartService {
return chartPO;
}
/**
*
* @param id
* @return
*/
public static String getJobFj(String id){
RecordSet rs = new RecordSet();
String gwsms = "";
String sql = "select gwsms from uf_zw where zw = "+id;
rs.executeQuery(sql);
if (rs.next()){
gwsms = Util.null2String(rs.getString("gwsms"));
}
return gwsms;
}
/**
*
* @param id
* @return
*/
public static String getBmsmsFj(String id){
RecordSet rs = new RecordSet();
String bmsms = "";
String sql = "select bmsms from hrmdepartmentdefined where DEPTID = "+id;
rs.executeQuery(sql);
if (rs.next()){
bmsms = Util.null2String(rs.getString("bmsms"));
}
return bmsms;
}
/**
* sql
*
@ -638,11 +729,18 @@ public class ChartServiceImpl extends Service implements ChartService {
list.add(stp.getDataId());
StringBuilder jobSql = new StringBuilder();
StringBuilder staffSql = new StringBuilder();
BaseBean bb = new BaseBean();
String bzzy = bb.getPropValue("jgKq_main","bzzy");
if (ModuleTypeEnum.subcompanyfielddefined.getValue().equals(stp.getType())) {
subCompany.getSubCompanyLists(String.valueOf(stp.getDataId()), list);
String value = StringUtils.join(list,",");
jobSql.append("select count(1) as count from hrmresource where status < 4 and subcompanyid1 in (").append(value).append(")");
// jobSql.append("select count(1) as count from hrmresource where status < 4 and subcompanyid1 in (").append(value).append(")");
jobSql.append("select count(1) as count from hrmresource h\n" +
"left join cus_fielddata c on h.id = c.id and c.scope = 'HrmCustomFieldByInfoType' and c.scopeid = 3 \n" +
"where h.status < 4 and h.subcompanyid1 in (").append(value).append(") and (c.").append(bzzy).append(" is null or c.").append(bzzy).append(" >0)");
staffSql.append("select a.staff_num from jcl_org_staff a inner join jcl_org_staffplan b\n" +
" on a.plan_id = b.id\n" +
" and a.ec_company = ? and a.ec_department is null and a.delete_type = 0\n" +
@ -650,7 +748,10 @@ public class ChartServiceImpl extends Service implements ChartService {
}else {
dept.getAllChildDeptByDepId(list,String.valueOf(stp.getDataId()));
String value = StringUtils.join(list,",");
jobSql.append("select count(1) as count from hrmresource where status < 4 and departmentid in (").append(value).append(")");
// jobSql.append("select count(1) as count from hrmresource where status < 4 and departmentid in (").append(value).append(")");
jobSql.append("select count(1) as count from hrmresource h\n" +
"left join cus_fielddata c on h.id = c.id and c.scope = 'HrmCustomFieldByInfoType' and c.scopeid = 3 \n" +
"where h.status < 4 and h.departmentid in (").append(value).append(") and (c.").append(bzzy).append(" is null or c.").append(bzzy).append(" >0)");
staffSql.append("select a.staff_num from jcl_org_staff a inner join jcl_org_staffplan b\n" +
" on a.plan_id = b.id\n" +
" and a.ec_department = ? and a.job_id is null and a.delete_type = 0\n" +

Loading…
Cancel
Save