From e6ded7373c021525934e2b741b3fbe176a1ef95c Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 14 Sep 2023 16:22:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ChartServiceImpl.java | 6 ++++-- .../service/impl/StaffServiceImpl.java | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index 0f714919..13d72a23 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -644,7 +644,7 @@ public class ChartServiceImpl extends Service implements ChartService { jobSql.append("select count(1) as count from hrmresource where status < 4 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\n" + + " and a.ec_company = ? and a.ec_department is null and a.delete_type = 0\n" + " and b.plan_year = ?"); }else { dept.getAllChildDeptByDepId(list,String.valueOf(stp.getDataId())); @@ -652,7 +652,7 @@ public class ChartServiceImpl extends Service implements ChartService { jobSql.append("select count(1) as count from hrmresource where status < 4 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\n" + + " and a.ec_department = ? and a.job_id is null and a.delete_type = 0\n" + " and b.plan_year = ?"); } @@ -663,6 +663,8 @@ public class ChartServiceImpl extends Service implements ChartService { rs.executeQuery(staffSql.toString(),stp.getDataId(),OrganizationDateUtil.getFormatYear(new Date())); if (rs.next()) { stp.setStaffNum(Util.getIntValue(rs.getString("staff_num"))); + }else { + stp.setStaffNum(0); } return stp; diff --git a/src/com/engine/organization/service/impl/StaffServiceImpl.java b/src/com/engine/organization/service/impl/StaffServiceImpl.java index a62e4a49..622ca6b3 100644 --- a/src/com/engine/organization/service/impl/StaffServiceImpl.java +++ b/src/com/engine/organization/service/impl/StaffServiceImpl.java @@ -31,6 +31,7 @@ import com.engine.organization.util.browser.OrganizationBrowserUtil; import com.engine.organization.util.db.DBType; import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.excel.ExcelUtil; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.conn.RecordSet; @@ -285,12 +286,13 @@ public class StaffServiceImpl extends Service implements StaffService { controlPolicyItem.setRules("required|string"); SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 200, "描述说明", "description"); - + StaffPlanPO staffPlanPO = new StaffPlanPO(); // 编辑状态下赋值操作 String id = Util.null2String(params.get("id")); if (!StringUtil.isEmpty(id)) { StaffPO staffPO = getStaffMapper().getStaffByID(Integer.parseInt(id)); OrganizationAssert.notNull(staffPO, "选择的数据不存在,或数据已删除"); + staffPlanPO = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId()); BrowserBean planIdItemBean = planIdItem.getBrowserConditionParam(); List> planIdMaps = getStaffPlanMapper().listPlansByIds(DeleteParam.builder().ids(staffPO.getPlanId().toString()).build().getIds()); @@ -317,9 +319,16 @@ public class StaffServiceImpl extends Service implements StaffService { descriptionItem.setValue(staffPO.getDescription()); } selectItems.add(planIdItem); - selectItems.add(ecCompanyItem); - selectItems.add(ecDepartmentItem); - selectItems.add(jobIdItem); + if (StringUtil.isEmpty(id) || "1".equals(staffPlanPO.getControlDimension())) { + selectItems.add(ecCompanyItem); + } + if (StringUtil.isEmpty(id) || "2".equals(staffPlanPO.getControlDimension())) { + selectItems.add(ecDepartmentItem); + } + if (StringUtil.isEmpty(id) || "3".equals(staffPlanPO.getControlDimension())) { + selectItems.add(jobIdItem); + } + selectItems.add(staffNumItem); selectItems.add(controlPolicyItem); selectItems.add(descriptionItem); -- 2.40.0.windows.1