2022-09-29 11:13:49 +08:00
|
|
|
|
package com.engine.salary.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
|
import com.engine.salary.encrypt.siexport.AccountExportPOEncrypt;
|
|
|
|
|
|
import com.engine.salary.encrypt.siexport.ExcelAccountExportPOEncrypt;
|
|
|
|
|
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
|
|
|
|
|
import com.engine.salary.entity.salaryacct.bo.SalaryAcctResultBO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryacct.dto.SalaryComparisonResultListDTO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam;
|
|
|
|
|
|
import com.engine.salary.entity.salaryacct.param.SalaryComparisonResultQueryParam;
|
|
|
|
|
|
import com.engine.salary.entity.salaryacct.po.ExcelAcctResultPO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
|
|
|
|
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
|
|
|
|
|
import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
|
|
|
|
|
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
|
|
|
|
|
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
|
|
|
|
|
import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO;
|
|
|
|
|
|
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
|
|
|
|
|
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
|
|
|
|
|
import com.engine.salary.entity.siaccount.bo.InsuranceComparisonResultBO;
|
|
|
|
|
|
import com.engine.salary.entity.siaccount.dto.InsuranceComparisonResultListDTO;
|
|
|
|
|
|
import com.engine.salary.entity.siaccount.param.InsuranceComparisonResultQueryParam;
|
2022-09-29 15:11:13 +08:00
|
|
|
|
import com.engine.salary.entity.siexport.param.InsuranceExportParam;
|
2022-09-29 11:13:49 +08:00
|
|
|
|
import com.engine.salary.entity.siexport.po.AccountExportPO;
|
|
|
|
|
|
import com.engine.salary.entity.siexport.po.ExcelAccountExportPO;
|
|
|
|
|
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
|
|
|
|
|
import com.engine.salary.exception.SalaryRunTimeException;
|
|
|
|
|
|
import com.engine.salary.mapper.InsuranceExportMapper;
|
|
|
|
|
|
import com.engine.salary.service.SIAComparisonResultService;
|
|
|
|
|
|
import com.engine.salary.util.SalaryEntityUtil;
|
|
|
|
|
|
import com.engine.salary.util.SalaryI18nUtil;
|
|
|
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
|
|
|
|
|
import com.engine.salary.util.page.Column;
|
|
|
|
|
|
import com.engine.salary.util.page.PageInfo;
|
|
|
|
|
|
import com.engine.salary.util.page.SalaryPageUtil;
|
|
|
|
|
|
import com.google.common.collect.Sets;
|
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
|
import org.apache.commons.lang3.BooleanUtils;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @Author: sy
|
|
|
|
|
|
* @Description: 福利核算的线下对比结果
|
|
|
|
|
|
* @Date: 2022/9/28
|
|
|
|
|
|
**/
|
|
|
|
|
|
public class SIAComparisonResultServiceImpl extends Service implements SIAComparisonResultService {
|
|
|
|
|
|
|
|
|
|
|
|
private InsuranceExportMapper getInsuranceExportMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceExportMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 根据列表查询条件查询线下对比结果(分页)
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public InsuranceComparisonResultListDTO listPageByParam(InsuranceComparisonResultQueryParam queryParam) {
|
|
|
|
|
|
return listByParam(true, queryParam);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 根据列表查询条件查询线下对比结果
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public InsuranceComparisonResultListDTO listByParam(InsuranceComparisonResultQueryParam queryParam) {
|
|
|
|
|
|
return listByParam(false, queryParam);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 根据福利核算人员查询福利核算线下对比结果
|
|
|
|
|
|
*/
|
|
|
|
|
|
private InsuranceComparisonResultListDTO listByParam(boolean needPage, InsuranceComparisonResultQueryParam queryParam) {
|
|
|
|
|
|
|
|
|
|
|
|
//1-查询线上福利核算记录
|
2022-09-29 15:11:13 +08:00
|
|
|
|
InsuranceExportParam insuranceExportParam = new InsuranceExportParam();
|
|
|
|
|
|
insuranceExportParam.setBillMonth(queryParam.getBillMonth());
|
|
|
|
|
|
insuranceExportParam.setPaymentOrganization(queryParam.getPaymentOrganization());
|
|
|
|
|
|
List<AccountExportPO> accountExportPOS = getInsuranceExportMapper().exportAccount(queryParam.getPaymentStatus(), insuranceExportParam);
|
|
|
|
|
|
//如果入参包含姓名信息
|
|
|
|
|
|
if (queryParam.getUserName() != null) {
|
|
|
|
|
|
accountExportPOS.stream().filter(v -> v.getUserName().contains(queryParam.getUserName())).collect(Collectors.toList());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-29 11:13:49 +08:00
|
|
|
|
AccountExportPOEncrypt.decryptAccountExportPOList(accountExportPOS);
|
|
|
|
|
|
//2-查询线下对比数据
|
|
|
|
|
|
List<ExcelAccountExportPO> excelAccountExportPOS = getInsuranceExportMapper().exportExcelAccount(queryParam.getPaymentStatus(), queryParam.getBillMonth(), queryParam.getPaymentOrganization());
|
|
|
|
|
|
ExcelAccountExportPOEncrypt.decryptExcelAccountExportPOList(excelAccountExportPOS);
|
|
|
|
|
|
//3-构建福利核算对比结果列表表头
|
|
|
|
|
|
List<Column> weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult();
|
|
|
|
|
|
//4-通过线上线下两份数据获得对比结果
|
|
|
|
|
|
List<Map<String, Object>> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS);
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
|
|
|
// 系统值和线下值一致的人员
|
|
|
|
|
|
if (queryParam.isOnlyDiffEmployee()) {
|
|
|
|
|
|
// 过滤系统值和线下值一致的薪资核算人员
|
|
|
|
|
|
resultMapList = resultMapList.stream()
|
|
|
|
|
|
.filter(map -> BooleanUtils.toBoolean(String.valueOf(map.get("different"))))
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
}
|
|
|
|
|
|
// 分页
|
|
|
|
|
|
PageInfo<Map<String, Object>> dtoPage = new PageInfo<>();
|
|
|
|
|
|
dtoPage.setTotal(resultMapList.size());
|
|
|
|
|
|
if (needPage) {
|
|
|
|
|
|
dtoPage.setList(SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), resultMapList));
|
|
|
|
|
|
dtoPage.setPageSize(queryParam.getPageSize());
|
|
|
|
|
|
dtoPage.setPageNum(queryParam.getCurrent());
|
|
|
|
|
|
} else {
|
|
|
|
|
|
dtoPage.setList(resultMapList);
|
|
|
|
|
|
}
|
|
|
|
|
|
// 返回结果
|
|
|
|
|
|
return new InsuranceComparisonResultListDTO().setWeaTableColumns(weaTableColumns).setData(dtoPage);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|