|
|
|
@ -14,6 +14,7 @@ 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;
|
|
|
|
@ -88,13 +89,13 @@ public class JobTriggerRunnable implements Runnable {
|
|
|
|
|
|
|
|
|
|
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(currentDate, ModuleTypeEnum.jobfielddefined.getValue().toString(), jclMap.getFObjId().toString());
|
|
|
|
|
|
|
|
|
|
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(null,null,jclOrgMapByObjID.getFObjId().toString());
|
|
|
|
|
// 该岗位有下级岗位时,查询
|
|
|
|
|
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, jclMap.getId().toString());
|
|
|
|
|
|
|
|
|
|
if (null != jclOrgMapByObjID) {
|
|
|
|
|
if (null != jclOrgMap) {
|
|
|
|
|
jclMap.setFPlan(staffPO.getStaffNum() + jclOrgMap.getFPlan());
|
|
|
|
|
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(null,null, jclOrgMapByObjID.getFObjId().toString());
|
|
|
|
|
jclMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMap.getFPlan());
|
|
|
|
|
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob() + jclOrgMap.getFOnJob());
|
|
|
|
|
} else {
|
|
|
|
|
jclMap.setFPlan(jclOrgMapByObjID.getFPlan());
|
|
|
|
@ -115,11 +116,15 @@ public class JobTriggerRunnable implements Runnable {
|
|
|
|
|
|
|
|
|
|
if (1 != newJob.getDeleteType() && 1 != newJob.getForbiddenTag()) {
|
|
|
|
|
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
|
|
|
|
if (null != jclOrgMapByObjID.getFParentId()) {
|
|
|
|
|
updateParentPlanAndJob(currentDate, jclOrgMapByObjID.getFParentId().toString());
|
|
|
|
|
if (null != jclOrgMapByObjID) {
|
|
|
|
|
if(null != jclOrgMapByObjID.getFParentId()){
|
|
|
|
|
updateParentPlanAndJob(currentDate, jclOrgMapByObjID.getFParentId().toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (null != oldJob) {
|
|
|
|
|
updateParentPlanAndJob(currentDate, oldJob.getId().toString());
|
|
|
|
|
if (null != oldJob.getId()){
|
|
|
|
|
updateParentPlanAndJob(currentDate, oldJob.getId().toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -135,7 +140,7 @@ public class JobTriggerRunnable implements Runnable {
|
|
|
|
|
JclOrgMap jclOrgMapSum = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, parentJclOrgMap.getId().toString());
|
|
|
|
|
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(null,null,parentJclOrgMap.getFObjId().toString());
|
|
|
|
|
if (null != jclOrgMapSum) {
|
|
|
|
|
parentJclOrgMap.setFPlan(staffPO.getStaffNum() + jclOrgMapSum.getFPlan());
|
|
|
|
|
parentJclOrgMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMapSum.getFPlan());
|
|
|
|
|
parentJclOrgMap.setFOnJob(jclOrgMapSum.getFOnJob());
|
|
|
|
|
} else {
|
|
|
|
|
parentJclOrgMap.setFPlan(0);
|
|
|
|
|