2022-04-16 15:33:51 +08:00
|
|
|
package com.engine.salary.service.impl;
|
|
|
|
|
|
2022-04-18 18:56:17 +08:00
|
|
|
import com.engine.common.util.ServiceUtil;
|
2022-04-16 15:33:51 +08:00
|
|
|
import com.engine.core.impl.Service;
|
2022-04-18 18:56:17 +08:00
|
|
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationDetailListDTO;
|
2022-04-16 15:33:51 +08:00
|
|
|
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationWageListDTO;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO;
|
|
|
|
|
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper;
|
2022-04-18 18:56:17 +08:00
|
|
|
import com.engine.salary.service.SalaryEmployeeService;
|
2022-04-16 15:33:51 +08:00
|
|
|
import com.engine.salary.service.TaxDeclarationDetailService;
|
2022-04-18 18:56:17 +08:00
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
2022-04-16 15:33:51 +08:00
|
|
|
import com.engine.salary.util.page.PageInfo;
|
2022-04-18 18:56:17 +08:00
|
|
|
import com.mzlion.core.lang.CollectionUtils;
|
2022-04-16 15:33:51 +08:00
|
|
|
|
|
|
|
|
import java.util.Collection;
|
2022-04-18 18:56:17 +08:00
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.List;
|
2022-04-16 15:33:51 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 个税申报表明细
|
|
|
|
|
* @author: xiajun
|
|
|
|
|
* @modified By: xiajun
|
|
|
|
|
* @date: Created in 1/23/22 4:29 PM
|
|
|
|
|
* @version:v1.0
|
|
|
|
|
*/
|
|
|
|
|
public class TaxDeclarationDetailServiceImpl extends Service implements TaxDeclarationDetailService {
|
|
|
|
|
|
2022-05-09 11:46:49 +08:00
|
|
|
private TaxDeclarationDetailMapper getTaxDeclarationDetailMapper() {
|
2022-04-18 18:56:17 +08:00
|
|
|
return MapperProxyFactory.getProxy(TaxDeclarationDetailMapper.class);
|
|
|
|
|
}
|
|
|
|
|
private SalaryEmployeeService getSalaryEmployeeService() {
|
|
|
|
|
return (SalaryEmployeeService) ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
|
|
|
|
}
|
2022-04-16 15:33:51 +08:00
|
|
|
|
|
|
|
|
/*@Override
|
|
|
|
|
public List<TaxDeclarationDetailPO> listByTaxDeclarationIdAndEmployeeIds(Long taxDeclarationId, Collection<Long> employeeIds, String tenantKey) {
|
|
|
|
|
if (CollectionUtils.isEmpty(employeeIds)) {
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
|
return new LambdaQueryChainWrapper<>(taxDeclarationDetailMapper)
|
|
|
|
|
.eq(TaxDeclarationDetailPO::getTenantKey, tenantKey)
|
|
|
|
|
.eq(TaxDeclarationDetailPO::getDeleteType, 0)
|
|
|
|
|
.eq(TaxDeclarationDetailPO::getTaxDeclarationId, taxDeclarationId)
|
|
|
|
|
.in(TaxDeclarationDetailPO::getEmployeeId, employeeIds)
|
|
|
|
|
.list();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Page<Long> listPage4EmployeeIdByParam(TaxDeclarationDetailListQueryParam queryParam, String tenantKey) {
|
|
|
|
|
// 分页参数
|
|
|
|
|
Page<Long> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
|
|
|
|
// 查询个税申报表明细中的人员(分页)
|
|
|
|
|
return taxDeclarationDetailMapper.listEmployeeId(page, queryParam.getTaxDeclarationId(), tenantKey);
|
|
|
|
|
}
|
2022-04-18 18:56:17 +08:00
|
|
|
*/
|
2022-04-16 15:33:51 +08:00
|
|
|
@Override
|
2022-04-18 18:56:17 +08:00
|
|
|
public PageInfo<TaxDeclarationDetailListDTO> listDtoPageByParam(TaxDeclarationDetailListQueryParam queryParam) {
|
2022-04-16 15:33:51 +08:00
|
|
|
// 查询个税申报表明细的人员
|
2022-05-09 11:46:49 +08:00
|
|
|
List<Long> employeeIdPage = getTaxDeclarationDetailMapper().listEmployeeId(queryParam.getTaxDeclarationId());
|
2022-04-18 18:56:17 +08:00
|
|
|
PageInfo<TaxDeclarationDetailListDTO> dtoPage = new PageInfo<TaxDeclarationDetailListDTO>(TaxDeclarationDetailListDTO.class);
|
|
|
|
|
dtoPage.setPageNum(queryParam.getCurrent());
|
|
|
|
|
dtoPage.setPageSize(queryParam.getPageSize());
|
2022-04-19 20:58:30 +08:00
|
|
|
if(null==employeeIdPage){
|
|
|
|
|
return dtoPage;
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtils.isNotEmpty(employeeIdPage)) {
|
2022-04-16 15:33:51 +08:00
|
|
|
// 查询个税申报表明细
|
2022-04-19 20:58:30 +08:00
|
|
|
List<TaxDeclarationDetailPO> taxDeclarationDetailPOS = listByTaxDeclarationIdAndEmployeeIds(queryParam.getTaxDeclarationId(), employeeIdPage);
|
2022-04-18 18:56:17 +08:00
|
|
|
// 查询人员
|
2022-04-19 20:58:30 +08:00
|
|
|
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService().listByIds(employeeIdPage);
|
2022-04-18 18:56:17 +08:00
|
|
|
// List<SimpleEmployee> simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIdPage.getRecords(), tenantKey);
|
2022-04-16 15:33:51 +08:00
|
|
|
// 转换成列表dto
|
|
|
|
|
TaxDeclarationBO.buildDetailListDTO(queryParam.getTaxDeclarationId(), dtoPage, taxDeclarationDetailPOS, simpleEmployees);
|
|
|
|
|
}
|
|
|
|
|
return dtoPage;
|
2022-04-18 18:56:17 +08:00
|
|
|
}
|
2022-04-16 15:33:51 +08:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<TaxDeclarationLaborListDTO> listDtoPageByParam4Labor(TaxDeclarationDetailListQueryParam queryParam) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<TaxDeclarationWageListDTO> listDtoPageByParam4Wage(TaxDeclarationDetailListQueryParam queryParam) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void batchSave(Collection<TaxDeclarationDetailPO> taxDeclarationDetailPOS) {
|
2022-05-09 11:46:49 +08:00
|
|
|
getTaxDeclarationDetailMapper().batchInsert(taxDeclarationDetailPOS);
|
2022-04-18 18:56:17 +08:00
|
|
|
}
|
2022-04-19 20:58:30 +08:00
|
|
|
public List<TaxDeclarationDetailPO> listByTaxDeclarationIdAndEmployeeIds(Long taxDeclarationId, List<Long> employeeIds) {
|
2022-04-18 18:56:17 +08:00
|
|
|
if (CollectionUtils.isEmpty(employeeIds)) {
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// return new LambdaQueryChainWrapper<>(taxDeclarationDetailMapper)
|
|
|
|
|
// .eq(TaxDeclarationDetailPO::getTenantKey, tenantKey)
|
|
|
|
|
// .eq(TaxDeclarationDetailPO::getDeleteType, 0)
|
|
|
|
|
// .eq(TaxDeclarationDetailPO::getTaxDeclarationId, taxDeclarationId)
|
|
|
|
|
// .in(TaxDeclarationDetailPO::getEmployeeId, employeeIds)
|
|
|
|
|
// .list();
|
2022-05-09 11:46:49 +08:00
|
|
|
return getTaxDeclarationDetailMapper().listByTaxDeclarationIdAndEmployeeIds(taxDeclarationId,employeeIds);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void deleteByTaxDeclarationIds(Collection<Long> taxDeclarationIds) {
|
|
|
|
|
getTaxDeclarationDetailMapper().deleteByTaxDeclarationIds(taxDeclarationIds);
|
2022-04-16 15:33:51 +08:00
|
|
|
}
|
|
|
|
|
}
|