2022-03-07 22:22:09 +08:00
|
|
|
|
package com.engine.salary.service.impl;
|
|
|
|
|
|
|
2022-05-06 16:58:01 +08:00
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
|
|
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
|
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
2022-03-07 22:22:09 +08:00
|
|
|
|
import com.engine.core.impl.Service;
|
2022-03-10 15:09:44 +08:00
|
|
|
|
import com.engine.salary.biz.SISchemeBiz;
|
2022-03-09 09:42:10 +08:00
|
|
|
|
import com.engine.salary.cmd.sischeme.*;
|
2022-05-06 16:58:01 +08:00
|
|
|
|
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
|
|
|
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
|
|
|
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO;
|
|
|
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO;
|
|
|
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO;
|
2022-04-22 15:17:31 +08:00
|
|
|
|
import com.engine.salary.entity.sicategory.po.ICategoryPO;
|
|
|
|
|
|
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeListDTO;
|
|
|
|
|
|
import com.engine.salary.entity.sischeme.param.InsuranceSchemeParam;
|
2022-03-10 15:09:44 +08:00
|
|
|
|
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
2022-04-18 20:24:43 +08:00
|
|
|
|
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
2022-05-06 16:58:01 +08:00
|
|
|
|
import com.engine.salary.enums.sicategory.*;
|
|
|
|
|
|
import com.engine.salary.mapper.siarchives.FundSchemeMapper;
|
|
|
|
|
|
import com.engine.salary.mapper.siarchives.OtherSchemeMapper;
|
|
|
|
|
|
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
2022-04-22 15:17:31 +08:00
|
|
|
|
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
|
|
|
|
|
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
|
2022-04-18 20:24:43 +08:00
|
|
|
|
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
|
2022-03-07 22:22:09 +08:00
|
|
|
|
import com.engine.salary.service.SISchemeService;
|
2022-05-06 16:58:01 +08:00
|
|
|
|
import com.engine.salary.util.*;
|
2022-04-18 20:24:43 +08:00
|
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
2022-05-06 16:58:01 +08:00
|
|
|
|
import com.engine.salary.util.excel.ExcelUtil;
|
2022-04-22 15:17:31 +08:00
|
|
|
|
import com.engine.salary.util.page.PageInfo;
|
|
|
|
|
|
import com.engine.salary.util.page.PageUtil;
|
2022-05-06 16:58:01 +08:00
|
|
|
|
import com.kingbase8.util.LOGGER;
|
2022-04-18 20:24:43 +08:00
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
2022-04-22 15:17:31 +08:00
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
2022-05-06 16:58:01 +08:00
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
2022-03-07 22:22:09 +08:00
|
|
|
|
|
2022-05-06 16:58:01 +08:00
|
|
|
|
import java.time.LocalDateTime;
|
2022-04-22 15:17:31 +08:00
|
|
|
|
import java.util.*;
|
2022-05-06 16:58:01 +08:00
|
|
|
|
import java.util.function.Function;
|
2022-04-18 20:24:43 +08:00
|
|
|
|
import java.util.stream.Collectors;
|
2022-03-07 22:22:09 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @Author weaver_cl
|
|
|
|
|
|
* @Description: TODO
|
|
|
|
|
|
* @Date 2022/3/7
|
|
|
|
|
|
* @Version V1.0
|
|
|
|
|
|
**/
|
|
|
|
|
|
public class SISchemeServiceImpl extends Service implements SISchemeService {
|
2022-05-06 16:58:01 +08:00
|
|
|
|
private SocialSchemeMapper getSocialSchemeMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(SocialSchemeMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private FundSchemeMapper getFundSchemeMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(FundSchemeMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private OtherSchemeMapper getOtherSchemeMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(OtherSchemeMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private InsuranceSchemeMapper getInsuranceSchemeMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ICategoryMapper getICategoryMapper() {
|
|
|
|
|
|
return MapperProxyFactory.getProxy(ICategoryMapper.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private SISchemeService getSiSchemeService() {
|
|
|
|
|
|
return ServiceUtil.getService(SISchemeServiceImpl.class, user);
|
|
|
|
|
|
}
|
2022-03-07 22:22:09 +08:00
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> getForm(Map<String, Object> params) {
|
|
|
|
|
|
return commandExecutor.execute(new SISchemeGetFormCmd(params,user));
|
|
|
|
|
|
}
|
2022-03-09 09:42:10 +08:00
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> insertScheme(Map<String, Object> params) {
|
|
|
|
|
|
return commandExecutor.execute(new SISchemeInsertCmd(params,user));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> update(Map<String, Object> params) {
|
|
|
|
|
|
return commandExecutor.execute(new SISchemeUpdateCmd(params,user));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> delete(Map<String, Object> params) {
|
|
|
|
|
|
return commandExecutor.execute(new SISchemeDeleteCmd(params,user));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> copyScheme(Map<String, Object> params) {
|
|
|
|
|
|
return commandExecutor.execute(new SISchemeCopyCmd(params,user));
|
|
|
|
|
|
}
|
2022-03-10 15:09:44 +08:00
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public List<InsuranceSchemeDetailPO> queryListByInsuranceIdIsPayment(Long insuranceId, Integer isPayment) {
|
|
|
|
|
|
return new SISchemeBiz().queryListByInsuranceIdIsPayment(insuranceId,isPayment);
|
|
|
|
|
|
}
|
2022-03-10 18:23:31 +08:00
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> listPage(Map<String, Object> params) {
|
|
|
|
|
|
return commandExecutor.execute(new SISchemeListCmd(params,user));
|
|
|
|
|
|
}
|
2022-04-18 20:24:43 +08:00
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<Long, String> getSchemeIdNameMap() {
|
|
|
|
|
|
Map<Long, String> result = new HashMap<>();
|
|
|
|
|
|
List<InsuranceSchemePO> insuranceSchemePOS = MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).listAll();
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(insuranceSchemePOS)) {
|
|
|
|
|
|
result = insuranceSchemePOS.stream().collect(Collectors.toMap(InsuranceSchemePO::getId, InsuranceSchemePO::getSchemeName));
|
|
|
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
2022-04-22 15:17:31 +08:00
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public PageInfo<InsuranceSchemeListDTO> list(InsuranceSchemeParam queryParam) {
|
|
|
|
|
|
SalaryAssert.notNull(queryParam.getWelfareTypeEnum(), SalaryI18nUtil.getI18nLabel( 84026, "参数错误"));
|
|
|
|
|
|
PageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
|
|
|
|
|
List<InsuranceSchemePO> insuranceSchemePOS = MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).listByWelfareType(queryParam.getWelfareTypeEnum().getValue());
|
|
|
|
|
|
List<InsuranceSchemeListDTO> collect = insuranceSchemePOS.stream().map(item ->
|
|
|
|
|
|
InsuranceSchemeListDTO.builder()
|
|
|
|
|
|
.id(item.getId())
|
|
|
|
|
|
.paymentType(SalaryI18nUtil.getI18nLabel( buildPaymentTypeEnum(item.getPaymentType()).getLabelId(),
|
|
|
|
|
|
buildPaymentTypeEnum(item.getPaymentType()).getDefaultLabel()))
|
|
|
|
|
|
.schemeName(item.getSchemeName())
|
|
|
|
|
|
.paymentArea(item.getPaymentArea())
|
|
|
|
|
|
.paymentScope(buildPaymentScope(item.getId()))
|
|
|
|
|
|
.remarks(item.getRemarks())
|
|
|
|
|
|
.build()
|
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
|
PageInfo<InsuranceSchemeListDTO> pageInfo = new PageInfo<>(collect,InsuranceSchemeListDTO.class);
|
|
|
|
|
|
return pageInfo;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-05-06 16:58:01 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public List<InsuranceArchivesEmployeePO> listPageEmployeePOS(InsuranceArchivesListParam param) {
|
|
|
|
|
|
return getSocialSchemeMapper().queryEmployeeList(param);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public List<Map<String, Object>> buildTableData(List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS) {
|
|
|
|
|
|
List<Map<String, Object>> records = new ArrayList<>();
|
|
|
|
|
|
List<Long> employeeIds = insuranceArchivesEmployeePOS.stream().map(InsuranceArchivesEmployeePO::getEmployeeId).collect(Collectors.toList());
|
|
|
|
|
|
if (CollectionUtils.isEmpty(employeeIds)) {
|
|
|
|
|
|
return records;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap =
|
|
|
|
|
|
getSocialSchemeMapper().getSocialByEmployeeId(employeeIds)
|
|
|
|
|
|
.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity()));
|
|
|
|
|
|
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap =
|
|
|
|
|
|
getFundSchemeMapper().getFundByEmployeeId(employeeIds)
|
|
|
|
|
|
.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity()));
|
|
|
|
|
|
Map<Long, InsuranceArchivesOtherSchemePO> otherSchemePOMap =
|
|
|
|
|
|
getOtherSchemeMapper().getOtherByEmployeeId(employeeIds)
|
|
|
|
|
|
.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity()));
|
|
|
|
|
|
insuranceArchivesEmployeePOS.forEach(item -> {
|
|
|
|
|
|
InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getEmployeeId());
|
|
|
|
|
|
InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getEmployeeId());
|
|
|
|
|
|
InsuranceArchivesOtherSchemePO otherItem = otherSchemePOMap.get(item.getEmployeeId());
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
map.put("employeeName", item.getUserName());
|
|
|
|
|
|
map.put("employeeId", item.getEmployeeId());
|
|
|
|
|
|
map.put("departmentName", item.getDepartmentName());
|
|
|
|
|
|
map.put("departmentId", item.getDepartmentId());
|
|
|
|
|
|
map.put("jobNum", item.getJobNum());
|
|
|
|
|
|
map.put("mobile", item.getTelephone());
|
|
|
|
|
|
map.put("status", item.getUserStatusEnum() == null ? "" : item.getUserStatusEnum().getDescription());
|
|
|
|
|
|
if (socialItem != null) {
|
|
|
|
|
|
map.put("socialName", getSiSchemeService().querySchemeName(socialItem.getSocialSchemeId()));
|
|
|
|
|
|
Map<String, Object> socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference<Map<String, Object>>() {
|
|
|
|
|
|
});
|
|
|
|
|
|
if (socialJson != null) {
|
|
|
|
|
|
SalaryEntityUtil.thousandthConvert(socialJson, map);
|
|
|
|
|
|
}
|
|
|
|
|
|
map.put("socialAccount", socialItem.getSocialAccount());
|
|
|
|
|
|
map.put("socialStartTime", socialItem.getSocialStartTime());
|
|
|
|
|
|
map.put("socialEndTime", socialItem.getSocialEndTime());
|
|
|
|
|
|
}
|
|
|
|
|
|
if (fundItem != null) {
|
|
|
|
|
|
map.put("fundName", getSiSchemeService().querySchemeName(fundItem.getFundSchemeId()));
|
|
|
|
|
|
map.put("fundAccount", fundItem.getFundAccount());
|
|
|
|
|
|
Map<String, Object> fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference<Map<String, Object>>() {
|
|
|
|
|
|
});
|
|
|
|
|
|
if (fundJson != null) {
|
|
|
|
|
|
SalaryEntityUtil.thousandthConvert(fundJson, map);
|
|
|
|
|
|
}
|
|
|
|
|
|
map.put("supplementFundAccount", fundItem.getSupplementFundAccount());
|
|
|
|
|
|
map.put("fundStartTime", fundItem.getFundStartTime());
|
|
|
|
|
|
map.put("fundEndTime", fundItem.getFundEndTime());
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
if (otherItem != null) {
|
|
|
|
|
|
map.put("otherName", getSiSchemeService().querySchemeName(otherItem.getOtherSchemeId()));
|
|
|
|
|
|
Map<String, Object> otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference<Map<String, Object>>() {
|
|
|
|
|
|
});
|
|
|
|
|
|
if (otherJson != null) {
|
|
|
|
|
|
SalaryEntityUtil.thousandthConvert(otherJson, map);
|
|
|
|
|
|
}
|
|
|
|
|
|
map.put("otherStartTime", otherItem.getOtherStartTime());
|
|
|
|
|
|
map.put("otherEndTime", otherItem.getOtherEndTime());
|
|
|
|
|
|
}
|
|
|
|
|
|
records.add(map);
|
|
|
|
|
|
});
|
|
|
|
|
|
return records;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public XSSFWorkbook export(InsuranceArchivesListParam param) {
|
|
|
|
|
|
InsuranceArchivesListParam request = InsuranceArchivesListParam.builder().build();
|
|
|
|
|
|
if (param.getHireDate() != null && param.getHireDate().length == 2) {
|
|
|
|
|
|
param.setHiredateStart(param.getHireDate()[0]);
|
|
|
|
|
|
param.setHiredateEnd(param.getHireDate()[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (param.getDimissionDate() != null && param.getDimissionDate().length == 2) {
|
|
|
|
|
|
param.setDimissionDateStart(param.getDimissionDate()[0]);
|
|
|
|
|
|
param.setDimissionDateEnd(param.getDimissionDate()[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Objects.equals("fromQuickSearch", param.getDataSource())) {
|
|
|
|
|
|
request.setStatuses(param.getStatuses());
|
|
|
|
|
|
request.setKeyword(param.getUserName());
|
|
|
|
|
|
} else {
|
|
|
|
|
|
request = param;
|
|
|
|
|
|
}
|
|
|
|
|
|
request.setPageSize(null);
|
|
|
|
|
|
request.setStartNum(null);
|
|
|
|
|
|
List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS = listPageEmployeePOS(request);
|
|
|
|
|
|
if (insuranceArchivesEmployeePOS == null) {
|
|
|
|
|
|
insuranceArchivesEmployeePOS = new ArrayList<>();
|
|
|
|
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> records = buildTableData(insuranceArchivesEmployeePOS);
|
|
|
|
|
|
List<WeaTableColumn> columns = buildWeaTableColumns(insuranceArchivesEmployeePOS, (long) user.getUID());
|
|
|
|
|
|
|
|
|
|
|
|
//工作簿list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//工作簿数据
|
|
|
|
|
|
List<List<String>> rows = new LinkedList<>();
|
|
|
|
|
|
List<String> collect = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList());
|
|
|
|
|
|
rows.add(collect);
|
|
|
|
|
|
for (Map<String, Object> recordData : records) {
|
|
|
|
|
|
List<String> row = new LinkedList<>();
|
|
|
|
|
|
for (WeaTableColumn column : columns) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
Object o = recordData.get(column.getColumn());
|
|
|
|
|
|
row.add(o.toString());
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
|
row.add("");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
rows.add(row);
|
|
|
|
|
|
}
|
|
|
|
|
|
// return salaryBatchService.simpleExportExcel(ExportExcelInfo.builder()
|
|
|
|
|
|
// .bizId(exportMap.get("biz"))
|
|
|
|
|
|
// .flag(true)
|
|
|
|
|
|
// .userId(employeeId)
|
|
|
|
|
|
// .eteamsId(eteamsId)
|
|
|
|
|
|
// .tenantKey(tenantKey)
|
|
|
|
|
|
// .operator(operator)
|
|
|
|
|
|
// .module(exportMap.get("module"))
|
|
|
|
|
|
// .fileName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 94629, "社保福利档案") + SalaryDateUtil.getFormatLocalDateTime(LocalDateTime.now()))
|
|
|
|
|
|
// .handlerName("insuranceArchivesExportHandler")
|
|
|
|
|
|
// .dataType(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 99915, "档案"))
|
|
|
|
|
|
// .function(exportMap.get("function")).build(), sheetList);
|
|
|
|
|
|
//获取excel
|
|
|
|
|
|
return ExcelUtil.genWorkbook(rows,"福利档案");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-22 15:17:31 +08:00
|
|
|
|
|
|
|
|
|
|
public PaymentTypeEnum buildPaymentTypeEnum(Integer value) {
|
|
|
|
|
|
return SalaryEnumUtil.enumMatchByValue(value, PaymentTypeEnum.values(), PaymentTypeEnum.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 组装社保福利方案列表页【缴纳范围】
|
|
|
|
|
|
* 1、到福利方案明细表查询该方案id下面有哪些福利
|
|
|
|
|
|
* 2、去重(福利是分个人和公司的,明细表中查询出来的福利id会重复)
|
|
|
|
|
|
* 3、根据查询出来的福利id,去福利表里面查询福利的名称
|
|
|
|
|
|
* 4、组装,以“、”分割
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param id 福利方案主表id
|
|
|
|
|
|
* @return result
|
|
|
|
|
|
*/
|
|
|
|
|
|
public String buildPaymentScope(Long id) {
|
|
|
|
|
|
List<String> collect = queryInsuranceSchemeDetailList(id).stream().map(InsuranceSchemeDetailPO::getInsuranceId).distinct().collect(Collectors.toList())
|
|
|
|
|
|
.stream().map(this::queryInsuranceName).collect(Collectors.toList());
|
|
|
|
|
|
return StringUtils.join(collect, "、");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Collection<InsuranceSchemeDetailPO> queryInsuranceSchemeDetailList(Long id) {
|
|
|
|
|
|
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryInsuranceSchemeDetailList(id, IsPaymentEnum.YES.getValue());
|
|
|
|
|
|
return insuranceSchemeDetailPOS;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String queryInsuranceName(Long id) {
|
|
|
|
|
|
ICategoryPO insuranceCategoryPO = MapperProxyFactory.getProxy(ICategoryMapper.class).getById(id);
|
|
|
|
|
|
return insuranceCategoryPO == null ? "" : Objects.isNull(insuranceCategoryPO.getInsuranceName()) ? "" : insuranceCategoryPO.getInsuranceName();
|
|
|
|
|
|
}
|
2022-05-06 16:58:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String querySchemeName(Long schemeId) {
|
|
|
|
|
|
if (schemeId == null) {
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
InsuranceSchemePO insuranceSchemePO =
|
|
|
|
|
|
getInsuranceSchemeMapper().getById(schemeId);
|
|
|
|
|
|
if (insuranceSchemePO == null) {
|
|
|
|
|
|
return "";
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return insuranceSchemePO.getSchemeName();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public List<WeaTableColumn> buildWeaTableColumns(List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS, Long employeeId) {
|
|
|
|
|
|
Map<Integer, Map<String, String>> titleMap = buildColumnTitle(insuranceArchivesEmployeePOS, employeeId);
|
|
|
|
|
|
List<WeaTableColumn> list = new ArrayList<>();
|
|
|
|
|
|
WeaTableColumn nameColumn = new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel( 85429, "姓名"), "employeeName");
|
|
|
|
|
|
nameColumn.setFixed("left");
|
|
|
|
|
|
list.add(nameColumn);
|
|
|
|
|
|
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86185, "部门"), "departmentName"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel( 86186, "手机号"), "mobile"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel(86187, "员工状态"), "status"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91323, "社保方案名称"), "socialName"));
|
|
|
|
|
|
titleMap.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> list.add(new WeaTableColumn("150px", v, k)));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91324, "社保账号"), "socialAccount"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月"), "socialStartTime"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91320, "社保最后缴纳月"), "socialEndTime"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"), "fundName"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91486, "公积金账号"), "fundAccount"));
|
|
|
|
|
|
titleMap.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> list.add(new WeaTableColumn("150px", v, k)));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号"), "supplementFundAccount"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月"), "fundStartTime"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月"), "fundEndTime"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"), "otherName"));
|
|
|
|
|
|
titleMap.get(WelfareTypeEnum.OTHER.getValue()).forEach((k, v) -> list.add(new WeaTableColumn("150px", v, k)));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月"), "otherStartTime"));
|
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月"), "otherEndTime"));
|
|
|
|
|
|
return list;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Map<Integer, Map<String, String>> buildColumnTitle(List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS, Long employeeId) {
|
|
|
|
|
|
Map<Integer, Map<String, String>> result = new HashMap<>();
|
|
|
|
|
|
Set<String> socialSet = new HashSet<>();
|
|
|
|
|
|
Set<String> fundSet = new HashSet<>();
|
|
|
|
|
|
Set<String> otherSet = new HashSet<>();
|
|
|
|
|
|
insuranceArchivesEmployeePOS.forEach(item -> {
|
|
|
|
|
|
List<InsuranceArchivesSocialSchemePO> socialByEmployeeId = getSocialSchemeMapper().getSocialByEmployeeId(new ArrayList<Long>() {{
|
|
|
|
|
|
add(item.getEmployeeId());
|
|
|
|
|
|
}});
|
|
|
|
|
|
InsuranceArchivesSocialSchemePO socialItem = null;
|
|
|
|
|
|
if(socialByEmployeeId.size() > 0) {
|
|
|
|
|
|
socialItem = socialByEmployeeId.get(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
InsuranceArchivesFundSchemePO fundItem = null;
|
|
|
|
|
|
|
|
|
|
|
|
List<InsuranceArchivesFundSchemePO> fundByEmployeeId = getFundSchemeMapper().getFundByEmployeeId(new ArrayList<Long>() {{
|
|
|
|
|
|
add(item.getEmployeeId());
|
|
|
|
|
|
}});
|
|
|
|
|
|
if(fundByEmployeeId.size() > 0) {
|
|
|
|
|
|
fundItem = fundByEmployeeId.get(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
InsuranceArchivesOtherSchemePO otherItem = null;
|
|
|
|
|
|
|
|
|
|
|
|
List<InsuranceArchivesOtherSchemePO> otherByEmployeeId = getOtherSchemeMapper().getOtherByEmployeeId(new ArrayList<Long>() {{
|
|
|
|
|
|
add(item.getEmployeeId());
|
|
|
|
|
|
}});
|
|
|
|
|
|
if(otherByEmployeeId.size() > 0) {
|
|
|
|
|
|
otherItem = otherByEmployeeId.get(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (socialItem != null) {
|
|
|
|
|
|
Map<String, Object> socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference<Map<String, Object>>() {
|
|
|
|
|
|
});
|
|
|
|
|
|
if (socialJson != null) {
|
|
|
|
|
|
socialJson.forEach((k, v) -> socialSet.add(k));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (fundItem != null) {
|
|
|
|
|
|
Map<String, Object> fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference<Map<String, Object>>() {
|
|
|
|
|
|
});
|
|
|
|
|
|
if (fundJson != null) {
|
|
|
|
|
|
fundJson.forEach((k, v) -> fundSet.add(k));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (otherItem != null) {
|
|
|
|
|
|
Map<String, Object> otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference<Map<String, Object>>() {
|
|
|
|
|
|
});
|
|
|
|
|
|
if (otherJson != null) {
|
|
|
|
|
|
otherJson.forEach((k, v) -> otherSet.add(k));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
Map<String, String> socialMap = new HashMap<>();
|
|
|
|
|
|
Map<Long, ICategoryPO> socialCollect = new HashMap<>();
|
|
|
|
|
|
Map<Long, ICategoryPO> customSocial =
|
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null)
|
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
|
|
Map<Long, ICategoryPO> sysSocial =
|
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue())
|
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
|
socialCollect.putAll(customSocial);
|
|
|
|
|
|
socialCollect.putAll(sysSocial);
|
|
|
|
|
|
socialSet.forEach(item -> {
|
|
|
|
|
|
if (socialCollect.containsKey(Long.valueOf(item))) {
|
|
|
|
|
|
socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"));
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
Map<String, String> fundMap = new HashMap<>();
|
|
|
|
|
|
Map<Long, ICategoryPO> fundCollect = new HashMap<>();
|
|
|
|
|
|
Map<Long, ICategoryPO> customFund =
|
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null)
|
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
|
Map<Long, ICategoryPO> sysFund =
|
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue())
|
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
|
fundCollect.putAll(customFund);
|
|
|
|
|
|
fundCollect.putAll(sysFund);
|
|
|
|
|
|
fundSet.forEach(item -> {
|
|
|
|
|
|
if (fundCollect.containsKey(Long.valueOf(item))) {
|
|
|
|
|
|
fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"));
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
Map<String, String> otherMap = new HashMap<>();
|
|
|
|
|
|
Map<Long, ICategoryPO> otherCollect = new HashMap<>();
|
|
|
|
|
|
Map<Long, ICategoryPO> customOther =
|
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null)
|
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
|
Map<Long, ICategoryPO> sysOther =
|
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue())
|
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
|
otherCollect.putAll(customOther);
|
|
|
|
|
|
otherCollect.putAll(sysOther);
|
|
|
|
|
|
otherSet.forEach(item -> {
|
|
|
|
|
|
if (otherCollect.containsKey(Long.valueOf(item))) {
|
|
|
|
|
|
otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"));
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMap);
|
|
|
|
|
|
result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMap);
|
|
|
|
|
|
result.put(WelfareTypeEnum.OTHER.getValue(), otherMap);
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
2022-03-07 22:22:09 +08:00
|
|
|
|
}
|