diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java index 6f376d8e4..c0c2dfa53 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java @@ -15,7 +15,6 @@ import com.google.common.collect.Sets; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; -import weaver.general.BaseBean; import weaver.general.Util; import java.util.*; @@ -47,11 +46,6 @@ public class SalaryAcctEmployeeBO { } Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); - BaseBean baseBean = new BaseBean(); - // 京贵投资二开 - 人员确认页面不能删除的人 - String cannotDeleteEmpIdStr = baseBean.getPropValue("jgtzSalaryAcct", "cannot_delete_emp_ids"); - List cannotDeleteEmpIds = Arrays.stream(cannotDeleteEmpIdStr.split(",")).filter(NumberUtils::isCreatable).map(Long::valueOf).collect(Collectors.toList()); - return salaryAccountingEmployees.stream() .map(e -> { DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(e.getEmployeeId()); @@ -76,7 +70,6 @@ public class SalaryAcctEmployeeBO { .jobNum(simpleEmployee.getWorkcode()) .hireDate(simpleEmployee.getCompanystartdate()) .dismissDate(simpleEmployee.getDismissdate()) - .canDelete(!cannotDeleteEmpIds.contains(e.getEmployeeId())) .build(); }).collect(Collectors.toList()); } diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java index e0fad94bd..94226573e 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java @@ -19,6 +19,8 @@ import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; +import weaver.general.BaseBean; +import weaver.hrm.User; import java.util.*; import java.util.stream.Collectors; @@ -47,7 +49,8 @@ public class SalaryAcctRecordBO { List employeeComInfos, List salaryAcctEmployeeCountDTOS, List salarySendCheckResult, - List taxAgentPOS) { + List taxAgentPOS, + User user) { if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) { return Collections.emptyList(); } @@ -56,6 +59,10 @@ public class SalaryAcctRecordBO { Map empSizeMap = SalaryEntityUtil.convert2Map(salaryAcctEmployeeCountDTOS, SalaryAcctEmployeeCountDTO::getSalaryAcctRecordId, SalaryAcctEmployeeCountDTO::getCountBySalaryAcctRecordId); Map salarySendMap = SalaryEntityUtil.convert2Map(salarySendCheckResult, SalarySendCheckDTO::getSalaryAcctId, SalarySendCheckDTO::isSendFinished); Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); + BaseBean baseBean = new BaseBean(); + // 京贵投资二开 - 人员确认页面不能删除的人 + String cannotDeleteEmpIdStr = baseBean.getPropValue("jgtzSalaryAcct", "cannot_delete_emp_ids"); + List cannotDeleteEmpIds = Arrays.stream(cannotDeleteEmpIdStr.split(",")).filter(NumberUtils::isCreatable).map(Integer::valueOf).collect(Collectors.toList()); return salaryAcctRecordPOS.stream() .map(salaryAcctRecordPO -> { SalarySobPO salarySobPO = salarySobMap.get(salaryAcctRecordPO.getSalarySobId()); @@ -66,7 +73,7 @@ public class SalaryAcctRecordBO { List btnList = new ArrayList<>(); if (SalaryAcctRecordStatusEnum.NOT_ARCHIVED == salaryAcctRecordStatusEnum) { btnList.add(new WeaTableOperate("核算", null, "0")); - if(!Objects.equals(salaryAcctRecordPO.getBackCalcStatus(),NumberUtils.INTEGER_ONE)){ + if(!Objects.equals(salaryAcctRecordPO.getBackCalcStatus(),NumberUtils.INTEGER_ONE) && !cannotDeleteEmpIds.contains(user.getUID())){ btnList.add(new WeaTableOperate("删除", null, "1")); } btnList.add(new WeaTableOperate("归档", null, "2")); diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java index 87da63f3a..5f9d256f8 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java @@ -68,7 +68,4 @@ public class SalaryAccEmployeeListDTO { //离职日期 // @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") private String dismissDate; - - // 是否可删除 - private Boolean canDelete; } diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index fa4a2b11f..90391abd4 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -43,9 +43,7 @@ import com.google.common.collect.Sets; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.BeanUtils; -import weaver.general.BaseBean; import weaver.hrm.User; import java.util.*; @@ -499,15 +497,6 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98830, "薪资核算人员不存在或已被删除")); } - // 京贵投资二开 - 人员确认页面不能删除的人 - BaseBean baseBean = new BaseBean(); - String cannotDeleteEmpIdStr = baseBean.getPropValue("jgtzSalaryAcct", "cannot_delete_emp_ids"); - List cannotDeleteEmpIds = Arrays.stream(cannotDeleteEmpIdStr.split(",")).filter(NumberUtils::isCreatable).map(Long::valueOf).collect(Collectors.toList()); - Optional cannotDeleteOptional = salaryAcctEmployeePOS.stream().filter(acctEmp -> cannotDeleteEmpIds.contains(acctEmp.getEmployeeId())).findFirst(); - if (cannotDeleteOptional.isPresent()) { - throw new SalaryRunTimeException("删除失败!存在不可删除的核算人员"); - } - // 删除薪资核算人员 Set ids = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId); deleteByIds(ids); diff --git a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java index 853a46e4d..118a7e25f 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java @@ -115,7 +115,7 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord List taxAgentPOS = getTaxAgentService(user).listByIds(taxAgentIds); // 转换成列表dto - List salaryAcctRecordListDTOS = SalaryAcctRecordBO.convert2ListDTO(list, salarySobPOS, employeeComInfos, salaryAcctEmployeeCountDTOS, salarySendCheckResult, taxAgentPOS); + List salaryAcctRecordListDTOS = SalaryAcctRecordBO.convert2ListDTO(list, salarySobPOS, employeeComInfos, salaryAcctEmployeeCountDTOS, salarySendCheckResult, taxAgentPOS, user); dtoPage.setList(salaryAcctRecordListDTOS); } // WeaTable weaTable = SalaryFormatUtil.getInstance().buildTable(SalaryAcctRecordListDTO.class, dtoPage);