pull/25/head
dxfeng 3 years ago
commit eeb21315c7

@ -66,5 +66,9 @@ public interface StaffMapper {
List<StaffPO> getStaffsByIds(@Param("ids") Collection<Long> ids); List<StaffPO> getStaffsByIds(@Param("ids") Collection<Long> ids);
StaffPO getStaffsByParamId(@Param("compId") String compId,@Param("deptId") String deptId,@Param("jobId") String jobId); /**
*
* @return
*/
StaffPO getStaffsByParamId(@Param("ftype") Integer ftype,@Param("compId") String compId,@Param("deptId") String deptId,@Param("jobId") String jobId);
} }

@ -337,18 +337,17 @@
</update> </update>
<select id="getStaffsByParamId" resultMap="BaseResultMap"> <select id="getStaffsByParamId" resultMap="BaseResultMap">
select select sum(a.staff_num) as staff_num from jcl_org_staff a
<include refid="baseColumns"/> inner join jcl_org_staffplan b on a.plan_id = b.id
from jcl_org_staff t WHERE a.delete_type = 0 and b.control_dimension = #{ftype}
WHERE t.delete_type = 0
<if test="compId != null"> <if test="compId != null">
and t.comp_id = #{compId} and a.comp_id = #{compId}
</if> </if>
<if test="deptId != null"> <if test="deptId != null">
and t.dept_id = #{deptId} and a.dept_id = #{deptId}
</if> </if>
<if test="jobId != null"> <if test="jobId != null">
and t.job_id = #{jobId} and a.job_id = #{jobId}
</if> </if>
</select> </select>
</mapper> </mapper>

@ -867,7 +867,7 @@ public class JobServiceImpl extends Service implements JobService {
for (HrmResourcePO hrmResourcePO : resourceList) { for (HrmResourcePO hrmResourcePO : resourceList) {
new RecordSet().executeUpdate("UPDATE HRMRESOURCE SET SUBCOMPANYID1 = ? , DEPARTMENTID = ? WHERE UUID =? ", ecCompany, ecDepartment, hrmResourcePO.getUuid()); new RecordSet().executeUpdate("UPDATE HRMRESOURCE SET SUBCOMPANYID1 = ? , DEPARTMENTID = ? WHERE UUID =? ", ecCompany, ecDepartment, hrmResourcePO.getUuid());
// 更新人员Map表信息 // 更新人员Map表信息
new Thread(new HrmResourceTriggerRunnable(hrmResourcePO.getId())).start(); new HrmResourceTriggerRunnable(hrmResourcePO.getId()).run();
} }
} }

@ -4,9 +4,11 @@ import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.hrmresource.po.HrmResourcePO; import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
import com.engine.organization.entity.logview.bo.FieldBaseEquator; import com.engine.organization.entity.logview.bo.FieldBaseEquator;
import com.engine.organization.entity.map.JclOrgMap; import com.engine.organization.entity.map.JclOrgMap;
import com.engine.organization.entity.staff.po.StaffPO;
import com.engine.organization.enums.ModuleTypeEnum; import com.engine.organization.enums.ModuleTypeEnum;
import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper; import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.mapper.staff.StaffMapper;
import com.engine.organization.mapper.trigger.CompTriggerMapper; import com.engine.organization.mapper.trigger.CompTriggerMapper;
import com.engine.organization.util.OrganizationDateUtil; import com.engine.organization.util.OrganizationDateUtil;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
@ -94,13 +96,13 @@ public class CompanyTriggerRunnable implements Runnable {
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime())); jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime())); jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(jclMap.getFType(),jclMap.getFObjId().toString(),null, null);
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclMap.getFDateBegin(), ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), jclMap.getFObjId().toString()); JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclMap.getFDateBegin(), ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), jclMap.getFObjId().toString());
if (null != jclOrgMapByObjID) { if (null != jclOrgMapByObjID) {
jclMap.setFPlan(jclOrgMapByObjID.getFPlan()); jclMap.setFPlan(jclOrgMapByObjID.getFPlan());
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob()); jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
} else { } else {
jclMap.setFPlan(0); jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(0); jclMap.setFOnJob(0);
} }
jclMap.setFIsVitual(0); jclMap.setFIsVitual(0);
@ -112,14 +114,17 @@ public class CompanyTriggerRunnable implements Runnable {
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin()); getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time); getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
if (1 != newCompany.getDeleteType() && 1 != newCompany.getForbiddenTag()) { if (1 != newCompany.getDeleteType() && 1 != newCompany.getForbiddenTag()) {
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap); MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
if(null != jclOrgMapByObjID.getFParentId()){ }
updateParentPlanAndJob(jclMap.getFDateBegin(),jclOrgMapByObjID.getFParentId().toString()); if (null != jclOrgMapByObjID) {
if (null != jclOrgMapByObjID.getFParentId()) {
updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString());
} }
if(null!=oldCompany){ }
updateParentPlanAndJob(jclMap.getFDateBegin(),oldCompany.getId().toString()); if (null != oldCompany) {
if(null != oldCompany.getId()){
updateParentPlanAndJob(jclMap.getFDateBegin(), oldCompany.getId().toString());
} }
} }
} }
@ -133,11 +138,12 @@ public class CompanyTriggerRunnable implements Runnable {
if (null != parentJclOrgMap) { if (null != parentJclOrgMap) {
// 上级部门当前在编、在岗数 // 上级部门当前在编、在岗数
JclOrgMap jclOrgMapSum = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, parentJclOrgMap.getId().toString()); JclOrgMap jclOrgMapSum = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, parentJclOrgMap.getId().toString());
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(parentJclOrgMap.getFType(),parentId,null, null);
if (null != jclOrgMapSum) { if (null != jclOrgMapSum) {
parentJclOrgMap.setFPlan(jclOrgMapSum.getFPlan()); parentJclOrgMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0 ) + jclOrgMapSum.getFPlan());
parentJclOrgMap.setFOnJob(jclOrgMapSum.getFOnJob()); parentJclOrgMap.setFOnJob(jclOrgMapSum.getFOnJob());
} else { } else {
parentJclOrgMap.setFPlan(0); parentJclOrgMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
parentJclOrgMap.setFOnJob(0); parentJclOrgMap.setFOnJob(0);
} }
parentJclOrgMap.setFDateBegin(currentDate); parentJclOrgMap.setFDateBegin(currentDate);

@ -4,9 +4,11 @@ import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.hrmresource.po.HrmResourcePO; import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
import com.engine.organization.entity.logview.bo.FieldBaseEquator; import com.engine.organization.entity.logview.bo.FieldBaseEquator;
import com.engine.organization.entity.map.JclOrgMap; import com.engine.organization.entity.map.JclOrgMap;
import com.engine.organization.entity.staff.po.StaffPO;
import com.engine.organization.enums.ModuleTypeEnum; import com.engine.organization.enums.ModuleTypeEnum;
import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper; import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.mapper.staff.StaffMapper;
import com.engine.organization.mapper.trigger.CompTriggerMapper; import com.engine.organization.mapper.trigger.CompTriggerMapper;
import com.engine.organization.mapper.trigger.DepartmentTriggerMapper; import com.engine.organization.mapper.trigger.DepartmentTriggerMapper;
import com.engine.organization.util.OrganizationDateUtil; import com.engine.organization.util.OrganizationDateUtil;
@ -31,6 +33,7 @@ public class DepartmentTriggerRunnable implements Runnable {
private final DepartmentPO newDepartment; private final DepartmentPO newDepartment;
private String oldFparentId; private String oldFparentId;
private String moveTarget; private String moveTarget;
private Boolean forbiddenTag = false;
private CompTriggerMapper getCompTriggerMapper() { private CompTriggerMapper getCompTriggerMapper() {
return MapperProxyFactory.getProxy(CompTriggerMapper.class); return MapperProxyFactory.getProxy(CompTriggerMapper.class);
@ -45,10 +48,17 @@ public class DepartmentTriggerRunnable implements Runnable {
this.newDepartment = newDepartment; this.newDepartment = newDepartment;
} }
public DepartmentTriggerRunnable(Boolean forbiddenTag,DepartmentPO oldDepartment, DepartmentPO newDepartment) {
this.oldDepartment = oldDepartment;
this.newDepartment = newDepartment;
this.forbiddenTag = forbiddenTag;
}
public DepartmentTriggerRunnable(Long departmentId) { public DepartmentTriggerRunnable(Long departmentId) {
this.oldDepartment = new DepartmentPO(); this.oldDepartment = new DepartmentPO();
this.newDepartment = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(departmentId); this.newDepartment = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(departmentId);
} }
public DepartmentTriggerRunnable(String moveTarget,DepartmentPO newDepartment) { public DepartmentTriggerRunnable(String moveTarget,DepartmentPO newDepartment) {
this.oldDepartment = new DepartmentPO(); this.oldDepartment = new DepartmentPO();
this.newDepartment = newDepartment; this.newDepartment = newDepartment;
@ -116,7 +126,18 @@ public class DepartmentTriggerRunnable implements Runnable {
// 获取当前生效的本部门map记录 // 获取当前生效的本部门map记录
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclMap.getFDateBegin(), ModuleTypeEnum.departmentfielddefined.getValue().toString(), Util.null2String(jclMap.getFObjId())); JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclMap.getFDateBegin(), ModuleTypeEnum.departmentfielddefined.getValue().toString(), Util.null2String(jclMap.getFObjId()));
StaffPO staffPO = new StaffPO();
// StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(null,jclMap.getFObjId().toString(), null);
switch (jclMap.getFType()) {
// 分部
case 1:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(1,jclMap.getFObjId().toString(), null, null);
break;
// 部门
case 2:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(2,null, jclMap.getFObjId().toString(), null);
break;
}
// 取出以该部门为上级部门的在编、在岗数,转移无需计算 // 取出以该部门为上级部门的在编、在岗数,转移无需计算
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(jclMap.getFDateBegin(), jclMap.getId().toString()); JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(jclMap.getFDateBegin(), jclMap.getId().toString());
if (null != moveTarget) { if (null != moveTarget) {
@ -124,14 +145,14 @@ public class DepartmentTriggerRunnable implements Runnable {
} }
if (null != jclOrgMapByObjID) { if (null != jclOrgMapByObjID) {
if (null != jclOrgMap) { if (null != jclOrgMap) {
jclMap.setFPlan(jclOrgMapByObjID.getFPlan() + jclOrgMap.getFPlan()); jclMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMap.getFPlan());
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob() + jclOrgMap.getFOnJob()); jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob() + jclOrgMap.getFOnJob());
} else { } else {
jclMap.setFPlan(jclOrgMapByObjID.getFPlan()); jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob()); jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
} }
} else { } else {
jclMap.setFPlan(0); jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(0); jclMap.setFOnJob(0);
} }
jclMap.setFIsVitual(0); jclMap.setFIsVitual(0);
@ -145,15 +166,19 @@ public class DepartmentTriggerRunnable implements Runnable {
if (1 != newDepartment.getDeleteType() && 1 != newDepartment.getForbiddenTag()) { if (1 != newDepartment.getDeleteType() && 1 != newDepartment.getForbiddenTag()) {
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap); MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
if(null != jclOrgMapByObjID) { }
updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString()); if(null != jclOrgMapByObjID) {
} updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString());
if(null != moveTarget){ }
updateParentPlanAndJob(jclMap.getFDateBegin(), moveTarget); // 部门启用,刷新上级数据
} if(forbiddenTag){
if (null != oldFparentId) { updateParentPlanAndJob(jclMap.getFDateBegin(), jclMap.getFParentId().toString());
updateParentPlanAndJob(jclMap.getFDateBegin(), oldFparentId); }
} if(null != moveTarget){
updateParentPlanAndJob(jclMap.getFDateBegin(), moveTarget);
}
if (null != oldFparentId) {
updateParentPlanAndJob(jclMap.getFDateBegin(), oldFparentId);
} }
} }
} }
@ -164,13 +189,22 @@ public class DepartmentTriggerRunnable implements Runnable {
if (null != parentJclOrgMap) { if (null != parentJclOrgMap) {
// 上级部门当前在编、在岗数 // 上级部门当前在编、在岗数
JclOrgMap jclOrgMapSum = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, parentJclOrgMap.getId().toString()); JclOrgMap jclOrgMapSum = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, parentJclOrgMap.getId().toString());
StaffPO staffPO = new StaffPO();
switch (parentJclOrgMap.getFType()) {
case 1:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(1,parentId, null, null);
break;
// 部门
case 2:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(2,null, parentId, null);
break;
}
// 编制表jcl_org_staff中的编制数+下级编制数,工具类判断 // 编制表jcl_org_staff中的编制数+下级编制数,工具类判断
if(null != jclOrgMapSum){ if(null != jclOrgMapSum){
parentJclOrgMap.setFPlan(jclOrgMapSum.getFPlan()); parentJclOrgMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMapSum.getFPlan());
parentJclOrgMap.setFOnJob(jclOrgMapSum.getFOnJob()); parentJclOrgMap.setFOnJob(jclOrgMapSum.getFOnJob());
}else{ }else{
parentJclOrgMap.setFPlan(0); parentJclOrgMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
parentJclOrgMap.setFOnJob(0); parentJclOrgMap.setFOnJob(0);
} }
parentJclOrgMap.setFDateBegin(currentDate); parentJclOrgMap.setFDateBegin(currentDate);

@ -28,6 +28,7 @@ public class JobTriggerRunnable implements Runnable {
private final JobPO oldJob; private final JobPO oldJob;
private final JobPO newJob; private final JobPO newJob;
private Boolean forbiddenTag = false;
private CompTriggerMapper getCompTriggerMapper() { private CompTriggerMapper getCompTriggerMapper() {
return MapperProxyFactory.getProxy(CompTriggerMapper.class); return MapperProxyFactory.getProxy(CompTriggerMapper.class);
@ -41,6 +42,11 @@ public class JobTriggerRunnable implements Runnable {
this.oldJob = oldJob; this.oldJob = oldJob;
this.newJob = newJob; this.newJob = newJob;
} }
public JobTriggerRunnable(Boolean forbiddenTag,JobPO oldJob, JobPO newJob) {
this.oldJob = oldJob;
this.newJob = newJob;
this.forbiddenTag = forbiddenTag;
}
public JobTriggerRunnable(Long jobId) { public JobTriggerRunnable(Long jobId) {
this.oldJob = new JobPO(); this.oldJob = new JobPO();
@ -91,17 +97,29 @@ public class JobTriggerRunnable implements Runnable {
// 该岗位有下级岗位时,查询 // 该岗位有下级岗位时,查询
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(jclMap.getFDateBegin(), jclMap.getId().toString()); JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(jclMap.getFDateBegin(), jclMap.getId().toString());
StaffPO staffPO = new StaffPO();
switch (jclMap.getFType()) {
// 部门
case 2:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(2,null, jclMap.getFObjId().toString(), null);
break;
// 岗位
case 3:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(3,null, null, jclMap.getFObjId().toString());
break;
default:
break;
}
if (null != jclOrgMapByObjID) { if (null != jclOrgMapByObjID) {
if (null != jclOrgMap) { if (null != jclOrgMap) {
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(null,null, jclOrgMapByObjID.getFObjId().toString());
jclMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMap.getFPlan()); jclMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMap.getFPlan());
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob() + jclOrgMap.getFOnJob()); jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob() + jclOrgMap.getFOnJob());
} else { } else {
jclMap.setFPlan(jclOrgMapByObjID.getFPlan()); jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob()); jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
} }
} else { } else {
jclMap.setFPlan(0); jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(0); jclMap.setFOnJob(0);
} }
jclMap.setFIsVitual(0); jclMap.setFIsVitual(0);
@ -115,15 +133,19 @@ public class JobTriggerRunnable implements Runnable {
if (1 != newJob.getDeleteType() && 1 != newJob.getForbiddenTag()) { if (1 != newJob.getDeleteType() && 1 != newJob.getForbiddenTag()) {
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap); MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
if (null != jclOrgMapByObjID) { }
if(null != jclOrgMapByObjID.getFParentId()){ if (null != jclOrgMapByObjID) {
updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString()); if(null != jclOrgMapByObjID.getFParentId()){
} updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString());
} }
if (null != oldJob) { }
if (null != oldJob.getId()){ // 部门启用,刷新上级数据
updateParentPlanAndJob(jclMap.getFDateBegin(), oldJob.getId().toString()); if(forbiddenTag){
} updateParentPlanAndJob(jclMap.getFDateBegin(), jclMap.getFParentId().toString());
}
if (null != oldJob) {
if (null != oldJob.getId()){
updateParentPlanAndJob(jclMap.getFDateBegin(), oldJob.getId().toString());
} }
} }
} }
@ -137,12 +159,28 @@ public class JobTriggerRunnable implements Runnable {
if (null != parentJclOrgMap) { if (null != parentJclOrgMap) {
// 上级部门当前在编、在岗数 // 上级部门当前在编、在岗数
JclOrgMap jclOrgMapSum = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, parentJclOrgMap.getId().toString()); JclOrgMap jclOrgMapSum = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, parentJclOrgMap.getId().toString());
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(null,null,parentJclOrgMap.getFObjId().toString()); StaffPO staffPO = new StaffPO();
switch (parentJclOrgMap.getFType()) {
// 分部
case 1:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(1, parentJclOrgMap.getFObjId().toString(), null, null);
break;
// 部门
case 2:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(2, null, parentJclOrgMap.getFObjId().toString(), null);
break;
// 岗位
case 3:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(3, null, parentJclOrgMap.getFObjId().toString(), null);
break;
default:
break;
}
if (null != jclOrgMapSum) { if (null != jclOrgMapSum) {
parentJclOrgMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMapSum.getFPlan()); parentJclOrgMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMapSum.getFPlan());
parentJclOrgMap.setFOnJob(jclOrgMapSum.getFOnJob()); parentJclOrgMap.setFOnJob(jclOrgMapSum.getFOnJob());
} else { } else {
parentJclOrgMap.setFPlan(0); parentJclOrgMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
parentJclOrgMap.setFOnJob(0); parentJclOrgMap.setFOnJob(0);
} }
parentJclOrgMap.setFDateBegin(currentDate); parentJclOrgMap.setFDateBegin(currentDate);

@ -115,7 +115,7 @@ public class DepartmentWrapper extends OrganizationWrapper {
DepartmentPO newDeptById = getDepartmentMapper().getDeptById(params.getId()); DepartmentPO newDeptById = getDepartmentMapper().getDeptById(params.getId());
writeOperateLog(new Object() { writeOperateLog(new Object() {
}.getClass(), deptById.getDeptName(), JSON.toJSONString(params), deptById, newDeptById); }.getClass(), deptById.getDeptName(), JSON.toJSONString(params), deptById, newDeptById);
new Thread(new DepartmentTriggerRunnable(deptById, newDeptById)).start(); new Thread(new DepartmentTriggerRunnable(params.getForbiddenTag(),deptById, newDeptById)).start();
return updateForbiddenTagById; return updateForbiddenTagById;
} }

@ -11,9 +11,11 @@ import com.engine.organization.entity.job.param.JobMergeParam;
import com.engine.organization.entity.job.param.JobSearchParam; import com.engine.organization.entity.job.param.JobSearchParam;
import com.engine.organization.entity.job.po.JobPO; import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.searchtree.SearchTreeParams; import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.entity.staff.po.StaffPO;
import com.engine.organization.enums.LogModuleNameEnum; import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum; import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.mapper.staff.StaffMapper;
import com.engine.organization.service.JobService; import com.engine.organization.service.JobService;
import com.engine.organization.service.impl.JobServiceImpl; import com.engine.organization.service.impl.JobServiceImpl;
import com.engine.organization.thread.JobTriggerRunnable; import com.engine.organization.thread.JobTriggerRunnable;
@ -167,6 +169,7 @@ public class JobWrapper extends OrganizationWrapper {
JobPO newJobById = getJobMapper().getJobById(params.getId()); JobPO newJobById = getJobMapper().getJobById(params.getId());
writeOperateLog(new Object() { writeOperateLog(new Object() {
}.getClass(), jobById.getJobNo(), JSON.toJSONString(params), jobById, newJobById); }.getClass(), jobById.getJobNo(), JSON.toJSONString(params), jobById, newJobById);
// 更新组织架构图 // 更新组织架构图
new Thread(new JobTriggerRunnable(jobById, newJobById)).start(); new Thread(new JobTriggerRunnable(jobById, newJobById)).start();
return updateForbiddenTagById; return updateForbiddenTagById;

Loading…
Cancel
Save