Merge branch 'develop' of http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization into feature/dxf
This commit is contained in:
commit
4ca7eeb93c
|
|
@ -34,11 +34,11 @@ public interface JclOrgMapper {
|
|||
|
||||
int updateAllMap(@Param("currentDate") Date currentDate, @Param("yesterday") Date yesterday);
|
||||
|
||||
int insertResToMap();
|
||||
int insertResToMap(@Param("level") String level, @Param("grade") String grade);
|
||||
|
||||
int insertJobToMap();
|
||||
|
||||
int insertDeptToMap();
|
||||
int insertDeptToMap(@Param("level") String level, @Param("grade") String grade);
|
||||
|
||||
int insertSubComToMap();
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@
|
|||
</set>
|
||||
where fdateend > #{currentDate}
|
||||
</update>
|
||||
|
||||
<!--初始化人员数据-->
|
||||
<insert id="insertResToMap" databaseId="sqlserver">
|
||||
insert into jcl_org_map
|
||||
|
|
@ -96,11 +97,11 @@
|
|||
c.id,c.jobtitlename,e.level_name,f.grade_name, isnull( b.id, '' ) +200000000,b.id,
|
||||
0,convert(varchar(100),getDate(),23),'2099-12-31'
|
||||
from hrmresource a
|
||||
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle
|
||||
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
|
||||
left join HrmJobTitles c on b.ec_jobTitle = c.id
|
||||
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
|
||||
left join jcl_org_level e on d.field3=e.id
|
||||
left join jcl_org_grade f on d.field4=f.id
|
||||
left join jcl_org_level e on d.${level}=e.id
|
||||
left join jcl_org_grade f on d.${grade}=f.id
|
||||
where a.status < 4
|
||||
</insert>
|
||||
<insert id="insertResToMap" databaseId="mysql">
|
||||
|
|
@ -112,14 +113,14 @@
|
|||
c.id,c.jobtitlename,e.level_name,f.grade_name, ifnull( b.id, '' ) +200000000,b.id,
|
||||
0,NOW(),'2099-12-31'
|
||||
from hrmresource a
|
||||
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle
|
||||
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
|
||||
left join HrmJobTitles c on b.ec_jobTitle = c.id
|
||||
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
|
||||
left join jcl_org_level e on d.field3=e.id
|
||||
left join jcl_org_grade f on d.field4=f.id
|
||||
left join jcl_org_level e on d.${level}=e.id
|
||||
left join jcl_org_grade f on d.${grade}=f.id
|
||||
where a.status < 4
|
||||
</insert>
|
||||
<insert id="insertResToMap" databaseId="oracle">
|
||||
<insert id="insertResToMap" parameterType="java.lang.String" databaseId="oracle">
|
||||
insert into jcl_org_map
|
||||
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleaderimg,
|
||||
fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
|
||||
|
|
@ -131,8 +132,8 @@
|
|||
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
|
||||
left join HrmJobTitles c on b.ec_jobTitle = c.id
|
||||
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
|
||||
left join jcl_org_level e on d.field3=e.id
|
||||
left join jcl_org_grade f on d.field4=f.id
|
||||
left join jcl_org_level e on ${level}=e.id
|
||||
left join jcl_org_grade f on ${grade}=f.id
|
||||
where a.status < 4
|
||||
</insert>
|
||||
<!--初始化岗位-->
|
||||
|
|
@ -169,9 +170,11 @@
|
|||
where plan_id in (select id from JCL_ORG_STAFFPLAN
|
||||
where time_start<=NOW() and time_end > NOW() and delete_type=0)
|
||||
group by job_id) e on a.id=e.job_id
|
||||
left join (select JOBTITLE,count(1) fcnt from hrmresource group by JOBTITLE
|
||||
) f
|
||||
on f.JOBTITLE=a.ec_jobTitle
|
||||
left join ( select c.id,count(1) fcnt from hrmresource a
|
||||
left join Hrmjobtitles b on a.jobtitle=b.id
|
||||
left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department
|
||||
group by c.id) f
|
||||
on f.id=a.id
|
||||
left join HrmJobTitles g on a.ec_jobTitle = g.id
|
||||
where ifnull(a.delete_type,0) <> 1 and ifnull(a.forbidden_tag,0) <> 1
|
||||
</insert>
|
||||
|
|
@ -214,8 +217,8 @@
|
|||
left join hrmresource as c on cast(b.BMFZR as varchar(10))=cast(c.ID as varchar(10))
|
||||
left join hrmjobtitles as d on c.JOBTITLE=d.id
|
||||
left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
|
||||
left join jcl_org_level f on e.field3=f.id
|
||||
left join jcl_org_grade g on e.field4=g.id
|
||||
left join jcl_org_level f on e.${level}=f.id
|
||||
left join jcl_org_grade g on e.${grade}=g.id
|
||||
where isnull(a.canceled,0) <> 1
|
||||
</insert>
|
||||
<insert id="insertDeptToMap" databaseId="mysql">
|
||||
|
|
@ -234,8 +237,8 @@
|
|||
left join hrmresource as c on b.BMFZR=c.ID
|
||||
left join hrmjobtitles as d on c.JOBTITLE=d.id
|
||||
left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
|
||||
left join jcl_org_level f on e.field3=f.id
|
||||
left join jcl_org_grade g on e.field4=g.id
|
||||
left join jcl_org_level f on e.${level}=f.id
|
||||
left join jcl_org_grade g on e.${grade}=g.id
|
||||
where ifnull(a.canceled,0) <> 1
|
||||
</insert>
|
||||
<insert id="insertDeptToMap" databaseId="oracle">
|
||||
|
|
@ -253,8 +256,8 @@
|
|||
left join hrmresource c on to_char(b.BMFZR)=c.ID
|
||||
left join hrmjobtitles d on c.JOBTITLE=d.id
|
||||
left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
|
||||
left join jcl_org_level f on e.field3=f.id
|
||||
left join jcl_org_grade g on e.field4=g.id
|
||||
left join jcl_org_level f on e.${level}=f.id
|
||||
left join jcl_org_grade g on e.${grade}=g.id
|
||||
where nvl(a.canceled,0) <> 1
|
||||
</insert>
|
||||
<!--同步分部信息-->
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
|
||||
private static final String COMPANY_RIGHT = "OrgChart:All";
|
||||
private static final String USER_RIGHT = "OrgPerspective:All";
|
||||
private final String level = getFieldName("职等");
|
||||
private final String grade = getFieldName("职级");
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getOptionCondition(Map<String, Object> request2Map, User user) {
|
||||
|
|
@ -505,9 +507,6 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
private JclOrgMapper getJclOrgMapMapper() {
|
||||
return MapperProxyFactory.getProxy(JclOrgMapper.class);
|
||||
}
|
||||
private StaffMapper getStaffMapper() {
|
||||
return MapperProxyFactory.getProxy(StaffMapper.class);
|
||||
}
|
||||
@Override
|
||||
public String synchronousData(Map<String, Object> request2Map, User user) {
|
||||
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
||||
|
|
@ -520,11 +519,11 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
getJclOrgMapMapper().deleteAllMap(date);
|
||||
getJclOrgMapMapper().updateAllMap(date,time);
|
||||
//同步人员信息
|
||||
getJclOrgMapMapper().insertResToMap();
|
||||
getJclOrgMapMapper().insertResToMap(level,grade);
|
||||
//同步岗位信息
|
||||
getJclOrgMapMapper().insertJobToMap();
|
||||
//同步部门信息
|
||||
getJclOrgMapMapper().insertDeptToMap();
|
||||
getJclOrgMapMapper().insertDeptToMap(level,grade);
|
||||
//同步分部信息
|
||||
getJclOrgMapMapper().insertSubComToMap();
|
||||
//同步集团信息
|
||||
|
|
@ -565,11 +564,22 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
}
|
||||
}
|
||||
JclOrgMap jclOrgMap = getJclOrgMapMapper().getSumPlanAndJobByFParentId(date, fparentid);
|
||||
getJclOrgMapMapper().updateMapById(Integer.parseInt(fparentid), jclOrgMap.getFPlan(), jclOrgMap.getFOnJob(), date);
|
||||
|
||||
if (!"-1".equals(fparentid)) {
|
||||
countJobAndPlans(ftype, Integer.parseInt(fparentid), String.valueOf(currentDate));
|
||||
if (fparentid != null) {
|
||||
getJclOrgMapMapper().updateMapById(Integer.parseInt(fparentid), jclOrgMap.getFPlan(), jclOrgMap.getFOnJob(), date);
|
||||
if (!"-1".equals(fparentid)) {
|
||||
countJobAndPlans(ftype, Integer.parseInt(fparentid), String.valueOf(currentDate));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private String getFieldName(String fieldabel) {
|
||||
RecordSet recordSet = new RecordSet();
|
||||
String fieldname = null;
|
||||
recordSet.executeQuery("select fieldname from jcl_org_field where fieldlabel='" + fieldabel+"'");
|
||||
if (recordSet.next()) {
|
||||
fieldname = recordSet.getString("fieldname");
|
||||
}
|
||||
return fieldname;
|
||||
}
|
||||
static class OrgSelectItem {
|
||||
private String id;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import java.util.*;
|
|||
**/
|
||||
public class VersionManageServiceImpl extends Service implements VersionManageService {
|
||||
|
||||
|
||||
private CompanyVersionMapper getCompanyVersionMapper() {
|
||||
return MapperProxyFactory.getProxy(CompanyVersionMapper.class);
|
||||
}
|
||||
|
|
@ -448,4 +449,5 @@ public class VersionManageServiceImpl extends Service implements VersionManageSe
|
|||
return id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue