薪酬系统-福利档案,SIArchivesBiz方法迁移到对应是实现类,并修改调用方相关代码

This commit is contained in:
sy 2024-02-02 15:23:26 +08:00
parent f4ecb19ef2
commit 9074fb46fc
11 changed files with 2766 additions and 151 deletions

View File

@ -3,9 +3,13 @@ package com.engine.salary.cmd.siarchives;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
import com.engine.salary.util.SalaryAssert;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
import weaver.hrm.User;
import java.util.List;
import java.util.Map;
/**
@ -28,8 +32,16 @@ public class SIArchivesTipsCmd extends AbstractCommonCommand<Map<String, Object>
@Override
public Map<String, Object> execute(CommandContext commandContext) {
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
siArchivesBiz.tips();
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class);
List<Long> employeeIds = socialSchemeMapper.tips();
SalaryAssert.isEmpty(employeeIds, "当前有离职人员档案存在福利缴纳起始月,未维护福利最后缴纳月,请尽快处理");
} finally {
sqlSession.close();
}
return null;
}
}

View File

@ -1,11 +1,11 @@
package com.engine.salary.service;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
import com.engine.salary.entity.siarchives.param.SIArchiveBaseHistoryListParam;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
import com.engine.salary.entity.siarchives.po.*;
import com.engine.salary.util.page.PageInfo;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@ -124,4 +124,32 @@ public interface SIArchivesService {
PageInfo<InsuranceArchivesBaseHistoryDTO> getAdjustHistoryList(SIArchiveBaseHistoryListParam param);
PageInfo<InsuranceArchivesBaseHistoryDTO> historyListByEmployeeIdAndOperator(SIArchiveBaseHistoryListParam param);
List<Map<String, Object>> buildTableData(List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS);
List<WeaTableColumn> buildWeaTableColumns(List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS);
boolean isDiffWelBase();
List<Long> payInsuranceIds(Long socialSchemeId, Integer paymentScope);
List<Long> payInsuranceIds(Long socialSchemeId);
List<InsuranceArchivesSocialSchemePO> getSocialByEmployeeIds(List<Long> employeeIds);
List<InsuranceArchivesFundSchemePO> getFundByEmployeeIds(List<Long> employeeIds);
List<InsuranceArchivesOtherSchemePO> getOtherByEmployeeIds(List<Long> employeeIds);
Map<Long, InsuranceArchivesAccountPO> buildBatchAccount(List<Long> ids, Long paymentOrganization);
Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope);
String checkAndBuildWelBaseWithLimit(Long primaryId, String paymentBaseString, Integer paymentScope);
List<InsuranceArchivesBaseHistoryPO> dealSocialBaseAdjustInfoList(List<InsuranceArchivesSocialSchemePO> adjustList, Long creator);
List<InsuranceArchivesBaseHistoryPO> dealFundBaseAdjustInfoList(List<InsuranceArchivesFundSchemePO> adjustList, Long creator);
List<InsuranceArchivesBaseHistoryPO> dealOtherBaseAdjustInfoList(List<InsuranceArchivesOtherSchemePO> adjustList, Long creator);
void batchInsertAdjustHistory(List<InsuranceArchivesBaseHistoryPO> adjustHistoryList);
List<InsuranceArchivesBaseInfoPO> listEndDateIsNull(List<Long> employeeIds);
}

View File

@ -4,8 +4,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.cloudstore.eccom.constant.WeaBoolAttr;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesAccountPO;
@ -17,9 +17,11 @@ import com.engine.salary.enums.siaccount.PaymentStatusEnum;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.service.ColumnBuildService;
import com.engine.salary.service.SIArchivesService;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import org.apache.commons.lang3.StringUtils;
import weaver.hrm.User;
import java.util.*;
import java.util.stream.Collectors;
@ -32,11 +34,16 @@ import java.util.stream.Collectors;
**/
public class ColumnBuildServiceImpl extends Service implements ColumnBuildService {
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
public SIArchivesService getSIArchivesService(User user) {
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
}
@Override
public List<WeaTableColumn> buildCommonColumnsWithStyle(List<InsuranceAccountDetailPO> pos, Long employeeId, String tenantKey, Integer paymentStatus) {
List<WeaTableColumn> list = new ArrayList<>();
@ -125,7 +132,8 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic
}
private Map<Integer, Map<String, String>> buildPaymentTitle(List<InsuranceAccountDetailPO> pos, Map<String, String> categoryIdNameMap, Long employeeId, String tenantKey) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
Set<String> socailIds = new HashSet<>();
Set<String> fundIds = new HashSet<>();
Set<String> otherIds = new HashSet<>();
@ -440,9 +448,10 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic
@Override
public List<WeaTableColumn> buildInspectColumns(List<InsuranceAccountInspectPO> pos, Long paymentOrganization) {
List<WeaTableColumn> list = new ArrayList<>();
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
List<Long> employeeIds = pos.stream().map(InsuranceAccountInspectPO::getEmployeeId).collect(Collectors.toList());
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization);
// Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization);
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOMap = getSIArchivesService(user).buildBatchAccount(employeeIds, paymentOrganization);
Map<String, String> categoryIdNameMap = getICategoryMapper().listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName));
Map<Integer, Map<String, String>> columns = buildInspectTableTitle(new ArrayList<>(insuranceArchivesAccountPOMap.values()), categoryIdNameMap);
WeaTableColumn weaTableNameColumn = new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 85429, "姓名"), "userName");

View File

@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
@ -21,6 +20,7 @@ import com.engine.salary.mapper.datacollection.EmployMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.RecordsBuildService;
import com.engine.salary.service.SIArchivesService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryDateUtil;
@ -62,11 +62,16 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
public SIArchivesService getSIArchivesService(User user) {
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
}
@Override
public List<Map<String, Object>> buildCommonRecords(List<InsuranceAccountDetailPO> list, Long employeeId) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
List<Map<String, Object>> result = new ArrayList<>();
if (CollectionUtils.isEmpty(list)) {
return result;
@ -114,7 +119,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
if (welBaseDiffSign) {
if (socialJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
socialJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialPerBase", v);
@ -125,7 +131,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
});
if (socialComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
socialComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialComBase", v);
@ -135,7 +142,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
} else {
if (socialJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId());
socialJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialBase", v);
@ -158,7 +166,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
if (welBaseDiffSign) {
if (fundJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
fundJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundPerBase", v);
@ -169,7 +178,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
});
if (fundComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
fundComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundComBase", v);
@ -179,7 +189,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
} else {
if (fundJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId());
fundJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundBase", v);
@ -200,7 +211,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
if (welBaseDiffSign) {
if (otherJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
otherJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherPerBase", v);
@ -211,7 +223,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
});
if (otherComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
otherComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherComBase", v);
@ -221,7 +234,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
} else {
if (otherJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId());
otherJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherBase", v);
@ -311,7 +325,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
@Override
public List<Map<String, Object>> buildInspectRecords(List<InsuranceAccountInspectPO> list, Long paymentOrganization) {
List<Map<String, Object>> result = new ArrayList<>();
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
if (CollectionUtils.isEmpty(list)) {
return result;
}
@ -325,7 +339,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
return result;
}
Map<Long, DataCollectionEmployee> collect = employeeByIds.stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, Function.identity()));
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization);
// Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization);
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOMap = getSIArchivesService(user).buildBatchAccount(employeeIds, paymentOrganization);
list.forEach(item -> {
Map<String, Object> record = new HashMap<>();
DataCollectionEmployee simpleEmployee = collect.get(item.getEmployeeId()) == null ? new DataCollectionEmployee() : collect.get(item.getEmployeeId());

View File

@ -2,7 +2,6 @@ package com.engine.salary.service.impl;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.siaccount.bo.InsuranceComparisonResultBO;
import com.engine.salary.entity.siaccount.dto.InsuranceComparisonResultListDTO;
@ -19,19 +18,18 @@ import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
import com.engine.salary.service.SIAComparisonResultService;
import com.engine.salary.service.SIArchivesService;
import com.engine.salary.service.SISchemeService;
import com.engine.salary.sys.entity.vo.OrderRuleVO;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.excel.ExcelUtilPlus;
import com.engine.salary.util.page.Column;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.engine.salary.util.valid.ValidUtil;
import com.google.common.collect.Lists;
import com.wbi.util.Util;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.hrm.User;
@ -47,7 +45,7 @@ import java.util.stream.Collectors;
public class SIAComparisonResultServiceImpl extends Service implements SIAComparisonResultService {
private EncryptUtil encryptUtil = new EncryptUtil();
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
private InsuranceExportMapper getInsuranceExportMapper() {
return MapperProxyFactory.getProxy(InsuranceExportMapper.class);
@ -73,6 +71,10 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar
return ServiceUtil.getService(SISchemeServiceImpl.class, user);
}
public SIArchivesService getSIArchivesService(User user) {
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
}
/**
* 根据列表查询条件查询线下对比结果分页
*/
@ -144,7 +146,8 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar
*/
private InsuranceComparisonResultListDTO listByParam(boolean needPage, InsuranceComparisonResultQueryParam queryParam) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
//排序配置
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
@ -232,7 +235,8 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar
}
private Set<String> welfareInfo() {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
Set<String> info = new HashSet<>();
List<ICategoryPO> listAll = getICategoryMapper().listAll();

View File

@ -103,7 +103,7 @@ import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
public class SIAccountServiceImpl extends Service implements SIAccountService {
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
private EncryptUtil encryptUtil = new EncryptUtil();
@ -227,6 +227,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
return MapperProxyFactory.getProxy(SIAccountUtilMapper.class);
}
public SIArchivesService getSIArchivesService(User user) {
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
}
@Override
public Map<String, Object> listPage(InsuranceAccountBatchParam queryParam) {
Long employeeId = (long) user.getUID();
@ -761,13 +765,15 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
PageInfo<InsuranceArchivesEmployeePO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(),
insuranceArchivesEmployeePOS, InsuranceArchivesEmployeePO.class);
List<Map<String, Object>> records = siArchivesBiz.buildTableData(insuranceArchivesEmployeePOS);
// List<Map<String, Object>> records = siArchivesBiz.buildTableData(insuranceArchivesEmployeePOS);
List<Map<String, Object>> records = getSIArchivesService(user).buildTableData(insuranceArchivesEmployeePOS);
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
pageInfos.setTotal(pageInfo.getTotal());
pageInfos.setPageNum(param.getCurrent());
pageInfos.setPageSize(param.getPageSize());
List<WeaTableColumn> weaTableColumns = siArchivesBiz.buildWeaTableColumns(insuranceArchivesEmployeePOS, employeeId);
// List<WeaTableColumn> weaTableColumns = siArchivesBiz.buildWeaTableColumns(insuranceArchivesEmployeePOS, employeeId);
List<WeaTableColumn> weaTableColumns = getSIArchivesService(user).buildWeaTableColumns(insuranceArchivesEmployeePOS);
WeaTable table = new WeaTable();
table.setPageUID(UUID.randomUUID().toString());
@ -2349,7 +2355,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
public Map<String, List<Object>> createWelColumnMap(InsuranceAccountDetailParam param) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
//查询线上福利核算记录
InsuranceExportParam insuranceExportParam = new InsuranceExportParam();
insuranceExportParam.setBillMonth(param.getBillMonth());
@ -2496,7 +2503,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
public Map<String, String> welColumnNameCodeMap(InsuranceAccountDetailParam param) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
//查询线上福利核算记录
InsuranceExportParam insuranceExportParam = new InsuranceExportParam();
insuranceExportParam.setBillMonth(param.getBillMonth());
@ -2821,7 +2829,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
* @param baseMap excel导入的对比数据
*/
private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map<String, Object> baseMap, Map<String, String> welColumnNameCodeMap) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
ExcelInsuranceDetailPO excelInsuranceDetailPO = new ExcelInsuranceDetailPO();
excelInsuranceDetailPO.setId(IdGenerator.generate());
@ -4452,7 +4461,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<Long> empIdsInPayMonthRange = listCanPayEmpIds(param.getPaymentOrganization(), param.getBillMonth());
empIds = empIds.stream().filter(f->canAccountIds.contains(f) && empIdsInPayMonthRange.contains(f)).collect(Collectors.toList());
List<InsuranceArchivesSocialSchemePO> socials = siArchivesBiz.getSocialByEmployeeIds(empIds);
// List<InsuranceArchivesSocialSchemePO> socials = siArchivesBiz.getSocialByEmployeeIds(empIds);
List<InsuranceArchivesSocialSchemePO> socials = getSIArchivesService(user).getSocialByEmployeeIds(empIds);
//过滤出目标个税扣缴义务人相关信息
socials = socials.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList());
List<Long> emp1 = socials.stream()
@ -4461,7 +4471,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
.map(InsuranceArchivesSocialSchemePO::getEmployeeId)
.collect(Collectors.toList());
List<InsuranceArchivesFundSchemePO> funds = siArchivesBiz.getFundByEmployeeIds(empIds);
// List<InsuranceArchivesFundSchemePO> funds = siArchivesBiz.getFundByEmployeeIds(empIds);
List<InsuranceArchivesFundSchemePO> funds = getSIArchivesService(user).getFundByEmployeeIds(empIds);
//过滤出目标个税扣缴义务人相关信息
funds = funds.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList());
List<Long> emp2 = funds.stream()
@ -4470,7 +4481,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
.map(InsuranceArchivesFundSchemePO::getEmployeeId)
.collect(Collectors.toList());
List<InsuranceArchivesOtherSchemePO> others = siArchivesBiz.getOtherByEmployeeIds(empIds);
// List<InsuranceArchivesOtherSchemePO> others = siArchivesBiz.getOtherByEmployeeIds(empIds);
List<InsuranceArchivesOtherSchemePO> others = getSIArchivesService(user).getOtherByEmployeeIds(empIds);
//过滤出目标个税扣缴义务人相关信息
others = others.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList());
List<Long> emp3 = others.stream()
@ -4534,8 +4546,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
public void siCommonAccount(String billMonth, List<Long> ids, Long paymentOrganization) {
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = siArchivesBiz.buildBatchAccount(ids, paymentOrganization);
// Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = siArchivesBiz.buildBatchAccount(ids, paymentOrganization);
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = getSIArchivesService(user).buildBatchAccount(ids, paymentOrganization);
List<InsuranceAccountDetailTempPO> list = new ArrayList<>();
int count = 0;
for (Map.Entry<Long, InsuranceArchivesAccountPO> entry : insuranceArchivesAccountPOS.entrySet()) {
@ -4597,7 +4610,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
if (accountPO.getOther() != null) {
InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther();
insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization());
@ -4759,7 +4773,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
if (accountPO.getFund() != null) {
InsuranceArchivesFundSchemePO fundPO = accountPO.getFund();
insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization());
@ -4922,7 +4937,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
if (accountPO.getSocial() != null) {
InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial();
insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization());
@ -5498,7 +5514,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
*/
public String accountSupplement(List<SupplementAccountBaseParam> baseList, List<Long> employeeIds, Long paymentOrganization) {
//(k,v) k-员工id v-员工对应的福利档案数据
Map<Long, InsuranceArchivesAccountPO> longInsuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization);
// Map<Long, InsuranceArchivesAccountPO> longInsuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization);
Map<Long, InsuranceArchivesAccountPO> longInsuranceArchivesAccountPOMap = getSIArchivesService(user).buildBatchAccount(employeeIds, paymentOrganization);
//核算结果集
List<InsuranceAccountDetailPO> pos = new ArrayList<>();
baseList.forEach(baseParam -> {

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,6 @@ import com.alibaba.fastjson.TypeReference;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
@ -25,10 +24,7 @@ import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.SIAccountService;
import com.engine.salary.service.SIExportService;
import com.engine.salary.service.SISchemeService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.service.*;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.sys.entity.vo.OrderRuleVO;
import com.engine.salary.sys.enums.OpenEnum;
@ -69,7 +65,7 @@ public class SIExportServiceImpl extends Service implements SIExportService {
// private SIAccountBiz siAccountBiz = new SIAccountBiz();
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
private SISchemeService getSISchemeService(User user) {
return ServiceUtil.getService(SISchemeServiceImpl.class, user);
@ -107,6 +103,10 @@ public class SIExportServiceImpl extends Service implements SIExportService {
return ServiceUtil.getService(SIAccountServiceImpl.class, user);
}
public SIArchivesService getSIArchivesService(User user) {
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
}
@Override
public XSSFWorkbook exportOverView(InsuranceExportParam queryParam) {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().selectList(queryParam.getBillMonth(), StringUtils.isBlank(queryParam.getPaymentOrganization()) ? null : Long.valueOf(queryParam.getPaymentOrganization()));
@ -253,7 +253,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
@Override
public List<Map<String, Object>> buildCommonRecords(List<AccountExportPO> list) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
List<Map<String, Object>> result = new ArrayList<>();
List<TaxAgentPO> paymentList = getTaxAgentMapper().listAll();
@ -287,7 +288,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
if (welBaseDiffSign) {
if (socialJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
socialJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialPerBase", v);
@ -298,7 +300,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
});
if (socialComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
socialComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialComBase", v);
@ -308,7 +311,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
} else {
if (socialJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId());
socialJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialBase", v);
@ -332,7 +336,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
if (welBaseDiffSign) {
if (fundJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
fundJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundPerBase", v);
@ -343,7 +348,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
});
if (fundComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
fundComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundComBase", v);
@ -353,7 +359,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
} else {
if (fundJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId());
fundJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundBase", v);
@ -375,7 +382,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
if (welBaseDiffSign) {
if (otherJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
otherJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherPerBase", v);
@ -386,7 +394,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
});
if (otherComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
otherComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherComBase", v);
@ -396,7 +405,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
} else {
if (otherJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId());
otherJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherBase", v);
@ -731,7 +741,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
}
private Map<Integer, Map<String, String>> buildPaymentTitle(List<AccountExportPO> pos, Map<String, String> categoryIdNameMap) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
Set<String> socailIds = new HashSet<>();
Set<String> fundIds = new HashSet<>();
Set<String> otherIds = new HashSet<>();

View File

@ -5,7 +5,6 @@ import com.alibaba.fastjson.TypeReference;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
@ -26,7 +25,6 @@ import com.engine.salary.service.SIImportService;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelComment;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.excel.ExcelUtilPlus;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
@ -51,7 +49,7 @@ import java.util.stream.Collectors;
public class SIImportServiceImpl extends Service implements SIImportService {
private EncryptUtil encryptUtil = new EncryptUtil();
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
public SIArchivesService getSIArchivesService(User user) {
return ServiceUtil.getService(SIArchivesServiceImpl.class,user);
@ -195,7 +193,8 @@ public class SIImportServiceImpl extends Service implements SIImportService {
* @return
*/
public List<String> buildHeader() {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
List<String> result = new ArrayList<>();
result.add(SalaryI18nUtil.getI18nLabel( 85429, "姓名"));
result.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人"));
@ -294,19 +293,22 @@ public class SIImportServiceImpl extends Service implements SIImportService {
}
List<Long> employeeIds = insuranceArchivesEmployeePOS.stream().map(InsuranceArchivesEmployeePO::getEmployeeId).collect(Collectors.toList());
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap = new HashMap<>();
List<InsuranceArchivesSocialSchemePO> socialSchemePOList = siArchivesBiz.getSocialByEmployeeIds(employeeIds);
// List<InsuranceArchivesSocialSchemePO> socialSchemePOList = siArchivesBiz.getSocialByEmployeeIds(employeeIds);
List<InsuranceArchivesSocialSchemePO> socialSchemePOList = getSIArchivesService(user).getSocialByEmployeeIds(employeeIds);
encryptUtil.decryptList(socialSchemePOList, InsuranceArchivesSocialSchemePO.class);
if (CollectionUtils.isNotEmpty(socialSchemePOList)) {
socialSchemePOMap = socialSchemePOList.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity()));
}
List<InsuranceArchivesFundSchemePO> fundSchemePOList = siArchivesBiz.getFundByEmployeeIds(employeeIds);
// List<InsuranceArchivesFundSchemePO> fundSchemePOList = siArchivesBiz.getFundByEmployeeIds(employeeIds);
List<InsuranceArchivesFundSchemePO> fundSchemePOList = getSIArchivesService(user).getFundByEmployeeIds(employeeIds);
encryptUtil.encryptList(fundSchemePOList, InsuranceArchivesFundSchemePO.class);
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(fundSchemePOList)) {
fundSchemePOMap = fundSchemePOList.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity()));
}
Map<Long, InsuranceArchivesOtherSchemePO> otherSchemePOMap = new HashMap<>();
List<InsuranceArchivesOtherSchemePO> otherSchemePOList = siArchivesBiz.getOtherByEmployeeIds(employeeIds);
// List<InsuranceArchivesOtherSchemePO> otherSchemePOList = siArchivesBiz.getOtherByEmployeeIds(employeeIds);
List<InsuranceArchivesOtherSchemePO> otherSchemePOList = getSIArchivesService(user).getOtherByEmployeeIds(employeeIds);
encryptUtil.decryptList(otherSchemePOList, InsuranceArchivesOtherSchemePO.class);
if (CollectionUtils.isNotEmpty(otherSchemePOList)) {
otherSchemePOMap = otherSchemePOList.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity()));

View File

@ -6,11 +6,9 @@ import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.biz.SISchemeBiz;
import com.engine.salary.cmd.sischeme.*;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
@ -51,7 +49,6 @@ import com.engine.salary.util.*;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelParseHelper;
import com.engine.salary.util.excel.ExcelSupport;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.excel.ExcelUtilPlus;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
@ -129,7 +126,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
return ServiceUtil.getService(SIImportServiceImpl.class, user);
}
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
private SISchemeBiz siSchemeBiz = new SISchemeBiz();
private SalaryEmployeeService getSalaryEmployeeService(User user) {
@ -152,6 +149,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
return ServiceUtil.getService(TaxAgentManageRangeServiceImpl.class, user);
}
public SIArchivesService getSIArchivesService(User user) {
return ServiceUtil.getService(SIArchivesServiceImpl.class,user);
}
@Override
public Map<String, Object> getForm(Map<String, Object> params) {
return commandExecutor.execute(new SISchemeGetFormCmd(params, user));
@ -264,7 +265,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
@Override
public List<Map<String, Object>> buildTableData(List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
List<Map<String, Object>> records = new ArrayList<>();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listAll();
Map<Long, TaxAgentPO> longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId);
@ -282,9 +284,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
end = employeeIds.size();
}
List<Long> ids = employeeIds.subList(i, end);
socialList.addAll(encryptUtil.decryptList(siArchivesBiz.getSocialByEmployeeIds(ids), InsuranceArchivesSocialSchemePO.class));
fundList.addAll(encryptUtil.decryptList(siArchivesBiz.getFundByEmployeeIds(ids), InsuranceArchivesFundSchemePO.class));
otherList.addAll(encryptUtil.decryptList(siArchivesBiz.getOtherByEmployeeIds(ids), InsuranceArchivesOtherSchemePO.class));
socialList.addAll(encryptUtil.decryptList(getSIArchivesService(user).getSocialByEmployeeIds(ids), InsuranceArchivesSocialSchemePO.class));
fundList.addAll(encryptUtil.decryptList(getSIArchivesService(user).getFundByEmployeeIds(ids), InsuranceArchivesFundSchemePO.class));
otherList.addAll(encryptUtil.decryptList(getSIArchivesService(user).getOtherByEmployeeIds(ids), InsuranceArchivesOtherSchemePO.class));
}
Map<String, InsuranceArchivesSocialSchemePO> socialSchemePOMap = SalaryEntityUtil.convert2Map(socialList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId());
Map<String, InsuranceArchivesFundSchemePO> fundSchemePOMap = SalaryEntityUtil.convert2Map(fundList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId());
@ -311,7 +313,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
if (welBaseDiffSign) {
if (socialJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
socialJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
map.put(k + "per", v);
@ -322,7 +325,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
});
if (socialComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
socialComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
map.put(k + "com", v);
@ -352,7 +356,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
if (welBaseDiffSign) {
if (fundJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
fundJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
map.put(k + "per", v);
@ -363,7 +368,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
});
if (fundComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
fundComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
map.put(k + "com", v);
@ -393,7 +399,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
if (welBaseDiffSign) {
if (otherJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
otherJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
map.put(k + "per", v);
@ -404,7 +411,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
});
if (otherComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
otherComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
map.put(k + "com", v);
@ -587,7 +595,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
public Map<Integer, Map<String, String>> buildColumnTitle(List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS, Long employeeId) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
Map<Integer, Map<String, String>> result = new HashMap<>();
Set<String> socialSet = new HashSet<>();
@ -599,7 +608,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
Set<String> otherComSet = new HashSet<>();
insuranceArchivesEmployeePOS.forEach(item -> {
List<InsuranceArchivesSocialSchemePO> socialByEmployeeId = siArchivesBiz.getSocialByEmployeeIds(new ArrayList<Long>() {{
List<InsuranceArchivesSocialSchemePO> socialByEmployeeId = getSIArchivesService(user).getSocialByEmployeeIds(new ArrayList<Long>() {{
add(item.getEmployeeId());
}});
encryptUtil.decryptList(socialByEmployeeId, InsuranceArchivesSocialSchemePO.class);
@ -609,7 +618,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
}
InsuranceArchivesFundSchemePO fundItem = null;
List<InsuranceArchivesFundSchemePO> fundByEmployeeId = siArchivesBiz.getFundByEmployeeIds(new ArrayList<Long>() {{
List<InsuranceArchivesFundSchemePO> fundByEmployeeId = getSIArchivesService(user).getFundByEmployeeIds(new ArrayList<Long>() {{
add(item.getEmployeeId());
}});
encryptUtil.decryptList(fundByEmployeeId, InsuranceArchivesFundSchemePO.class);
@ -619,7 +628,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
}
InsuranceArchivesOtherSchemePO otherItem = null;
List<InsuranceArchivesOtherSchemePO> otherByEmployeeId = siArchivesBiz.getOtherByEmployeeIds(new ArrayList<Long>() {{
List<InsuranceArchivesOtherSchemePO> otherByEmployeeId = getSIArchivesService(user).getOtherByEmployeeIds(new ArrayList<Long>() {{
add(item.getEmployeeId());
}});
encryptUtil.decryptList(otherByEmployeeId, InsuranceArchivesOtherSchemePO.class);
@ -809,6 +818,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
/**
* 导入的数据插入到数据库中
*/
@Override
public Map<String, Object> batchImportEbatch(SIArchiveImportParam param) {
ValidUtil.doValidator(param);
param.setProcess(false);
@ -1229,7 +1239,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
insuranceArchivesOtherSchemePO = buildOtherPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator);
}
/**************校验申报基数**************/
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
if (welBaseDiffSign) {
for (Map.Entry<Long, String> entry : welfareMap.entrySet()) {
String keyPerName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人");
@ -1276,19 +1287,19 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO);
insuranceArchivesAccountPO.setBaseInfo(insuranceArchivesBaseInfoPO);
//校验福利基数是否符合上下限要求
Boolean socialCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
Boolean socialCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
Boolean fundCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
Boolean fundCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
Boolean otherCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
Boolean socialCheckComBase = true;
Boolean fundCheckComBase = true;
Boolean otherCheckComBase = true;
if (welBaseDiffSign) {
socialCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
fundCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
otherCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
socialCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
fundCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
otherCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
}
if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckComBase && fundCheckComBase && otherCheckComBase) {
insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO);
@ -1313,18 +1324,18 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
} else if (!isError) {
//校验福利基数是否符合上下限要求不符合上下限的基数调整为上限 /下限
String newSocialPaymentBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
String newFundPaymentBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
String newOtherPaymentBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
String newSocialPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
String newFundPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
String newOtherPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(newSocialPaymentBaseString);
insuranceArchivesFundSchemePO.setFundPaymentBaseString(newFundPaymentBaseString);
insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(newOtherPaymentBaseString);
if (welBaseDiffSign) {
String newSocialPaymentComBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
String newFundPaymentComBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
String newOtherPaymentComBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
String newSocialPaymentComBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
String newFundPaymentComBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
String newOtherPaymentComBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
insuranceArchivesSocialSchemePO.setSocialPaymentComBaseString(newSocialPaymentComBaseString);
insuranceArchivesFundSchemePO.setFundPaymentComBaseString(newFundPaymentComBaseString);
@ -1413,7 +1424,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId());
encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class);
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) {
List<Long> insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList());
HashMap<String, String> socialPaymentBase = new HashMap<>();
@ -1525,7 +1537,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesFundSchemePO.getFundSchemeId());
encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class);
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) {
List<Long> insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList());
HashMap<String, String> fundPaymentBase = new HashMap<>();
@ -1627,7 +1640,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
insuranceArchivesOtherSchemePO.setEmployeeId(employeeId);
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesOtherSchemePO.getOtherSchemeId());
encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class);
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) {
List<Long> insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList());
HashMap<String, String> otherPaymentBase = new HashMap<>();
@ -1705,7 +1719,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
//生成福利档案基数调整历史记录
List<InsuranceArchivesBaseHistoryPO> adjustSocialHistoryPOList = siArchivesBiz.dealSocialBaseAdjustInfoList(socialSchemePOS, (long) user.getUID());
// List<InsuranceArchivesBaseHistoryPO> adjustSocialHistoryPOList = siArchivesBiz.dealSocialBaseAdjustInfoList(socialSchemePOS, (long) user.getUID());
List<InsuranceArchivesBaseHistoryPO> adjustSocialHistoryPOList = getSIArchivesService(user).dealSocialBaseAdjustInfoList(socialSchemePOS, (long) user.getUID());
//根据人员id和个税扣缴义务人id删除对应旧档案
socialSchemePOS.forEach(getSocialSchemeMapper()::deleteByEmployeeIdAndPayOrg);
@ -1716,7 +1731,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
partition.forEach(getSocialSchemeMapper()::batchSave);
//新建福利档案基数调整历史记录
siArchivesBiz.batchInsertAdjustHistory(adjustSocialHistoryPOList, user.getUID());
// siArchivesBiz.batchInsertAdjustHistory(adjustSocialHistoryPOList, user.getUID());
getSIArchivesService(user).batchInsertAdjustHistory(adjustSocialHistoryPOList);
}
//导入公积金档案
List<InsuranceArchivesFundSchemePO> fundSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getFund).collect(Collectors.toList());
@ -1727,7 +1743,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
//生成福利档案基数调整历史记录
List<InsuranceArchivesBaseHistoryPO> adjustFundHistoryPOList = siArchivesBiz.dealFundBaseAdjustInfoList(fundSchemePOS, (long) user.getUID());
// List<InsuranceArchivesBaseHistoryPO> adjustFundHistoryPOList = siArchivesBiz.dealFundBaseAdjustInfoList(fundSchemePOS, (long) user.getUID());
List<InsuranceArchivesBaseHistoryPO> adjustFundHistoryPOList = getSIArchivesService(user).dealFundBaseAdjustInfoList(fundSchemePOS, (long) user.getUID());
//根据人员id和个税扣缴义务人id删除对应档案
fundSchemePOS.forEach(getFundSchemeMapper()::deleteByEmployeeIdAndPayOrg);
//新建新档案
@ -1735,7 +1752,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
List<List<InsuranceArchivesFundSchemePO>> partition = Lists.partition(insuranceArchivesFundSchemePOS, 100);
partition.forEach(getFundSchemeMapper()::batchSave);
//新建福利档案基数调整历史记录
siArchivesBiz.batchInsertAdjustHistory(adjustFundHistoryPOList, user.getUID());
// siArchivesBiz.batchInsertAdjustHistory(adjustFundHistoryPOList, user.getUID());
getSIArchivesService(user).batchInsertAdjustHistory(adjustFundHistoryPOList);
}
//导入其他福利档案
List<InsuranceArchivesOtherSchemePO> otherSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getOther).collect(Collectors.toList());
@ -1746,7 +1764,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
//生成福利档案基数调整历史记录
List<InsuranceArchivesBaseHistoryPO> adjustOtherHistoryPOList = siArchivesBiz.dealOtherBaseAdjustInfoList(otherSchemePOS, (long) user.getUID());
// List<InsuranceArchivesBaseHistoryPO> adjustOtherHistoryPOList = siArchivesBiz.dealOtherBaseAdjustInfoList(otherSchemePOS, (long) user.getUID());
List<InsuranceArchivesBaseHistoryPO> adjustOtherHistoryPOList = getSIArchivesService(user).dealOtherBaseAdjustInfoList(otherSchemePOS, (long) user.getUID());
//根据人员id和个税扣缴义务人id删除对应档案
otherSchemePOS.forEach(getOtherSchemeMapper()::deleteByEmployeeIdAndPayOrg);
@ -1755,7 +1774,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
List<List<InsuranceArchivesOtherSchemePO>> partition = Lists.partition(insuranceArchivesOtherSchemePOS, 100);
partition.forEach(getOtherSchemeMapper()::batchSave);
//新建福利档案基数调整历史记录
siArchivesBiz.batchInsertAdjustHistory(adjustOtherHistoryPOList, user.getUID());
// siArchivesBiz.batchInsertAdjustHistory(adjustOtherHistoryPOList, user.getUID());
getSIArchivesService(user).batchInsertAdjustHistory(adjustOtherHistoryPOList);
}
//导入福利档案基础信息
List<InsuranceArchivesBaseInfoPO> baseInfoPOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getBaseInfo).collect(Collectors.toList());
@ -1801,6 +1821,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
*
* @param param 是否导出带档案数据的模板
*/
@Override
public XSSFWorkbook exportTemplate(InsuranceArchivesListParam param) {
return getSIImportService().exportTemplate(param);

View File

@ -1,15 +1,16 @@
package com.engine.salary.timer;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.biz.SalaryArchiveBiz;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
import com.engine.salary.mapper.siarchives.FundSchemeMapper;
import com.engine.salary.mapper.siarchives.OtherSchemeMapper;
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
import com.engine.salary.service.SIArchivesService;
import com.engine.salary.service.SalaryArchiveService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.impl.SIArchivesServiceImpl;
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
import com.engine.salary.util.SalaryDateUtil;
@ -54,6 +55,10 @@ public class AutoSyncResignationEmpArchiveJob extends BaseCronJob {
private String preMonth;
public SIArchivesService getSIArchivesService(User user) {
return ServiceUtil.getService(SIArchivesServiceImpl.class,user);
}
@Override
public void execute() {
User user = new User();
@ -85,8 +90,8 @@ public class AutoSyncResignationEmpArchiveJob extends BaseCronJob {
}
// 获取离职人员中没有设置最后缴纳月的社保福利档案
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
List<InsuranceArchivesBaseInfoPO> needSyncList = siArchivesBiz.listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
// List<InsuranceArchivesBaseInfoPO> needSyncList = siArchivesBiz.listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
List<InsuranceArchivesBaseInfoPO> needSyncList = getSIArchivesService(user).listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
// 设置社保公积金最后缴纳月
for(InsuranceArchivesBaseInfoPO po : needSyncList){
String dismissDate = resignationMap.get(po.getEmployeeId());