分部转移、部门转移、岗位合并修复1021

pull/21/head
‘ml’ 3 years ago
parent 444153f44d
commit 05fe14b5e1

@ -74,4 +74,10 @@ public class StaffPO {
private Date createTime;
private Date updateTime;
public Integer getStaffNum() {
if (null == staffNum){
staffNum = 0;
}
return staffNum;
}
}

@ -342,13 +342,13 @@
from jcl_org_staff t
WHERE t.delete_type = 0
<if test="compId != null">
t.comp_id = #{compId}
and t.comp_id = #{compId}
</if>
<if test="dept_id != null">
t.dept_id = #{deptId}
<if test="deptId != null">
and t.dept_id = #{deptId}
</if>
<if test="jobId != null">
t.job_id = #{jobId}
and t.job_id = #{jobId}
</if>
</select>
</mapper>

@ -98,6 +98,6 @@
<select id="countOnJobByJObId" resultType="java.lang.Integer">
select count(1)
from jcl_org_hrmresource a
where a.jobtitle = #{jobId} where a.status &lt; 4
where a.job_title = #{jobId} and a.status &lt; 4
</select>
</mapper>

@ -144,7 +144,7 @@ public class DepartmentTriggerRunnable implements Runnable {
if (1 != newDepartment.getDeleteType() && 1 != newDepartment.getForbiddenTag()) {
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
if(null != jclOrgMapByObjID.getFParentId()) {
if(null != jclOrgMapByObjID) {
updateParentPlanAndJob(currentDate, jclOrgMapByObjID.getFParentId().toString());
}
if(null != moveTarget){

@ -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);

Loading…
Cancel
Save