|
|
|
@ -14,7 +14,6 @@ import com.engine.organization.util.OrganizationDateUtil;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import weaver.common.DateUtil;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
|
|
|
import java.sql.Date;
|
|
|
|
|
import java.util.Calendar;
|
|
|
|
@ -87,10 +86,10 @@ public class JobTriggerRunnable implements Runnable {
|
|
|
|
|
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
|
|
|
|
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
|
|
|
|
|
|
|
|
|
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(currentDate, ModuleTypeEnum.jobfielddefined.getValue().toString(), jclMap.getFObjId().toString());
|
|
|
|
|
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID( jclMap.getFDateBegin(), ModuleTypeEnum.jobfielddefined.getValue().toString(), jclMap.getFObjId().toString());
|
|
|
|
|
|
|
|
|
|
// 该岗位有下级岗位时,查询
|
|
|
|
|
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, jclMap.getId().toString());
|
|
|
|
|
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(jclMap.getFDateBegin(), jclMap.getId().toString());
|
|
|
|
|
|
|
|
|
|
if (null != jclOrgMapByObjID) {
|
|
|
|
|
if (null != jclOrgMap) {
|
|
|
|
@ -118,12 +117,12 @@ public class JobTriggerRunnable implements Runnable {
|
|
|
|
|
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
|
|
|
|
if (null != jclOrgMapByObjID) {
|
|
|
|
|
if(null != jclOrgMapByObjID.getFParentId()){
|
|
|
|
|
updateParentPlanAndJob(currentDate, jclOrgMapByObjID.getFParentId().toString());
|
|
|
|
|
updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (null != oldJob) {
|
|
|
|
|
if (null != oldJob.getId()){
|
|
|
|
|
updateParentPlanAndJob(currentDate, oldJob.getId().toString());
|
|
|
|
|
updateParentPlanAndJob(jclMap.getFDateBegin(), oldJob.getId().toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -133,7 +132,7 @@ public class JobTriggerRunnable implements Runnable {
|
|
|
|
|
/**
|
|
|
|
|
* 更新上级部门在编、在岗数
|
|
|
|
|
*/
|
|
|
|
|
void updateParentPlanAndJob(String currentDate, String parentId) {
|
|
|
|
|
void updateParentPlanAndJob(Date currentDate, String parentId) {
|
|
|
|
|
JclOrgMap parentJclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapById(currentDate, parentId);
|
|
|
|
|
if (null != parentJclOrgMap) {
|
|
|
|
|
// 上级部门当前在编、在岗数
|
|
|
|
@ -146,7 +145,7 @@ public class JobTriggerRunnable implements Runnable {
|
|
|
|
|
parentJclOrgMap.setFPlan(0);
|
|
|
|
|
parentJclOrgMap.setFOnJob(0);
|
|
|
|
|
}
|
|
|
|
|
parentJclOrgMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
|
|
|
|
parentJclOrgMap.setFDateBegin(currentDate);
|
|
|
|
|
parentJclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
|
|
|
|
|
|
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
|
|