Compare commits
4 Commits
master
...
feature/简阳
| Author | SHA1 | Date |
|---|---|---|
|
|
76b435cf81 | |
|
|
808939c0fd | |
|
|
8221b98624 | |
|
|
1c2338ea30 |
|
|
@ -22,9 +22,13 @@ import lombok.NoArgsConstructor;
|
|||
@OrganizationTable(pageId = "80e7830c-18e8-4e14-8241-18821195ef31",
|
||||
fields = "t.id," +
|
||||
"t.lastname," +
|
||||
"t.mobile," +
|
||||
"t.companystartdate," +
|
||||
"t.sex",
|
||||
"t.workcode," +
|
||||
"t.sex," +
|
||||
"t.status," +
|
||||
"t.managerid," +
|
||||
"t.jobtitle," +
|
||||
"t.loginid," +
|
||||
"t.seclevel",
|
||||
fromSql = "FROM hrmresource t ",
|
||||
orderby = "id",
|
||||
primarykey = "id",
|
||||
|
|
@ -35,17 +39,26 @@ public class EmployeeTableVO {
|
|||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
@OrganizationTableColumn(text = "姓名", width = "25%", column = "lastname")
|
||||
@OrganizationTableColumn(text = "姓名", width = "10%", column = "lastname")
|
||||
private String lastname;
|
||||
|
||||
@OrganizationTableColumn(text = "性别", width = "25%", column = "sex",transmethod = "com.engine.organization.transmethod.JobTransMethod.getSexName")
|
||||
@OrganizationTableColumn(text = "编号", width = "10%", column = "workcode")
|
||||
private String workcode;
|
||||
|
||||
@OrganizationTableColumn(text = "性别", width = "10%", column = "sex",transmethod = "com.engine.organization.transmethod.JobTransMethod.getSexName")
|
||||
private String sex;
|
||||
|
||||
@OrganizationTableColumn(text = "手机", width = "25%", column = "mobile")
|
||||
private String mobile;
|
||||
@OrganizationTableColumn(text = "直接上级", width = "10%", column = "managerid",transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getManagerName")
|
||||
private String managerid;
|
||||
|
||||
@OrganizationTableColumn(text = "入职日期", width = "25%", column = "companystartdate")
|
||||
private String companystartdate;
|
||||
@OrganizationTableColumn(text = "岗位", width = "10%", column = "jobtitle",transmethod = "com.engine.organization.transmethod.JobTransMethod.getJobTitleName")
|
||||
private String jobtitle;
|
||||
|
||||
@OrganizationTableColumn(text = "登录名", width = "10%", column = "loginid")
|
||||
private String loginid;
|
||||
|
||||
@OrganizationTableColumn(text = "安全级别", width = "10%", column = "seclevel")
|
||||
private String seclevel;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,8 +25,11 @@ import lombok.NoArgsConstructor;
|
|||
operates = {
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除"),
|
||||
@OrganizationTableOperate(index = "2", text = "变更")
|
||||
}, tableType = WeaTableType.CHECKBOX
|
||||
@OrganizationTableOperate(index = "2", text = "变更"),
|
||||
@OrganizationTableOperate(index = "3", text = "详情")
|
||||
}, tableType = WeaTableType.CHECKBOX,
|
||||
operatePopedom = @OperatePopedom(transmethod = "com.engine.organization.util.ConfigTrans.formatStaffOperates", otherpara = "column:control_dimension")
|
||||
|
||||
|
||||
)
|
||||
public class StaffTableVO {
|
||||
|
|
@ -35,11 +38,7 @@ public class StaffTableVO {
|
|||
*/
|
||||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
/**
|
||||
* 是否被引用
|
||||
*/
|
||||
@OrganizationTableColumn(column = "isUsed", display = false)
|
||||
private Integer isUsed;
|
||||
|
||||
/**
|
||||
* 方案id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -149,4 +149,6 @@ public interface JobMapper {
|
|||
List<String> isAllowDelete(@Param("jobId") Long jobId);
|
||||
|
||||
JobPO getJobByResource(@Param("resourcePO") ResourcePO resourcePO);
|
||||
|
||||
String selectJobTitleById(@Param("id") String id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -512,12 +512,21 @@
|
|||
t.ec_department = h.departmentid
|
||||
where h.status < 4
|
||||
</select>
|
||||
|
||||
<select id="isAllowDelete" resultType="java.lang.String">
|
||||
select t.id
|
||||
from jcl_org_job t
|
||||
inner join hrmresource h on t.ec_jobtitle = h.jobtitle and t.ec_company = h.subcompanyid1 and
|
||||
t.ec_department = h.departmentid and t.id = #{jobId} and h.status < 4
|
||||
</select>
|
||||
|
||||
<select id="selectJobTitleById" resultType="java.lang.String">
|
||||
select jobtitlename
|
||||
from hrmjobtitles where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getJobByResource" resultType="com.engine.organization.entity.job.po.JobPO">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
topChartPO.setFtype(rs.getString("type"));
|
||||
topChartPO.setFobjid(rs.getString("id"));
|
||||
topChartPO.setFname(rs.getString("name"));
|
||||
topChartPO.setOnJobNum(Util.getIntValue(rs.getString("on_job_num"),0));
|
||||
topChartPO.setOnJobNum(isRealTime ? Util.getIntValue(rs.getString("on_job_num"),0) : Util.getIntValue(rs.getString("job_num"),0));
|
||||
topChartPO.setStaffNum(Util.getIntValue(rs.getString("staff_num"),0));
|
||||
topChartPO.setParentId(null);
|
||||
topChartPO.setExpand("1");
|
||||
|
|
@ -197,6 +197,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
chartPO.setFisvitual(rs.getString("isvitual"));
|
||||
chartPO.setHasChildren(getHasChildren(chartPO.getFtype(), chartPO.getFobjid()).toString());
|
||||
filterAndAddData(dataList, chartPO, hideDepartment);
|
||||
|
||||
//dataList.add(chartPO);
|
||||
}
|
||||
}
|
||||
|
|
@ -403,12 +404,12 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
} else {
|
||||
if (hasVirtualFields) {
|
||||
if (showVirtual) {
|
||||
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a." + SUB_COMPANY_ID + "=b.data_id and b.type=1 where versionid = " + versionId + " and subcompanyid = " + root;
|
||||
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and subcompanyid = " + root;
|
||||
} else {
|
||||
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a." + SUB_COMPANY_ID + "=b.data_id and b.type=1 where versionid = " + versionId + " and subcompanyid = " + root + " and (isvirtual is null or isvirtual != '1')";
|
||||
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and subcompanyid = " + root + " and (isvirtual is null or isvirtual != '1')";
|
||||
}
|
||||
} else {
|
||||
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a." + SUB_COMPANY_ID + "=b.data_id and b.type=1 where versionid = " + versionId + " and subcompanyid = " + root;
|
||||
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and subcompanyid = " + root;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -634,6 +635,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
list.add(stp.getDataId());
|
||||
StringBuilder jobSql = new StringBuilder();
|
||||
StringBuilder staffSql = new StringBuilder();
|
||||
List<Integer> jobList = new ArrayList<>();
|
||||
|
||||
if (ModuleTypeEnum.subcompanyfielddefined.getValue().equals(stp.getType())) {
|
||||
subCompany.getSubCompanyLists(String.valueOf(stp.getDataId()), list);
|
||||
|
|
@ -643,27 +645,43 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
" on a.plan_id = b.id\n" +
|
||||
" and a.ec_company = ? and a.ec_department is null and a.delete_type = 0\n" +
|
||||
" and b.plan_year = ?");
|
||||
|
||||
rs.executeQuery(staffSql.toString(),stp.getDataId(),OrganizationDateUtil.getFormatYear(new Date()));
|
||||
if (rs.next()) {
|
||||
stp.setStaffNum(Util.getIntValue(rs.getString("staff_num"),0));
|
||||
}
|
||||
|
||||
}else {
|
||||
dept.getAllChildDeptByDepId(list,String.valueOf(stp.getDataId()));
|
||||
String value = StringUtils.join(list,",");
|
||||
//编制数维度是岗位 部门展示页面显示当前部门所有岗位编制数之和
|
||||
rs.executeQuery("select id from jcl_org_job where ec_department = ?",stp.getDataId());
|
||||
while (rs.next()) {
|
||||
jobList.add(Util.getIntValue(rs.getString("id")));
|
||||
}
|
||||
String join = StringUtils.join(jobList, ",");
|
||||
|
||||
jobSql.append("select count(1) as count from hrmresource where status < 4 and departmentid in (").append(value).append(")");
|
||||
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" +
|
||||
" and a.job_id in ("+join+") and a.delete_type = 0\n" +
|
||||
" and b.plan_year = ?");
|
||||
List<Integer> count = new ArrayList<>();
|
||||
if (CollectionUtils.isEmpty(jobList)) {
|
||||
stp.setStaffNum(0);
|
||||
} else {
|
||||
rs.executeQuery(staffSql.toString(),OrganizationDateUtil.getFormatYear(new Date()));
|
||||
while (rs.next()) {
|
||||
count.add(Util.getIntValue(rs.getString("staff_num")));
|
||||
}
|
||||
stp.setStaffNum(count.stream().reduce(0, Integer::sum));
|
||||
}
|
||||
}
|
||||
|
||||
rs.executeQuery(jobSql.toString());
|
||||
rs.next();
|
||||
stp.setOnJobNum(Util.getIntValue(rs.getString("count")));
|
||||
|
||||
rs.executeQuery(staffSql.toString(),stp.getDataId(),OrganizationDateUtil.getFormatYear(new Date()));
|
||||
if (rs.next()) {
|
||||
stp.setStaffNum(Util.getIntValue(rs.getString("staff_num")));
|
||||
}else {
|
||||
stp.setStaffNum(0);
|
||||
}
|
||||
|
||||
return stp;
|
||||
}
|
||||
|
||||
|
|
@ -1353,12 +1371,12 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
case "0":
|
||||
if (hasVirtualFields) {
|
||||
if (showVirtual) {
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type ,isvirtual as isvitual,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a."+ SUB_COMPANY_ID + "=b.data_id and b.type=1 where (a.canceled is null or a.canceled != '1') and (a.supsubcompanyid is null or a.supsubcompanyid = '0') and versionid = " + versionId;
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type ,isvirtual as isvitual,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where (a.canceled is null or a.canceled != '1') and (a.supsubcompanyid is null or a.supsubcompanyid = '0') and versionid = " + versionId;
|
||||
} else {
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type ,isvirtual as isvitual,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a."+ SUB_COMPANY_ID + "=b.data_id and b.type=1 where (a.canceled is null or a.canceled != '1') and (a.supsubcompanyid is null or a.supsubcompanyid = '0') and (isvirtual is null or isvirtual != '1') and versionid = " + versionId;
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type ,isvirtual as isvitual,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where (a.canceled is null or a.canceled != '1') and (a.supsubcompanyid is null or a.supsubcompanyid = '0') and (isvirtual is null or isvirtual != '1') and versionid = " + versionId;
|
||||
}
|
||||
} else {
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a."+ SUB_COMPANY_ID + "=b.data_id and b.type=1 where (a.canceled is null or a.canceled != '1') and (a.supsubcompanyid is null or a.supsubcompanyid = '0') and versionid = " + versionId;
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where (a.canceled is null or a.canceled != '1') and (a.supsubcompanyid is null or a.supsubcompanyid = '0') and versionid = " + versionId;
|
||||
}
|
||||
if (!isRealDimension) {
|
||||
sql += " and companyid = " + fObjId;
|
||||
|
|
@ -1367,26 +1385,26 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
case "1":
|
||||
if (hasVirtualFields) {
|
||||
if (showVirtual) {
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type ,isvirtual as isvitual,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a."+ SUB_COMPANY_ID + "=b.data_id and b.type=1 where (a.canceled is null or a.canceled != '1') and a.supsubcompanyid = '" + fObjId + "' and versionid = " + versionId +
|
||||
" union select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual,b.on_job_num,b.staff_num from " + DEPARTMENT_TABLE + " a left join jcl_org_onjob b on a."+ SUB_COMPANY_ID + "=b.data_id and b.type=2 where (a.canceled is null or a.canceled != '1') and (a.supdepartmentid is null or a.supdepartmentid = '0') and subcompanyid = '" + fObjId + "' and versionid = " + versionId;
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type ,isvirtual as isvitual,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where (a.canceled is null or a.canceled != '1') and a.supsubcompanyid = '" + fObjId + "' and versionid = " + versionId +
|
||||
" union select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual,a.job_num,a.staff_num from " + DEPARTMENT_TABLE + " a where (a.canceled is null or a.canceled != '1') and (a.supdepartmentid is null or a.supdepartmentid = '0') and subcompanyid = '" + fObjId + "' and versionid = " + versionId;
|
||||
} else {
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type ,isvirtual as isvitual,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a."+ SUB_COMPANY_ID + "=b.data_id and b.type=1 where (a.canceled is null or a.canceled != '1') and (isvirtual is null or isvirtual != '1') and a.supsubcompanyid = '" + fObjId + "' and versionid = " + versionId +
|
||||
" union select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual,b.on_job_num,b.staff_num from " + DEPARTMENT_TABLE + " a left join jcl_org_onjob b on a."+ DEPARTMENT_ID + "=b.data_id and b.type=2 where (a.canceled is null or a.canceled != '1') and (a.supdepartmentid is null or a.supdepartmentid = '0') and (isvirtual is null or isvirtual != '1') and subcompanyid = '" + fObjId + "' and versionid = " + versionId;
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type ,isvirtual as isvitual,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where (a.canceled is null or a.canceled != '1') and (isvirtual is null or isvirtual != '1') and a.supsubcompanyid = '" + fObjId + "' and versionid = " + versionId +
|
||||
" union select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual,a.job_num,a.staff_num from " + DEPARTMENT_TABLE + " a where (a.canceled is null or a.canceled != '1') and (a.supdepartmentid is null or a.supdepartmentid = '0') and (isvirtual is null or isvirtual != '1') and subcompanyid = '" + fObjId + "' and versionid = " + versionId;
|
||||
}
|
||||
} else {
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a."+ SUB_COMPANY_ID + "=b.data_id and b.type=1 where (canceled is null or canceled != '1') and supsubcompanyid = '" + fObjId + "' and versionid = " + versionId +
|
||||
" union select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type,b.on_job_num,b.staff_num from " + DEPARTMENT_TABLE + " a left join jcl_org_onjob b on a."+ DEPARTMENT_ID + "=b.data_id and b.type=2 where (canceled is null or canceled != '1') and (supdepid is null or supdepid = '0') and subcompanyid = '" + fObjId + "' and versionid = " + versionId;
|
||||
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where (canceled is null or canceled != '1') and supsubcompanyid = '" + fObjId + "' and versionid = " + versionId +
|
||||
" union select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type,a.job_num,a.staff_num from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and (supdepid is null or supdepid = '0') and subcompanyid = '" + fObjId + "' and versionid = " + versionId;
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
if (hasVirtualFields) {
|
||||
if (showVirtual) {
|
||||
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual,b.on_job_num,b.staff_num from " + DEPARTMENT_TABLE + " a left join jcl_org_onjob b on a."+ DEPARTMENT_ID + "=b.data_id and b.type=2 where (a.canceled is null or a.canceled != '1') and supdepartmentid = '" + fObjId + "' and versionid = " + versionId;
|
||||
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual,a.job_num,a.staff_num from " + DEPARTMENT_TABLE + " a where (a.canceled is null or a.canceled != '1') and supdepartmentid = '" + fObjId + "' and versionid = " + versionId;
|
||||
} else {
|
||||
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual,b.on_job_num,b.staff_num from " + DEPARTMENT_TABLE + " a left join jcl_org_onjob b on a."+ DEPARTMENT_ID + "=b.data_id and b.type=2 where (canceled is null or canceled != '1') and (isvirtual is null or isvirtual != '1') and a.supdepartmentid = '" + fObjId + "' and versionid = " + versionId;
|
||||
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual,a.job_num,a.staff_num from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and (isvirtual is null or isvirtual != '1') and a.supdepartmentid = '" + fObjId + "' and versionid = " + versionId;
|
||||
}
|
||||
} else {
|
||||
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type,b.on_job_num,b.staff_num from " + DEPARTMENT_TABLE + " a left join jcl_org_onjob b on a."+ DEPARTMENT_ID + "=b.data_id and b.type=2 where (canceled is null or canceled != '1') and supdepid = '" + fObjId + "' and versionid = " + versionId;
|
||||
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type,a.job_num,a.staff_num from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and supdepid = '" + fObjId + "' and versionid = " + versionId;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
@ -1423,7 +1441,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
chartPO.setFtype(recordSet.getString("type"));
|
||||
chartPO.setFobjid(recordSet.getString("id"));
|
||||
chartPO.setFname(recordSet.getString("name"));
|
||||
chartPO.setOnJobNum(Util.getIntValue(recordSet.getString("on_job_num"),0));
|
||||
chartPO.setOnJobNum(isRealTime ? Util.getIntValue(recordSet.getString("on_job_num"),0) : Util.getIntValue(recordSet.getString("job_num"),0));
|
||||
chartPO.setStaffNum(Util.getIntValue(recordSet.getString("staff_num"),0));
|
||||
chartPO.setParentId(topChartPO.getId());
|
||||
chartPO.setFisvitual(recordSet.getString("isvitual"));
|
||||
|
|
|
|||
|
|
@ -98,8 +98,19 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
// 是否展示当前数据
|
||||
boolean isSearchCurrent = StringUtils.isBlank(id) || "0".equals(id);
|
||||
String sql;
|
||||
String judgeTreeLeafSql;
|
||||
if (isSearchCurrent) {
|
||||
sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? ";
|
||||
boolean isRealDimension = StringUtils.isBlank(fclass) || "0".equals(fclass);
|
||||
boolean isRealTime = StringUtils.isBlank(id) || "0".equals(id);
|
||||
judgeTreeLeafSql = sql;
|
||||
if (isRealTime && user.getUID() != 1 && isRealDimension) {
|
||||
DetachUtil detachUtil = new DetachUtil(user);
|
||||
String ids = detachUtil.getJclRoleLevels();
|
||||
if ("0".equals(subcompany)) {
|
||||
sql = sql + " and id in ("+ids+")";
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) {
|
||||
sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? and companyid = '" + fclass + "'";
|
||||
}
|
||||
|
|
@ -110,10 +121,11 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
}
|
||||
// 添加时间轴条件
|
||||
sql += " and versionid = " + id;
|
||||
judgeTreeLeafSql = sql;
|
||||
}
|
||||
rs.executeQuery(sql,subcompany);
|
||||
while (rs.next()) {
|
||||
companyTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf(sql, rs.getString("id"))).build());
|
||||
companyTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf(judgeTreeLeafSql, rs.getString("id"))).build());
|
||||
}
|
||||
result.put("companyTree", companyTree);
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,12 @@ public class JobTransMethod {
|
|||
return schemeMapper.getSchemeByID(Long.parseLong(schemeId)).getSchemeName();
|
||||
}
|
||||
|
||||
public static String getJobTitleName(String jobTitle) {
|
||||
JobMapper jobMapper = MapperProxyFactory.getProxy(JobMapper.class);
|
||||
return jobMapper.selectJobTitleById(jobTitle);
|
||||
}
|
||||
|
||||
|
||||
public static String getIsKeySpan(String isKey) {
|
||||
if ("1".equals(isKey)) {
|
||||
return "是";
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ public class ConfigTrans {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static List<Object> formatSourceOperates(String id, String isDefault) {
|
||||
List list = Lists.newArrayList();
|
||||
list.add(true);
|
||||
|
|
@ -34,7 +35,9 @@ public class ConfigTrans {
|
|||
public static List<Object> formatStaffOperates(String id, String isDefault) {
|
||||
List list = Lists.newArrayList();
|
||||
list.add(true);
|
||||
if ("0".equals(isDefault)) {
|
||||
list.add(true);
|
||||
list.add(true);
|
||||
if ("3".equals(isDefault)) {
|
||||
list.add(true);
|
||||
} else {
|
||||
list.add(false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue