薪资项目模块
This commit is contained in:
parent
f62dfa17be
commit
f0f6943eb0
|
|
@ -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());
|
||||
|
||||
//过滤掉不属于当前账套扣缴义务人的人员
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue