Merge pull request '组织架构图排序' (#200) from feature/dxf into develop

Reviewed-on: #200
pull/201/head
dxfeng 2 years ago
commit e6600a813c

@ -6,7 +6,6 @@ import com.engine.organization.entity.chart.ChartPO;
import com.engine.organization.entity.chart.CompanyTreePO;
import com.engine.organization.entity.chart.TreeSelect;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.service.ChartService;
import com.engine.organization.service.OrgChartService;
import com.engine.organization.util.HasRightUtil;
@ -54,10 +53,6 @@ public class ChartServiceImpl extends Service implements ChartService {
*/
boolean hasVirtualFields;
private JclOrgMapper getJclOrgMapMapper() {
return MapperProxyFactory.getProxy(JclOrgMapper.class,true);
}
private OrgChartService getOrgChartService(User user) {
return ServiceUtil.getService(OrgChartServiceImpl.class, user);
@ -1016,13 +1011,13 @@ public class ChartServiceImpl extends Service implements ChartService {
} else {
if (hasVirtualFields) {
if (showVirtual) {
return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid where a.id = '" + root + "'";
return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid where a.id = '" + root + "' order by showorder,id";
} else {
return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid where a.id = '" + root + "' and (b.fblx is null or b.fblx!='1')";
return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid where a.id = '" + root + "' and (b.fblx is null or b.fblx!='1') order by showorder,id";
}
} else {
return "select id,subcompanyname as name,'1' as type from " + SUB_COMPANY_TABLE + " where id = '" + root + "'";
return "select id,subcompanyname as name,'1' as type from " + SUB_COMPANY_TABLE + " where id = '" + root + "' order by showorder,id";
}
}
}
@ -1052,15 +1047,15 @@ public class ChartServiceImpl extends Service implements ChartService {
case "1":
if (hasVirtualFields) {
if (showVirtual) {
sql = "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid where (a.canceled is null or a.canceled != '1') and a.supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and subcompanyid1 = '" + fObjId + "'";
sql = "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,showorder from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid where (a.canceled is null or a.canceled != '1') and a.supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,showorder from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and subcompanyid1 = '" + fObjId + "'";
} else {
sql = "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid where (a.canceled is null or a.canceled != '1') and (b.fblx is null or b.fblx != '1') and a.supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and (b.bmlx is null or b.bmlx != '1') and subcompanyid1 = '" + fObjId + "'";
sql = "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,showorder from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid where (a.canceled is null or a.canceled != '1') and (b.fblx is null or b.fblx != '1') and a.supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,showorder from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and (b.bmlx is null or b.bmlx != '1') and subcompanyid1 = '" + fObjId + "'";
}
} else {
sql = "select a.id,a.subcompanyname as name,'1' as type from " + SUB_COMPANY_TABLE + " a where (canceled is null or canceled != '1') and supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and (supdepid is null or supdepid = '0') and subcompanyid1 = '" + fObjId + "'";
sql = "select a.id,a.subcompanyname as name,'1' as type,showorder from " + SUB_COMPANY_TABLE + " a where (canceled is null or canceled != '1') and supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type,showorder from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and (supdepid is null or supdepid = '0') and subcompanyid1 = '" + fObjId + "'";
}
break;
case "2":
@ -1077,6 +1072,7 @@ public class ChartServiceImpl extends Service implements ChartService {
default:
break;
}
sql += " order by showorder,id";
}
return sql;
}

Loading…
Cancel
Save