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 ";