diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index 957a0852..e9c0579f 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -762,6 +762,7 @@ public class ChartServiceImpl extends Service implements ChartService { /** * 生成人数 + * 二开需求(在职人数统计去除临时状态) * @param stp * @return */ @@ -777,7 +778,7 @@ public class ChartServiceImpl extends Service implements ChartService { if (ModuleTypeEnum.subcompanyfielddefined.getValue().equals(stp.getType())) { subCompany.getSubCompanyLists(String.valueOf(stp.getDataId()), list); String value = StringUtils.join(list,","); - jobSql.append("select count(1) as count from hrmresource where status < 4 and subcompanyid1 in (").append(value).append(")"); + jobSql.append("select count(1) as count from hrmresource where status in (0,1,3) and subcompanyid1 in (").append(value).append(")"); staffSql.append("select a.staff_num from jcl_org_staff a inner join jcl_org_staffplan b\n" + " on a.plan_id = b.id\n" + " and a.ec_company = ? and a.ec_department is null and a.delete_type = 0\n" + @@ -785,7 +786,7 @@ public class ChartServiceImpl extends Service implements ChartService { }else { dept.getAllChildDeptByDepId(list,String.valueOf(stp.getDataId())); String value = StringUtils.join(list,","); - jobSql.append("select count(1) as count from hrmresource where status < 4 and departmentid in (").append(value).append(")"); + jobSql.append("select count(1) as count from hrmresource where status in (0,1,3) and departmentid in (").append(value).append(")"); staffSql.append("select a.staff_num from jcl_org_staff a inner join jcl_org_staffplan b\n" + " on a.plan_id = b.id\n" + " and a.ec_department = ? and a.job_id is null and a.delete_type = 0\n" + @@ -831,7 +832,13 @@ public class ChartServiceImpl extends Service implements ChartService { List hisCompanyList = new ArrayList<>(); List hisDepartmentList = new ArrayList<>(); - rs.executeQuery("select data_id from jcl_org_onjob where type = 1"); + StringBuilder companySql = new StringBuilder("select data_id from jcl_org_onjob where type = 1"); + + if (companyId != null) { + companySql.append(" and data_id = ").append(companyId); + } + + rs.executeQuery(companySql.toString()); while (rs.next()) { hisCompanyList.add(Util.getIntValue(rs.getString("data_id"))); } diff --git a/src/com/engine/organization/service/impl/StaffServiceImpl.java b/src/com/engine/organization/service/impl/StaffServiceImpl.java index 8d6d9719..d21557e5 100644 --- a/src/com/engine/organization/service/impl/StaffServiceImpl.java +++ b/src/com/engine/organization/service/impl/StaffServiceImpl.java @@ -493,7 +493,7 @@ public class StaffServiceImpl extends Service implements StaffService { boolean hasDepartment = null != staffPO.getEcDepartment() && 0 != staffPO.getEcDepartment(); boolean hasJob = null != staffPO.getJobId() && 0 != staffPO.getJobId(); RecordSet rs = new RecordSet(); - String sql = "select count(1) as num from hrmresource where STATUS < 4"; + String sql = "select count(1) as num from hrmresource where STATUS in (0,1,3)"; if (null != staffPO.getEcCompany() && 0 != staffPO.getEcCompany()) { ArrayList subCompanyList = new ArrayList<>(); subCompanyList.add(staffPO.getEcCompany().toString()); diff --git a/src/weaver/interfaces/organization/cronjob/StaffPersonCron.java b/src/weaver/interfaces/organization/cronjob/StaffPersonCron.java index 7e40bcb7..07058f1c 100644 --- a/src/weaver/interfaces/organization/cronjob/StaffPersonCron.java +++ b/src/weaver/interfaces/organization/cronjob/StaffPersonCron.java @@ -71,7 +71,7 @@ public class StaffPersonCron extends BaseCronJob { List poList = new ArrayList<>(); cronParamList.forEach(item -> { - String sql = "select count(1) as num from hrmresource where status < 4"; + String sql = "select count(1) as num from hrmresource where status in (0,1,3)"; if ("1".equals(item.getControlDimension())){ ArrayList subCompanyList = new ArrayList<>(); subCompanyList.add(item.getEcCompany().toString()); diff --git a/src/weaver/interfaces/organization/cronjob/StatisticsPersonCron.java b/src/weaver/interfaces/organization/cronjob/StatisticsPersonCron.java index 1f159df8..754b79de 100644 --- a/src/weaver/interfaces/organization/cronjob/StatisticsPersonCron.java +++ b/src/weaver/interfaces/organization/cronjob/StatisticsPersonCron.java @@ -34,7 +34,9 @@ public class StatisticsPersonCron extends BaseCronJob { @Override public void execute() { Integer value = StringUtils.isNotBlank(companyId) ? Integer.parseInt(companyId) : null; - StatisticsParam build = StatisticsParam.builder().companyId(value).build(); + + //数据过滤去除可手动选择 () + StatisticsParam build = StatisticsParam.builder().companyId(null).build(); User user = new User(); user.setUid(1); getChartService(user).recordStatistics(build);