编制模块 #215

Merged
liang.cheng merged 1 commits from feature/cl into develop 2 years ago

@ -389,7 +389,7 @@
where t.delete_type = 0
AND t.ec_department IN
<foreach collection="departmentIds" open="(" item="departmentId" separator="," close=")">
#{departmentId}
#{departmentId}
</foreach>
AND t.plan_id IN (SELECT id from jcl_org_staffplan s where s.control_dimension = 2)
</select>

@ -164,8 +164,10 @@ public class FunctionOutStaffServiceImpl {
.collect(Collectors.toList());
subCompanys.addAll(sub);
}
List<StaffPO> staffPOS = staffMapper().selectByEcCompany(subCompanys);
List<StaffPO> staffPOS = new ArrayList<>();
if (CollectionUtils.isNotEmpty(subCompanys)) {
staffPOS = staffMapper().selectByEcCompany(subCompanys);
}
if (!CollectionUtils.isEmpty(staffPOS)) {
staffPOS.forEach(item -> {
if (param.getType().getValue() == 3){
@ -193,8 +195,10 @@ public class FunctionOutStaffServiceImpl {
.collect(Collectors.toList());
subDepartments.addAll(sub);
}
List<StaffPO> staffPOS = staffMapper().selectByEcDepartment(subDepartments);
List<StaffPO> staffPOS = new ArrayList<>();
if (CollectionUtils.isNotEmpty(subDepartments)) {
staffPOS = staffMapper().selectByEcDepartment(subDepartments);
}
if (!CollectionUtils.isEmpty(staffPOS)) {
staffPOS.forEach(item -> {
if (param.getType().getValue() == 3){

@ -56,6 +56,8 @@ public class StaffServiceImpl extends Service implements StaffService {
private static final String RIGHT_NAME = "Staff:All";
private static final Integer HARDCONTROLLER = 2;
private StaffMapper getStaffMapper() {
return MapperProxyFactory.getProxy(StaffMapper.class);
}
@ -171,6 +173,9 @@ public class StaffServiceImpl extends Service implements StaffService {
}
OrganizationAssert.isFalse(staffPO.getStaffNum() < 0, "调整后编制数小于0请更正");
StaffBO.buildStaffDesc(staffPO);
if (staffPO.getControlPolicy().equals(HARDCONTROLLER) && staffPO.getStaffNum() < (staffPO.getPermanentNum() + staffPO.getFreezeNum())){
throw new OrganizationRunTimeException("存在编制超编风险,请先修改控制策略");
}
// 更新主表
int updateStaff = getStaffMapper().updateStaff(staffPO);
// 同步组织架构图编制信息

Loading…
Cancel
Save