修复非系统人员状态bug
This commit is contained in:
parent
9ca420b5e6
commit
db4b44e62c
|
|
@ -320,11 +320,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
|
||||
@Override
|
||||
public void deleteSalaryArchive(Collection<Long> salaryArchiveIds) {
|
||||
if(CollectionUtils.isEmpty(salaryArchiveIds)){
|
||||
if (CollectionUtils.isEmpty(salaryArchiveIds)) {
|
||||
throw new SalaryRunTimeException("薪资档案参数为空!");
|
||||
}
|
||||
SalarySysConfPO canDelete = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_ARCHIVE_DELETE);
|
||||
if(Objects.isNull(canDelete) || StringUtils.equals(canDelete.getConfValue(),"0") ){
|
||||
if (Objects.isNull(canDelete) || StringUtils.equals(canDelete.getConfValue(), "0")) {
|
||||
throw new SalaryRunTimeException("不允许删除薪资档案,请先开启删除档案规则配置!");
|
||||
}
|
||||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(salaryArchiveIds).build());
|
||||
|
|
@ -333,17 +333,17 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
List<Long> canDeleteTaxAgentIds = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID())
|
||||
.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
boolean err = salaryArchiveList.stream().anyMatch(po -> !canDeleteTaxAgentIds.contains(po.getTaxAgentId()));
|
||||
if(CollectionUtils.isEmpty(salaryArchiveList) || err){
|
||||
if (CollectionUtils.isEmpty(salaryArchiveList) || err) {
|
||||
throw new SalaryRunTimeException("薪资档案不存在,或没有权限删除该薪资档案!");
|
||||
}
|
||||
Optional<SalaryArchivePO> fixedList = salaryArchiveList.stream().filter(archive -> !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.PENDING.getValue())
|
||||
&& !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())).findFirst();
|
||||
if(fixedList.isPresent()){
|
||||
if (fixedList.isPresent()) {
|
||||
throw new SalaryRunTimeException("发薪员工、待停薪员工、停薪_来自待停薪,无法删除薪资档案!");
|
||||
}
|
||||
List<Long> deleteIds = salaryArchiveList.stream().map(SalaryArchivePO::getId).collect(Collectors.toList());
|
||||
// 删除薪资档案及档案项目
|
||||
if(CollectionUtils.isNotEmpty(deleteIds)){
|
||||
if (CollectionUtils.isNotEmpty(deleteIds)) {
|
||||
getSalaryArchiveMapper().deleteByIds(deleteIds);
|
||||
getSalaryArchiveItemMapper().deleteBySalaryArchiveId(deleteIds);
|
||||
}
|
||||
|
|
@ -432,7 +432,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
List<Long> salaryItemIds = salaryItems.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
// 1.获取薪资档案所对应的当前生效的薪资项目数据
|
||||
List<SalaryArchiveItemPO> salaryArchiveItemList = Collections.emptyList();
|
||||
if(CollectionUtils.isNotEmpty(ids) && CollectionUtils.isNotEmpty(salaryItemIds) || !isPage){
|
||||
if (CollectionUtils.isNotEmpty(ids) && CollectionUtils.isNotEmpty(salaryItemIds) || !isPage) {
|
||||
salaryArchiveItemList = getCurrentEffectiveItemList(ids, salaryItemIds);
|
||||
}
|
||||
List<SalaryArchiveItemPO> finalSalaryArchiveItemList = salaryArchiveItemList;
|
||||
|
|
@ -461,7 +461,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
// 3.组装数据
|
||||
List<Map<String, Object>> listMaps = new ArrayList<>();
|
||||
salaryArchives.forEach(e -> {
|
||||
e.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(e.getEmployeeStatus())));
|
||||
e.setEmployeeStatus(NumberUtils.isCreatable(e.getEmployeeStatus()) ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(e.getEmployeeStatus())) : "");
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("id", e.getId());
|
||||
|
|
@ -757,11 +757,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
// 获取核算人员规则
|
||||
List<String> statusList = Collections.emptyList();
|
||||
SalarySysConfPO employeeRule = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_ACCT_EMPLOYEE_RULE);
|
||||
if(Objects.isNull(employeeRule) || StringUtils.equals(employeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue())){
|
||||
if (Objects.isNull(employeeRule) || StringUtils.equals(employeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue())) {
|
||||
// 默认包含停薪列表
|
||||
statusList = Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue(), SalaryArchiveStatusEnum.SUSPEND.getValue(),
|
||||
SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue() );
|
||||
}else{
|
||||
SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue());
|
||||
} else {
|
||||
// 仅包含发薪、待定薪
|
||||
statusList = Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue(), SalaryArchiveStatusEnum.SUSPEND.getValue());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue