2022-04-11 19:07:35 +08:00
|
|
|
|
package com.engine.salary.service.impl;
|
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
|
import com.alibaba.fastjson.JSON;
|
2022-04-12 19:29:19 +08:00
|
|
|
|
import com.api.browser.bean.SearchConditionGroup;
|
|
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
2022-04-18 20:24:43 +08:00
|
|
|
|
import com.api.browser.bean.SearchConditionOption;
|
2022-09-15 16:14:34 +08:00
|
|
|
|
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
2022-04-16 16:43:33 +08:00
|
|
|
|
import com.cloudstore.eccom.pc.table.*;
|
2022-04-11 19:07:35 +08:00
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
2022-04-12 10:24:21 +08:00
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
2022-04-11 19:07:35 +08:00
|
|
|
|
import com.engine.core.impl.Service;
|
2022-09-02 11:53:38 +08:00
|
|
|
|
import com.engine.salary.biz.*;
|
2022-04-11 19:07:35 +08:00
|
|
|
|
import com.engine.salary.component.SalaryWeaTable;
|
2022-04-12 19:29:19 +08:00
|
|
|
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
2022-12-12 15:40:01 +08:00
|
|
|
|
import com.engine.salary.encrypt.EncryptUtil;
|
2022-09-02 11:53:38 +08:00
|
|
|
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
2022-04-11 19:07:35 +08:00
|
|
|
|
import com.engine.salary.entity.siaccount.bo.InsuranceAccountBO;
|
|
|
|
|
|
import com.engine.salary.entity.siaccount.dto.InsuranceAccountBatchListDTO;
|
2022-04-15 19:01:09 +08:00
|
|
|
|
import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO;
|
2022-04-18 20:24:43 +08:00
|
|
|
|
import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO;
|
2022-04-15 13:17:25 +08:00
|
|
|
|
import com.engine.salary.entity.siaccount.param.*;
|
2022-09-27 17:36:06 +08:00
|
|
|
|
import com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO;
|
2022-04-11 19:07:35 +08:00
|
|
|
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
|
2022-04-12 10:24:21 +08:00
|
|
|
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
|
2022-04-15 13:17:25 +08:00
|
|
|
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
|
2022-10-20 16:29:49 +08:00
|
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
|
2022-04-16 16:43:33 +08:00
|
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
|
2022-12-07 17:09:53 +08:00
|
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO;
|
|
|
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO;
|
2022-04-27 16:21:24 +08:00
|
|
|
|
import com.engine.salary.entity.sicategory.po.ICategoryPO;
|
2023-04-18 14:21:05 +08:00
|
|
|
|
import com.engine.salary.entity.siexport.param.InsuranceExportParam;
|
|
|
|
|
|
import com.engine.salary.entity.siexport.po.AccountExportPO;
|
|
|
|
|
|
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
2022-09-27 17:36:06 +08:00
|
|
|
|
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
2022-06-08 17:52:10 +08:00
|
|
|
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
2022-04-16 16:43:33 +08:00
|
|
|
|
import com.engine.salary.enums.UserStatusEnum;
|
2022-10-20 11:27:27 +08:00
|
|
|
|
import com.engine.salary.enums.siaccount.*;
|
2022-12-07 17:09:53 +08:00
|
|
|
|
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
2022-04-27 16:21:24 +08:00
|
|
|
|
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
2022-07-20 15:40:51 +08:00
|
|
|
|
import com.engine.salary.exception.SalaryRunTimeException;
|
2023-04-18 14:21:05 +08:00
|
|
|
|
import com.engine.salary.mapper.InsuranceExportMapper;
|
2022-09-27 17:36:06 +08:00
|
|
|
|
import com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper;
|
2022-04-14 11:54:16 +08:00
|
|
|
|
import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper;
|
2022-04-12 19:29:19 +08:00
|
|
|
|
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
|
2022-04-15 13:17:25 +08:00
|
|
|
|
import com.engine.salary.mapper.siaccount.InsuranceAccountInspectMapper;
|
2022-12-07 17:09:53 +08:00
|
|
|
|
import com.engine.salary.mapper.siarchives.FundSchemeMapper;
|
2022-10-20 16:29:49 +08:00
|
|
|
|
import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
|
2022-12-07 17:09:53 +08:00
|
|
|
|
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
2022-04-27 16:21:24 +08:00
|
|
|
|
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
2023-04-18 14:21:05 +08:00
|
|
|
|
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
|
2022-09-27 17:36:06 +08:00
|
|
|
|
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
|
2022-09-15 16:14:34 +08:00
|
|
|
|
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
2022-09-06 17:13:33 +08:00
|
|
|
|
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
2022-06-08 17:52:10 +08:00
|
|
|
|
import com.engine.salary.service.*;
|
2022-09-15 16:14:34 +08:00
|
|
|
|
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
2022-09-27 10:19:09 +08:00
|
|
|
|
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
|
|
|
|
|
import com.engine.salary.sys.service.SalarySysConfService;
|
|
|
|
|
|
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
2022-04-12 19:29:19 +08:00
|
|
|
|
import com.engine.salary.util.SalaryDateUtil;
|
2022-12-19 17:26:44 +08:00
|
|
|
|
import com.engine.salary.util.SalaryEntityUtil;
|
2022-04-14 11:54:16 +08:00
|
|
|
|
import com.engine.salary.util.SalaryFormItemUtil;
|
2022-04-15 19:01:09 +08:00
|
|
|
|
import com.engine.salary.util.SalaryI18nUtil;
|
2022-04-12 19:29:19 +08:00
|
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
2022-09-02 11:53:38 +08:00
|
|
|
|
import com.engine.salary.util.excel.ExcelParseHelper;
|
|
|
|
|
|
import com.engine.salary.util.excel.ExcelSupport;
|
|
|
|
|
|
import com.engine.salary.util.excel.ExcelUtil;
|
2022-04-19 12:19:06 +08:00
|
|
|
|
import com.engine.salary.util.page.Column;
|
2022-04-11 19:07:35 +08:00
|
|
|
|
import com.engine.salary.util.page.PageInfo;
|
2022-05-25 13:10:03 +08:00
|
|
|
|
import com.engine.salary.util.page.SalaryPageUtil;
|
2022-04-14 11:54:16 +08:00
|
|
|
|
import com.engine.salary.util.valid.ValidUtil;
|
2022-04-27 14:36:05 +08:00
|
|
|
|
import com.google.common.collect.Lists;
|
2022-09-02 11:53:38 +08:00
|
|
|
|
import com.google.common.collect.Maps;
|
2022-09-30 10:55:46 +08:00
|
|
|
|
import dm.jdbc.util.IdGenerator;
|
2022-04-12 19:29:19 +08:00
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
2022-09-02 11:53:38 +08:00
|
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
|
|
|
import org.apache.poi.util.IOUtils;
|
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
|
|
import weaver.file.ImageFileManager;
|
|
|
|
|
|
import weaver.general.Util;
|
2022-04-12 10:24:21 +08:00
|
|
|
|
import weaver.hrm.User;
|
2022-04-11 19:07:35 +08:00
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
import java.io.InputStream;
|
2022-06-06 19:08:39 +08:00
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
import java.util.*;
|
2022-11-17 13:39:50 +08:00
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
|
|
import java.util.concurrent.Executors;
|
2022-09-14 14:36:05 +08:00
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
|
|
import java.util.regex.Pattern;
|
2022-06-06 19:08:39 +08:00
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
|
|
|
|
|
|
2022-04-11 19:07:35 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @Author weaver_cl
|
2022-07-13 11:45:16 +08:00
|
|
|
|
* @Description:
|
2022-04-11 19:07:35 +08:00
|
|
|
|
* @Date 2022/4/11
|
|
|
|
|
|
* @Version V1.0
|
|
|
|
|
|
**/
|
|
|
|
|
|
public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|
|
|
|
|
|
2022-06-08 17:52:10 +08:00
|
|
|
|
// private SIAccountBiz siAccountBiz = new SIAccountBiz();
|
2022-04-11 19:07:35 +08:00
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
|
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
|
|
|
|
|
|
2022-12-12 15:40:01 +08:00
|
|
|
|
private EncryptUtil encryptUtil = new EncryptUtil();
|
|
|
|
|
|
|
2022-04-12 10:24:21 +08:00
|
|
|
|
public RecordsBuildService getService(User user) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
return ServiceUtil.getService(RecordsBuildServiceImpl.class, user);
|
2022-04-12 10:24:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-06-08 17:52:10 +08:00
|
|
|
|
public SIAccountBiz getSiAccountBiz(User user) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
return ServiceUtil.getService(SIAccountBiz.class, user);
|
2022-06-08 17:52:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
|
public ColumnBuildService getColumnBuildService(User user) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
return ServiceUtil.getService(ColumnBuildServiceImpl.class, user);
|
2022-04-12 19:29:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-27 16:21:24 +08:00
|
|
|
|
public SICategoryService getSICategoryService(User user) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
return ServiceUtil.getService(SICategoryServiceImpl.class, user);
|
2022-04-27 16:21:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-06-08 17:52:10 +08:00
|
|
|
|
private TaxAgentService getTaxAgentService(User user) {
|
|
|
|
|
|
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
|
|
|
|
|
}
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
2022-08-02 14:58:18 +08:00
|
|
|
|
private InsuranceAccountBatchMapper getInsuranceAccountBatchMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private InsuranceAccountDetailMapper getInsuranceAccountDetailMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-27 17:36:06 +08:00
|
|
|
|
private ExcelInsuranceDetailMapper getExcelInsuranceDetailMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(ExcelInsuranceDetailMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
private SalaryItemService getSalaryItemService(User user) {
|
|
|
|
|
|
return (SalaryItemService) ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
private TaxAgentMapper getTaxAgentMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
SICategoryBiz siCategoryBiz = new SICategoryBiz();
|
|
|
|
|
|
|
2022-09-15 16:14:34 +08:00
|
|
|
|
private SalarySysConfMapper getSalarySysConfMapper() {
|
|
|
|
|
|
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-21 15:49:55 +08:00
|
|
|
|
private SalaryEmployeeService getSalaryEmployeeService(User user) {
|
|
|
|
|
|
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
2022-09-15 16:14:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-27 10:19:09 +08:00
|
|
|
|
private SalarySysConfService getSalarySysConfService(User user) {
|
|
|
|
|
|
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-27 17:36:06 +08:00
|
|
|
|
private InsuranceSchemeMapper getInsuranceSchemeMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-20 16:29:49 +08:00
|
|
|
|
private InsuranceBaseInfoMapper getInsuranceBaseInfoMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceBaseInfoMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-12-07 17:09:53 +08:00
|
|
|
|
private SocialSchemeMapper getSocialSchemeMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(SocialSchemeMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private FundSchemeMapper getFundSchemeMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(FundSchemeMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-19 17:59:12 +08:00
|
|
|
|
private TaxAgentBiz taxAgentBiz = new TaxAgentBiz();
|
|
|
|
|
|
|
2023-03-07 14:21:01 +08:00
|
|
|
|
private ICategoryMapper getICategoryMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(ICategoryMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private InsuranceAccountInspectMapper getInsuranceAccountInspectMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-04-18 14:21:05 +08:00
|
|
|
|
private InsuranceExportMapper getInsuranceExportMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceExportMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private InsuranceSchemeDetailMapper getInsuranceSchemeDetailMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-11 19:07:35 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> listPage(InsuranceAccountBatchParam queryParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
2022-04-11 19:07:35 +08:00
|
|
|
|
|
2022-06-09 18:31:36 +08:00
|
|
|
|
// 分权逻辑
|
2022-07-06 16:42:13 +08:00
|
|
|
|
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
2022-07-08 11:19:08 +08:00
|
|
|
|
if (needAuth) {
|
2022-06-09 18:31:36 +08:00
|
|
|
|
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
|
|
|
|
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
2022-07-08 11:19:08 +08:00
|
|
|
|
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
|
|
|
|
//防止普通用户查询
|
|
|
|
|
|
queryParam.setTaxAgents(Collections.singletonList(-1L));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
queryParam.setTaxAgents(taxAgents);
|
|
|
|
|
|
}
|
2022-06-09 18:31:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-11 19:07:35 +08:00
|
|
|
|
//福利台账列表
|
2022-07-05 19:19:17 +08:00
|
|
|
|
PageInfo<InsuranceAccountBatchPO> pageInfo = getSiAccountBiz(user).listPage(queryParam);
|
2022-04-11 19:07:35 +08:00
|
|
|
|
Collection<InsuranceAccountBatchPO> insuranceAccountBatchPOS = pageInfo.getList();
|
|
|
|
|
|
|
|
|
|
|
|
List<InsuranceAccountBatchListDTO> insuranceAccountBatchListDTOS = InsuranceAccountBO.buildAccountBatchDTOList(insuranceAccountBatchPOS);
|
2022-07-08 11:19:08 +08:00
|
|
|
|
PageInfo<InsuranceAccountBatchListDTO> pageInfos = new PageInfo<>(insuranceAccountBatchListDTOS, InsuranceAccountBatchListDTO.class);
|
2022-04-22 18:50:03 +08:00
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
2022-04-11 19:07:35 +08:00
|
|
|
|
pageInfos.setPageNum(queryParam.getCurrent());
|
|
|
|
|
|
pageInfos.setPageSize(queryParam.getPageSize());
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
|
List<Map<Integer, List<Permission>>> operatesPermission = new ArrayList<>();
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
2022-04-11 19:07:35 +08:00
|
|
|
|
SalaryWeaTable<InsuranceAccountBatchListDTO> table = new SalaryWeaTable<>(user, InsuranceAccountBatchListDTO.class);
|
2022-04-19 12:19:06 +08:00
|
|
|
|
List<Column> columns = pageInfos.getColumns();
|
|
|
|
|
|
List<WeaTableColumn> weaTableColumn = columns.stream().map(v -> new WeaTableColumn("100", v.getTitle(), v.getKey())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
table.setColumns(weaTableColumn);
|
2022-04-11 19:07:35 +08:00
|
|
|
|
|
|
|
|
|
|
//table.getColumns().get(0).setFixed("left");
|
2022-04-12 19:29:19 +08:00
|
|
|
|
// for (int i = 0; i < insuranceAccountBatchListDTOS.size(); i++) {
|
|
|
|
|
|
// InsuranceAccountBatchListDTO insuranceAccountBatchListDTO = insuranceAccountBatchListDTOS.get(i);
|
|
|
|
|
|
// if (Objects.equals(insuranceAccountBatchListDTO.getBillStatus(), BillStatusEnum.ARCHIVED.getDefaultLabel())) {
|
|
|
|
|
|
// table.getOperates().getOperate().get(i).getIndex();
|
|
|
|
|
|
//
|
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(0).setVisible(false);
|
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(1).setVisible(false);
|
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(2).setVisible(false);
|
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(3).setVisible(false);
|
|
|
|
|
|
// resultTable.getOperates().get(4).setOuter(true);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (Objects.equals(insuranceAccountBatchListDTO.getBillStatus(), BillStatusEnum.NOT_ARCHIVED.getDefaultLabel())) {
|
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(4).setVisible(false);
|
|
|
|
|
|
// List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = siAccountInspectService.listByBillMonth(insuranceAccountBatchListDTO.getBillMonth(), tenantKey);
|
|
|
|
|
|
// if (CollectionUtils.isEmpty(insuranceAccountInspectPOS)) {
|
|
|
|
|
|
// resultTable.getOperatesPermission().get(i).get(2).setVisible(false);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
2022-04-11 19:07:35 +08:00
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
|
|
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-07-08 11:19:08 +08:00
|
|
|
|
datas.put("operatesPermission", operatesPermission);
|
|
|
|
|
|
datas.put("dataKey", result.getResultMap());
|
2022-04-11 19:07:35 +08:00
|
|
|
|
return datas;
|
|
|
|
|
|
|
|
|
|
|
|
// WeaTable<InsuranceAccountBatchListDTO> resultTable = FormatManager.<InsuranceAccountBatchListDTO>getInstance()
|
|
|
|
|
|
// .genTable(InsuranceAccountBatchListDTO.class, insuranceAccountBatchListDTOPage);
|
|
|
|
|
|
//
|
|
|
|
|
|
// resultTable.getOperates().forEach(e -> {
|
|
|
|
|
|
// if (e.getIndex() == 0) {
|
|
|
|
|
|
// e.setOuter(true);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// });
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
2022-04-11 19:07:35 +08:00
|
|
|
|
// resultTable.setModule("hrmsalary");
|
|
|
|
|
|
// resultTable.getColumns().get(0).setFixed("left");
|
|
|
|
|
|
// return WeaResult.success(resultTable);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
2022-04-12 10:24:21 +08:00
|
|
|
|
public Map<String, Object> listCommonPage(InsuranceAccountDetailParam queryParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
2022-04-11 19:07:35 +08:00
|
|
|
|
|
2022-04-12 10:24:21 +08:00
|
|
|
|
//正常缴纳列表
|
2022-06-08 17:52:10 +08:00
|
|
|
|
PageInfo<InsuranceAccountDetailPO> pageInfo = getSiAccountBiz(user).listCommonPage(queryParam);
|
2022-04-12 10:24:21 +08:00
|
|
|
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
|
|
|
|
|
|
|
|
|
|
|
|
//数据组装
|
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
|
2022-04-15 19:01:09 +08:00
|
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
|
2022-04-22 18:50:03 +08:00
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
2022-04-12 19:29:19 +08:00
|
|
|
|
pageInfos.setPageNum(queryParam.getCurrent());
|
|
|
|
|
|
pageInfos.setPageSize(queryParam.getPageSize());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//动态列组装
|
2022-11-16 15:45:36 +08:00
|
|
|
|
List<WeaTableColumn> weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, queryParam.getPaymentStatus());
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
2022-04-19 13:31:46 +08:00
|
|
|
|
WeaTable table = new WeaTable();
|
2022-04-19 17:46:24 +08:00
|
|
|
|
table.setPageUID(UUID.randomUUID().toString());
|
2022-04-12 19:29:19 +08:00
|
|
|
|
table.setColumns(weaTableColumn);
|
2022-04-19 12:19:06 +08:00
|
|
|
|
List<Column> columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList());
|
|
|
|
|
|
pageInfos.setColumns(columns);
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
|
|
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-04-19 17:46:24 +08:00
|
|
|
|
//datas.put("dataKey",result.getResultMap());
|
2022-04-12 19:29:19 +08:00
|
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> listCommonPageByName(InsuranceAccountDetailParam queryParam) {
|
|
|
|
|
|
//增加查询参数userName
|
|
|
|
|
|
if (StringUtils.isNotBlank(queryParam.getUserName())) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
queryParam.setUserName(queryParam.getUserName());
|
2022-04-12 19:29:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
return listCommonPage(queryParam);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> listSupplementaryPage(InsuranceAccountDetailParam queryParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
2023-04-17 10:27:31 +08:00
|
|
|
|
// //过滤出福利档案基础信息表中runStatus为正在缴纳和待减员的人员
|
|
|
|
|
|
// List<InsuranceArchivesBaseInfoPO> baseInfoPOList = getInsuranceBaseInfoMapper().listAll();
|
|
|
|
|
|
// List<Long> canAccountIds = baseInfoPOList.stream()
|
|
|
|
|
|
// .filter(f->f.getPaymentOrganization().toString().equals(queryParam.getPaymentOrganization())
|
|
|
|
|
|
// && (f.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue()) || f.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())))
|
|
|
|
|
|
// .map(InsuranceArchivesBaseInfoPO::getEmployeeId)
|
|
|
|
|
|
// .collect(Collectors.toList());
|
|
|
|
|
|
// queryParam.setEmployeeIds(canAccountIds);
|
2022-10-20 17:33:29 +08:00
|
|
|
|
|
2022-04-15 19:01:09 +08:00
|
|
|
|
//补缴缴纳列表
|
2022-04-12 19:29:19 +08:00
|
|
|
|
queryParam.setPaymentStatus(PaymentStatusEnum.REPAIR.getValue());
|
2022-09-27 10:19:09 +08:00
|
|
|
|
|
|
|
|
|
|
//排序配置
|
|
|
|
|
|
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
|
|
|
|
|
queryParam.setOrderRule(orderRule);
|
|
|
|
|
|
|
2022-08-02 14:58:18 +08:00
|
|
|
|
List<InsuranceAccountDetailPO> list = getInsuranceAccountDetailMapper().list(queryParam);
|
2022-12-12 10:25:55 +08:00
|
|
|
|
PageInfo<InsuranceAccountDetailPO> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(),queryParam.getPageSize(),
|
|
|
|
|
|
list, InsuranceAccountDetailPO.class);
|
2022-04-12 19:29:19 +08:00
|
|
|
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
|
2022-12-12 17:56:26 +08:00
|
|
|
|
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class);
|
2022-04-12 19:29:19 +08:00
|
|
|
|
//数据组装
|
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
|
2022-04-19 12:19:06 +08:00
|
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
|
2022-04-22 18:50:03 +08:00
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
2022-04-12 19:29:19 +08:00
|
|
|
|
pageInfos.setPageNum(queryParam.getCurrent());
|
|
|
|
|
|
pageInfos.setPageSize(queryParam.getPageSize());
|
2022-04-12 10:24:21 +08:00
|
|
|
|
|
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
|
//动态列组装
|
2022-11-16 15:45:36 +08:00
|
|
|
|
List<WeaTableColumn> weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, queryParam.getPaymentStatus());
|
2022-04-12 10:24:21 +08:00
|
|
|
|
|
2022-04-19 12:19:06 +08:00
|
|
|
|
SalaryWeaTable<InsuranceAccountDetailPO> table = new SalaryWeaTable<>(user, InsuranceAccountDetailPO.class);
|
2022-04-12 19:29:19 +08:00
|
|
|
|
table.setColumns(weaTableColumn);
|
2022-04-19 17:46:24 +08:00
|
|
|
|
List<Column> columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList());
|
|
|
|
|
|
pageInfos.setColumns(columns);
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
|
|
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-04-19 17:46:24 +08:00
|
|
|
|
//datas.put("dataKey",result.getResultMap());
|
2022-04-12 10:24:21 +08:00
|
|
|
|
return datas;
|
2022-04-11 19:07:35 +08:00
|
|
|
|
}
|
2022-04-12 10:24:21 +08:00
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> supplementaryByNameList(InsuranceAccountDetailParam queryParam) {
|
|
|
|
|
|
//增加查询参数userName
|
|
|
|
|
|
if (StringUtils.isNotBlank(queryParam.getUserName())) {
|
2022-04-19 17:46:24 +08:00
|
|
|
|
queryParam.setUserName(queryParam.getUserName());
|
2022-04-12 19:29:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
return listSupplementaryPage(queryParam);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-16 15:45:36 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> listRecessionPage(InsuranceAccountDetailParam queryParam) {
|
|
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
// 分权逻辑
|
|
|
|
|
|
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
|
|
|
|
|
if (needAuth) {
|
|
|
|
|
|
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
|
|
|
|
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
|
|
|
|
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
|
|
|
|
//防止普通用户查询
|
|
|
|
|
|
queryParam.setTaxAgents(Collections.singletonList(-1L));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
queryParam.setTaxAgents(taxAgents);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-22 09:46:37 +08:00
|
|
|
|
//退差列表
|
2022-11-16 15:45:36 +08:00
|
|
|
|
queryParam.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
//排序配置
|
|
|
|
|
|
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
|
|
|
|
|
queryParam.setOrderRule(orderRule);
|
|
|
|
|
|
|
|
|
|
|
|
List<InsuranceAccountDetailPO> list = getInsuranceAccountDetailMapper().list(queryParam);
|
2022-12-12 10:25:55 +08:00
|
|
|
|
PageInfo<InsuranceAccountDetailPO> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(),queryParam.getPageSize(),
|
|
|
|
|
|
list, InsuranceAccountDetailPO.class);
|
2022-11-16 15:45:36 +08:00
|
|
|
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
|
2022-12-12 17:56:26 +08:00
|
|
|
|
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class);
|
2022-12-09 14:50:29 +08:00
|
|
|
|
//数据组装
|
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
|
|
|
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
|
|
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
|
|
|
|
|
pageInfos.setPageNum(queryParam.getCurrent());
|
|
|
|
|
|
pageInfos.setPageSize(queryParam.getPageSize());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//动态列组装
|
|
|
|
|
|
List<WeaTableColumn> weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, queryParam.getPaymentStatus());
|
|
|
|
|
|
|
|
|
|
|
|
SalaryWeaTable<InsuranceAccountDetailPO> table = new SalaryWeaTable<>(user, InsuranceAccountDetailPO.class);
|
|
|
|
|
|
table.setColumns(weaTableColumn);
|
|
|
|
|
|
List<Column> columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList());
|
|
|
|
|
|
pageInfos.setColumns(columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
|
|
|
|
|
datas.put("pageInfo", pageInfos);
|
|
|
|
|
|
//datas.put("dataKey",result.getResultMap());
|
|
|
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> listBalancePage(InsuranceAccountDetailParam queryParam) {
|
|
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
// 分权逻辑
|
|
|
|
|
|
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
|
|
|
|
|
if (needAuth) {
|
|
|
|
|
|
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
|
|
|
|
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
|
|
|
|
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
|
|
|
|
//防止普通用户查询
|
|
|
|
|
|
queryParam.setTaxAgents(Collections.singletonList(-1L));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
queryParam.setTaxAgents(taxAgents);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//补差列表
|
|
|
|
|
|
queryParam.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
//排序配置
|
|
|
|
|
|
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
|
|
|
|
|
queryParam.setOrderRule(orderRule);
|
|
|
|
|
|
|
|
|
|
|
|
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
|
|
|
|
|
List<InsuranceAccountDetailPO> list = getInsuranceAccountDetailMapper().list(queryParam);
|
|
|
|
|
|
PageInfo<InsuranceAccountDetailPO> pageInfo = new PageInfo<>(list, InsuranceAccountDetailPO.class);
|
|
|
|
|
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
|
2022-12-15 17:11:38 +08:00
|
|
|
|
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class);
|
2022-11-16 15:45:36 +08:00
|
|
|
|
//数据组装
|
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
|
|
|
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
|
|
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
|
|
|
|
|
pageInfos.setPageNum(queryParam.getCurrent());
|
|
|
|
|
|
pageInfos.setPageSize(queryParam.getPageSize());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//动态列组装
|
|
|
|
|
|
List<WeaTableColumn> weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, queryParam.getPaymentStatus());
|
|
|
|
|
|
|
|
|
|
|
|
SalaryWeaTable<InsuranceAccountDetailPO> table = new SalaryWeaTable<>(user, InsuranceAccountDetailPO.class);
|
|
|
|
|
|
table.setColumns(weaTableColumn);
|
|
|
|
|
|
List<Column> columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList());
|
|
|
|
|
|
pageInfos.setColumns(columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
|
|
|
|
|
datas.put("pageInfo", pageInfos);
|
|
|
|
|
|
//datas.put("dataKey",result.getResultMap());
|
|
|
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> getForm(Map<String, Object> params) {
|
2022-04-14 11:54:16 +08:00
|
|
|
|
Map<String, Object> apidatas = new HashMap<>();
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
|
|
|
|
|
//条件组
|
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
2022-04-20 19:12:01 +08:00
|
|
|
|
SearchConditionItem datePickerItem = SalaryFormItemUtil.datePickerItem(user, 2, 16, true, 2, "账单月份", "billMonth");
|
2022-04-14 11:54:16 +08:00
|
|
|
|
String minDate = SalaryDateUtil.getYearMonth(-1, 0);
|
|
|
|
|
|
String maxDate = SalaryDateUtil.getYearMonth(0, 6);
|
2022-04-20 19:12:01 +08:00
|
|
|
|
datePickerItem.setOtherParams(new HashMap<>());
|
2022-07-08 11:19:08 +08:00
|
|
|
|
datePickerItem.getOtherParams().put("minDate", minDate);
|
|
|
|
|
|
datePickerItem.getOtherParams().put("maxDate", maxDate);
|
2022-04-14 11:54:16 +08:00
|
|
|
|
|
2022-08-02 14:58:18 +08:00
|
|
|
|
List<InsuranceAccountBatchPO> billMonthList = getInsuranceAccountBatchMapper().listByTimeRange(minDate, maxDate);
|
2022-12-12 15:40:01 +08:00
|
|
|
|
encryptUtil.decryptList(billMonthList, InsuranceAccountBatchPO.class);
|
2022-04-14 11:54:16 +08:00
|
|
|
|
if (CollectionUtils.isEmpty(billMonthList)) {
|
|
|
|
|
|
datePickerItem.getOtherParams().put("disabledData", Collections.emptyList());
|
|
|
|
|
|
} else {
|
|
|
|
|
|
datePickerItem.getOtherParams().put("disabledData", billMonthList.stream().map(InsuranceAccountBatchPO::getBillMonth).collect(Collectors.toList()));
|
|
|
|
|
|
}
|
|
|
|
|
|
datePickerItem.getOtherParams().put("type", "month");
|
|
|
|
|
|
datePickerItem.getOtherParams().put("format", "YYYY-MM");
|
|
|
|
|
|
datePickerItem.getOtherParams().put("showFormat", "YYYY-MM");
|
|
|
|
|
|
conditionItems.add(datePickerItem);
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
2022-04-20 19:12:01 +08:00
|
|
|
|
SearchConditionItem textareaItem = SalaryFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "备注", "remarks");
|
2022-04-14 11:54:16 +08:00
|
|
|
|
conditionItems.add(textareaItem);
|
2022-07-08 11:19:08 +08:00
|
|
|
|
addGroups.add(new SearchConditionGroup("常用条件", true, conditionItems));
|
2022-04-14 11:54:16 +08:00
|
|
|
|
|
|
|
|
|
|
apidatas.put("billMonth", SalaryDateUtil.getYearMonth(0, 0));
|
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
|
apidatas.put("condition", addGroups);
|
2022-04-14 11:54:16 +08:00
|
|
|
|
|
|
|
|
|
|
return apidatas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
2022-11-23 15:01:28 +08:00
|
|
|
|
public String save(AccountParam param) {
|
2022-07-05 19:19:17 +08:00
|
|
|
|
ValidUtil.doValidator(param);
|
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-15 13:17:25 +08:00
|
|
|
|
String lastName = user.getLastname();
|
2022-11-23 15:01:28 +08:00
|
|
|
|
return getSiAccountBiz(user).save(param.isFlag(), param, employeeId, lastName);
|
2022-04-15 13:17:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void commonAccount(SaveCommonAccountParam param) {
|
|
|
|
|
|
ValidUtil.doValidator(param);
|
2022-07-05 19:19:17 +08:00
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-22 15:17:31 +08:00
|
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
|
getSiAccountBiz(user).saveCommonAccount(param, employeeId, currentUserName);
|
2022-04-15 13:17:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void delete(AccountParam accountParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
|
getSiAccountBiz(user).delete(accountParam, employeeId);
|
2022-04-15 13:17:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void saveCommonAccount(SaveCommonAccountParam accountParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-22 15:17:31 +08:00
|
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
|
getSiAccountBiz(user).saveCommonAccount(accountParam, employeeId, currentUserName);
|
2022-04-15 13:17:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void saveSupplementaryAccount(SaveSupplementaryAccountParam saveSupplementaryAccountParam) {
|
2022-06-28 18:21:44 +08:00
|
|
|
|
ValidUtil.doValidator(saveSupplementaryAccountParam);
|
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-22 15:17:31 +08:00
|
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
|
getSiAccountBiz(user).saveSupplementaryAccount(saveSupplementaryAccountParam, employeeId, currentUserName);
|
2022-04-15 13:17:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void deleteCommonAccount(SaveCommonAccountParam param) {
|
2022-06-06 19:08:39 +08:00
|
|
|
|
ValidUtil.doValidator(param);
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-22 15:17:31 +08:00
|
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
|
getSiAccountBiz(user).deleteCommonAccount(param, employeeId, currentUserName);
|
2022-04-15 13:17:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void deleteSummplementaryAccount(List<SupplementAccountBaseParam> supplementAccountBaseParams) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-22 15:17:31 +08:00
|
|
|
|
String currentUserName = user.getLastname();
|
2022-07-08 11:19:08 +08:00
|
|
|
|
getSiAccountBiz(user).deleteSupplementaryAccount(supplementAccountBaseParams, employeeId, currentUserName);
|
2022-04-15 13:17:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void file(AccountParam accountParam) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-15 13:17:25 +08:00
|
|
|
|
String billMonth = accountParam.getBillMonth();
|
2022-07-08 11:19:08 +08:00
|
|
|
|
getSiAccountBiz(user).file(billMonth, employeeId, accountParam.getPaymentOrganization());
|
2022-04-15 13:17:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void unconfirmed(Collection<Long> ids) {
|
2023-03-07 14:21:01 +08:00
|
|
|
|
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByInspectStatusAndIds(InspectStatusEnum.COMFORED.getValue(), ids);
|
2022-04-15 13:17:25 +08:00
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(insuranceAccountInspectPOS)) {
|
2022-08-02 14:58:18 +08:00
|
|
|
|
getInsuranceAccountDetailMapper().batchUnConfirmedInspectDetails(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getId).collect(Collectors.toList()));
|
2022-04-15 13:17:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Boolean> buttonCheck(String billMonth) {
|
|
|
|
|
|
Map<String, Boolean> result = new HashMap<>();
|
2023-03-07 14:21:01 +08:00
|
|
|
|
List<InsuranceAccountInspectPO> list = getInsuranceAccountInspectMapper().getByInspectStatusAndBillMonth(InspectStatusEnum.IGNORE.getValue(), billMonth);
|
2022-04-15 13:17:25 +08:00
|
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
|
|
|
result.put("displayFlag", false);
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
result.put("displayFlag", true);
|
|
|
|
|
|
return result;
|
2022-04-12 19:29:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-15 19:01:09 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public void ignore(Collection<Long> ids) {
|
2023-03-07 14:21:01 +08:00
|
|
|
|
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByInspectStatusAndIds(InspectStatusEnum.IGNORE.getValue(), ids);
|
2022-04-15 19:01:09 +08:00
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(insuranceAccountInspectPOS)) {
|
2022-08-02 14:58:18 +08:00
|
|
|
|
getInsuranceAccountDetailMapper().batchIgnoreInspectDetails(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getId).collect(Collectors.toList()));
|
2022-04-15 19:01:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
2022-06-06 19:08:39 +08:00
|
|
|
|
public InsuranceAccountTabDTO tabList(AccountParam build) {
|
2022-04-15 19:01:09 +08:00
|
|
|
|
InsuranceAccountTabDTO insuranceAccountTabDTO = InsuranceAccountTabDTO.builder().build();
|
2022-08-02 14:58:18 +08:00
|
|
|
|
InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(build.getBillMonth(), build.getPaymentOrganization());
|
2022-12-12 15:40:01 +08:00
|
|
|
|
insuranceAccountBatchPO = encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class);
|
2022-04-15 19:01:09 +08:00
|
|
|
|
boolean isShow = false;
|
|
|
|
|
|
if (insuranceAccountBatchPO == null || insuranceAccountBatchPO.getBillStatus() == BillStatusEnum.NOT_ARCHIVED.getValue()) {
|
|
|
|
|
|
isShow = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (insuranceAccountBatchPO != null) {
|
|
|
|
|
|
insuranceAccountTabDTO.setRemarks(insuranceAccountBatchPO.getRemarks());
|
|
|
|
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> tabList = new ArrayList<>();
|
|
|
|
|
|
Map<String, Object> common = new HashMap<>();
|
|
|
|
|
|
common.put("id", "1");
|
2022-07-08 11:19:08 +08:00
|
|
|
|
common.put("content", SalaryI18nUtil.getI18nLabel(92265, "正常缴纳"));
|
2022-04-15 19:01:09 +08:00
|
|
|
|
tabList.add(common);
|
|
|
|
|
|
if (isShow) {
|
|
|
|
|
|
Map<String, Object> change = new HashMap<>();
|
|
|
|
|
|
change.put("id", "2");
|
2022-07-08 11:19:08 +08:00
|
|
|
|
change.put("content", SalaryI18nUtil.getI18nLabel(100509, "异动清单"));
|
2022-04-15 19:01:09 +08:00
|
|
|
|
tabList.add(change);
|
|
|
|
|
|
}
|
|
|
|
|
|
Map<String, Object> repair = new HashMap<>();
|
|
|
|
|
|
repair.put("id", "3");
|
|
|
|
|
|
repair.put("content", SalaryI18nUtil.getI18nLabel(92267, "补缴"));
|
|
|
|
|
|
tabList.add(repair);
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> overView = new HashMap<>();
|
|
|
|
|
|
overView.put("id", "4");
|
2022-07-08 11:19:08 +08:00
|
|
|
|
overView.put("content", SalaryI18nUtil.getI18nLabel(99927, "总览"));
|
2022-04-15 19:01:09 +08:00
|
|
|
|
tabList.add(overView);
|
2022-11-22 13:35:09 +08:00
|
|
|
|
|
|
|
|
|
|
Map<String, Object> recession = new HashMap<>();
|
|
|
|
|
|
recession.put("id", "5");
|
|
|
|
|
|
recession.put("content", SalaryI18nUtil.getI18nLabel(92270, "退差"));
|
|
|
|
|
|
tabList.add(recession);
|
|
|
|
|
|
|
2022-12-16 11:13:28 +08:00
|
|
|
|
Map<String, Object> balance = new HashMap<>();
|
|
|
|
|
|
balance.put("id", "6");
|
|
|
|
|
|
balance.put("content", SalaryI18nUtil.getI18nLabel(92271, "补差"));
|
|
|
|
|
|
tabList.add(balance);
|
|
|
|
|
|
|
2022-04-15 19:01:09 +08:00
|
|
|
|
insuranceAccountTabDTO.setTabList(tabList);
|
|
|
|
|
|
insuranceAccountTabDTO.setShow(isShow);
|
2022-06-06 19:08:39 +08:00
|
|
|
|
insuranceAccountTabDTO.setBillMonth(build.getBillMonth());
|
2022-04-15 19:01:09 +08:00
|
|
|
|
return insuranceAccountTabDTO;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> changeList(InsuranceAccountDetailParam param) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
|
Long employeeId = (long) user.getUID();
|
2022-08-02 14:58:18 +08:00
|
|
|
|
List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS = getInsuranceAccountDetailMapper().changeList(param.getUserName());
|
2022-12-12 10:25:55 +08:00
|
|
|
|
PageInfo<InsuranceArchivesEmployeePO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(),
|
|
|
|
|
|
insuranceArchivesEmployeePOS, InsuranceArchivesEmployeePO.class);
|
2022-04-22 18:50:03 +08:00
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
|
List<Map<String, Object>> records = siArchivesBiz.buildTableData(insuranceArchivesEmployeePOS);
|
|
|
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
|
2022-04-22 18:50:03 +08:00
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
2022-04-16 16:43:33 +08:00
|
|
|
|
pageInfos.setPageNum(param.getCurrent());
|
|
|
|
|
|
pageInfos.setPageSize(param.getPageSize());
|
|
|
|
|
|
|
|
|
|
|
|
List<WeaTableColumn> weaTableColumns = siArchivesBiz.buildWeaTableColumns(insuranceArchivesEmployeePOS, employeeId);
|
|
|
|
|
|
|
|
|
|
|
|
WeaTable table = new WeaTable();
|
|
|
|
|
|
table.setPageUID(UUID.randomUUID().toString());
|
|
|
|
|
|
table.setColumns(weaTableColumns);
|
|
|
|
|
|
table.setTableType(WeaTableType.CHECKBOX);
|
|
|
|
|
|
WeaTableOperates weaTableOperates = new WeaTableOperates();
|
|
|
|
|
|
WeaTableOperate weaTableOperate = new WeaTableOperate();
|
|
|
|
|
|
weaTableOperate.setIndex("0");
|
|
|
|
|
|
weaTableOperate.setText("移除");
|
|
|
|
|
|
WeaTableOperate weaTableOperate1 = new WeaTableOperate();
|
|
|
|
|
|
weaTableOperate1.setIndex("1");
|
|
|
|
|
|
weaTableOperate1.setText("添加");
|
|
|
|
|
|
table.setOperates(weaTableOperates);
|
|
|
|
|
|
|
|
|
|
|
|
List<List<Permission>> permissions = new ArrayList<>();
|
|
|
|
|
|
for (int i = 0; i < records.size(); i++) {
|
|
|
|
|
|
List<Permission> permission = new ArrayList<>();
|
2022-07-27 16:56:13 +08:00
|
|
|
|
if (UserStatusEnum.DEPARTURE.getDefaultLabel().equals(records.get(i).get("status"))) {
|
2022-04-16 16:43:33 +08:00
|
|
|
|
permission.add(new Permission(true, false));
|
|
|
|
|
|
permission.add(new Permission(false, false));
|
|
|
|
|
|
permissions.add(permission);
|
|
|
|
|
|
}
|
2022-07-27 16:56:13 +08:00
|
|
|
|
if (UserStatusEnum.DEPARTURE.getDefaultLabel().equals(records.get(i).get("status"))) {
|
2022-04-16 16:43:33 +08:00
|
|
|
|
permission.add(new Permission(false, false));
|
|
|
|
|
|
permission.add(new Permission(true, false));
|
|
|
|
|
|
permissions.add(permission);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
|
datas.put("permissions", permissions);
|
2022-04-16 16:43:33 +08:00
|
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-07-08 11:19:08 +08:00
|
|
|
|
datas.put("dataKey", result.getResultMap());
|
2022-04-16 16:43:33 +08:00
|
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void accountInspect(InspectAccountParam param) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Long employeeId = (long) user.getUID();
|
2022-04-16 16:43:33 +08:00
|
|
|
|
ValidUtil.doValidator(param);
|
2022-04-22 15:17:31 +08:00
|
|
|
|
String currentUserName = user.getLastname();
|
2022-10-28 15:25:58 +08:00
|
|
|
|
getSiAccountBiz(user).accountInspect(param.getIds(), param.getBillMonth(), employeeId, currentUserName, param.getPaymentOrganization());
|
2022-04-16 16:43:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> getInspectTable(InsuranceAccountDetailParam param) {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
2022-04-16 16:43:33 +08:00
|
|
|
|
|
2023-03-07 14:21:01 +08:00
|
|
|
|
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByBillMonth(param.getBillMonth());
|
2022-10-28 15:25:58 +08:00
|
|
|
|
List<Map<String, Object>> records = getService(user).buildInspectRecords(insuranceAccountInspectPOS, Long.valueOf(param.getPaymentOrganization()));
|
2022-12-12 10:25:55 +08:00
|
|
|
|
List<Map<String, Object>> paged = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), records);
|
|
|
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(paged);
|
2022-04-16 16:43:33 +08:00
|
|
|
|
pageInfos.setTotal(records.size());
|
|
|
|
|
|
pageInfos.setPageNum(param.getCurrent());
|
|
|
|
|
|
pageInfos.setPageSize(param.getPageSize());
|
|
|
|
|
|
|
2022-10-28 15:25:58 +08:00
|
|
|
|
List<WeaTableColumn> weaTableColumns = getColumnBuildService(user).buildInspectColumns(insuranceAccountInspectPOS, Long.valueOf(param.getPaymentOrganization()));
|
2022-04-16 16:43:33 +08:00
|
|
|
|
WeaTable table = new WeaTable();
|
|
|
|
|
|
table.setPageUID(UUID.randomUUID().toString());
|
|
|
|
|
|
table.setColumns(weaTableColumns);
|
|
|
|
|
|
table.setTableType(WeaTableType.CHECKBOX);
|
|
|
|
|
|
WeaTableOperates weaTableOperates = new WeaTableOperates();
|
|
|
|
|
|
WeaTableOperate weaTableOperate = new WeaTableOperate();
|
|
|
|
|
|
weaTableOperate.setIndex("0");
|
|
|
|
|
|
weaTableOperate.setText("忽略");
|
|
|
|
|
|
WeaTableOperate weaTableOperate1 = new WeaTableOperate();
|
|
|
|
|
|
weaTableOperate1.setIndex("1");
|
|
|
|
|
|
weaTableOperate1.setText("重置");
|
|
|
|
|
|
table.setOperates(weaTableOperates);
|
|
|
|
|
|
|
|
|
|
|
|
List<List<Permission>> permissions = new ArrayList<>();
|
|
|
|
|
|
for (int i = 0; i < records.size(); i++) {
|
|
|
|
|
|
List<Permission> permission = new ArrayList<>();
|
|
|
|
|
|
Permission permissionCheckBox = new Permission();
|
|
|
|
|
|
if (InspectStatusEnum.IGNORE.getValue() == records.get(i).get("inspectStatus")) {
|
|
|
|
|
|
permissionCheckBox.setVisible(true);
|
|
|
|
|
|
permissionCheckBox.setDisabled(false);
|
|
|
|
|
|
permission.add(new Permission(true, false));
|
|
|
|
|
|
permission.add(new Permission(false, true));
|
|
|
|
|
|
permissions.add(permission);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (InspectStatusEnum.COMFORED.getValue() == records.get(i).get("inspectStatus")) {
|
|
|
|
|
|
permissionCheckBox.setVisible(true);
|
|
|
|
|
|
permissionCheckBox.setDisabled(true);
|
|
|
|
|
|
permission.add(new Permission(false, true));
|
|
|
|
|
|
permission.add(new Permission(true, false));
|
|
|
|
|
|
permissions.add(permission);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
|
datas.put("permissions", permissions);
|
2022-04-16 16:43:33 +08:00
|
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-07-08 11:19:08 +08:00
|
|
|
|
datas.put("dataKey", result.getResultMap());
|
2022-04-16 16:43:33 +08:00
|
|
|
|
|
|
|
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-18 20:24:43 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> getCommonForm(Map<String, Object> params) {
|
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
//条件组
|
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
|
|
List<SearchConditionItem> conditionItem = new ArrayList<>();
|
|
|
|
|
|
|
2022-04-22 16:42:06 +08:00
|
|
|
|
SearchConditionItem includes = SalaryFormItemUtil.browserItem(user, 18, 12, 2, true, "对象", "required", "17", "includes");
|
2022-04-18 20:24:43 +08:00
|
|
|
|
conditionItems.add(includes);
|
2022-04-22 16:42:06 +08:00
|
|
|
|
SearchConditionItem excludes = SalaryFormItemUtil.browserItem(user, 18, 12, 2, true, "选择人员", "required", "17", "excludes");
|
2022-04-18 20:24:43 +08:00
|
|
|
|
conditionItem.add(excludes);
|
2022-07-08 11:19:08 +08:00
|
|
|
|
addGroups.add(new SearchConditionGroup("人员范围", true, conditionItems));
|
|
|
|
|
|
addGroups.add(new SearchConditionGroup("人员范围排除", true, conditionItem));
|
2022-04-18 20:24:43 +08:00
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
|
apidatas.put("condition", addGroups);
|
2022-04-18 20:24:43 +08:00
|
|
|
|
return apidatas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> getSupplementaryForm(Map<String, Object> params) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
//条件组
|
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
|
List<SearchConditionItem> condition = new ArrayList<>();
|
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
|
|
List<SearchConditionItem> conditionItem = new ArrayList<>();
|
|
|
|
|
|
|
2022-09-22 14:25:50 +08:00
|
|
|
|
SearchConditionItem billMonthList = SalaryFormItemUtil.datePickerItem(user, 2, 16, true, 2, "补缴月份", "billMonth");
|
2022-04-18 20:24:43 +08:00
|
|
|
|
billMonthList.setMultiple(true);
|
2022-04-20 19:12:01 +08:00
|
|
|
|
billMonthList.setOtherParams(new HashMap<>());
|
2022-04-18 20:24:43 +08:00
|
|
|
|
billMonthList.getOtherParams().put("type", "months");
|
|
|
|
|
|
billMonthList.getOtherParams().put("format", "YYYY-MM");
|
|
|
|
|
|
billMonthList.getOtherParams().put("showFormat", "YYYY-MM");
|
|
|
|
|
|
billMonthList.setMultiple(true);
|
2022-09-22 14:25:50 +08:00
|
|
|
|
billMonthList.setViewAttr(3);
|
|
|
|
|
|
billMonthList.setRules("required");
|
2022-04-18 20:24:43 +08:00
|
|
|
|
condition.add(billMonthList);
|
|
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
|
SearchConditionItem billProjects = SalaryFormItemUtil.selectItem(user, buildBillProjectsOptions(), 2, 16, 6, true, "补缴项目", "projects");
|
2022-09-22 14:25:50 +08:00
|
|
|
|
billProjects.setViewAttr(3);
|
2022-05-26 11:00:38 +08:00
|
|
|
|
billProjects.setDetailtype(2);
|
2022-09-22 14:25:50 +08:00
|
|
|
|
billProjects.setRules("required");
|
2022-04-18 20:24:43 +08:00
|
|
|
|
condition.add(billProjects);
|
|
|
|
|
|
|
2022-04-22 15:17:31 +08:00
|
|
|
|
SearchConditionItem includes = SalaryFormItemUtil.browserItem(user, 18, 6, 3, true, "对象", "required", "17", "includes");
|
2022-04-18 20:24:43 +08:00
|
|
|
|
conditionItems.add(includes);
|
2022-05-26 11:00:38 +08:00
|
|
|
|
// SearchConditionItem excludes = SalaryFormItemUtil.browserItem(user, 18, 6, 2, true, "选择人员", "required", "17", "excludes");
|
|
|
|
|
|
// excludes.setViewAttr(2);
|
|
|
|
|
|
// conditionItem.add(excludes);
|
2022-07-08 11:19:08 +08:00
|
|
|
|
addGroups.add(new SearchConditionGroup("基础信息", true, condition));
|
|
|
|
|
|
addGroups.add(new SearchConditionGroup("人员范围", true, conditionItems));
|
2022-05-26 11:00:38 +08:00
|
|
|
|
// addGroups.add(new SearchConditionGroup("人员范围排除",true,conditionItem));
|
2022-04-18 20:24:43 +08:00
|
|
|
|
|
2022-07-08 11:19:08 +08:00
|
|
|
|
apidatas.put("condition", addGroups);
|
2022-04-18 20:24:43 +08:00
|
|
|
|
return apidatas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public PageInfo<InsuranceAccountViewListDTO> overView(InsuranceAccountDetailParam queryParam) {
|
2022-06-08 17:52:10 +08:00
|
|
|
|
PageInfo<InsuranceAccountViewListDTO> pageInfos = getSiAccountBiz(user).overView(queryParam);
|
2022-04-18 20:24:43 +08:00
|
|
|
|
return pageInfos;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
|
@Override
|
2022-07-08 11:19:08 +08:00
|
|
|
|
public List<Map<String, Object>> welfareData(String billMonth, List<Long> employeeIds, Long taxAgentId) {
|
2022-08-02 14:58:18 +08:00
|
|
|
|
InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, taxAgentId);
|
2022-12-12 15:40:01 +08:00
|
|
|
|
insuranceAccountBatchPO = encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class);
|
2022-04-27 14:36:05 +08:00
|
|
|
|
if (insuranceAccountBatchPO == null || Objects.equals(BillStatusEnum.NOT_ARCHIVED.getValue(), insuranceAccountBatchPO.getBillStatus())) {
|
|
|
|
|
|
return Lists.newArrayList();
|
|
|
|
|
|
}
|
2023-07-10 10:26:08 +08:00
|
|
|
|
// List<InsuranceAccountDetailPO> list = queryList(billMonth, taxAgentId, employeeIds);
|
|
|
|
|
|
//20230707增加福利核算明细中的缴纳状态+合计的数据项
|
|
|
|
|
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().queryList(billMonth, taxAgentId, employeeIds);
|
|
|
|
|
|
//退差数据不参与薪资核算
|
|
|
|
|
|
insuranceAccountDetailPOS = insuranceAccountDetailPOS.stream()
|
|
|
|
|
|
.filter(f -> f.getPaymentStatus().equals(PaymentStatusEnum.COMMON.getValue())
|
|
|
|
|
|
|| f.getPaymentStatus().equals(PaymentStatusEnum.REPAIR.getValue())
|
|
|
|
|
|
|| f.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue()) )
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
List<InsuranceAccountDetailPO> list = buildNewInsuranceDetailPOS(insuranceAccountDetailPOS);
|
|
|
|
|
|
Map<String, InsuranceAccountDetailPO> siAcctResultWithEmpAndPayStatus = insuranceAccountDetailPOS.stream()
|
|
|
|
|
|
.collect(Collectors.toMap(po -> po.getEmployeeId() + "_" + po.getPaymentStatus(), a -> a, (a, b) -> a));
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
|
List<Map<String, Object>> result = new ArrayList<>();
|
|
|
|
|
|
list.stream().forEach(item -> {
|
|
|
|
|
|
Map<String, Object> record = new HashMap<>();
|
|
|
|
|
|
record.put("employeeId", item.getEmployeeId());
|
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getSocialPerJson())) {
|
|
|
|
|
|
Map<String, Object> socialJson = JSON.parseObject(item.getSocialPerJson(), new HashMap<String, Object>().getClass());
|
|
|
|
|
|
socialJson.forEach((k, v) -> {
|
|
|
|
|
|
record.put(k + "socialPer", v);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getSocialComJson())) {
|
|
|
|
|
|
Map<String, Object> socialJson = JSON.parseObject(item.getSocialComJson(), new HashMap<String, Object>().getClass());
|
|
|
|
|
|
socialJson.forEach((k, v) -> {
|
|
|
|
|
|
record.put(k + "socialCom", v);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
record.put("socialPerSum", item.getSocialPerSum());
|
|
|
|
|
|
record.put("socialComSum", item.getSocialComSum());
|
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getFundPerJson())) {
|
|
|
|
|
|
Map<String, Object> fundPerJson = JSON.parseObject(item.getFundPerJson(), new HashMap<String, Object>().getClass());
|
|
|
|
|
|
fundPerJson.forEach((k, v) -> {
|
|
|
|
|
|
record.put(k + "fundPer", v);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getFundComJson())) {
|
|
|
|
|
|
Map<String, Object> fundPerJson = JSON.parseObject(item.getFundComJson(), new HashMap<String, Object>().getClass());
|
|
|
|
|
|
fundPerJson.forEach((k, v) -> {
|
|
|
|
|
|
record.put(k + "fundCom", v);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
record.put("fundPerSum", item.getFundPerSum());
|
|
|
|
|
|
record.put("fundComSum", item.getFundComSum());
|
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getOtherPerJson())) {
|
|
|
|
|
|
Map<String, Object> fundPerJson = JSON.parseObject(item.getOtherPerJson(), new HashMap<String, Object>().getClass());
|
|
|
|
|
|
fundPerJson.forEach((k, v) -> {
|
|
|
|
|
|
record.put(k + "otherPer", v);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(item.getOtherComJson())) {
|
|
|
|
|
|
Map<String, Object> fundComJson = JSON.parseObject(item.getOtherComJson(), new HashMap<String, Object>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
|
if (fundComJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
2022-04-27 14:36:05 +08:00
|
|
|
|
fundComJson.forEach((k, v) -> {
|
|
|
|
|
|
record.put(k + "otherCom", v);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
record.put("otherPerSum", item.getOtherPerSum());
|
|
|
|
|
|
record.put("otherComSum", item.getOtherComSum());
|
|
|
|
|
|
record.put("perSum", item.getPerSum());
|
|
|
|
|
|
record.put("comSum", item.getComSum());
|
2023-07-10 10:26:08 +08:00
|
|
|
|
|
|
|
|
|
|
//20230707增加福利核算明细中的缴纳状态+合计的数据项
|
|
|
|
|
|
InsuranceAccountDetailPO commonSiAcct = siAcctResultWithEmpAndPayStatus.get(item.getEmployeeId() + "_" + PaymentStatusEnum.COMMON.getValue());
|
|
|
|
|
|
InsuranceAccountDetailPO repairSiAcct = siAcctResultWithEmpAndPayStatus.get(item.getEmployeeId() + "_" + PaymentStatusEnum.REPAIR.getValue());
|
|
|
|
|
|
InsuranceAccountDetailPO balanceSiAcct = siAcctResultWithEmpAndPayStatus.get(item.getEmployeeId() + "_" + PaymentStatusEnum.BALANCE.getValue());
|
|
|
|
|
|
record.put("socialPerCommonSum", commonSiAcct != null ? commonSiAcct.getSocialPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("socialComCommonSum", commonSiAcct != null ? commonSiAcct.getSocialComSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("socialPerRepairSum", repairSiAcct != null ? repairSiAcct.getSocialPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("socialComRepairSum", repairSiAcct != null ? repairSiAcct.getSocialComSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("socialPerBalanceSum", balanceSiAcct != null ? balanceSiAcct.getSocialPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("socialComBalanceSum", balanceSiAcct != null ? balanceSiAcct.getSocialComSum() : new BigDecimal("0"));
|
|
|
|
|
|
|
|
|
|
|
|
record.put("fundPerCommonSum", commonSiAcct != null ? commonSiAcct.getFundPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("fundComCommonSum", commonSiAcct != null ? commonSiAcct.getFundComSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("fundPerRepairSum", repairSiAcct != null ? repairSiAcct.getFundPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("fundComRepairSum", repairSiAcct != null ? repairSiAcct.getFundComSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("fundPerBalanceSum", balanceSiAcct != null ? balanceSiAcct.getFundPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("fundComBalanceSum", balanceSiAcct != null ? balanceSiAcct.getFundComSum() : new BigDecimal("0"));
|
|
|
|
|
|
|
|
|
|
|
|
record.put("otherPerCommonSum", commonSiAcct != null ? commonSiAcct.getOtherPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("otherComCommonSum", commonSiAcct != null ? commonSiAcct.getOtherComSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("otherPerRepairSum", repairSiAcct != null ? repairSiAcct.getOtherPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("otherComRepairSum", repairSiAcct != null ? repairSiAcct.getOtherComSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("otherPerBalanceSum", balanceSiAcct != null ? balanceSiAcct.getOtherPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("otherComBalanceSum", balanceSiAcct != null ? balanceSiAcct.getOtherComSum() : new BigDecimal("0"));
|
|
|
|
|
|
|
|
|
|
|
|
record.put("perCommonSum", commonSiAcct != null ? commonSiAcct.getPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("comCommonSum", commonSiAcct != null ? commonSiAcct.getComSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("perRepairSum", repairSiAcct != null ? repairSiAcct.getPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("comRepairSum", repairSiAcct != null ? repairSiAcct.getComSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("perBalanceSum", balanceSiAcct != null ? balanceSiAcct.getPerSum() : new BigDecimal("0"));
|
|
|
|
|
|
record.put("comBalanceSum", balanceSiAcct != null ? balanceSiAcct.getComSum() : new BigDecimal("0"));
|
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
|
result.add(record);
|
|
|
|
|
|
});
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
2022-04-18 20:24:43 +08:00
|
|
|
|
|
2022-04-27 16:21:24 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, String> welfareColumns() {
|
2023-03-07 14:21:01 +08:00
|
|
|
|
List<ICategoryPO> listAll = getICategoryMapper().listAll();
|
2022-04-27 16:21:24 +08:00
|
|
|
|
List<ICategoryPO> list = new ArrayList<>();
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(listAll)) {
|
|
|
|
|
|
list.addAll(listAll);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> result = new LinkedHashMap<>();
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100393, "个人合计"), "perSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100388, "社保个人合计"), "socialPerSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100390, "公积金个人合计"), "fundPerSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100392, "其他福利个人合计"), "otherPerSum");
|
2023-07-10 10:26:08 +08:00
|
|
|
|
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "个人正常缴纳合计"), "perCommonSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "社保个人正常缴纳合计"), "socialPerCommonSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人正常缴纳合计"), "fundPerCommonSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人正常缴纳合计"), "otherPerCommonSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "个人补缴合计"), "perRepairSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "社保个人补缴合计"), "socialPerRepairSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人补缴合计"), "fundPerRepairSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人补缴合计"), "otherPerRepairSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "个人补差合计"), "perBalanceSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "社保个人补差合计"), "socialPerBalanceSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人补差合计"), "fundPerBalanceSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人补差合计"), "otherPerBalanceSum");
|
|
|
|
|
|
|
2022-04-27 16:21:24 +08:00
|
|
|
|
Map<String, String> categoryIdNameMap = getSICategoryService(user).categoryIdNameMap();
|
|
|
|
|
|
list.stream().forEach(item -> {
|
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), item.getWelfareType())) {
|
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "socialPer");
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), item.getWelfareType())) {
|
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "fundPer");
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.OTHER.getValue(), item.getWelfareType())) {
|
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "otherPer");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100397, "单位合计"), "comSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100394, "社保单位合计"), "socialComSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100395, "公积金单位合计"), "fundComSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计"), "otherComSum");
|
2023-07-10 10:26:08 +08:00
|
|
|
|
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "单位正常缴纳合计"), "comCommonSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "社保单位正常缴纳合计"), "socialComCommonSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位正常缴纳合计"), "fundComCommonSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位正常缴纳合计"), "otherComCommonSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "单位补缴合计"), "comRepairSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "社保单位补缴合计"), "socialComRepairSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位补缴合计"), "fundComRepairSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位补缴合计"), "otherComRepairSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "单位补差合计"), "comBalanceSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "社保单位补差合计"), "socialComBalanceSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位补差合计"), "fundComBalanceSum");
|
|
|
|
|
|
result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位补差合计"), "otherComBalanceSum");
|
|
|
|
|
|
|
2022-04-27 16:21:24 +08:00
|
|
|
|
list.stream().forEach(item -> {
|
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), item.getWelfareType())) {
|
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(100289, "单位"), item.getId() + "socialCom");
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), item.getWelfareType())) {
|
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(100289, "单位"), item.getId() + "fundCom");
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Objects.equals(WelfareTypeEnum.OTHER.getValue(), item.getWelfareType())) {
|
|
|
|
|
|
result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(100289, "单位"), item.getId() + "otherCom");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-18 20:24:43 +08:00
|
|
|
|
|
|
|
|
|
|
public List<SearchConditionOption> buildBillProjectsOptions() {
|
|
|
|
|
|
List<SearchConditionOption> options = new ArrayList<>();
|
|
|
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.ALL.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.ALL.getLabelId(), ProjectTypeEnum.ALL.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.SOCIAL.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.SOCIAL.getLabelId(), ProjectTypeEnum.SOCIAL.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.FUND.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.FUND.getLabelId(), ProjectTypeEnum.FUND.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.OTHER.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.OTHER.getLabelId(), ProjectTypeEnum.OTHER.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.ENDOWMENT_INSURANCE.getLabelId(), ProjectTypeEnum.ENDOWMENT_INSURANCE.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
|
options.add(new SearchConditionOption(String.valueOf(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()),
|
2022-07-08 11:19:08 +08:00
|
|
|
|
SalaryI18nUtil.getI18nLabel(ProjectTypeEnum.MEDICAL_INSURANCE.getLabelId(), ProjectTypeEnum.MEDICAL_INSURANCE.getDefaultLabel())));
|
2022-04-18 20:24:43 +08:00
|
|
|
|
return options;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-02 14:58:18 +08:00
|
|
|
|
public List<InsuranceAccountDetailPO> queryList(String billMonth, Long taxAgentId, List<Long> employeeIds) {
|
2022-08-18 15:02:04 +08:00
|
|
|
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().queryList(billMonth, taxAgentId, employeeIds);
|
2022-11-22 10:26:34 +08:00
|
|
|
|
//退差数据不参与薪资核算
|
2022-12-21 11:12:14 +08:00
|
|
|
|
insuranceAccountDetailPOS = insuranceAccountDetailPOS.stream()
|
|
|
|
|
|
.filter(f -> f.getPaymentStatus().equals(PaymentStatusEnum.COMMON.getValue())
|
|
|
|
|
|
|| f.getPaymentStatus().equals(PaymentStatusEnum.REPAIR.getValue())
|
|
|
|
|
|
|| f.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue()) )
|
|
|
|
|
|
.collect(Collectors.toList());
|
2022-08-18 15:02:04 +08:00
|
|
|
|
List<InsuranceAccountDetailPO> list = buildNewInsuranceDetailPOS(insuranceAccountDetailPOS);
|
2022-06-06 20:05:37 +08:00
|
|
|
|
// InsuranceAccountDetailPOEncrypt.decryptInsuranceAccountDetailPOList(list);
|
2022-04-27 14:36:05 +08:00
|
|
|
|
return list;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<InsuranceAccountDetailPO> buildNewInsuranceDetailPOS(List<InsuranceAccountDetailPO> list) {
|
|
|
|
|
|
List<InsuranceAccountDetailPO> newList = new ArrayList<>();
|
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
|
|
|
return newList;
|
|
|
|
|
|
}
|
|
|
|
|
|
Map<Long, List<InsuranceAccountDetailPO>> employeeMap = list.stream().filter(item -> item.getEmployeeId() != null)
|
|
|
|
|
|
.collect(Collectors.groupingBy(InsuranceAccountDetailPO::getEmployeeId));
|
|
|
|
|
|
for (Map.Entry<Long, List<InsuranceAccountDetailPO>> entry : employeeMap.entrySet()) {
|
|
|
|
|
|
Long k = entry.getKey();
|
|
|
|
|
|
List<InsuranceAccountDetailPO> v = entry.getValue();
|
|
|
|
|
|
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
|
|
|
|
|
|
insuranceAccountDetailPO.setEmployeeId(k);
|
|
|
|
|
|
Map<String, String> socialPerMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> fundPerMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> otherPerMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> socialComMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> fundComMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> otherComMap = new HashMap<>();
|
|
|
|
|
|
BigDecimal socialPer = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal socialCom = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal fundPer = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal fundCom = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal otherPer = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal otherCom = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal perSum = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal comSum = new BigDecimal("0");
|
|
|
|
|
|
for (InsuranceAccountDetailPO item : v) {
|
2022-12-12 17:56:26 +08:00
|
|
|
|
encryptUtil.decrypt(item, InsuranceAccountDetailPO.class);
|
2022-09-20 10:13:05 +08:00
|
|
|
|
insuranceAccountDetailPO.setId(item.getId());
|
2022-04-27 14:36:05 +08:00
|
|
|
|
BigDecimal socialPerSum = StringUtils.isBlank(item.getSocialPerSum()) ? new BigDecimal("0") : new BigDecimal(item.getSocialPerSum());
|
|
|
|
|
|
BigDecimal socialComSum = StringUtils.isBlank(item.getSocialComSum()) ? new BigDecimal("0") : new BigDecimal(item.getSocialComSum());
|
|
|
|
|
|
BigDecimal fundPerSum = StringUtils.isBlank(item.getFundPerSum()) ? new BigDecimal("0") : new BigDecimal(item.getFundPerSum());
|
|
|
|
|
|
BigDecimal fundComSum = StringUtils.isBlank(item.getFundComSum()) ? new BigDecimal("0") : new BigDecimal(item.getFundComSum());
|
|
|
|
|
|
BigDecimal otherPerSum = StringUtils.isBlank(item.getOtherPerSum()) ? new BigDecimal("0") : new BigDecimal(item.getOtherPerSum());
|
|
|
|
|
|
BigDecimal otherComSum = StringUtils.isBlank(item.getOtherComSum()) ? new BigDecimal("0") : new BigDecimal(item.getOtherComSum());
|
|
|
|
|
|
BigDecimal perSumItem = StringUtils.isBlank(item.getPerSum()) ? new BigDecimal("0") : new BigDecimal(item.getPerSum());
|
|
|
|
|
|
BigDecimal comSumItem = StringUtils.isBlank(item.getComSum()) ? new BigDecimal("0") : new BigDecimal(item.getComSum());
|
|
|
|
|
|
socialPer = socialPer.add(socialPerSum);
|
|
|
|
|
|
socialCom = socialCom.add(socialComSum);
|
|
|
|
|
|
fundPer = fundPer.add(fundPerSum);
|
|
|
|
|
|
fundCom = fundCom.add(fundComSum);
|
|
|
|
|
|
otherPer = otherPer.add(otherPerSum);
|
|
|
|
|
|
otherCom = otherCom.add(otherComSum);
|
|
|
|
|
|
perSum = perSum.add(perSumItem);
|
|
|
|
|
|
comSum = comSum.add(comSumItem);
|
|
|
|
|
|
if (StringUtils.isNotBlank(item.getSocialPerJson())) {
|
|
|
|
|
|
Map<String, String> socialJson = JSON.parseObject(item.getSocialPerJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
|
if (socialJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
|
socialJson.forEach((insuranceId, num) -> {
|
|
|
|
|
|
if (socialPerMap.get(insuranceId) == null) {
|
|
|
|
|
|
socialPerMap.put(insuranceId, num);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
String oldNum = socialPerMap.get(insuranceId);
|
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
|
socialPerMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(item.getSocialComJson())) {
|
|
|
|
|
|
Map<String, String> socialJson = JSON.parseObject(item.getSocialComJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
|
if (socialJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
|
socialJson.forEach((insuranceId, num) -> {
|
|
|
|
|
|
if (socialComMap.get(insuranceId) == null) {
|
|
|
|
|
|
socialComMap.put(insuranceId, num);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
String oldNum = socialComMap.get(insuranceId);
|
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
|
socialComMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(item.getFundPerJson())) {
|
|
|
|
|
|
Map<String, String> fundJson = JSON.parseObject(item.getFundPerJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
|
if (fundJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
|
fundJson.forEach((insuranceId, num) -> {
|
|
|
|
|
|
if (fundPerMap.get(insuranceId) == null) {
|
|
|
|
|
|
fundPerMap.put(insuranceId, num);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
String oldNum = fundPerMap.get(insuranceId);
|
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
|
fundPerMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(item.getFundComJson())) {
|
|
|
|
|
|
Map<String, String> fundJson = JSON.parseObject(item.getFundComJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
|
if (fundJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
|
fundJson.forEach((insuranceId, num) -> {
|
|
|
|
|
|
if (fundComMap.get(insuranceId) == null) {
|
|
|
|
|
|
fundComMap.put(insuranceId, num);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
String oldNum = fundComMap.get(insuranceId);
|
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
|
fundComMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(item.getOtherPerJson())) {
|
|
|
|
|
|
Map<String, String> otherJson = JSON.parseObject(item.getOtherPerJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
|
if (otherJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
|
otherJson.forEach((insuranceId, num) -> {
|
|
|
|
|
|
if (otherPerMap.get(insuranceId) == null) {
|
|
|
|
|
|
otherPerMap.put(insuranceId, num);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
String oldNum = otherPerMap.get(insuranceId);
|
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
|
otherPerMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(item.getOtherComJson())) {
|
|
|
|
|
|
Map<String, String> otherJson = JSON.parseObject(item.getOtherComJson(), new HashMap<String, String>().getClass());
|
2022-08-02 14:58:18 +08:00
|
|
|
|
if (otherJson != null) {
|
2022-07-21 17:28:47 +08:00
|
|
|
|
otherJson.forEach((insuranceId, num) -> {
|
|
|
|
|
|
if (otherComMap.get(insuranceId) == null) {
|
|
|
|
|
|
otherComMap.put(insuranceId, num);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
String oldNum = otherComMap.get(insuranceId);
|
|
|
|
|
|
BigDecimal insuanceNum = new BigDecimal("0");
|
|
|
|
|
|
BigDecimal oldDecimal = new BigDecimal(oldNum);
|
|
|
|
|
|
BigDecimal numDecimal = num == null ? new BigDecimal("0") : new BigDecimal(num);
|
|
|
|
|
|
insuanceNum = insuanceNum.add(numDecimal).add(oldDecimal);
|
|
|
|
|
|
otherComMap.put(insuranceId, insuanceNum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-27 14:36:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerMap));
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(socialComMap));
|
|
|
|
|
|
insuranceAccountDetailPO.setFundPerJson(JSON.toJSONString(fundPerMap));
|
|
|
|
|
|
insuranceAccountDetailPO.setFundComJson(JSON.toJSONString(fundComMap));
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherPerJson(JSON.toJSONString(otherPerMap));
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherComJson(JSON.toJSONString(otherComMap));
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialPerSum(socialPer.toPlainString());
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialComSum(socialCom.toPlainString());
|
|
|
|
|
|
insuranceAccountDetailPO.setFundPerSum(fundPer.toPlainString());
|
|
|
|
|
|
insuranceAccountDetailPO.setFundComSum(fundCom.toPlainString());
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherPerSum(otherPer.toPlainString());
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherComSum(otherCom.toPlainString());
|
|
|
|
|
|
insuranceAccountDetailPO.setPerSum(perSum.toPlainString());
|
|
|
|
|
|
insuranceAccountDetailPO.setComSum(comSum.toPlainString());
|
|
|
|
|
|
newList.add(insuranceAccountDetailPO);
|
|
|
|
|
|
}
|
|
|
|
|
|
return newList;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-12 10:24:21 +08:00
|
|
|
|
|
2022-05-09 11:18:54 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public List<InsuranceAccountInspectPO> allInspects(Collection<Long> ids, String billMonth) {
|
2023-03-07 14:21:01 +08:00
|
|
|
|
// InsuranceAccountInspectMapper siAccountInspectMapper = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class);
|
|
|
|
|
|
List<InsuranceAccountInspectPO> list = getInsuranceAccountInspectMapper().getList(billMonth, InspectStatusEnum.IGNORE.getValue(), ids);
|
2022-05-09 11:18:54 +08:00
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
|
|
|
return list;
|
|
|
|
|
|
}
|
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-06-08 17:52:10 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Collection<TaxAgentPO> getAdminTaxAgentList() {
|
2022-07-08 11:19:08 +08:00
|
|
|
|
return getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID());
|
2022-06-08 17:52:10 +08:00
|
|
|
|
}
|
2022-04-22 15:17:31 +08:00
|
|
|
|
|
2022-07-20 15:40:51 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public void socialSecurityBenefitsRecalculate(InsuranceAccountBatchPO param) {
|
2022-09-21 11:12:05 +08:00
|
|
|
|
//fixme 重新核算的校验逻辑 1、先取台账对应扣缴义务人下的所有账套 2、取账套下所有核算记录 3、判断核算记录有没有使用对应月份的福利台账
|
2023-07-11 17:56:45 +08:00
|
|
|
|
int num = getSiAccountBiz(user).checkIfBusinessaccounting(param);
|
|
|
|
|
|
//表示已经被核算过不能重新核算
|
|
|
|
|
|
if (num > 0) {
|
|
|
|
|
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "已被薪酬核算给核算过,无法重新核算!"));
|
|
|
|
|
|
}
|
2022-07-20 15:40:51 +08:00
|
|
|
|
param.setBillStatus(0);
|
|
|
|
|
|
getSiAccountBiz(user).updateById(param);
|
|
|
|
|
|
}
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 导出“福利核算导入模板”
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public XSSFWorkbook exportImportTemplate(InsuranceAcctDetailImportTemplateParam param) {
|
|
|
|
|
|
ValidUtil.doValidator(param);
|
|
|
|
|
|
|
|
|
|
|
|
// 必须选择导入模板所需的薪资项目(福利项)
|
2022-09-06 17:13:33 +08:00
|
|
|
|
if (CollectionUtils.isEmpty(param.getWelfareNames())) {
|
|
|
|
|
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99019, "参数错误,请选择导入模板所需的福利项目核算项"));
|
2022-09-02 11:53:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 模板表头(默认必带"个税扣缴义务人"、"姓名")
|
|
|
|
|
|
List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"),
|
|
|
|
|
|
"部门",
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(86186, "手机号"),
|
2022-09-15 10:43:34 +08:00
|
|
|
|
SalaryI18nUtil.getI18nLabel(86317, "工号"),
|
2022-09-02 11:53:38 +08:00
|
|
|
|
SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"),
|
|
|
|
|
|
"账单月份");
|
2022-09-30 15:40:15 +08:00
|
|
|
|
List<String> dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "workcode", "taxAgentName", "billMonth");
|
2022-09-06 17:13:33 +08:00
|
|
|
|
// 查询福利核算项目
|
|
|
|
|
|
List<String> welfareNames = (List<String>) param.getWelfareNames();
|
|
|
|
|
|
headerList.addAll(welfareNames);
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
|
|
|
|
|
// excel导出的数据
|
2022-10-20 16:29:49 +08:00
|
|
|
|
//查询当前已有的正常缴纳数据
|
2022-09-30 15:40:15 +08:00
|
|
|
|
List<Map<String, Object>> resultMapList = getNormalDataByBillMonth(param.getBillMonth(), param.getPaymentOrganization());
|
|
|
|
|
|
// excel导出的数据
|
|
|
|
|
|
List<List<Object>> rows = Lists.newArrayListWithExpectedSize(resultMapList.size());
|
2022-09-02 11:53:38 +08:00
|
|
|
|
rows.add(headerList);
|
2022-09-30 15:40:15 +08:00
|
|
|
|
for (Map<String, Object> map : resultMapList) {
|
|
|
|
|
|
List<Object> row = Lists.newArrayListWithExpectedSize(headerList.size());
|
|
|
|
|
|
for (String dataIndex : dataIndexList) {
|
|
|
|
|
|
row.add(map.getOrDefault(dataIndex, StringUtils.EMPTY));
|
|
|
|
|
|
}
|
|
|
|
|
|
rows.add(row);
|
|
|
|
|
|
}
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
|
|
|
|
|
String sheetName = "福利核算导入模板";
|
|
|
|
|
|
return ExcelUtil.genWorkbookV2(rows, sheetName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 将福利核算模板导入的数据更新到数据库
|
|
|
|
|
|
*/
|
2022-09-02 11:53:38 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> importInsuranceAcctDetail(InsuranceAcctImportParam importParam) {
|
2022-09-06 17:13:33 +08:00
|
|
|
|
// long currentEmployeeId = user.getUID();
|
|
|
|
|
|
// Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
|
|
|
|
|
|
2022-09-15 16:14:34 +08:00
|
|
|
|
//查询对于人员信息导入筛选的全局配置
|
|
|
|
|
|
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
|
2022-09-19 15:11:27 +08:00
|
|
|
|
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
|
2022-09-02 11:53:38 +08:00
|
|
|
|
//检验参数
|
|
|
|
|
|
//excel文件id
|
|
|
|
|
|
String imageId = Util.null2String(importParam.getImageId());
|
2022-09-06 17:13:33 +08:00
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
if (StringUtils.isBlank(imageId)) {
|
|
|
|
|
|
throw new SalaryRunTimeException("文件不存在");
|
|
|
|
|
|
}
|
2022-09-06 17:13:33 +08:00
|
|
|
|
// // 获取所有个税扣缴义务人
|
|
|
|
|
|
// List<TaxAgentPO> taxAgents = getTaxAgentService(user).listAll();
|
|
|
|
|
|
// Map<String, Long> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getName, TaxAgentPO::getId);
|
|
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
// 获取租户下所有的人员
|
2023-04-12 15:27:35 +08:00
|
|
|
|
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listEmployee();
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
|
|
|
|
|
// 失败的数量
|
|
|
|
|
|
int failCount = 0;
|
|
|
|
|
|
// 成功的数量
|
|
|
|
|
|
int successCount = 0;
|
|
|
|
|
|
InputStream fileInputStream = null;
|
|
|
|
|
|
try {
|
|
|
|
|
|
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(importParam.getImageId()));
|
|
|
|
|
|
|
|
|
|
|
|
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
|
|
|
|
|
|
|
|
|
|
|
// 错误提示信息
|
|
|
|
|
|
List<Map> excelComments = Lists.newArrayList();
|
|
|
|
|
|
// 存在错误的那行数据
|
|
|
|
|
|
List<Map<String, Object>> errorDatas = Lists.newArrayList();
|
|
|
|
|
|
// 表头
|
|
|
|
|
|
List<String> headers = ExcelSupport.getSheetHeader(sheet, 0);
|
|
|
|
|
|
// 处理数值
|
|
|
|
|
|
List<Map<String, Object>> data = ExcelParseHelper.parse2Map(sheet, 1);
|
|
|
|
|
|
if (CollectionUtils.isEmpty(headers)) {
|
2022-11-17 13:39:50 +08:00
|
|
|
|
throw new SalaryRunTimeException("表头为空");
|
2022-09-02 11:53:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isEmpty(data)) {
|
2022-11-17 13:39:50 +08:00
|
|
|
|
throw new SalaryRunTimeException("无数据");
|
2022-09-02 11:53:38 +08:00
|
|
|
|
}
|
2022-09-06 17:13:33 +08:00
|
|
|
|
//存储待更新的InsuranceAccountDetailPO数据
|
|
|
|
|
|
List<InsuranceAccountDetailPO> updateInsuranceAccountDetailList = new ArrayList<>();
|
|
|
|
|
|
//遍历excel表具体数据
|
2022-09-02 11:53:38 +08:00
|
|
|
|
for (int i = 0; i < data.size(); i++) {
|
|
|
|
|
|
|
|
|
|
|
|
String row = "第" + (i + 2) + "行";
|
|
|
|
|
|
|
|
|
|
|
|
boolean isError = false;
|
|
|
|
|
|
Map<String, Object> map = data.get(i);
|
|
|
|
|
|
Long employeeId = 0L;
|
2022-09-06 17:13:33 +08:00
|
|
|
|
// Long taxAgentId = 0L;
|
|
|
|
|
|
|
|
|
|
|
|
List<InsuranceAccountDetailPO> list = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
String billMonth = (String) map.getOrDefault("账单月份", "");
|
|
|
|
|
|
String taxAgentName = (String) map.getOrDefault("个税扣缴义务人", "");
|
2022-09-20 10:13:05 +08:00
|
|
|
|
String supplementaryMonth = (String) map.getOrDefault("补缴月份", "");
|
2022-09-06 17:13:33 +08:00
|
|
|
|
Long paymentOrganization = 0L;
|
|
|
|
|
|
List<TaxAgentPO> taxAgentPoList = getTaxAgentMapper().listByName(taxAgentName);
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
if (taxAgentPoList.size() == 1) {
|
|
|
|
|
|
paymentOrganization = taxAgentPoList.get(0).getId();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "个税扣缴义务人错误,系统内不存在该个税扣缴义务人")));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!checkBillMonth(billMonth)) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "账单月份输入有误,请参照“2022-09”这种格式进行检查"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
}
|
2022-09-02 15:40:05 +08:00
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
//遍历表头
|
2022-09-02 11:53:38 +08:00
|
|
|
|
for (int j = 0; j < headers.size(); j++) {
|
|
|
|
|
|
String header = headers.get(j);
|
|
|
|
|
|
String dataKey = header;
|
|
|
|
|
|
if (dataKey == null) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
String dataValue = (String) map.getOrDefault(dataKey.toString(), "");
|
|
|
|
|
|
String deparmentName = (String) map.getOrDefault("部门", "");
|
|
|
|
|
|
String mobile = (String) map.getOrDefault("手机号", "");
|
2022-09-15 16:14:34 +08:00
|
|
|
|
String workcode = (String) map.getOrDefault("工号", "");
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
2022-09-20 10:13:05 +08:00
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) {
|
2022-09-15 16:14:34 +08:00
|
|
|
|
//当人员信息导入筛选的全局配置为"0"时,姓名才是必填项
|
2022-09-19 15:11:27 +08:00
|
|
|
|
if (StringUtils.isEmpty(dataValue) && "0".equals(confValue)) {
|
2022-09-02 11:53:38 +08:00
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
} else {
|
2022-09-15 16:14:34 +08:00
|
|
|
|
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
2022-09-21 15:49:55 +08:00
|
|
|
|
List<DataCollectionEmployee> employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode, null);
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(employeeSameIds)) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "姓名错误,系统内不存在该姓名"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
2022-09-06 17:13:33 +08:00
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
} else if (employeeSameIds.size() > 1) {
|
|
|
|
|
|
//存在离职和在职状态取在职状态
|
|
|
|
|
|
employeeSameIds = employeeSameIds.stream()
|
|
|
|
|
|
.filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus()))
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
if (employeeSameIds.size() != 1) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
2022-09-15 16:14:34 +08:00
|
|
|
|
errorMessageMap.put("message", row + "员工信息不存在或者存在多个员工");
|
2022-09-02 11:53:38 +08:00
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
employeeId = employeeSameIds.get(0).getEmployeeId();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-15 16:14:34 +08:00
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
}
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
if (!isError){
|
|
|
|
|
|
List<Long> employeeIds = new ArrayList<>();
|
|
|
|
|
|
employeeIds.add(employeeId);
|
|
|
|
|
|
//如果福利核算信息查询不到唯一匹配数据,不支持导入
|
|
|
|
|
|
//根据员工id、个税扣缴义务人id、账单月份查询
|
2022-09-20 10:13:05 +08:00
|
|
|
|
//根据表头字段来区分正常缴纳和补缴两类数据
|
|
|
|
|
|
if (!headers.contains("补缴月份")) {
|
2022-09-21 10:47:07 +08:00
|
|
|
|
list = getInsuranceAccountDetailMapper().queryNormalList(billMonth, paymentOrganization, employeeIds.get(0));
|
2022-09-20 10:13:05 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
list = getInsuranceAccountDetailMapper().querySupplementList(billMonth, paymentOrganization, employeeIds.get(0), supplementaryMonth);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
if (list.isEmpty()) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "本次福利核算不包含该人员"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
} else if (list.size() > 1) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员本次核算出现多组数据,请删除数据库中多余核算项"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
//拼装待更新数据
|
2022-12-12 17:56:26 +08:00
|
|
|
|
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class);
|
2022-09-06 17:13:33 +08:00
|
|
|
|
updateInsuranceAccountDetailList.add(handleInsuranceAccountDetail(list.get(0), map));
|
2022-09-02 11:53:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isError) {
|
|
|
|
|
|
failCount++;
|
|
|
|
|
|
errorDatas.add(map);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
successCount++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2022-09-06 17:13:33 +08:00
|
|
|
|
//将待更新列表加密
|
2022-12-12 17:56:26 +08:00
|
|
|
|
encryptUtil.encryptList(updateInsuranceAccountDetailList, InsuranceAccountDetailPO.class);
|
2022-09-06 17:13:33 +08:00
|
|
|
|
//更新
|
2022-09-08 09:43:46 +08:00
|
|
|
|
for(InsuranceAccountDetailPO po : updateInsuranceAccountDetailList) {
|
|
|
|
|
|
getSiAccountBiz(user).updateByEmployeeIdAndBillMonth(po);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-17 10:09:01 +08:00
|
|
|
|
//刷新hrsa_bill_batch中数据统计信息
|
|
|
|
|
|
if (updateInsuranceAccountDetailList.size() > 0) {
|
2022-12-07 17:50:25 +08:00
|
|
|
|
refreshBillBatch(updateInsuranceAccountDetailList.get(0).getPaymentOrganization(), updateInsuranceAccountDetailList.get(0).getBillMonth());
|
2022-11-17 10:09:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
apidatas.put("successCount", successCount);
|
|
|
|
|
|
apidatas.put("errorCount", failCount);
|
|
|
|
|
|
apidatas.put("errorData", excelComments);
|
|
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
IOUtils.closeQuietly(fileInputStream);
|
|
|
|
|
|
}
|
|
|
|
|
|
return apidatas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-07 14:57:07 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 预览“福利核算导入”模板导入的数据
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> preview(InsuranceAcctImportParam param) {
|
|
|
|
|
|
//1、参数校验
|
|
|
|
|
|
String imageId = param.getImageId();
|
|
|
|
|
|
if (StringUtils.isBlank(imageId)) {
|
|
|
|
|
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100593, "文件id为空"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
InputStream fileInputStream = null;
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId));
|
|
|
|
|
|
|
|
|
|
|
|
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
|
|
|
|
|
List<String> headers = ExcelSupport.getSheetHeader(sheet, 0);
|
|
|
|
|
|
|
|
|
|
|
|
map.put("headers", headers);
|
|
|
|
|
|
map.put("list", ExcelParseHelper.parse2List(sheet, 1));
|
|
|
|
|
|
|
|
|
|
|
|
return map;
|
|
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
IOUtils.closeQuietly(fileInputStream);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-19 15:11:27 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 导出“福利核算-补缴导入”模板
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public XSSFWorkbook exportSupplyImportTemplate(InsuranceAcctDetailImportTemplateParam param) {
|
|
|
|
|
|
ValidUtil.doValidator(param);
|
|
|
|
|
|
|
|
|
|
|
|
// 必须选择导入模板所需的薪资项目(福利项)
|
|
|
|
|
|
if (CollectionUtils.isEmpty(param.getWelfareNames())) {
|
|
|
|
|
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99019, "参数错误,请选择导入模板所需的福利项目核算项"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 模板表头(默认必带"个税扣缴义务人"、"姓名")
|
|
|
|
|
|
List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"),
|
|
|
|
|
|
"部门",
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(86186, "手机号"),
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(86317, "工号"),
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"),
|
|
|
|
|
|
"账单月份",
|
|
|
|
|
|
"补缴月份");
|
2022-09-19 17:59:12 +08:00
|
|
|
|
List<String> dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "workcode", "taxAgentName", "billMonth", "supplementaryMonth");
|
2022-09-19 15:11:27 +08:00
|
|
|
|
// 查询福利核算项目
|
|
|
|
|
|
List<String> welfareNames = (List<String>) param.getWelfareNames();
|
|
|
|
|
|
headerList.addAll(welfareNames);
|
|
|
|
|
|
|
2022-09-19 17:59:12 +08:00
|
|
|
|
//查询当前已有的补缴数据
|
|
|
|
|
|
List<Map<String, Object>> resultMapList = getSupplyDataByBillMonth(param.getBillMonth(), param.getPaymentOrganization());
|
2022-09-19 15:11:27 +08:00
|
|
|
|
// excel导出的数据
|
2022-09-19 17:59:12 +08:00
|
|
|
|
List<List<Object>> rows = Lists.newArrayListWithExpectedSize(resultMapList.size());
|
2022-09-19 15:11:27 +08:00
|
|
|
|
rows.add(headerList);
|
2022-09-19 17:59:12 +08:00
|
|
|
|
for (Map<String, Object> map : resultMapList) {
|
|
|
|
|
|
List<Object> row = Lists.newArrayListWithExpectedSize(headerList.size());
|
|
|
|
|
|
for (String dataIndex : dataIndexList) {
|
|
|
|
|
|
row.add(map.getOrDefault(dataIndex, StringUtils.EMPTY));
|
|
|
|
|
|
}
|
|
|
|
|
|
rows.add(row);
|
|
|
|
|
|
}
|
2022-09-19 15:11:27 +08:00
|
|
|
|
|
2022-09-19 17:59:12 +08:00
|
|
|
|
|
|
|
|
|
|
String sheetName = "福利核算-补缴导入模板";
|
2022-09-19 15:11:27 +08:00
|
|
|
|
return ExcelUtil.genWorkbookV2(rows, sheetName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-19 17:59:12 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 获取福利台账中的补缴数据
|
|
|
|
|
|
* @param billMonth 账单月份
|
|
|
|
|
|
* @param paymentOrganization 个税扣缴义务人id
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
private List<Map<String, Object>> getSupplyDataByBillMonth(String billMonth, Long paymentOrganization) {
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
2022-09-20 10:13:05 +08:00
|
|
|
|
|
2022-09-19 17:59:12 +08:00
|
|
|
|
DataCollectionEmployee employee = new DataCollectionEmployee();
|
|
|
|
|
|
|
|
|
|
|
|
TaxAgentPO taxAgentPO = taxAgentBiz.getById(paymentOrganization);
|
|
|
|
|
|
|
|
|
|
|
|
List<InsuranceAccountDetailPO> supplyDataList = getInsuranceAccountDetailMapper().querySupplementListByBillMonth(billMonth, paymentOrganization);
|
2022-10-20 17:33:29 +08:00
|
|
|
|
|
|
|
|
|
|
//过滤出福利档案基础信息表中runStatus为正在缴纳和待减员的人员
|
|
|
|
|
|
List<InsuranceArchivesBaseInfoPO> baseInfoPOList = getInsuranceBaseInfoMapper().listAll();
|
|
|
|
|
|
List<Long> canAccountIds = baseInfoPOList.stream()
|
|
|
|
|
|
.filter(f->f.getPaymentOrganization().equals(paymentOrganization)
|
|
|
|
|
|
&& (f.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue()) || f.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())))
|
|
|
|
|
|
.map(InsuranceArchivesBaseInfoPO::getEmployeeId)
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
supplyDataList = supplyDataList.stream().filter(f -> canAccountIds.contains(f.getEmployeeId())).collect(Collectors.toList());
|
|
|
|
|
|
|
2022-09-19 17:59:12 +08:00
|
|
|
|
for(InsuranceAccountDetailPO po : supplyDataList) {
|
2022-09-20 10:13:05 +08:00
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
2023-04-12 15:27:35 +08:00
|
|
|
|
employee = getSalaryEmployeeService(user).getEmployeeById(po.getEmployeeId());
|
2022-09-20 10:13:05 +08:00
|
|
|
|
resultMap.put("username", employee.getUsername());
|
|
|
|
|
|
resultMap.put("departmentName", employee.getDepartmentName());
|
|
|
|
|
|
resultMap.put("mobile", employee.getMobile());
|
|
|
|
|
|
resultMap.put("workcode", employee.getWorkcode());
|
|
|
|
|
|
resultMap.put("taxAgentName", taxAgentPO.getName());
|
|
|
|
|
|
resultMap.put("billMonth", billMonth);
|
|
|
|
|
|
resultMap.put("supplementaryMonth", po.getSupplementaryMonth());
|
|
|
|
|
|
|
|
|
|
|
|
resultList.add(resultMap);
|
2022-09-19 17:59:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
return resultList;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-30 15:40:15 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 获取福利台账中的正常缴纳数据
|
|
|
|
|
|
* @param billMonth 账单月份
|
|
|
|
|
|
* @param paymentOrganization 个税扣缴义务人id
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
private List<Map<String, Object>> getNormalDataByBillMonth(String billMonth, Long paymentOrganization) {
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
DataCollectionEmployee employee = new DataCollectionEmployee();
|
|
|
|
|
|
|
|
|
|
|
|
TaxAgentPO taxAgentPO = taxAgentBiz.getById(paymentOrganization);
|
|
|
|
|
|
|
2022-10-20 16:29:49 +08:00
|
|
|
|
List<InsuranceAccountDetailPO> normalDataList = getInsuranceAccountDetailMapper().queryNormalListByBillMonth(billMonth, paymentOrganization);
|
2022-10-20 17:33:29 +08:00
|
|
|
|
//过滤出福利档案基础信息表中runStatus为正在缴纳和待减员的人员
|
2022-10-20 16:29:49 +08:00
|
|
|
|
List<InsuranceArchivesBaseInfoPO> baseInfoPOList = getInsuranceBaseInfoMapper().listAll();
|
|
|
|
|
|
List<Long> canAccountIds = baseInfoPOList.stream()
|
|
|
|
|
|
.filter(f->f.getPaymentOrganization().equals(paymentOrganization)
|
|
|
|
|
|
&& (f.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue()) || f.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())))
|
|
|
|
|
|
.map(InsuranceArchivesBaseInfoPO::getEmployeeId)
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
normalDataList = normalDataList.stream().filter(f -> canAccountIds.contains(f.getEmployeeId())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
for(InsuranceAccountDetailPO po : normalDataList) {
|
2022-09-30 15:40:15 +08:00
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
2023-04-12 15:27:35 +08:00
|
|
|
|
employee = getSalaryEmployeeService(user).getEmployeeById(po.getEmployeeId());
|
2022-09-30 15:40:15 +08:00
|
|
|
|
resultMap.put("username", employee.getUsername());
|
|
|
|
|
|
resultMap.put("departmentName", employee.getDepartmentName());
|
|
|
|
|
|
resultMap.put("mobile", employee.getMobile());
|
|
|
|
|
|
resultMap.put("workcode", employee.getWorkcode());
|
|
|
|
|
|
resultMap.put("taxAgentName", taxAgentPO.getName());
|
|
|
|
|
|
resultMap.put("billMonth", billMonth);
|
|
|
|
|
|
|
|
|
|
|
|
resultList.add(resultMap);
|
|
|
|
|
|
}
|
|
|
|
|
|
return resultList;
|
|
|
|
|
|
}
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
2022-09-02 15:40:05 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 将更新的数据设置到老的insuranceAccountDetailPO对象中
|
|
|
|
|
|
*/
|
2022-09-06 17:13:33 +08:00
|
|
|
|
private InsuranceAccountDetailPO handleInsuranceAccountDetail(InsuranceAccountDetailPO insuranceAccountDetailPO, Map<String, Object> baseMap) {
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
|
|
|
|
|
//组装json数据,格式Map<String, Object>
|
2022-09-02 15:40:05 +08:00
|
|
|
|
Map<String, String> socialPerMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> fundPerMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> otherPerMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> socialComMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> fundComMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> otherComMap = new HashMap<>();
|
2022-09-02 11:53:38 +08:00
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
//筛选出福利核算项
|
|
|
|
|
|
Map<String, Object> toDealMap =
|
|
|
|
|
|
baseMap.entrySet().stream()
|
|
|
|
|
|
.filter(map -> !"姓名".equals(map.getKey())
|
|
|
|
|
|
&& !"部门".equals(map.getKey())
|
|
|
|
|
|
&& !"手机号".equals(map.getKey())
|
|
|
|
|
|
&& !"个税扣缴义务人".equals(map.getKey())
|
|
|
|
|
|
&& !"账单月份".equals(map.getKey()))
|
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
|
|
|
|
|
|
|
|
|
|
|
for(Map.Entry<String, Object> entry : toDealMap.entrySet()) {
|
2022-09-02 11:53:38 +08:00
|
|
|
|
//判断元素是否属于福利类
|
|
|
|
|
|
String keyName = entry.getKey();
|
|
|
|
|
|
//获取元素名后缀,方便之后判断“个人”或“单位”
|
2022-09-06 17:13:33 +08:00
|
|
|
|
String payScope = keyName.substring(keyName.length() - 2);
|
2022-09-02 11:53:38 +08:00
|
|
|
|
//获取福利类型
|
|
|
|
|
|
Integer welfareType;
|
2022-09-06 17:13:33 +08:00
|
|
|
|
List<ICategoryPO> categoryPOList = siCategoryBiz.listByName(entry.getKey().substring(0, keyName.length() - 2));
|
2022-09-02 11:53:38 +08:00
|
|
|
|
if (categoryPOList.size() == 1) {
|
|
|
|
|
|
ICategoryPO iCategoryPO = categoryPOList.get(0);
|
|
|
|
|
|
welfareType = iCategoryPO.getWelfareType();
|
2022-09-06 17:13:33 +08:00
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
if ("个人".equals(payScope)) {
|
|
|
|
|
|
switch (welfareType) {
|
|
|
|
|
|
case 1:
|
2022-09-02 15:40:05 +08:00
|
|
|
|
socialPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
2022-09-02 11:53:38 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
2022-09-02 15:40:05 +08:00
|
|
|
|
fundPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
2022-09-02 11:53:38 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 3:
|
2022-09-02 15:40:05 +08:00
|
|
|
|
otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
2022-09-02 11:53:38 +08:00
|
|
|
|
break;
|
2022-09-06 17:13:33 +08:00
|
|
|
|
default:
|
|
|
|
|
|
throw new SalaryRunTimeException("福利类型不存在");
|
2022-09-02 11:53:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else if ("单位".equals(payScope)) {
|
|
|
|
|
|
switch (welfareType) {
|
|
|
|
|
|
case 1:
|
2022-09-02 15:40:05 +08:00
|
|
|
|
socialComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
2022-09-02 11:53:38 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
2022-09-02 15:40:05 +08:00
|
|
|
|
fundComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
2022-09-02 11:53:38 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 3:
|
2022-09-02 15:40:05 +08:00
|
|
|
|
otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
2022-09-02 11:53:38 +08:00
|
|
|
|
break;
|
2022-09-06 17:13:33 +08:00
|
|
|
|
default:
|
|
|
|
|
|
throw new SalaryRunTimeException("福利类型不存在");
|
2022-09-02 11:53:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//组装新的insuranceAccountDetailPO对象数据
|
2022-09-02 15:40:05 +08:00
|
|
|
|
if (!socialPerMap.isEmpty()) {
|
|
|
|
|
|
//对比新旧json中数据,并输出最终json
|
2022-09-06 17:13:33 +08:00
|
|
|
|
checkJsonMap(socialPerMap, insuranceAccountDetailPO.getSocialPerJson());
|
2022-09-02 15:40:05 +08:00
|
|
|
|
insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerMap));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!socialComMap.isEmpty()) {
|
2022-09-06 17:13:33 +08:00
|
|
|
|
checkJsonMap(socialComMap, insuranceAccountDetailPO.getSocialComJson());
|
2022-09-02 15:40:05 +08:00
|
|
|
|
insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(socialComMap));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!fundPerMap.isEmpty()) {
|
2022-09-06 17:13:33 +08:00
|
|
|
|
checkJsonMap(fundPerMap, insuranceAccountDetailPO.getFundPerJson());
|
2022-09-02 15:40:05 +08:00
|
|
|
|
insuranceAccountDetailPO.setFundPerJson(JSON.toJSONString(fundPerMap));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!fundComMap.isEmpty()) {
|
2022-09-06 17:13:33 +08:00
|
|
|
|
checkJsonMap(fundComMap, insuranceAccountDetailPO.getFundComJson());
|
2022-09-02 15:40:05 +08:00
|
|
|
|
insuranceAccountDetailPO.setFundComJson(JSON.toJSONString(fundComMap));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!otherPerMap.isEmpty()) {
|
2022-09-06 17:13:33 +08:00
|
|
|
|
checkJsonMap(otherPerMap, insuranceAccountDetailPO.getOtherPerJson());
|
2022-09-02 15:40:05 +08:00
|
|
|
|
insuranceAccountDetailPO.setOtherPerJson(JSON.toJSONString(otherPerMap));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!otherComMap.isEmpty()) {
|
2022-09-06 17:13:33 +08:00
|
|
|
|
checkJsonMap(otherComMap, insuranceAccountDetailPO.getOtherComJson());
|
2022-09-02 15:40:05 +08:00
|
|
|
|
insuranceAccountDetailPO.setOtherComJson(JSON.toJSONString(otherComMap));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("社保个人合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialPerSum(baseMap.get("社保个人合计").toString());
|
2023-04-23 18:05:32 +08:00
|
|
|
|
} else if (!socialPerMap.isEmpty()) {
|
2023-04-23 16:35:52 +08:00
|
|
|
|
insuranceAccountDetailPO.setSocialPerSum(sumOfMapValue(socialPerMap));
|
2022-09-02 15:40:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("公积金个人合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setFundPerSum(baseMap.get("公积金个人合计").toString());
|
2023-04-23 18:05:32 +08:00
|
|
|
|
} else if (!fundPerMap.isEmpty()) {
|
2023-04-23 16:35:52 +08:00
|
|
|
|
insuranceAccountDetailPO.setFundPerSum(sumOfMapValue(fundPerMap));
|
2022-09-02 15:40:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("其他福利个人合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherPerSum(baseMap.get("其他福利个人合计").toString());
|
2023-04-23 18:05:32 +08:00
|
|
|
|
} else if (!otherPerMap.isEmpty()) {
|
2023-04-23 16:35:52 +08:00
|
|
|
|
insuranceAccountDetailPO.setOtherPerSum(sumOfMapValue(otherPerMap));
|
2022-09-02 15:40:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-04-23 16:35:52 +08:00
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("个人合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setPerSum(baseMap.get("个人合计").toString());
|
|
|
|
|
|
} else {
|
2023-04-24 10:11:02 +08:00
|
|
|
|
insuranceAccountDetailPO.setPerSum(new BigDecimal(insuranceAccountDetailPO.getSocialPerSum() == null ? "0" : insuranceAccountDetailPO.getSocialPerSum())
|
|
|
|
|
|
.add(new BigDecimal(insuranceAccountDetailPO.getFundPerSum() == null ? "0" : insuranceAccountDetailPO.getFundPerSum()))
|
|
|
|
|
|
.add(new BigDecimal(insuranceAccountDetailPO.getOtherPerSum() == null ? "0" : insuranceAccountDetailPO.getOtherPerSum())).toString());
|
2022-09-02 15:40:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("社保单位合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialComSum(baseMap.get("社保单位合计").toString());
|
2023-04-23 18:05:32 +08:00
|
|
|
|
} else if (!socialComMap.isEmpty()) {
|
2023-04-23 16:35:52 +08:00
|
|
|
|
insuranceAccountDetailPO.setSocialComSum(sumOfMapValue(socialComMap));
|
2022-09-02 15:40:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("公积金单位合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setFundComSum(baseMap.get("公积金单位合计").toString());
|
2023-04-23 18:05:32 +08:00
|
|
|
|
} else if (!fundComMap.isEmpty()) {
|
2023-04-23 16:35:52 +08:00
|
|
|
|
insuranceAccountDetailPO.setFundComSum(sumOfMapValue(fundComMap));
|
2022-09-02 15:40:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("其他福利单位合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherComSum(baseMap.get("其他福利单位合计").toString());
|
2023-04-23 18:05:32 +08:00
|
|
|
|
} else if (!otherComMap.isEmpty()) {
|
2023-04-23 16:35:52 +08:00
|
|
|
|
insuranceAccountDetailPO.setOtherComSum(sumOfMapValue(otherComMap));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("单位合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setComSum(baseMap.get("单位合计").toString());
|
|
|
|
|
|
} else {
|
2023-04-24 10:11:02 +08:00
|
|
|
|
insuranceAccountDetailPO.setComSum(new BigDecimal(insuranceAccountDetailPO.getSocialComSum() == null ? "0" : insuranceAccountDetailPO.getSocialComSum())
|
|
|
|
|
|
.add(new BigDecimal(insuranceAccountDetailPO.getFundComSum() == null ? "0" : insuranceAccountDetailPO.getFundComSum()))
|
|
|
|
|
|
.add(new BigDecimal(insuranceAccountDetailPO.getOtherComSum() == null ? "0" : insuranceAccountDetailPO.getOtherComSum())).toString());
|
2022-09-02 15:40:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("账单月份", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setBillMonth(baseMap.get("账单月份").toString());
|
2022-09-02 15:40:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-16 14:21:15 +08:00
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("社保合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialSum(baseMap.get("社保合计").toString());
|
2023-04-23 16:35:52 +08:00
|
|
|
|
} else {
|
2023-04-24 10:11:02 +08:00
|
|
|
|
insuranceAccountDetailPO.setSocialSum(new BigDecimal(insuranceAccountDetailPO.getSocialComSum() == null ? "0" : insuranceAccountDetailPO.getSocialComSum())
|
|
|
|
|
|
.add(new BigDecimal(insuranceAccountDetailPO.getSocialPerSum() == null ? "0" : insuranceAccountDetailPO.getSocialPerSum()))
|
2023-04-23 16:35:52 +08:00
|
|
|
|
.toString());
|
2022-09-16 14:21:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("公积金合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setFundSum(baseMap.get("公积金合计").toString());
|
2023-04-23 16:35:52 +08:00
|
|
|
|
} else {
|
2023-04-24 10:11:02 +08:00
|
|
|
|
insuranceAccountDetailPO.setFundSum(new BigDecimal(insuranceAccountDetailPO.getFundComSum() == null ? "0" : insuranceAccountDetailPO.getFundComSum())
|
|
|
|
|
|
.add(new BigDecimal(insuranceAccountDetailPO.getFundPerSum() == null ? "0" : insuranceAccountDetailPO.getFundPerSum()))
|
2023-04-23 16:35:52 +08:00
|
|
|
|
.toString());
|
2022-09-16 14:21:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("其他福利合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherSum(baseMap.get("其他福利合计").toString());
|
2023-04-23 16:35:52 +08:00
|
|
|
|
} else {
|
2023-04-24 10:11:02 +08:00
|
|
|
|
insuranceAccountDetailPO.setOtherSum(new BigDecimal(insuranceAccountDetailPO.getOtherComSum() == null ? "0" : insuranceAccountDetailPO.getOtherComSum())
|
|
|
|
|
|
.add(new BigDecimal(insuranceAccountDetailPO.getOtherPerSum() == null ? "0" : insuranceAccountDetailPO.getOtherPerSum()))
|
2023-04-23 16:35:52 +08:00
|
|
|
|
.toString());
|
2022-09-16 14:21:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("合计", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setTotal(baseMap.get("合计").toString());
|
2023-04-23 16:35:52 +08:00
|
|
|
|
} else {
|
2023-04-24 10:11:02 +08:00
|
|
|
|
insuranceAccountDetailPO.setTotal(new BigDecimal(insuranceAccountDetailPO.getPerSum() == null ? "0" : insuranceAccountDetailPO.getPerSum())
|
|
|
|
|
|
.add(new BigDecimal(insuranceAccountDetailPO.getComSum() == null ? "0" : insuranceAccountDetailPO.getComSum()))
|
2023-04-23 16:35:52 +08:00
|
|
|
|
.toString());
|
2022-09-16 14:21:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-20 10:13:05 +08:00
|
|
|
|
//如果导入的时补缴数据,还会包含补缴月份
|
|
|
|
|
|
if (!StringUtils.isEmpty(baseMap.getOrDefault("补缴月份", "").toString())) {
|
|
|
|
|
|
insuranceAccountDetailPO.setSupplementaryMonth(baseMap.get("补缴月份").toString());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
insuranceAccountDetailPO.setUpdateTime(new Date());
|
|
|
|
|
|
|
2022-09-02 15:40:05 +08:00
|
|
|
|
return insuranceAccountDetailPO;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-04-23 16:35:52 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* map中value值求和
|
|
|
|
|
|
*/
|
|
|
|
|
|
public String sumOfMapValue(Map<String, String> welfarePay){
|
|
|
|
|
|
BigDecimal sum = new BigDecimal("0");
|
|
|
|
|
|
for (String value : welfarePay.values()) {
|
|
|
|
|
|
sum = sum.add(new BigDecimal(value));
|
|
|
|
|
|
}
|
|
|
|
|
|
return sum.toString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-02 15:40:05 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 对比新旧两份数据,并更新数据
|
|
|
|
|
|
*/
|
2022-09-06 17:13:33 +08:00
|
|
|
|
private Map<String, String> checkJsonMap(Map<String, String> newMap, String oldJson) {
|
|
|
|
|
|
Map<String, String> oldMap = JSON.parseObject(oldJson, HashMap.class);
|
2022-09-14 14:36:05 +08:00
|
|
|
|
|
2023-01-12 17:23:26 +08:00
|
|
|
|
Map<String, String> toDelMap = new HashMap<>();
|
2022-09-14 14:36:05 +08:00
|
|
|
|
//校验newMap中的value值是否为整数或者小数
|
|
|
|
|
|
for(Map.Entry<String, String> newEntry : newMap.entrySet()) {
|
|
|
|
|
|
String newValue = newEntry.getValue();
|
|
|
|
|
|
int l = newValue.length();
|
|
|
|
|
|
|
|
|
|
|
|
if (newValue.length() > 0 && !isNumeric(newValue)) {
|
|
|
|
|
|
throw new SalaryRunTimeException("请检查导入Excel中个人或单位对应的福利项数值是否为整数或小数!");
|
|
|
|
|
|
}
|
2023-01-12 17:23:26 +08:00
|
|
|
|
|
|
|
|
|
|
if ("".equals(newEntry.getValue())) {
|
|
|
|
|
|
toDelMap.put(newEntry.getKey(), newEntry.getValue());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (toDelMap.size() > 0) {
|
|
|
|
|
|
for (Map.Entry<String, String> delEntry : toDelMap.entrySet()) {
|
|
|
|
|
|
newMap.remove(delEntry.getKey());
|
|
|
|
|
|
}
|
2022-09-14 14:36:05 +08:00
|
|
|
|
}
|
2022-09-20 16:36:01 +08:00
|
|
|
|
|
2023-01-12 17:23:26 +08:00
|
|
|
|
|
2022-09-20 16:36:01 +08:00
|
|
|
|
if (oldMap == null) {
|
|
|
|
|
|
return newMap;
|
|
|
|
|
|
}
|
2022-09-14 14:36:05 +08:00
|
|
|
|
//保留oldMap无变动数据,更新newMap已变动数据
|
2022-09-02 15:40:05 +08:00
|
|
|
|
for (Map.Entry<String, String> oldEntry : oldMap.entrySet()) {
|
|
|
|
|
|
if (!newMap.containsKey(oldEntry.getKey())) {
|
|
|
|
|
|
newMap.put(oldEntry.getKey(), oldEntry.getValue());
|
2022-09-14 14:36:05 +08:00
|
|
|
|
} else if (newMap.containsKey(oldEntry.getKey()) && "".equals(newMap.get(oldEntry.getKey()))) {
|
|
|
|
|
|
newMap.put(oldEntry.getKey(), oldEntry.getValue());
|
2022-09-02 15:40:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-09-14 14:36:05 +08:00
|
|
|
|
|
2022-09-02 15:40:05 +08:00
|
|
|
|
return newMap;
|
2022-09-02 11:53:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-14 14:36:05 +08:00
|
|
|
|
/**
|
2022-09-21 10:47:07 +08:00
|
|
|
|
* 判断字符串是否为整数或者小数或者负数
|
2022-09-14 14:36:05 +08:00
|
|
|
|
*/
|
|
|
|
|
|
public static boolean isNumeric(String str){
|
|
|
|
|
|
|
2022-09-21 10:47:07 +08:00
|
|
|
|
// Pattern pattern = Pattern.compile("[0-9]*\\.?[0-9]+");
|
|
|
|
|
|
Pattern pattern = Pattern.compile("^-?\\d+(\\.\\d+)?$");
|
2022-09-14 14:36:05 +08:00
|
|
|
|
Matcher isNum = pattern.matcher(str);
|
|
|
|
|
|
if (!isNum.matches()) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-02 11:53:38 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 校验福利核算的账单月份输入格式是否正确
|
|
|
|
|
|
*/
|
|
|
|
|
|
public boolean checkBillMonth(String billMonth) {
|
|
|
|
|
|
|
2022-09-06 17:13:33 +08:00
|
|
|
|
//校验内容:billMonth的长度是否为7、年月连接符是否为“-”
|
|
|
|
|
|
String connector;
|
2022-09-02 11:53:38 +08:00
|
|
|
|
if(billMonth.length() == 7){
|
|
|
|
|
|
connector = billMonth.substring(4,5);
|
|
|
|
|
|
return "-".equals(connector);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-27 10:55:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 导出“福利核算-线下对比导入模板”
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
2023-04-18 14:21:05 +08:00
|
|
|
|
public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAccountDetailParam param) {
|
|
|
|
|
|
|
|
|
|
|
|
//查询线上福利核算记录
|
|
|
|
|
|
InsuranceExportParam insuranceExportParam = new InsuranceExportParam();
|
|
|
|
|
|
insuranceExportParam.setBillMonth(param.getBillMonth());
|
|
|
|
|
|
insuranceExportParam.setPaymentOrganization(param.getPaymentOrganization());
|
|
|
|
|
|
List<AccountExportPO> accountExportPOS = getInsuranceExportMapper().exportAccount(param.getPaymentStatus(), insuranceExportParam);
|
|
|
|
|
|
|
|
|
|
|
|
//整理线上核算记录相关的福利方案,并以此整理需要对比的福利项类别数据
|
|
|
|
|
|
Set<Long> welfareSchemeIds = new HashSet<>();
|
|
|
|
|
|
accountExportPOS.forEach(f -> {
|
|
|
|
|
|
welfareSchemeIds.add(f.getSocialSchemeId());
|
|
|
|
|
|
welfareSchemeIds.add(f.getFundSchemeId());
|
|
|
|
|
|
welfareSchemeIds.add(f.getOtherSchemeId());
|
|
|
|
|
|
});
|
|
|
|
|
|
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPos = getInsuranceSchemeDetailMapper().listAll();
|
|
|
|
|
|
List<Long> insuranceBaseIds = insuranceSchemeDetailPos.stream()
|
|
|
|
|
|
.filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1)
|
|
|
|
|
|
.map(InsuranceSchemeDetailPO::getInsuranceId)
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
List<Long> insurancePerPayIds = insuranceSchemeDetailPos.stream()
|
|
|
|
|
|
.filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1 && f.getPaymentScope() == 2)
|
|
|
|
|
|
.map(InsuranceSchemeDetailPO::getInsuranceId)
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
List<Long> insuranceComPayIds = insuranceSchemeDetailPos.stream()
|
|
|
|
|
|
.filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1 && f.getPaymentScope() == 1)
|
|
|
|
|
|
.map(InsuranceSchemeDetailPO::getInsuranceId)
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
Set<Long> insuranceBaseSet = new HashSet<>(insuranceBaseIds);
|
|
|
|
|
|
Set<Long> insurancePerPaySet = new HashSet<>(insurancePerPayIds);
|
|
|
|
|
|
Set<Long> insuranceComPaySet = new HashSet<>(insuranceComPayIds);
|
2022-09-27 10:55:57 +08:00
|
|
|
|
|
2023-03-07 14:21:01 +08:00
|
|
|
|
List<ICategoryPO> listAll = getICategoryMapper().listAll();
|
2023-04-18 14:21:05 +08:00
|
|
|
|
List<ICategoryPO> socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList());
|
|
|
|
|
|
List<ICategoryPO> fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList());
|
|
|
|
|
|
List<ICategoryPO> otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
List<ICategoryPO> socialWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList());
|
|
|
|
|
|
List<ICategoryPO> fundWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList());
|
|
|
|
|
|
List<ICategoryPO> otherWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
List<ICategoryPO> socialWelComList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList());
|
|
|
|
|
|
List<ICategoryPO> fundWelComList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList());
|
|
|
|
|
|
List<ICategoryPO> otherWelComList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList());
|
|
|
|
|
|
|
2022-09-27 10:55:57 +08:00
|
|
|
|
List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"),
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(86185, "部门"),
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(86186, "手机号"),
|
2022-09-27 11:39:57 +08:00
|
|
|
|
SalaryI18nUtil.getI18nLabel(86317, "工号"),
|
2022-09-27 10:55:57 +08:00
|
|
|
|
SalaryI18nUtil.getI18nLabel(86187, "员工状态"),
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(100377, "数据来源"),
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人"));
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(91324, "社保账号"));
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"));
|
|
|
|
|
|
// "失业保险申报基数"
|
|
|
|
|
|
// "生育保险申报基数"
|
|
|
|
|
|
// "养老保险申报基数"
|
|
|
|
|
|
// "医疗保险申报基数"
|
|
|
|
|
|
// "工伤保险申报基数"
|
|
|
|
|
|
for (ICategoryPO po : socialWelfareList) {
|
|
|
|
|
|
headerList.add(po.getInsuranceName() + "申报基数");
|
|
|
|
|
|
}
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(91486, "公积金账号"));
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"));
|
|
|
|
|
|
//组装公积金基数
|
|
|
|
|
|
for (ICategoryPO po : fundWelfareList) {
|
|
|
|
|
|
headerList.add(po.getInsuranceName() + "申报基数");
|
|
|
|
|
|
}
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号"));
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"));
|
|
|
|
|
|
//组装其他福利基数
|
|
|
|
|
|
for (ICategoryPO po : otherWelfareList) {
|
|
|
|
|
|
headerList.add(po.getInsuranceName() + "申报基数");
|
|
|
|
|
|
}
|
|
|
|
|
|
//社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人)
|
2023-04-18 14:21:05 +08:00
|
|
|
|
for (ICategoryPO po : socialWelPerList) {
|
2022-09-27 10:55:57 +08:00
|
|
|
|
headerList.add(po.getInsuranceName() + "个人");
|
|
|
|
|
|
}
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100388, "社保个人合计"));
|
|
|
|
|
|
//住房公积金个人、补充住房公积金个人
|
2023-04-18 14:21:05 +08:00
|
|
|
|
for (ICategoryPO po : fundWelPerList) {
|
2022-09-27 10:55:57 +08:00
|
|
|
|
headerList.add(po.getInsuranceName() + "个人");
|
|
|
|
|
|
}
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100390, "公积金个人合计"));
|
|
|
|
|
|
//其他个人(比如企业年金个人)
|
2023-04-18 14:21:05 +08:00
|
|
|
|
for (ICategoryPO po : otherWelPerList) {
|
2022-09-27 10:55:57 +08:00
|
|
|
|
headerList.add(po.getInsuranceName() + "个人");
|
|
|
|
|
|
}
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100392, "其他福利个人合计"));
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100393, "个人合计"));
|
|
|
|
|
|
//社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位)
|
2023-04-18 14:21:05 +08:00
|
|
|
|
for (ICategoryPO po : socialWelComList) {
|
2022-09-27 10:55:57 +08:00
|
|
|
|
headerList.add(po.getInsuranceName() + "单位");
|
|
|
|
|
|
}
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100394, "社保单位合计"));
|
|
|
|
|
|
//住房公积金单位、补充住房公积金单位
|
2023-04-18 14:21:05 +08:00
|
|
|
|
for (ICategoryPO po : fundWelComList) {
|
2022-09-27 10:55:57 +08:00
|
|
|
|
headerList.add(po.getInsuranceName() + "单位");
|
|
|
|
|
|
}
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100395, "公积金单位合计"));
|
|
|
|
|
|
//其他单位(比如企业年金单位)
|
2023-04-18 14:21:05 +08:00
|
|
|
|
for (ICategoryPO po : otherWelComList) {
|
2022-09-27 10:55:57 +08:00
|
|
|
|
headerList.add(po.getInsuranceName() + "单位");
|
|
|
|
|
|
}
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计"));
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100397, "单位合计"));
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100398, "社保合计"));
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100399, "公积金合计"));
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(100400, "其他福利合计"));
|
|
|
|
|
|
headerList.add(SalaryI18nUtil.getI18nLabel(93278, "合计"));
|
|
|
|
|
|
|
|
|
|
|
|
List<List<Object>> rows = new ArrayList<>();
|
|
|
|
|
|
rows.add(headerList);
|
|
|
|
|
|
String sheetName = "福利核算-线下对比导入模板";
|
|
|
|
|
|
|
|
|
|
|
|
return ExcelUtil.genWorkbookV2(rows, sheetName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-27 17:36:06 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 将通过“福利核算-线下对比导入”模板导入的数据更新到hrsa_excel_bill_detail表中
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> importExcelInsuranceDetail(ExcelInsuranceImportParam importParam) {
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
|
|
|
|
|
//查询对于人员信息导入筛选的全局配置
|
|
|
|
|
|
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
|
|
|
|
|
|
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
|
|
|
|
|
|
//检验参数
|
|
|
|
|
|
//excel文件id
|
|
|
|
|
|
String imageId = Util.null2String(importParam.getImageId());
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(imageId)) {
|
|
|
|
|
|
throw new SalaryRunTimeException("文件不存在");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取租户下所有的人员
|
2023-04-12 15:27:35 +08:00
|
|
|
|
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listEmployee();
|
2022-09-27 17:36:06 +08:00
|
|
|
|
|
|
|
|
|
|
// 失败的数量
|
|
|
|
|
|
int failCount = 0;
|
|
|
|
|
|
// 成功的数量
|
|
|
|
|
|
int successCount = 0;
|
|
|
|
|
|
InputStream fileInputStream = null;
|
|
|
|
|
|
try {
|
|
|
|
|
|
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(importParam.getImageId()));
|
|
|
|
|
|
|
|
|
|
|
|
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
|
|
|
|
|
|
|
|
|
|
|
// 错误提示信息
|
|
|
|
|
|
List<Map> excelComments = Lists.newArrayList();
|
|
|
|
|
|
// 存在错误的那行数据
|
|
|
|
|
|
List<Map<String, Object>> errorDatas = Lists.newArrayList();
|
|
|
|
|
|
// 表头
|
|
|
|
|
|
List<String> headers = ExcelSupport.getSheetHeader(sheet, 0);
|
|
|
|
|
|
// 处理数值
|
|
|
|
|
|
List<Map<String, Object>> data = ExcelParseHelper.parse2Map(sheet, 1);
|
|
|
|
|
|
if (CollectionUtils.isEmpty(headers)) {
|
2022-11-17 13:39:50 +08:00
|
|
|
|
throw new SalaryRunTimeException("表头为空");
|
2022-09-27 17:36:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isEmpty(data)) {
|
2022-11-17 13:39:50 +08:00
|
|
|
|
throw new SalaryRunTimeException("无数据");
|
2022-09-27 17:36:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String billMonth = importParam.getBillMonth();
|
|
|
|
|
|
//存储待更新的InsuranceAccountDetailPO数据
|
|
|
|
|
|
List<ExcelInsuranceDetailPO> addCompareList = new ArrayList<>();
|
|
|
|
|
|
//记录待删除hrsa_excel_bill_detail.id
|
|
|
|
|
|
List<Long> idList = new ArrayList<>();
|
|
|
|
|
|
//遍历excel表具体数据
|
|
|
|
|
|
for (int i = 0; i < data.size(); i++) {
|
|
|
|
|
|
|
|
|
|
|
|
String row = "第" + (i + 2) + "行";
|
|
|
|
|
|
|
|
|
|
|
|
boolean isError = false;
|
|
|
|
|
|
Map<String, Object> map = data.get(i);
|
|
|
|
|
|
Long employeeId = 0L;
|
|
|
|
|
|
|
|
|
|
|
|
List<ExcelInsuranceDetailPO> list = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
String taxAgentName = (String) map.getOrDefault("个税扣缴义务人", "");
|
|
|
|
|
|
Long paymentOrganization = 0L;
|
|
|
|
|
|
List<TaxAgentPO> taxAgentPoList = getTaxAgentMapper().listByName(taxAgentName);
|
|
|
|
|
|
|
|
|
|
|
|
if (taxAgentPoList.size() == 1) {
|
|
|
|
|
|
paymentOrganization = taxAgentPoList.get(0).getId();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "个税扣缴义务人错误,系统内不存在该个税扣缴义务人")));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//遍历表头
|
|
|
|
|
|
for (int j = 0; j < headers.size(); j++) {
|
|
|
|
|
|
String header = headers.get(j);
|
|
|
|
|
|
String dataKey = header;
|
|
|
|
|
|
if (dataKey == null) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
String dataValue = (String) map.getOrDefault(dataKey.toString(), "");
|
|
|
|
|
|
String deparmentName = (String) map.getOrDefault("部门", "");
|
|
|
|
|
|
String mobile = (String) map.getOrDefault("手机号", "");
|
|
|
|
|
|
String workcode = (String) map.getOrDefault("工号", "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) {
|
|
|
|
|
|
//当人员信息导入筛选的全局配置为"0"时,姓名才是必填项
|
|
|
|
|
|
if (StringUtils.isEmpty(dataValue) && "0".equals(confValue)) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
|
|
|
|
|
List<DataCollectionEmployee> employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode, null);
|
|
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(employeeSameIds)) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "姓名错误,系统内不存在该姓名"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (employeeSameIds.size() > 1) {
|
|
|
|
|
|
//存在离职和在职状态取在职状态
|
|
|
|
|
|
employeeSameIds = employeeSameIds.stream()
|
|
|
|
|
|
.filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus()))
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
if (employeeSameIds.size() != 1) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + "员工信息不存在或者存在多个员工");
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
employeeId = employeeSameIds.get(0).getEmployeeId();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!isError){
|
|
|
|
|
|
List<Long> employeeIds = new ArrayList<>();
|
|
|
|
|
|
employeeIds.add(employeeId);
|
|
|
|
|
|
//根据员工id、个税扣缴义务人id、账单月份查询,如果当前对比表中存在数据,则记录为待删除数据
|
|
|
|
|
|
list = getExcelInsuranceDetailMapper().queryCompareList(billMonth, paymentOrganization, employeeIds.get(0));
|
|
|
|
|
|
|
|
|
|
|
|
if (!list.isEmpty()) {
|
|
|
|
|
|
List<Long> ids = list.stream().map(ExcelInsuranceDetailPO::getId)
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
idList.addAll(ids);
|
|
|
|
|
|
}
|
|
|
|
|
|
//拼装待更新数据
|
|
|
|
|
|
addCompareList.add(handleExcelInsuranceDetail(billMonth, employeeId, paymentOrganization, map));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isError) {
|
|
|
|
|
|
failCount++;
|
|
|
|
|
|
errorDatas.add(map);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
successCount++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
//将待更新列表加密
|
2022-12-13 13:34:22 +08:00
|
|
|
|
encryptUtil.encryptList(addCompareList, ExcelInsuranceDetailPO.class);
|
2022-09-27 17:36:06 +08:00
|
|
|
|
//删除
|
|
|
|
|
|
if (idList.size() > 0) {
|
|
|
|
|
|
getExcelInsuranceDetailMapper().batchDelByIds(idList);
|
|
|
|
|
|
}
|
|
|
|
|
|
//新增
|
|
|
|
|
|
getExcelInsuranceDetailMapper().batchSave(addCompareList);
|
|
|
|
|
|
|
|
|
|
|
|
apidatas.put("successCount", successCount);
|
|
|
|
|
|
apidatas.put("errorCount", failCount);
|
|
|
|
|
|
apidatas.put("errorData", excelComments);
|
|
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
IOUtils.closeQuietly(fileInputStream);
|
|
|
|
|
|
}
|
|
|
|
|
|
return apidatas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 将excel导入的数据行组装成ExcelInsuranceDetailPO对象
|
|
|
|
|
|
* @param billMonth 对比的账单月份
|
|
|
|
|
|
* @param baseMap excel导入的对比数据
|
|
|
|
|
|
*/
|
|
|
|
|
|
private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map<String, Object> baseMap) {
|
|
|
|
|
|
|
|
|
|
|
|
ExcelInsuranceDetailPO excelInsuranceDetailPO = new ExcelInsuranceDetailPO();
|
2022-09-30 10:55:46 +08:00
|
|
|
|
excelInsuranceDetailPO.setId(IdGenerator.generate());
|
2022-09-27 17:36:06 +08:00
|
|
|
|
//组装json数据,格式Map<String, Object>
|
|
|
|
|
|
Map<String, String> socialPerMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> fundPerMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> otherPerMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> socialComMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> fundComMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> otherComMap = new HashMap<>();
|
2022-09-29 11:13:49 +08:00
|
|
|
|
//组装福利基数
|
2022-09-27 17:36:06 +08:00
|
|
|
|
Map<String, String> socialPaymentBaseMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> fundPaymentBaseMap = new HashMap<>();
|
|
|
|
|
|
Map<String, String> otherPaymentBaseMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
//筛选出福利核算项
|
|
|
|
|
|
Map<String, Object> toDealMap =
|
|
|
|
|
|
baseMap.entrySet().stream()
|
|
|
|
|
|
.filter(map -> !"姓名".equals(map.getKey())
|
|
|
|
|
|
&& !"部门".equals(map.getKey())
|
|
|
|
|
|
&& !"手机号".equals(map.getKey())
|
|
|
|
|
|
&& !"个税扣缴义务人".equals(map.getKey())
|
|
|
|
|
|
&& !"员工状态".equals(map.getKey())
|
|
|
|
|
|
&& !"数据来源".equals(map.getKey())
|
|
|
|
|
|
&& !"工号".equals(map.getKey()))
|
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
|
|
|
|
|
|
|
|
|
|
|
for(Map.Entry<String, Object> entry : toDealMap.entrySet()) {
|
|
|
|
|
|
//判断元素是否属于福利类
|
|
|
|
|
|
String keyName = entry.getKey();
|
|
|
|
|
|
//获取元素名后缀,方便之后判断“个人”或“单位”或者“基数”
|
|
|
|
|
|
String payScope = keyName.substring(keyName.length() - 2);
|
|
|
|
|
|
//获取福利类型
|
|
|
|
|
|
Integer welfareType;
|
|
|
|
|
|
//根据元素名后缀,区分截取内容
|
|
|
|
|
|
String targetWelfareName;
|
|
|
|
|
|
if ("基数".equals(payScope)) {
|
|
|
|
|
|
targetWelfareName = entry.getKey().substring(0, keyName.length() - 4);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
targetWelfareName = entry.getKey().substring(0, keyName.length() - 2);
|
|
|
|
|
|
}
|
|
|
|
|
|
List<ICategoryPO> categoryPOList = siCategoryBiz.listByName(targetWelfareName);
|
|
|
|
|
|
if (categoryPOList.size() == 1) {
|
|
|
|
|
|
ICategoryPO iCategoryPO = categoryPOList.get(0);
|
|
|
|
|
|
welfareType = iCategoryPO.getWelfareType();
|
|
|
|
|
|
|
|
|
|
|
|
switch (payScope) {
|
|
|
|
|
|
case "个人":
|
|
|
|
|
|
switch (welfareType) {
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
socialPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
fundPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
throw new SalaryRunTimeException("福利类型不存在");
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "单位":
|
|
|
|
|
|
switch (welfareType) {
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
socialComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
fundComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
throw new SalaryRunTimeException("福利类型不存在");
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "基数":
|
|
|
|
|
|
switch (welfareType) {
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
socialPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
fundPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
otherPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString());
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
throw new SalaryRunTimeException("福利类型不存在");
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//设置社保个人和公司缴纳明细
|
|
|
|
|
|
excelInsuranceDetailPO.setSocialPerJson(JSON.toJSONString(socialPerMap));
|
|
|
|
|
|
excelInsuranceDetailPO.setSocialComJson(JSON.toJSONString(socialComMap));
|
|
|
|
|
|
//设置公积金个人和公司缴纳明细
|
|
|
|
|
|
excelInsuranceDetailPO.setFundPerJson(JSON.toJSONString(fundPerMap));
|
|
|
|
|
|
excelInsuranceDetailPO.setFundComJson(JSON.toJSONString(fundComMap));
|
|
|
|
|
|
//设置其他福利个人和公司缴纳明细
|
|
|
|
|
|
excelInsuranceDetailPO.setOtherPerJson(JSON.toJSONString(otherPerMap));
|
|
|
|
|
|
excelInsuranceDetailPO.setOtherComJson(JSON.toJSONString(otherComMap));
|
|
|
|
|
|
//设置社保、公积金、其他福利缴纳基数
|
|
|
|
|
|
excelInsuranceDetailPO.setSocialPaymentBaseString(JSON.toJSONString(socialPaymentBaseMap));
|
|
|
|
|
|
excelInsuranceDetailPO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBaseMap));
|
|
|
|
|
|
excelInsuranceDetailPO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBaseMap));
|
|
|
|
|
|
|
|
|
|
|
|
//组装新的insuranceAccountDetailPO对象数据
|
|
|
|
|
|
excelInsuranceDetailPO.setEmployeeId(employeeId);
|
|
|
|
|
|
excelInsuranceDetailPO.setBillMonth(billMonth);
|
|
|
|
|
|
excelInsuranceDetailPO.setBillStatus(1);
|
|
|
|
|
|
excelInsuranceDetailPO.setPaymentStatus(0);
|
|
|
|
|
|
excelInsuranceDetailPO.setResourceFrom(1);
|
|
|
|
|
|
excelInsuranceDetailPO.setSocialAccount(baseMap.getOrDefault("社保账号", "").toString());
|
|
|
|
|
|
if (baseMap.getOrDefault("社保方案名称", "") != null) {
|
|
|
|
|
|
List<InsuranceSchemePO> socialSchemeList = getInsuranceSchemeMapper().listByName(baseMap.get("社保方案名称").toString());
|
|
|
|
|
|
if (socialSchemeList.size() == 1) {
|
|
|
|
|
|
//设置社保方案id
|
|
|
|
|
|
excelInsuranceDetailPO.setSocialSchemeId(socialSchemeList.get(0).getId());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
excelInsuranceDetailPO.setFundAccount(baseMap.getOrDefault("公积金账号", "").toString());
|
|
|
|
|
|
excelInsuranceDetailPO.setSupplementFundAccount(baseMap.getOrDefault("补充公积金账号", "").toString());
|
|
|
|
|
|
if (baseMap.getOrDefault("公积金方案名称", "") != null) {
|
|
|
|
|
|
List<InsuranceSchemePO> fundSchemeList = getInsuranceSchemeMapper().listByName(baseMap.get("公积金方案名称").toString());
|
|
|
|
|
|
if (fundSchemeList.size() == 1) {
|
|
|
|
|
|
//设置公积金方案id
|
|
|
|
|
|
excelInsuranceDetailPO.setFundSchemeId(fundSchemeList.get(0).getId());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (baseMap.getOrDefault("其他福利方案名称", "") != null) {
|
|
|
|
|
|
List<InsuranceSchemePO> otherSchemeList = getInsuranceSchemeMapper().listByName(baseMap.get("其他福利方案名称").toString());
|
|
|
|
|
|
if (otherSchemeList.size() == 1) {
|
|
|
|
|
|
//其他福利方案id
|
|
|
|
|
|
excelInsuranceDetailPO.setOtherSchemeId(otherSchemeList.get(0).getId());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
excelInsuranceDetailPO.setSocialPerSum(baseMap.getOrDefault("社保个人合计", "").toString());
|
|
|
|
|
|
excelInsuranceDetailPO.setFundPerSum(baseMap.getOrDefault("公积金个人合计", "").toString());
|
|
|
|
|
|
excelInsuranceDetailPO.setOtherPerSum(baseMap.getOrDefault("其他福利个人合计", "").toString());
|
|
|
|
|
|
excelInsuranceDetailPO.setPerSum(baseMap.getOrDefault("个人合计", "").toString());
|
|
|
|
|
|
|
|
|
|
|
|
excelInsuranceDetailPO.setSocialComSum(baseMap.getOrDefault("社保单位合计", "").toString());
|
|
|
|
|
|
excelInsuranceDetailPO.setFundComSum(baseMap.getOrDefault("公积金单位合计", "").toString());
|
|
|
|
|
|
excelInsuranceDetailPO.setOtherComSum(baseMap.getOrDefault("其他福利单位合计", "").toString());
|
|
|
|
|
|
excelInsuranceDetailPO.setComSum(baseMap.getOrDefault("单位合计", "").toString());
|
|
|
|
|
|
|
|
|
|
|
|
excelInsuranceDetailPO.setSocialSum(baseMap.getOrDefault("社保合计", "").toString());
|
|
|
|
|
|
excelInsuranceDetailPO.setFundSum(baseMap.getOrDefault("公积金合计", "").toString());
|
|
|
|
|
|
excelInsuranceDetailPO.setOtherSum(baseMap.getOrDefault("其他福利合计", "").toString());
|
|
|
|
|
|
excelInsuranceDetailPO.setTotal(baseMap.getOrDefault("合计", "").toString());
|
|
|
|
|
|
|
2022-09-30 10:55:46 +08:00
|
|
|
|
excelInsuranceDetailPO.setCreator((long) user.getUID());
|
2022-09-27 17:36:06 +08:00
|
|
|
|
excelInsuranceDetailPO.setCreateTime(new Date());
|
|
|
|
|
|
excelInsuranceDetailPO.setUpdateTime(new Date());
|
|
|
|
|
|
excelInsuranceDetailPO.setDeleteType(0);
|
|
|
|
|
|
excelInsuranceDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
|
|
|
|
|
|
excelInsuranceDetailPO.setPaymentOrganization(paymentOrganization);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return excelInsuranceDetailPO;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-24 09:31:44 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 刷新_bill_batch表中的统计信息
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void refreshBillBatch(Long paymentOrganization, String billMonth) {
|
|
|
|
|
|
ExecutorService taskExecutor = Executors.newCachedThreadPool();
|
|
|
|
|
|
taskExecutor.execute(() -> {
|
|
|
|
|
|
|
|
|
|
|
|
if (paymentOrganization != null && billMonth != null) {
|
|
|
|
|
|
InsuranceAccountDetailParam refreshParam =new InsuranceAccountDetailParam();
|
|
|
|
|
|
refreshParam.setBillMonth(billMonth);
|
|
|
|
|
|
refreshParam.setPaymentOrganization(paymentOrganization.toString());
|
|
|
|
|
|
PageInfo<InsuranceAccountViewListDTO> pageInfos = overView(refreshParam);
|
|
|
|
|
|
TaxAgentPO taxAgentPo = getTaxAgentMapper().getById(paymentOrganization);
|
|
|
|
|
|
if (taxAgentPo != null) {
|
|
|
|
|
|
List<InsuranceAccountViewListDTO> viewListDTOList = pageInfos.getList();
|
|
|
|
|
|
viewListDTOList.stream().filter(f -> f.getPayOrg().equals(taxAgentPo.getName())).collect(Collectors.toList());
|
|
|
|
|
|
InsuranceAccountBatchPO batchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, paymentOrganization);
|
2022-12-12 15:40:01 +08:00
|
|
|
|
batchPO = encryptUtil.decrypt(batchPO, InsuranceAccountBatchPO.class);
|
2022-11-24 09:31:44 +08:00
|
|
|
|
//更新
|
|
|
|
|
|
if (viewListDTOList.size() > 0 && batchPO != null) {
|
|
|
|
|
|
InsuranceAccountViewListDTO viewListDTO = viewListDTOList.get(0);
|
|
|
|
|
|
batchPO.setSocialNum(viewListDTO.getSocialNum());
|
|
|
|
|
|
batchPO.setFundNum(viewListDTO.getFundNum());
|
|
|
|
|
|
batchPO.setOtherNum(viewListDTO.getOtherNum());
|
|
|
|
|
|
|
|
|
|
|
|
batchPO.setSocialPay(viewListDTO.getSocialPaySum().replace(",", ""));
|
|
|
|
|
|
batchPO.setFundPay(viewListDTO.getFundPaySum().replace(",", ""));
|
|
|
|
|
|
batchPO.setOtherPay(viewListDTO.getOtherPaySum().replace(",", ""));
|
|
|
|
|
|
|
|
|
|
|
|
batchPO.setUpdateTime(new Date());
|
2022-12-12 15:40:01 +08:00
|
|
|
|
batchPO = encryptUtil.encrypt(batchPO, InsuranceAccountBatchPO.class);
|
2022-11-24 09:31:44 +08:00
|
|
|
|
getInsuranceAccountBatchMapper().updateById(batchPO);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2022-11-18 16:07:20 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 将通过id获取InsuranceAccountDetailPO中的社保、公积金、其他福利个人和公司缴纳数据
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> getPaymentById(Long id) {
|
|
|
|
|
|
|
|
|
|
|
|
InsuranceAccountDetailPO insuranceAccountDetailPO = getInsuranceAccountDetailMapper().getById(id);
|
|
|
|
|
|
if (insuranceAccountDetailPO == null) {
|
|
|
|
|
|
throw new SalaryRunTimeException("该条核算数据不存在!");
|
|
|
|
|
|
}
|
2022-12-12 17:56:26 +08:00
|
|
|
|
encryptUtil.decrypt(insuranceAccountDetailPO, InsuranceAccountDetailPO.class);
|
2022-11-18 16:07:20 +08:00
|
|
|
|
String socialPerJson = insuranceAccountDetailPO.getSocialPerJson();
|
|
|
|
|
|
String socialComJson = insuranceAccountDetailPO.getSocialComJson();
|
|
|
|
|
|
String fundPerJson = insuranceAccountDetailPO.getFundPerJson();
|
|
|
|
|
|
String fundComJson = insuranceAccountDetailPO.getFundComJson();
|
|
|
|
|
|
String otherPerJson = insuranceAccountDetailPO.getOtherPerJson();
|
|
|
|
|
|
String otherComJson = insuranceAccountDetailPO.getOtherComJson();
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> dataMap = new HashMap<>();
|
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
getPaymentGroup(socialPerJson, "个人", "社保", dataMap, addGroups);
|
|
|
|
|
|
getPaymentGroup(socialComJson, "公司", "社保", dataMap, addGroups);
|
|
|
|
|
|
getPaymentGroup(fundPerJson, "个人", "公积金", dataMap, addGroups);
|
|
|
|
|
|
getPaymentGroup(fundComJson, "公司", "公积金", dataMap, addGroups);
|
|
|
|
|
|
getPaymentGroup(otherPerJson, "个人", "其他福利", dataMap, addGroups);
|
|
|
|
|
|
getPaymentGroup(otherComJson, "公司", "其他福利", dataMap, addGroups);
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
2022-11-24 10:43:20 +08:00
|
|
|
|
// resultMap.put("data", dataMap);
|
|
|
|
|
|
// resultMap.put("items", addGroups);
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, String>> perList = new ArrayList<>();
|
|
|
|
|
|
List<Map<String, String>> comList = new ArrayList<>();
|
|
|
|
|
|
for (SearchConditionGroup group : addGroups) {
|
|
|
|
|
|
|
2022-11-24 11:04:12 +08:00
|
|
|
|
if (group.getItems() != null && group.getItems().size() > 0) {
|
|
|
|
|
|
for (SearchConditionItem item : group.getItems()) {
|
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
String[] domkey = item.getDomkey();
|
|
|
|
|
|
String insuranceId = domkey[0].substring(3);
|
|
|
|
|
|
if (group.getTitle().contains("个人")) {
|
|
|
|
|
|
map.put("title", group.getTitle());
|
|
|
|
|
|
map.put("paymentScope", "个人");
|
|
|
|
|
|
map.put("insuranceName", item.getLabel());
|
|
|
|
|
|
map.put("insuranceId", insuranceId);
|
|
|
|
|
|
map.put("insuranceValue", dataMap.get(domkey[0]));
|
2022-12-23 16:34:12 +08:00
|
|
|
|
if (map.get("insuranceValue") != null && !"".equals(map.get("insuranceValue"))) {
|
|
|
|
|
|
|
|
|
|
|
|
perList.add(map);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-24 11:04:12 +08:00
|
|
|
|
} else if (group.getTitle().contains("公司")) {
|
|
|
|
|
|
map.put("title", group.getTitle());
|
|
|
|
|
|
map.put("paymentScope", "公司");
|
|
|
|
|
|
map.put("insuranceName", item.getLabel());
|
|
|
|
|
|
map.put("insuranceId", insuranceId);
|
|
|
|
|
|
map.put("insuranceValue", dataMap.get(domkey[0]));
|
2022-12-23 16:34:12 +08:00
|
|
|
|
if (map.get("insuranceValue") != null && !"".equals(map.get("insuranceValue"))) {
|
|
|
|
|
|
|
|
|
|
|
|
comList.add(map);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-24 11:04:12 +08:00
|
|
|
|
}
|
2022-11-24 10:43:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-11-24 11:04:12 +08:00
|
|
|
|
|
2022-11-24 10:43:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, String>> resultList = new ArrayList<>();
|
|
|
|
|
|
resultList.addAll(perList);
|
|
|
|
|
|
resultList.addAll(comList);
|
|
|
|
|
|
resultMap.put("data", resultList);
|
2022-11-18 16:07:20 +08:00
|
|
|
|
|
|
|
|
|
|
return resultMap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void getPaymentGroup(String baseJson, String groupType, String welfareType, Map<String, String> dataMap, List<SearchConditionGroup> addGroups) {
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(baseJson)) {
|
|
|
|
|
|
addGroups.add(new SearchConditionGroup(welfareType + groupType +"缴纳", true, null));
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String groupPrefix = "个人".equals(groupType) ? "per" : "com";
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> toDealMap = JSON.parseObject(baseJson, new HashMap<String, String>().getClass());
|
|
|
|
|
|
Map<String, String> baseJsonMap = new HashMap<>();
|
|
|
|
|
|
List<SearchConditionItem> inputItems = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
for (Map.Entry<String, String> entry : toDealMap.entrySet()) {
|
|
|
|
|
|
//获取福利项信息
|
|
|
|
|
|
ICategoryPO iCategoryPO = siCategoryBiz.getByID(Long.valueOf(entry.getKey()));
|
|
|
|
|
|
if (iCategoryPO != null) {
|
|
|
|
|
|
String name = groupPrefix + iCategoryPO.getId().toString();
|
|
|
|
|
|
String label = iCategoryPO.getInsuranceName();
|
|
|
|
|
|
inputItems.add(SalaryFormItemUtil.inputNumberItem(user, "precision:2", 2, 12, 2, label, name));
|
|
|
|
|
|
}
|
|
|
|
|
|
baseJsonMap.put(groupPrefix + entry.getKey(), entry.getValue());
|
|
|
|
|
|
}
|
|
|
|
|
|
dataMap.putAll(baseJsonMap);
|
|
|
|
|
|
addGroups.add(new SearchConditionGroup(welfareType + groupType +"缴纳", true, inputItems));
|
|
|
|
|
|
}
|
2022-09-27 10:55:57 +08:00
|
|
|
|
|
2022-11-18 17:56:21 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 编辑InsuranceAccountDetailPO中的社保、公积金、其他福利个人和公司缴纳数据
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void editAccount(EditAccountDetailParam param) {
|
|
|
|
|
|
InsuranceAccountDetailPO insuranceAccountDetailPO = getInsuranceAccountDetailMapper().getById(param.getId());
|
|
|
|
|
|
if (insuranceAccountDetailPO == null) {
|
|
|
|
|
|
throw new SalaryRunTimeException("该条核算数据不存在!");
|
|
|
|
|
|
}
|
2022-12-12 17:56:26 +08:00
|
|
|
|
encryptUtil.decrypt(insuranceAccountDetailPO, InsuranceAccountDetailPO.class);
|
2022-11-18 17:56:21 +08:00
|
|
|
|
|
|
|
|
|
|
accountSocialByData(insuranceAccountDetailPO, param);
|
|
|
|
|
|
accountFundByData(insuranceAccountDetailPO, param);
|
|
|
|
|
|
accountOtherByData(insuranceAccountDetailPO, param);
|
|
|
|
|
|
account(insuranceAccountDetailPO);
|
|
|
|
|
|
|
2022-12-12 17:56:26 +08:00
|
|
|
|
encryptUtil.encrypt(insuranceAccountDetailPO, InsuranceAccountDetailPO.class);
|
2022-11-18 17:56:21 +08:00
|
|
|
|
getInsuranceAccountDetailMapper().updateById(insuranceAccountDetailPO);
|
2022-11-24 14:19:58 +08:00
|
|
|
|
|
|
|
|
|
|
//刷新_bill_batch表中的统计信息
|
|
|
|
|
|
refreshBillBatch(insuranceAccountDetailPO.getPaymentOrganization(), insuranceAccountDetailPO.getBillMonth());
|
2022-11-18 17:56:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void accountFundByData(InsuranceAccountDetailPO insuranceAccountDetailPO, EditAccountDetailParam baseParam) {
|
|
|
|
|
|
//公积金个人
|
|
|
|
|
|
if (StringUtils.isNotBlank(baseParam.getFundPerJson())) {
|
|
|
|
|
|
List<BigDecimal> fundPer = new ArrayList<>();
|
|
|
|
|
|
HashMap<String, String> fundPerson = JSON.parseObject(baseParam.getFundPerJson(), new HashMap<String, String>().getClass());
|
|
|
|
|
|
fundPerson.forEach((k, v) -> {
|
|
|
|
|
|
BigDecimal result = new BigDecimal(v);
|
|
|
|
|
|
fundPer.add(result);
|
|
|
|
|
|
});
|
|
|
|
|
|
insuranceAccountDetailPO.setFundPerJson(baseParam.getFundPerJson());
|
|
|
|
|
|
BigDecimal fundPerSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : fundPer) {
|
|
|
|
|
|
fundPerSum = fundPerSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setFundPerSum(fundPerSum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
//公积金单位
|
|
|
|
|
|
if (StringUtils.isNotBlank(baseParam.getFundComJson())) {
|
|
|
|
|
|
List<BigDecimal> fundCom = new ArrayList<>();
|
|
|
|
|
|
HashMap<String, String> fundComMap = JSON.parseObject(baseParam.getFundComJson(), new HashMap<String, String>().getClass());
|
|
|
|
|
|
fundComMap.forEach((k, v) -> {
|
|
|
|
|
|
BigDecimal result = new BigDecimal(v);
|
|
|
|
|
|
fundCom.add(result);
|
|
|
|
|
|
});
|
|
|
|
|
|
insuranceAccountDetailPO.setFundComJson(baseParam.getFundComJson());
|
|
|
|
|
|
BigDecimal fundComSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : fundCom) {
|
|
|
|
|
|
fundComSum = fundComSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setFundComSum(fundComSum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void accountOtherByData(InsuranceAccountDetailPO insuranceAccountDetailPO, EditAccountDetailParam baseParam) {
|
|
|
|
|
|
//其他福利个人
|
|
|
|
|
|
if (StringUtils.isNotBlank(baseParam.getOtherPerJson())) {
|
|
|
|
|
|
List<BigDecimal> otherPer = new ArrayList<>();
|
|
|
|
|
|
HashMap<String, String> otherPerMap = JSON.parseObject(baseParam.getOtherPerJson(), new HashMap<String, String>().getClass());
|
|
|
|
|
|
otherPerMap.forEach((k, v) -> {
|
|
|
|
|
|
BigDecimal result = new BigDecimal(v);
|
|
|
|
|
|
otherPer.add(result);
|
|
|
|
|
|
});
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherPerJson(baseParam.getOtherPerJson());
|
|
|
|
|
|
BigDecimal otherPerSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : otherPer) {
|
|
|
|
|
|
otherPerSum = otherPerSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherPerSum(otherPerSum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
//其他福利单位
|
|
|
|
|
|
if (StringUtils.isNotBlank(baseParam.getOtherComJson())) {
|
|
|
|
|
|
List<BigDecimal> otherCom = new ArrayList<>();
|
|
|
|
|
|
HashMap<String, String> otherComMap = JSON.parseObject(baseParam.getOtherComJson(), new HashMap<String, String>().getClass());
|
|
|
|
|
|
otherComMap.forEach((k, v) -> {
|
|
|
|
|
|
BigDecimal result = new BigDecimal(v);
|
|
|
|
|
|
otherCom.add(result);
|
|
|
|
|
|
});
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherComJson(baseParam.getOtherComJson());
|
|
|
|
|
|
BigDecimal otherComSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : otherCom) {
|
|
|
|
|
|
otherComSum = otherComSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherComSum(otherComSum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void accountSocialByData(InsuranceAccountDetailPO insuranceAccountDetailPO, EditAccountDetailParam baseParam) {
|
|
|
|
|
|
//社保个人
|
|
|
|
|
|
if (StringUtils.isNotBlank(baseParam.getSocialPerJson())) {
|
|
|
|
|
|
List<BigDecimal> socialPer = new ArrayList<>();
|
|
|
|
|
|
HashMap<String, String> archivesPerson = JSON.parseObject(baseParam.getSocialPerJson(), new HashMap<String, String>().getClass());
|
|
|
|
|
|
archivesPerson.forEach((k, v) -> {
|
|
|
|
|
|
BigDecimal result = new BigDecimal(v);
|
|
|
|
|
|
socialPer.add(result);
|
|
|
|
|
|
});
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialPerJson(baseParam.getSocialPerJson());
|
|
|
|
|
|
BigDecimal socialPerSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : socialPer) {
|
|
|
|
|
|
socialPerSum = socialPerSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
//社保单位
|
|
|
|
|
|
if (StringUtils.isNotBlank(baseParam.getSocialComJson())) {
|
|
|
|
|
|
List<BigDecimal> socialCom = new ArrayList<>();
|
|
|
|
|
|
HashMap<String, String> archivesCom = JSON.parseObject(baseParam.getSocialComJson(), new HashMap<String, String>().getClass());
|
|
|
|
|
|
archivesCom.forEach((k, v) -> {
|
|
|
|
|
|
BigDecimal result = new BigDecimal(v);
|
|
|
|
|
|
socialCom.add(result);
|
|
|
|
|
|
});
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialComJson(baseParam.getSocialComJson());
|
|
|
|
|
|
BigDecimal socialComSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : socialCom) {
|
|
|
|
|
|
socialComSum = socialComSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public InsuranceAccountDetailPO account(InsuranceAccountDetailPO insuranceAccountDetailPO) {
|
|
|
|
|
|
//个人合计
|
|
|
|
|
|
BigDecimal socialPerson =
|
|
|
|
|
|
StringUtils.isBlank(insuranceAccountDetailPO.getSocialPerSum()) ? new BigDecimal("0") : new BigDecimal(insuranceAccountDetailPO.getSocialPerSum());
|
|
|
|
|
|
BigDecimal fundPerson =
|
|
|
|
|
|
StringUtils.isBlank(insuranceAccountDetailPO.getFundPerSum()) ? new BigDecimal("0") : new BigDecimal(insuranceAccountDetailPO.getFundPerSum());
|
|
|
|
|
|
BigDecimal otherPerson =
|
|
|
|
|
|
StringUtils.isBlank(insuranceAccountDetailPO.getOtherPerSum()) ? new BigDecimal("0") : new BigDecimal(insuranceAccountDetailPO.getOtherPerSum());
|
|
|
|
|
|
BigDecimal perSum = socialPerson.add(fundPerson).add(otherPerson);
|
|
|
|
|
|
insuranceAccountDetailPO.setPerSum(perSum.toPlainString());
|
|
|
|
|
|
//单位合计
|
|
|
|
|
|
BigDecimal socialCom =
|
|
|
|
|
|
StringUtils.isBlank(insuranceAccountDetailPO.getSocialComSum()) ? new BigDecimal("0") : new BigDecimal(insuranceAccountDetailPO.getSocialComSum());
|
|
|
|
|
|
BigDecimal fundCom = StringUtils.isBlank(insuranceAccountDetailPO.getFundComSum()) ? new BigDecimal("0") : new BigDecimal(insuranceAccountDetailPO.getFundComSum());
|
|
|
|
|
|
BigDecimal otherCom =
|
|
|
|
|
|
StringUtils.isBlank(insuranceAccountDetailPO.getOtherComSum()) ? new BigDecimal("0") : new BigDecimal(insuranceAccountDetailPO.getOtherComSum());
|
|
|
|
|
|
BigDecimal comSum = socialCom.add(fundCom).add(otherCom);
|
|
|
|
|
|
insuranceAccountDetailPO.setComSum(comSum.toPlainString());
|
|
|
|
|
|
//社保合计
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialSum(socialPerson.add(socialCom).toPlainString());
|
|
|
|
|
|
//公积金合计
|
|
|
|
|
|
insuranceAccountDetailPO.setFundSum(fundPerson.add(fundCom).toPlainString());
|
|
|
|
|
|
//其他福利合计
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherSum(otherPerson.add(otherCom).toPlainString());
|
|
|
|
|
|
//合计
|
|
|
|
|
|
insuranceAccountDetailPO.setTotal(perSum.add(comSum).toPlainString());
|
|
|
|
|
|
return insuranceAccountDetailPO;
|
|
|
|
|
|
}
|
2022-12-06 11:44:04 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 导出“福利核算-补差导入”模板
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public XSSFWorkbook exportBalanceImportTemplate(InsuranceAcctDetailImportTemplateParam param) {
|
|
|
|
|
|
ValidUtil.doValidator(param);
|
|
|
|
|
|
|
|
|
|
|
|
// 必须选择导入模板所需的薪资项目(福利项)
|
|
|
|
|
|
if (CollectionUtils.isEmpty(param.getWelfareNames())) {
|
|
|
|
|
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99019, "参数错误,请选择导入模板所需的福利项目核算项"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 模板表头(默认必带"个税扣缴义务人"、"姓名")
|
|
|
|
|
|
List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"),
|
|
|
|
|
|
"部门",
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(86186, "手机号"),
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(86317, "工号"),
|
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人")
|
|
|
|
|
|
);
|
|
|
|
|
|
List<String> dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "workcode", "taxAgentName");
|
|
|
|
|
|
// 查询福利核算项目
|
|
|
|
|
|
List<String> welfareNames = (List<String>) param.getWelfareNames();
|
|
|
|
|
|
headerList.addAll(welfareNames);
|
|
|
|
|
|
|
|
|
|
|
|
// //查询当前已有的补缴数据
|
|
|
|
|
|
// List<Map<String, Object>> resultMapList = getSupplyDataByBillMonth(param.getBillMonth(), param.getPaymentOrganization());
|
|
|
|
|
|
// // excel导出的数据
|
|
|
|
|
|
// List<List<Object>> rows = Lists.newArrayListWithExpectedSize(resultMapList.size());
|
|
|
|
|
|
// rows.add(headerList);
|
|
|
|
|
|
// for (Map<String, Object> map : resultMapList) {
|
|
|
|
|
|
// List<Object> row = Lists.newArrayListWithExpectedSize(headerList.size());
|
|
|
|
|
|
// for (String dataIndex : dataIndexList) {
|
|
|
|
|
|
// row.add(map.getOrDefault(dataIndex, StringUtils.EMPTY));
|
|
|
|
|
|
// }
|
|
|
|
|
|
// rows.add(row);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
List<List<Object>> rows = new ArrayList<>();
|
|
|
|
|
|
rows.add(headerList);
|
|
|
|
|
|
|
|
|
|
|
|
String sheetName = "福利核算-补差导入模板";
|
|
|
|
|
|
return ExcelUtil.genWorkbookV2(rows, sheetName);
|
|
|
|
|
|
}
|
2022-12-07 17:09:53 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 将福利台账-补差模板导入的数据更新到数据库
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> importBalanceInsuranceDetail(InsuranceAcctImportParam importParam) {
|
|
|
|
|
|
long currentEmployeeId = user.getUID();
|
|
|
|
|
|
// Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
|
|
//查询对于人员信息导入筛选的全局配置
|
|
|
|
|
|
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
|
|
|
|
|
|
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
|
|
|
|
|
|
//检验参数
|
|
|
|
|
|
//excel文件id
|
|
|
|
|
|
String imageId = Util.null2String(importParam.getImageId());
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(imageId)) {
|
|
|
|
|
|
throw new SalaryRunTimeException("文件不存在");
|
|
|
|
|
|
}
|
|
|
|
|
|
// // 获取所有个税扣缴义务人
|
|
|
|
|
|
// List<TaxAgentPO> taxAgents = getTaxAgentService(user).listAll();
|
|
|
|
|
|
// Map<String, Long> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getName, TaxAgentPO::getId);
|
|
|
|
|
|
|
|
|
|
|
|
// 获取租户下所有的人员
|
2023-04-12 15:27:35 +08:00
|
|
|
|
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listEmployee();
|
2022-12-07 17:09:53 +08:00
|
|
|
|
|
2023-03-07 14:21:01 +08:00
|
|
|
|
List<ICategoryPO> insuranceCategoryPOS = getICategoryMapper().listAll();
|
2022-12-07 17:09:53 +08:00
|
|
|
|
// 失败的数量
|
|
|
|
|
|
int failCount = 0;
|
|
|
|
|
|
// 成功的数量
|
|
|
|
|
|
int successCount = 0;
|
|
|
|
|
|
InputStream fileInputStream = null;
|
|
|
|
|
|
try {
|
|
|
|
|
|
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(importParam.getImageId()));
|
|
|
|
|
|
|
|
|
|
|
|
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
|
|
|
|
|
|
|
|
|
|
|
// 错误提示信息
|
|
|
|
|
|
List<Map> excelComments = Lists.newArrayList();
|
|
|
|
|
|
// 存在错误的那行数据
|
|
|
|
|
|
List<Map<String, Object>> errorDatas = Lists.newArrayList();
|
|
|
|
|
|
// 表头
|
|
|
|
|
|
List<String> headers = ExcelSupport.getSheetHeader(sheet, 0);
|
|
|
|
|
|
// 处理数值
|
|
|
|
|
|
List<Map<String, Object>> data = ExcelParseHelper.parse2Map(sheet, 1);
|
|
|
|
|
|
if (CollectionUtils.isEmpty(headers)) {
|
|
|
|
|
|
throw new SalaryRunTimeException("表头为空");
|
|
|
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isEmpty(data)) {
|
|
|
|
|
|
throw new SalaryRunTimeException("无数据");
|
|
|
|
|
|
}
|
|
|
|
|
|
//存储待更新的InsuranceAccountDetailPO数据
|
|
|
|
|
|
List<InsuranceAccountDetailPO> updateInsuranceAccountDetailList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
//存储待新增的InsuranceAccountDetailPO数据
|
|
|
|
|
|
List<InsuranceAccountDetailPO> createInsuranceAccountDetailList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
String billMonth = importParam.getBillMonth();
|
|
|
|
|
|
//遍历excel表具体数据
|
|
|
|
|
|
for (int i = 0; i < data.size(); i++) {
|
|
|
|
|
|
|
|
|
|
|
|
String row = "第" + (i + 2) + "行";
|
|
|
|
|
|
|
|
|
|
|
|
boolean isError = false;
|
|
|
|
|
|
Map<String, Object> map = data.get(i);
|
|
|
|
|
|
Long employeeId = 0L;
|
|
|
|
|
|
// Long taxAgentId = 0L;
|
|
|
|
|
|
|
|
|
|
|
|
List<InsuranceAccountDetailPO> list = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String taxAgentName = (String) map.getOrDefault("个税扣缴义务人", "");
|
|
|
|
|
|
|
|
|
|
|
|
Long paymentOrganization = 0L;
|
|
|
|
|
|
List<TaxAgentPO> taxAgentPoList = getTaxAgentMapper().listByName(taxAgentName);
|
|
|
|
|
|
|
|
|
|
|
|
if (taxAgentPoList.size() == 1) {
|
|
|
|
|
|
paymentOrganization = taxAgentPoList.get(0).getId();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "个税扣缴义务人错误,系统内不存在该个税扣缴义务人")));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!checkBillMonth(billMonth)) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "账单月份输入有误,请参照“2022-09”这种格式进行检查"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> singleAccount = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
//遍历表头
|
|
|
|
|
|
for (int j = 0; j < headers.size(); j++) {
|
|
|
|
|
|
String header = headers.get(j);
|
|
|
|
|
|
String dataKey = header;
|
|
|
|
|
|
if (dataKey == null) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
//组装单条数据基础数据
|
|
|
|
|
|
Map<String, Object> cellData = new HashMap<>();
|
|
|
|
|
|
cellData.put(dataKey, Optional.ofNullable(map.get(dataKey)).orElse("").toString());
|
|
|
|
|
|
cellData.put("index", j);
|
|
|
|
|
|
singleAccount.add(cellData);
|
|
|
|
|
|
//抽取人员信息进行校验
|
|
|
|
|
|
String name = (String) map.getOrDefault("姓名", "");
|
|
|
|
|
|
String departmentName = (String) map.getOrDefault("部门", "");
|
|
|
|
|
|
String mobile = (String) map.getOrDefault("手机号", "");
|
|
|
|
|
|
String workcode = (String) map.getOrDefault("工号", "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) {
|
|
|
|
|
|
//当人员信息导入筛选的全局配置为"0"时,姓名才是必填项
|
|
|
|
|
|
if (StringUtils.isEmpty(name) && "0".equals(confValue)) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
|
|
|
|
|
List<DataCollectionEmployee> employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, name, departmentName, mobile, workcode, null);
|
|
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(employeeSameIds)) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "姓名错误,系统内不存在该姓名"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (employeeSameIds.size() > 1) {
|
|
|
|
|
|
//存在离职和在职状态取在职状态
|
|
|
|
|
|
employeeSameIds = employeeSameIds.stream()
|
|
|
|
|
|
.filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus()))
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
if (employeeSameIds.size() != 1) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + "员工信息不存在或者存在多个员工");
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
employeeId = employeeSameIds.get(0).getEmployeeId();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!isError){
|
|
|
|
|
|
|
|
|
|
|
|
//如果福利核算信息查询不到唯一匹配数据,不支持导入
|
|
|
|
|
|
//根据员工id、个税扣缴义务人id、账单月份查询补差数据
|
|
|
|
|
|
list = getInsuranceAccountDetailMapper().queryBalanceList(InsuranceAccountDetailPO.builder()
|
|
|
|
|
|
.employeeId(employeeId)
|
|
|
|
|
|
.paymentOrganization(paymentOrganization)
|
|
|
|
|
|
.billMonth(billMonth)
|
|
|
|
|
|
.build());
|
|
|
|
|
|
|
|
|
|
|
|
if (list.isEmpty()) {
|
|
|
|
|
|
//新增数据情况
|
|
|
|
|
|
InsuranceAccountDetailPO createPO = buildBalanceAccountDetail(paymentOrganization, insuranceCategoryPOS, singleAccount, billMonth, employeeId, currentEmployeeId);
|
2022-12-19 17:26:44 +08:00
|
|
|
|
if(checkBalance(createPO)) {
|
|
|
|
|
|
createInsuranceAccountDetailList.add(createPO);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员在当前账单月不存在补差数据中的福利类,请检查补差缴纳信息!"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-12-07 17:09:53 +08:00
|
|
|
|
} else if (list.size() > 1) {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员在当前账单月已存在多组补差数据,请删除数据库中多余项"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
//更新数据情况
|
|
|
|
|
|
//拼装待更新数据
|
2022-12-15 17:11:38 +08:00
|
|
|
|
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class);
|
2022-12-19 17:26:44 +08:00
|
|
|
|
InsuranceAccountDetailPO updatePO = handleInsuranceAccountDetail(list.get(0), map);
|
|
|
|
|
|
if(checkBalance(updatePO)) {
|
|
|
|
|
|
updateInsuranceAccountDetailList.add(updatePO);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
isError = true;
|
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
|
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员在当前账单月不存在补差数据中的福利类,请检查补差缴纳信息!"));
|
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-12-07 17:09:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isError) {
|
|
|
|
|
|
failCount++;
|
|
|
|
|
|
errorDatas.add(map);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
successCount++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
Long paymentOrganization = null;
|
|
|
|
|
|
if (updateInsuranceAccountDetailList.size() > 0) {
|
|
|
|
|
|
paymentOrganization = updateInsuranceAccountDetailList.get(0).getPaymentOrganization();
|
|
|
|
|
|
//将待更新列表加密
|
2022-12-15 17:11:38 +08:00
|
|
|
|
encryptUtil.encryptList(updateInsuranceAccountDetailList, InsuranceAccountDetailPO.class);
|
2022-12-07 17:09:53 +08:00
|
|
|
|
//更新
|
|
|
|
|
|
for(InsuranceAccountDetailPO po : updateInsuranceAccountDetailList) {
|
|
|
|
|
|
getSiAccountBiz(user).updateByEmployeeIdAndBillMonth(po);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (createInsuranceAccountDetailList.size() > 0) {
|
|
|
|
|
|
paymentOrganization = createInsuranceAccountDetailList.get(0).getPaymentOrganization();
|
2022-12-19 11:43:20 +08:00
|
|
|
|
//去除员工id+个税扣缴义务人下重复的数据
|
|
|
|
|
|
createInsuranceAccountDetailList = createInsuranceAccountDetailList.stream()
|
|
|
|
|
|
.collect(Collectors.collectingAndThen(Collectors.toCollection(()
|
|
|
|
|
|
-> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
|
2022-12-07 17:09:53 +08:00
|
|
|
|
//将待新增列表加密
|
2022-12-15 17:11:38 +08:00
|
|
|
|
encryptUtil.encryptList(createInsuranceAccountDetailList, InsuranceAccountDetailPO.class);
|
2022-12-07 17:09:53 +08:00
|
|
|
|
//新增
|
|
|
|
|
|
List<List<InsuranceAccountDetailPO>> createPartition = Lists.partition((List<InsuranceAccountDetailPO>) createInsuranceAccountDetailList, 20);
|
|
|
|
|
|
createPartition.forEach(getInsuranceAccountDetailMapper()::batchSaveAccountDetails);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//刷新bill_batch表中统计信息
|
|
|
|
|
|
refreshBillBatch(paymentOrganization, importParam.getBillMonth());
|
|
|
|
|
|
|
|
|
|
|
|
apidatas.put("successCount", successCount);
|
|
|
|
|
|
apidatas.put("errorCount", failCount);
|
|
|
|
|
|
apidatas.put("errorData", excelComments);
|
|
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
IOUtils.closeQuietly(fileInputStream);
|
|
|
|
|
|
}
|
|
|
|
|
|
return apidatas;
|
|
|
|
|
|
}
|
2023-03-16 11:17:18 +08:00
|
|
|
|
|
2023-04-04 17:21:29 +08:00
|
|
|
|
|
2023-03-16 11:17:18 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> listCommonSum(InsuranceAccountDetailParam queryParam) {
|
|
|
|
|
|
|
|
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
// 正常缴纳列表
|
|
|
|
|
|
queryParam.setPageSize(10000000);
|
|
|
|
|
|
PageInfo<InsuranceAccountDetailPO> pageInfo = getSiAccountBiz(user).listCommonPage(queryParam);
|
|
|
|
|
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
|
|
|
|
|
|
// 数据组装
|
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
|
2023-04-04 17:21:29 +08:00
|
|
|
|
// Map<String, Object> maxSizeRecord = records.stream().reduce(new HashMap<>(), (a, b) -> a.size() > b.size() ? a : b);
|
|
|
|
|
|
Map<String, Object> sumRow = countSum(records);
|
|
|
|
|
|
datas.put("sumRow", sumRow);
|
|
|
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> listSupplementarySum(InsuranceAccountDetailParam queryParam) {
|
|
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
|
queryParam.setPageSize(10000000);
|
|
|
|
|
|
|
2023-04-17 10:27:31 +08:00
|
|
|
|
// //过滤出福利档案基础信息表中runStatus为正在缴纳和待减员的人员
|
|
|
|
|
|
// List<InsuranceArchivesBaseInfoPO> baseInfoPOList = getInsuranceBaseInfoMapper().listAll();
|
|
|
|
|
|
// List<Long> canAccountIds = baseInfoPOList.stream()
|
|
|
|
|
|
// .filter(f->f.getPaymentOrganization().toString().equals(queryParam.getPaymentOrganization())
|
|
|
|
|
|
// && (f.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue()) || f.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())))
|
|
|
|
|
|
// .map(InsuranceArchivesBaseInfoPO::getEmployeeId)
|
|
|
|
|
|
// .collect(Collectors.toList());
|
|
|
|
|
|
// queryParam.setEmployeeIds(canAccountIds);
|
2023-04-04 17:21:29 +08:00
|
|
|
|
|
|
|
|
|
|
//补缴缴纳列表
|
|
|
|
|
|
queryParam.setPaymentStatus(PaymentStatusEnum.REPAIR.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
//排序配置
|
|
|
|
|
|
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
|
|
|
|
|
queryParam.setOrderRule(orderRule);
|
|
|
|
|
|
|
|
|
|
|
|
List<InsuranceAccountDetailPO> list = getInsuranceAccountDetailMapper().list(queryParam);
|
|
|
|
|
|
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class);
|
|
|
|
|
|
//数据组装
|
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildCommonRecords(list, employeeId);
|
|
|
|
|
|
// Map<String, Object> maxSizeRecord = records.stream().reduce(new HashMap<>(), (a, b) -> a.size() > b.size() ? a : b);
|
|
|
|
|
|
Map<String, Object> sumRow = countSum(records);
|
|
|
|
|
|
datas.put("sumRow", sumRow);
|
|
|
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> listRecessionSum(InsuranceAccountDetailParam queryParam) {
|
|
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
|
queryParam.setPageSize(10000000);
|
|
|
|
|
|
// 分权逻辑
|
|
|
|
|
|
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
|
|
|
|
|
if (needAuth) {
|
|
|
|
|
|
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
|
|
|
|
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
|
|
|
|
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
|
|
|
|
//防止普通用户查询
|
|
|
|
|
|
queryParam.setTaxAgents(Collections.singletonList(-1L));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
queryParam.setTaxAgents(taxAgents);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//退差列表
|
|
|
|
|
|
queryParam.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
//排序配置
|
|
|
|
|
|
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
|
|
|
|
|
queryParam.setOrderRule(orderRule);
|
|
|
|
|
|
|
|
|
|
|
|
List<InsuranceAccountDetailPO> list = getInsuranceAccountDetailMapper().list(queryParam);
|
|
|
|
|
|
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class);
|
|
|
|
|
|
//数据组装
|
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildCommonRecords(list, employeeId);
|
|
|
|
|
|
Map<String, Object> sumRow = countSum(records);
|
|
|
|
|
|
datas.put("sumRow", sumRow);
|
|
|
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> listBalanceSum(InsuranceAccountDetailParam queryParam) {
|
|
|
|
|
|
Long employeeId = (long) user.getUID();
|
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
|
queryParam.setPageSize(10000000);
|
|
|
|
|
|
// 分权逻辑
|
|
|
|
|
|
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
|
|
|
|
|
if (needAuth) {
|
|
|
|
|
|
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
|
|
|
|
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
|
|
|
|
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
|
|
|
|
//防止普通用户查询
|
|
|
|
|
|
queryParam.setTaxAgents(Collections.singletonList(-1L));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
queryParam.setTaxAgents(taxAgents);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//补差列表
|
|
|
|
|
|
queryParam.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
//排序配置
|
|
|
|
|
|
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
|
|
|
|
|
queryParam.setOrderRule(orderRule);
|
|
|
|
|
|
|
|
|
|
|
|
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
|
|
|
|
|
List<InsuranceAccountDetailPO> list = getInsuranceAccountDetailMapper().list(queryParam);
|
|
|
|
|
|
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class);
|
|
|
|
|
|
//数据组装
|
|
|
|
|
|
List<Map<String, Object>> records = getService(user).buildCommonRecords(list, employeeId);
|
|
|
|
|
|
Map<String, Object> sumRow = countSum(records);
|
|
|
|
|
|
datas.put("sumRow", sumRow);
|
|
|
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String, Object> countSum(List<Map<String, Object>> records ){
|
2023-03-16 11:17:18 +08:00
|
|
|
|
// 获取需要统计的列
|
|
|
|
|
|
String[] keys = {"Base", "Com", "Sum", "Per", "total"};
|
2023-04-04 17:21:29 +08:00
|
|
|
|
Set<String> numKeys = new HashSet<>();
|
|
|
|
|
|
// for(String key : maxSizeRecord.keySet()){
|
|
|
|
|
|
// if(StringUtils.containsAny(key,keys)){
|
|
|
|
|
|
// numKeys.add(key);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
for(int i =0; i < records.size(); i++){
|
|
|
|
|
|
Map<String, Object> record = records.get(i);
|
|
|
|
|
|
for(String key : record.keySet()){
|
|
|
|
|
|
if(StringUtils.containsAny(key,keys)){
|
|
|
|
|
|
numKeys.add(key);
|
|
|
|
|
|
}
|
2023-03-16 11:17:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Map<String, Object> sumRow = new HashMap<>();
|
|
|
|
|
|
for(String numKey : numKeys){
|
|
|
|
|
|
BigDecimal value = new BigDecimal(0);
|
|
|
|
|
|
for(Map<String, Object> record : records){
|
2023-03-28 11:00:18 +08:00
|
|
|
|
BigDecimal addValue = null;
|
2023-03-28 13:59:57 +08:00
|
|
|
|
if(record.get(numKey) == null || StringUtils.isBlank(record.get(numKey).toString())){
|
2023-03-28 11:00:18 +08:00
|
|
|
|
addValue = new BigDecimal(0);
|
|
|
|
|
|
}else{
|
|
|
|
|
|
addValue = new BigDecimal(record.get(numKey).toString());
|
|
|
|
|
|
}
|
|
|
|
|
|
value = value.add(addValue);
|
2023-03-16 11:17:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
sumRow.put(numKey,value);
|
|
|
|
|
|
}
|
2023-04-04 17:21:29 +08:00
|
|
|
|
return sumRow;
|
2023-03-16 11:17:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-04-04 17:21:29 +08:00
|
|
|
|
|
2022-12-19 17:26:44 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 检查补差数据中的福利缴纳费用相关福利类别,是否在正常缴纳中有设置缴纳
|
|
|
|
|
|
* @param po
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
private boolean checkBalance(InsuranceAccountDetailPO po) {
|
|
|
|
|
|
InsuranceAccountDetailPO commonAccountPO = getInsuranceAccountDetailMapper().getOneByBpep(InsuranceAccountDetailPO.builder()
|
|
|
|
|
|
.billMonth(po.getBillMonth())
|
|
|
|
|
|
.paymentStatus(PaymentStatusEnum.COMMON.getValue())
|
|
|
|
|
|
.employeeId(po.getEmployeeId())
|
|
|
|
|
|
.paymentOrganization(po.getPaymentOrganization())
|
|
|
|
|
|
.build());
|
|
|
|
|
|
if (commonAccountPO != null) {
|
2022-12-20 15:20:42 +08:00
|
|
|
|
|
|
|
|
|
|
encryptUtil.decrypt(commonAccountPO, InsuranceAccountDetailPO.class);
|
2022-12-20 09:25:55 +08:00
|
|
|
|
boolean commonSocialNullFlag = (StringUtils.isBlank(commonAccountPO.getSocialSum()) || SalaryEntityUtil.StringEqZERO(commonAccountPO.getSocialSum()));
|
|
|
|
|
|
boolean commonFundNullFlag = (StringUtils.isBlank(commonAccountPO.getFundSum()) || SalaryEntityUtil.StringEqZERO(commonAccountPO.getFundSum()));
|
|
|
|
|
|
boolean commonOtherNullFlag = (StringUtils.isBlank(commonAccountPO.getOtherSum()) || SalaryEntityUtil.StringEqZERO(commonAccountPO.getOtherSum()));
|
2022-12-19 17:26:44 +08:00
|
|
|
|
|
2022-12-20 09:25:55 +08:00
|
|
|
|
boolean balanceSocialNullFlag = (StringUtils.isBlank(po.getSocialSum()) || SalaryEntityUtil.StringEqZERO(po.getSocialSum()));
|
|
|
|
|
|
boolean balanceFundNullFlag = (StringUtils.isBlank(po.getFundSum()) || SalaryEntityUtil.StringEqZERO(po.getFundSum()));
|
|
|
|
|
|
boolean balanceOtherNullFlag = (StringUtils.isBlank(po.getOtherSum()) || SalaryEntityUtil.StringEqZERO(po.getOtherSum()));
|
2022-12-19 17:26:44 +08:00
|
|
|
|
//在正常缴纳数据中未设置的福利类别(社保、公积金、其他福利),不允许在补差数据中缴纳
|
2022-12-20 09:25:55 +08:00
|
|
|
|
if ((commonSocialNullFlag && !balanceSocialNullFlag) || (commonFundNullFlag && !balanceFundNullFlag) || (commonOtherNullFlag && !balanceOtherNullFlag)) {
|
2022-12-19 17:26:44 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-12-07 17:09:53 +08:00
|
|
|
|
|
|
|
|
|
|
public InsuranceAccountDetailPO buildBalanceAccountDetail(Long paymentOrganization, List<ICategoryPO> insuranceCategoryPOS,
|
|
|
|
|
|
List<Map<String, Object>> singleAccount, String billMonth, Long employeeId, Long creator) {
|
|
|
|
|
|
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
|
|
|
|
|
|
insuranceAccountDetailPO.setId(IdGenerator.generate());
|
|
|
|
|
|
insuranceAccountDetailPO.setEmployeeId(employeeId);
|
|
|
|
|
|
insuranceAccountDetailPO.setBillMonth(billMonth);
|
|
|
|
|
|
insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue());
|
|
|
|
|
|
insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());
|
|
|
|
|
|
insuranceAccountDetailPO.setResourceFrom(ResourceFromEnum.IMPORT.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
insuranceAccountDetailPO.setCreator(creator);
|
|
|
|
|
|
insuranceAccountDetailPO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
|
|
|
|
|
|
insuranceAccountDetailPO.setCreateTime(new Date());
|
|
|
|
|
|
insuranceAccountDetailPO.setUpdateTime(new Date());
|
|
|
|
|
|
insuranceAccountDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
|
|
|
|
|
|
insuranceAccountDetailPO.setPaymentOrganization(paymentOrganization);
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialPayOrg(paymentOrganization);
|
|
|
|
|
|
insuranceAccountDetailPO.setFundPayOrg(paymentOrganization);
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherPayOrg(paymentOrganization);
|
|
|
|
|
|
|
|
|
|
|
|
InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(employeeId, paymentOrganization);
|
|
|
|
|
|
if (baseInfoPO != null) {
|
|
|
|
|
|
InsuranceArchivesSocialSchemePO socialSchemePO = getSocialSchemeMapper().getOneById(baseInfoPO.getSocialArchivesId());
|
|
|
|
|
|
|
|
|
|
|
|
InsuranceArchivesFundSchemePO fundSchemePO = getFundSchemeMapper().getOneById(baseInfoPO.getFundArchivesId());
|
|
|
|
|
|
if (socialSchemePO != null) {
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialAccount(socialSchemePO.getSocialAccount());
|
|
|
|
|
|
}
|
|
|
|
|
|
if (fundSchemePO != null) {
|
|
|
|
|
|
insuranceAccountDetailPO.setFundAccount(fundSchemePO.getFundAccount());
|
|
|
|
|
|
insuranceAccountDetailPO.setSupplementFundAccount(fundSchemePO.getSupplementFundAccount());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取改员工社保档案
|
|
|
|
|
|
accountBalanceSocial(singleAccount, insuranceAccountDetailPO, insuranceCategoryPOS, creator);
|
|
|
|
|
|
accountBalanceFund(singleAccount, insuranceAccountDetailPO, insuranceCategoryPOS, creator);
|
|
|
|
|
|
// 其他福利档案
|
|
|
|
|
|
accountBalanceOther(singleAccount, insuranceAccountDetailPO, insuranceCategoryPOS, creator);
|
|
|
|
|
|
account((insuranceAccountDetailPO));
|
|
|
|
|
|
if (insuranceAccountDetailPO.getOtherSchemeId() == null) {
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherSchemeId(0L);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (insuranceAccountDetailPO.getSocialSchemeId() == null) {
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialSchemeId(0L);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (insuranceAccountDetailPO.getFundSchemeId() == null) {
|
|
|
|
|
|
insuranceAccountDetailPO.setFundSchemeId(0L);
|
|
|
|
|
|
}
|
|
|
|
|
|
return insuranceAccountDetailPO;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public InsuranceAccountDetailPO accountBalanceSocial(List<Map<String, Object>> singleAccount, InsuranceAccountDetailPO insuranceAccountDetailPO,
|
|
|
|
|
|
List<ICategoryPO> insuranceCategoryPOS, Long employeeId) {
|
|
|
|
|
|
//社保-个人
|
|
|
|
|
|
List<ICategoryPO> socialCategory = insuranceCategoryPOS.stream().filter(po -> po.getWelfareType().equals(WelfareTypeEnum.SOCIAL_SECURITY.getValue()))
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
List<BigDecimal> socialPer = new ArrayList<>();
|
|
|
|
|
|
Map<String, String> socialPerJsonMap = new HashMap<>();
|
|
|
|
|
|
for (int i = 0; i < singleAccount.size(); i++) {
|
|
|
|
|
|
Map<String, Object> stringObjectMap = singleAccount.get(i);
|
|
|
|
|
|
Optional<ICategoryPO> personalOptional = socialCategory.stream()
|
|
|
|
|
|
.filter(social -> stringObjectMap.containsKey(social.getInsuranceName() + SalaryI18nUtil.getI18nLabel(87159, "个人"))).findFirst();
|
|
|
|
|
|
if (personalOptional.isPresent() && StringUtils
|
|
|
|
|
|
.isNotBlank((String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(87159, "个人")))) {
|
|
|
|
|
|
String perNumString = (String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(87159, "个人"));
|
2022-12-23 17:50:12 +08:00
|
|
|
|
if (perNumString.length() > 0 && !isNumeric(perNumString)) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-12-07 17:09:53 +08:00
|
|
|
|
perNumString = perNumString.replace(",", "");
|
|
|
|
|
|
BigDecimal result = new BigDecimal(perNumString);
|
|
|
|
|
|
socialPerJsonMap.put(String.valueOf(personalOptional.get().getId()), result.toPlainString());
|
|
|
|
|
|
socialPer.add(result);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerJsonMap));
|
|
|
|
|
|
BigDecimal socialPerSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : socialPer) {
|
|
|
|
|
|
socialPerSum = socialPerSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString());
|
|
|
|
|
|
|
|
|
|
|
|
//社保-单位
|
|
|
|
|
|
List<BigDecimal> socialCom = new ArrayList<>();
|
|
|
|
|
|
Map<String, String> sociaComJsonMap = new HashMap<>();
|
|
|
|
|
|
for (int i = 0; i < singleAccount.size(); i++) {
|
|
|
|
|
|
Map<String, Object> stringObjectMap = singleAccount.get(i);
|
|
|
|
|
|
Optional<ICategoryPO> personalOptional = socialCategory.stream()
|
|
|
|
|
|
.filter(social -> stringObjectMap.containsKey(social.getInsuranceName() + SalaryI18nUtil.getI18nLabel(100289, "单位"))).findFirst();
|
|
|
|
|
|
if (personalOptional.isPresent() && StringUtils
|
|
|
|
|
|
.isNotBlank((String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(100289, "单位")))) {
|
|
|
|
|
|
String perNumString = (String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(100289, "单位"));
|
2022-12-23 17:50:12 +08:00
|
|
|
|
|
|
|
|
|
|
if (perNumString.length() > 0 && !isNumeric(perNumString)) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2022-12-07 17:09:53 +08:00
|
|
|
|
perNumString = perNumString.replace(",", "");
|
|
|
|
|
|
BigDecimal result = new BigDecimal(perNumString);
|
|
|
|
|
|
sociaComJsonMap.put(String.valueOf(personalOptional.get().getId()), result.toPlainString());
|
|
|
|
|
|
socialCom.add(result);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(sociaComJsonMap));
|
|
|
|
|
|
BigDecimal socialComSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal decimal : socialCom) {
|
|
|
|
|
|
socialComSum = socialComSum.add(decimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString());
|
|
|
|
|
|
return insuranceAccountDetailPO;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public InsuranceAccountDetailPO accountBalanceFund(List<Map<String, Object>> singleAccount, InsuranceAccountDetailPO insuranceAccountDetailPO,
|
|
|
|
|
|
List<ICategoryPO> insuranceCategoryPOS, Long employeeId) {
|
|
|
|
|
|
//公积金-个人
|
|
|
|
|
|
List<ICategoryPO> fundCategory = insuranceCategoryPOS.stream().filter(po -> po.getWelfareType().equals(WelfareTypeEnum.ACCUMULATION_FUND.getValue()))
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
List<BigDecimal> fundPer = new ArrayList<>();
|
|
|
|
|
|
Map<String, String> fundPerJsonMap = new HashMap<>();
|
|
|
|
|
|
for (int i = 0; i < singleAccount.size(); i++) {
|
|
|
|
|
|
Map<String, Object> stringObjectMap = singleAccount.get(i);
|
|
|
|
|
|
Optional<ICategoryPO> personalOptional = fundCategory.stream()
|
|
|
|
|
|
.filter(social -> stringObjectMap.containsKey(social.getInsuranceName() + SalaryI18nUtil.getI18nLabel(87159, "个人"))).findFirst();
|
|
|
|
|
|
if (personalOptional.isPresent() && StringUtils
|
|
|
|
|
|
.isNotBlank((String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(87159, "个人")))) {
|
|
|
|
|
|
String perNumString = (String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(87159, "个人"));
|
2022-12-23 17:50:12 +08:00
|
|
|
|
if (perNumString.length() > 0 && !isNumeric(perNumString)) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2022-12-07 17:09:53 +08:00
|
|
|
|
perNumString = perNumString.replace(",", "");
|
|
|
|
|
|
BigDecimal result = new BigDecimal(perNumString);
|
|
|
|
|
|
fundPerJsonMap.put(String.valueOf(personalOptional.get().getId()), result.toPlainString());
|
|
|
|
|
|
fundPer.add(result);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setFundPerJson(JSON.toJSONString(fundPerJsonMap));
|
|
|
|
|
|
BigDecimal funPerSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : fundPer) {
|
|
|
|
|
|
funPerSum = funPerSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setFundPerSum(funPerSum.toPlainString());
|
|
|
|
|
|
|
|
|
|
|
|
//公积金-单位
|
|
|
|
|
|
List<BigDecimal> fundComList = new ArrayList<>();
|
|
|
|
|
|
Map<String, String> fundComJsonMap = new HashMap<>();
|
|
|
|
|
|
for (int i = 0; i < singleAccount.size(); i++) {
|
|
|
|
|
|
Map<String, Object> stringObjectMap = singleAccount.get(i);
|
|
|
|
|
|
Optional<ICategoryPO> personalOptional = fundCategory.stream()
|
|
|
|
|
|
.filter(social -> stringObjectMap.containsKey(social.getInsuranceName() + SalaryI18nUtil.getI18nLabel(100289, "单位"))).findFirst();
|
|
|
|
|
|
if (personalOptional.isPresent() && StringUtils
|
|
|
|
|
|
.isNotBlank((String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(100289, "单位")))) {
|
|
|
|
|
|
String perNumString = (String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(100289, "单位"));
|
2022-12-23 17:50:12 +08:00
|
|
|
|
if (perNumString.length() > 0 && !isNumeric(perNumString)) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2022-12-07 17:09:53 +08:00
|
|
|
|
perNumString = perNumString.replace(",", "");
|
|
|
|
|
|
BigDecimal result = new BigDecimal(perNumString);
|
|
|
|
|
|
fundComJsonMap.put(String.valueOf(personalOptional.get().getId()), result.toPlainString());
|
|
|
|
|
|
fundComList.add(result);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setFundComJson(JSON.toJSONString(fundComJsonMap));
|
|
|
|
|
|
BigDecimal fundComSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : fundComList) {
|
|
|
|
|
|
fundComSum = fundComSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setFundComSum(fundComSum.toPlainString());
|
|
|
|
|
|
return insuranceAccountDetailPO;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public InsuranceAccountDetailPO accountBalanceOther(List<Map<String, Object>> singleAccount, InsuranceAccountDetailPO insuranceAccountDetailPO,
|
|
|
|
|
|
List<ICategoryPO> insuranceCategoryPOS, Long employeeId) {
|
|
|
|
|
|
List<ICategoryPO> otherCategory = insuranceCategoryPOS.stream().filter(po -> po.getWelfareType().equals(WelfareTypeEnum.OTHER.getValue()))
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
// 其他福利-个人
|
|
|
|
|
|
List<BigDecimal> otherPer = new ArrayList<>();
|
|
|
|
|
|
Map<String, String> otherPerJsonMap = new HashMap<>();
|
|
|
|
|
|
for (int i = 0; i < singleAccount.size(); i++) {
|
|
|
|
|
|
Map<String, Object> stringObjectMap = singleAccount.get(i);
|
|
|
|
|
|
Optional<ICategoryPO> personalOptional = otherCategory.stream()
|
|
|
|
|
|
.filter(social -> stringObjectMap.containsKey(social.getInsuranceName() + SalaryI18nUtil.getI18nLabel(87159, "个人"))).findFirst();
|
|
|
|
|
|
if (personalOptional.isPresent() && StringUtils
|
|
|
|
|
|
.isNotBlank((String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(87159, "个人")))) {
|
|
|
|
|
|
String perNumString = (String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(87159, "个人"));
|
2022-12-23 17:50:12 +08:00
|
|
|
|
if (perNumString.length() > 0 && !isNumeric(perNumString)) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2022-12-07 17:09:53 +08:00
|
|
|
|
perNumString = perNumString.replace(",", "");
|
|
|
|
|
|
BigDecimal result = new BigDecimal(perNumString);
|
|
|
|
|
|
otherPerJsonMap.put(String.valueOf(personalOptional.get().getId()), result.toPlainString());
|
|
|
|
|
|
otherPer.add(result);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherPerJson(JSON.toJSONString(otherPerJsonMap));
|
|
|
|
|
|
BigDecimal otherPerSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : otherPer) {
|
|
|
|
|
|
otherPerSum = otherPerSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherPerSum(otherPerSum.toPlainString());
|
|
|
|
|
|
|
|
|
|
|
|
// 其他福利-单位
|
|
|
|
|
|
List<BigDecimal> otherComList = new ArrayList<>();
|
|
|
|
|
|
Map<String, String> otherComJsonMap = new HashMap<>();
|
|
|
|
|
|
for (int i = 0; i < singleAccount.size(); i++) {
|
|
|
|
|
|
Map<String, Object> stringObjectMap = singleAccount.get(i);
|
|
|
|
|
|
Optional<ICategoryPO> personalOptional = otherCategory.stream()
|
|
|
|
|
|
.filter(social -> stringObjectMap.containsKey(social.getInsuranceName() + SalaryI18nUtil.getI18nLabel(100289, "单位"))).findFirst();
|
|
|
|
|
|
if (personalOptional.isPresent() && StringUtils
|
|
|
|
|
|
.isNotBlank((String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(100289, "单位")))) {
|
|
|
|
|
|
String perNumString = (String) stringObjectMap.get(personalOptional.get().getInsuranceName() + SalaryI18nUtil.getI18nLabel(100289, "单位"));
|
2022-12-23 17:50:12 +08:00
|
|
|
|
if (perNumString.length() > 0 && !isNumeric(perNumString)) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2022-12-07 17:09:53 +08:00
|
|
|
|
perNumString = perNumString.replace(",", "");
|
|
|
|
|
|
BigDecimal result = new BigDecimal(perNumString);
|
|
|
|
|
|
otherComJsonMap.put(String.valueOf(personalOptional.get().getId()), result.toPlainString());
|
|
|
|
|
|
otherComList.add(result);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherComJson(JSON.toJSONString(otherComJsonMap));
|
|
|
|
|
|
BigDecimal otherComSum = new BigDecimal("0");
|
|
|
|
|
|
for (BigDecimal bigDecimal : otherComList) {
|
|
|
|
|
|
otherComSum = otherComSum.add(bigDecimal);
|
|
|
|
|
|
}
|
|
|
|
|
|
insuranceAccountDetailPO.setOtherComSum(otherComSum.toPlainString());
|
|
|
|
|
|
return insuranceAccountDetailPO;
|
|
|
|
|
|
}
|
2022-04-11 19:07:35 +08:00
|
|
|
|
}
|