薪资项目模块

This commit is contained in:
钱涛 2024-09-23 10:17:36 +08:00
parent f62dfa17be
commit f0f6943eb0
2 changed files with 22 additions and 30 deletions

View File

@ -382,7 +382,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
List<Long> employeeIds = SalaryEntityUtil.properties(salaryEmployees, DataCollectionEmployee::getEmployeeId, Collectors.toList());
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds);
// 转换成薪资核算人员po
Date salaryDate = SalaryDateUtil.dateStrToLocalTime(salaryYearMonth + "-01");
Date salaryDate = SalaryDateUtil.dateStrToLocalDate(salaryYearMonth + "-01");
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, SalaryAcctRecordPO.builder().salarySobId(salarySobId).salaryMonth(salaryDate).build(), salaryArchiveDataDTOS, (long) user.getUID());
//过滤掉不属于当前账套扣缴义务人的人员

View File

@ -23,8 +23,10 @@ import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobPO;
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.*;
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
import com.engine.salary.enums.salaryformula.ReferenceTypeEnum;
import com.engine.salary.enums.salaryformula.ReturnTypeEnum;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
@ -169,36 +171,26 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
@Override
public PageInfo<SalaryItemPO> listPageByParam(SalaryItemSearchParam searchParam) {
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
Boolean isAdminEnable = getTaxAgentService(user).isAdminEnable((long) user.getUID());
List<SalaryItemPO> salaryItemPOS = salaryItemBiz.listByParam(searchParam);
if (needAuth) {
if (isAdminEnable) {
//管理员
Set<Long> userTaxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID())
.stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
salaryItemPOS = salaryItemPOS.stream()
.filter(po -> filterInRange(userTaxAgentIds, po))
.sorted(new Comparator<SalaryItemPO>() {
@Override
public int compare(SalaryItemPO o1, SalaryItemPO o2) {
if (o1.getSortedIndex() == null && o2.getSortedIndex() == null) {
Integer systemType1 = o1.getSystemType() == null ? 0 : o1.getSystemType();
Integer systemType2 = o2.getSystemType() == null ? 0 : o2.getSystemType();
return systemType1.compareTo(systemType2);
} else {
Integer sortedIndex1 = o1.getSortedIndex() == null ? 0 : o1.getSortedIndex();
Integer sortedIndex2 = o2.getSortedIndex() == null ? 0 : o2.getSortedIndex();
return sortedIndex2.compareTo(sortedIndex1);
}
}
})
.collect(Collectors.toList());
} else {
//普通用户
salaryItemPOS = new ArrayList<>();
}
}
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAuth(param);
Set<Long> userTaxAgentIds = SalaryEntityUtil.properties(taxAgentPOS,TaxAgentPO::getId);
salaryItemPOS = salaryItemPOS.stream()
.filter(po -> filterInRange(userTaxAgentIds, po))
.sorted((o1, o2) -> {
if (o1.getSortedIndex() == null && o2.getSortedIndex() == null) {
Integer systemType1 = o1.getSystemType() == null ? 0 : o1.getSystemType();
Integer systemType2 = o2.getSystemType() == null ? 0 : o2.getSystemType();
return systemType1.compareTo(systemType2);
} else {
Integer sortedIndex1 = o1.getSortedIndex() == null ? 0 : o1.getSortedIndex();
Integer sortedIndex2 = o2.getSortedIndex() == null ? 0 : o2.getSortedIndex();
return sortedIndex2.compareTo(sortedIndex1);
}
})
.collect(Collectors.toList());
return SalaryPageUtil.buildPage(searchParam.getCurrent(), searchParam.getPageSize(), salaryItemPOS);
}