|
|
|
@ -15,7 +15,6 @@ import com.engine.organization.mapper.staff.StaffPlanMapper;
|
|
|
|
|
import com.engine.organization.mapper.trigger.StaffTriggerMapper;
|
|
|
|
|
import com.engine.organization.util.OrganizationDateUtil;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.organization.util.relation.EcHrmRelationUtil;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import weaver.common.DateUtil;
|
|
|
|
|
|
|
|
|
@ -28,6 +27,7 @@ import java.sql.Date;
|
|
|
|
|
*/
|
|
|
|
|
public class StaffTriggerRunnable implements Runnable {
|
|
|
|
|
StaffPO staffPO;
|
|
|
|
|
StaffPlanPO staffPlanByID;
|
|
|
|
|
|
|
|
|
|
private StaffPlanMapper getStaffPlanMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(StaffPlanMapper.class);
|
|
|
|
@ -58,6 +58,20 @@ public class StaffTriggerRunnable implements Runnable {
|
|
|
|
|
|
|
|
|
|
public StaffTriggerRunnable(StaffPO staffPO) {
|
|
|
|
|
this.staffPO = staffPO;
|
|
|
|
|
this.staffPlanByID = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId());
|
|
|
|
|
|
|
|
|
|
currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
|
|
|
|
yesterday = DateUtil.addDate(currentDate, -1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public StaffTriggerRunnable(Integer jclJobId) {
|
|
|
|
|
if (null != jclJobId) {
|
|
|
|
|
JobPO jobById = getJobMapper().getJobById((long) jclJobId);
|
|
|
|
|
if (null != jobById) {
|
|
|
|
|
this.staffPO = StaffPO.builder().compId(jobById.getParentComp()).deptId(jobById.getParentDept()).jobId(jobById.getId()).build();
|
|
|
|
|
this.staffPlanByID = StaffPlanPO.builder().controlDimension("3").build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
|
|
|
|
yesterday = DateUtil.addDate(currentDate, -1);
|
|
|
|
|
}
|
|
|
|
@ -65,7 +79,6 @@ public class StaffTriggerRunnable implements Runnable {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
if (null != staffPO) {
|
|
|
|
|
StaffPlanPO staffPlanByID = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId());
|
|
|
|
|
if (null != staffPlanByID && StringUtils.isNotBlank(staffPlanByID.getControlDimension())) {
|
|
|
|
|
String fType = staffPlanByID.getControlDimension();
|
|
|
|
|
switch (fType) {
|
|
|
|
@ -150,8 +163,7 @@ public class StaffTriggerRunnable implements Runnable {
|
|
|
|
|
break;
|
|
|
|
|
case "3":
|
|
|
|
|
planSum = getStaffTriggerMapper().countJobStaffNum(currentDate, objId);
|
|
|
|
|
String ecJobId = EcHrmRelationUtil.getEcJobId(Long.parseLong(objId));
|
|
|
|
|
onJobSum = getStaffTriggerMapper().countJobUsers(ecJobId);
|
|
|
|
|
onJobSum = getStaffTriggerMapper().countOnJobByJObId(objId);
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|