From 21cd02c72a1083691d04b4836d9ece2b0597b25b Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 7 Sep 2023 10:43:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/mapper/staff/StaffMapper.xml | 22 +++++++++---------- .../impl/FunctionOutStaffServiceImpl.java | 5 +++-- .../service/impl/StaffServiceImpl.java | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/com/engine/organization/mapper/staff/StaffMapper.xml b/src/com/engine/organization/mapper/staff/StaffMapper.xml index d79f36dc..16c8024a 100644 --- a/src/com/engine/organization/mapper/staff/StaffMapper.xml +++ b/src/com/engine/organization/mapper/staff/StaffMapper.xml @@ -373,27 +373,25 @@ \ No newline at end of file diff --git a/src/com/engine/organization/service/impl/FunctionOutStaffServiceImpl.java b/src/com/engine/organization/service/impl/FunctionOutStaffServiceImpl.java index 5de3a2fe..1c4466bf 100644 --- a/src/com/engine/organization/service/impl/FunctionOutStaffServiceImpl.java +++ b/src/com/engine/organization/service/impl/FunctionOutStaffServiceImpl.java @@ -3,6 +3,7 @@ package com.engine.organization.service.impl; import com.engine.organization.entity.staff.param.StaffOutParam; import com.engine.organization.entity.staff.po.StaffPO; import com.engine.organization.enums.StaffChangeEnum; +import com.engine.organization.exception.OrganizationRunTimeException; import com.engine.organization.mapper.staff.StaffMapper; import com.engine.organization.util.OrganizationAssert; import com.engine.organization.util.db.MapperProxyFactory; @@ -62,7 +63,7 @@ public class FunctionOutStaffServiceImpl { if (staffPO.getControlPolicy().equals(HARDCONTROLLER)) { OrganizationAssert.isFalse(difference.compareTo(sums) < 0,"存在编制超编风险,请先修改控制策略"); } - staffPO.setStaffNum(difference); + staffPO.setStaffNum(difference < 0 ? 0 :difference); buildStaffPO(staffPO); return staffMapper().updateStaff(staffPO); } @@ -172,7 +173,7 @@ public class FunctionOutStaffServiceImpl { //2.部门 if (param.getDepartment() != null) { String allSupDepartment = departmentComInfo.getAllSupDepartment(String.valueOf(param.getDepartment())); - if ("".equals(allSupDepartment)) { + if (!"".equals(allSupDepartment)) { Collection subDepartments = Arrays.stream(allSupDepartment.split(",")) .map(Integer::parseInt) .collect(Collectors.toList()); diff --git a/src/com/engine/organization/service/impl/StaffServiceImpl.java b/src/com/engine/organization/service/impl/StaffServiceImpl.java index 70f9e5ab..17c17d97 100644 --- a/src/com/engine/organization/service/impl/StaffServiceImpl.java +++ b/src/com/engine/organization/service/impl/StaffServiceImpl.java @@ -367,7 +367,7 @@ public class StaffServiceImpl extends Service implements StaffService { String sqlWhere = " where t.delete_type ='0' "; String planId = param.getPlanId(); - if ("".equals(planId)) { + if (!"".equals(planId)) { sqlWhere += " AND t.plan_id in (" + planId + ")"; } else { sqlWhere = " where 1 = 2 "; -- 2.40.0.windows.1