2022-04-12 19:29:19 +08:00
|
|
|
package com.engine.salary.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
|
|
|
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
2022-07-07 18:29:52 +08:00
|
|
|
import com.engine.core.impl.Service;
|
2022-04-16 16:43:33 +08:00
|
|
|
import com.engine.salary.biz.SIArchivesBiz;
|
2022-04-12 19:29:19 +08:00
|
|
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
|
|
|
|
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
|
2022-04-16 16:43:33 +08:00
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesAccountPO;
|
|
|
|
|
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-12 19:29:19 +08:00
|
|
|
import com.engine.salary.entity.sicategory.po.ICategoryPO;
|
2022-11-16 15:45:36 +08:00
|
|
|
import com.engine.salary.enums.siaccount.PaymentStatusEnum;
|
2022-04-12 19:29:19 +08:00
|
|
|
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
|
|
|
|
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
|
|
|
|
import com.engine.salary.service.ColumnBuildService;
|
|
|
|
|
import com.engine.salary.util.SalaryI18nUtil;
|
|
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author weaver_cl
|
2022-07-13 11:45:16 +08:00
|
|
|
* @Description:
|
2022-04-12 19:29:19 +08:00
|
|
|
* @Date 2022/4/12
|
|
|
|
|
* @Version V1.0
|
|
|
|
|
**/
|
|
|
|
|
public class ColumnBuildServiceImpl extends Service implements ColumnBuildService {
|
2023-03-07 14:21:01 +08:00
|
|
|
|
|
|
|
|
private ICategoryMapper getICategoryMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(ICategoryMapper.class);
|
|
|
|
|
}
|
2022-04-12 19:29:19 +08:00
|
|
|
@Override
|
2022-11-16 15:45:36 +08:00
|
|
|
public List<WeaTableColumn> buildCommonColumnsWithStyle(List<InsuranceAccountDetailPO> pos, Long employeeId, String tenantKey, Integer paymentStatus) {
|
2022-04-12 19:29:19 +08:00
|
|
|
List<WeaTableColumn> list = new ArrayList<>();
|
2023-03-07 14:21:01 +08:00
|
|
|
Map<String, String> categoryIdNameMap = getICategoryMapper().listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName));
|
2022-04-12 19:29:19 +08:00
|
|
|
Map<Integer, Map<String, String>> columns = buildPaymentTitle(pos, categoryIdNameMap, employeeId, tenantKey);
|
|
|
|
|
Map<Integer, Map<String, String>> personColumns = buildPersonalTitle(pos, categoryIdNameMap, employeeId, tenantKey);
|
|
|
|
|
Map<Integer, Map<String, String>> comColumns = buildComTitle(pos, categoryIdNameMap, employeeId, tenantKey);
|
|
|
|
|
WeaTableColumn weaTableNameColumn = new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 85429, "姓名"), "userName");
|
|
|
|
|
weaTableNameColumn.setFixed("left");
|
|
|
|
|
WeaTableColumn idColumn = new WeaTableColumn("150px", "id", "id");
|
|
|
|
|
idColumn.setIsPrimarykey(WeaBoolAttr.TRUE);
|
|
|
|
|
idColumn.setDisplay(WeaBoolAttr.FALSE);
|
|
|
|
|
list.add(idColumn);
|
|
|
|
|
WeaTableColumn employeeIdColumn = new WeaTableColumn("150px", "人员信息表的主键id", "employeeId");
|
|
|
|
|
employeeIdColumn.setDisplay(WeaBoolAttr.FALSE);
|
|
|
|
|
list.add(employeeIdColumn);
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 86185, "部门"), "department"));
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 86186, "手机号"), "mobile"));
|
2023-05-31 11:49:40 +08:00
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 1933, "工号"), "workcode"));
|
2023-06-13 14:49:26 +08:00
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 86187, "员工状态"), "employeeStatus"));
|
2022-04-12 19:29:19 +08:00
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 100377, "数据来源"), "sourceFrom"));
|
2022-11-16 15:45:36 +08:00
|
|
|
if (paymentStatus.equals(PaymentStatusEnum.REPAIR.getValue())) {
|
2022-04-12 19:29:19 +08:00
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 100379, "补缴月份"), "supplementaryMonth"));
|
2022-11-16 15:45:36 +08:00
|
|
|
} else if (paymentStatus.equals(PaymentStatusEnum.RECESSION.getValue())) {
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 100379, "退差月份"), "supplementaryMonth"));
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
2022-08-04 15:09:40 +08:00
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91325, "个税扣缴义务人"), "socialPayOrg"));
|
2023-08-17 11:31:38 +08:00
|
|
|
if (!paymentStatus.equals(PaymentStatusEnum.BALANCE.getValue())) {
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91324, "社保账号"), "socialAccount"));
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91323, "社保方案名称"), "socialSchemeName"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
//组装社保基数
|
|
|
|
|
columns.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
2023-08-17 11:31:38 +08:00
|
|
|
|
|
|
|
|
if (!paymentStatus.equals(PaymentStatusEnum.BALANCE.getValue())) {
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91486, "公积金账号"), "fundAccount"));
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91485, "公积金方案名称"), "fundSchemeName"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
//组装公积金基数
|
|
|
|
|
columns.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
2023-08-17 11:31:38 +08:00
|
|
|
if (!paymentStatus.equals(PaymentStatusEnum.BALANCE.getValue())) {
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91487, "补充公积金账号"), "supplementFundAccount"));
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"), "otherSchemeName"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
columns.get(WelfareTypeEnum.OTHER.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
|
|
|
|
personColumns.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100388, "社保个人合计") + "</span>", "socialPerSum"));
|
|
|
|
|
personColumns.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100390, "公积金个人合计") + "</span>", "fundPerSum"));
|
|
|
|
|
personColumns.get(WelfareTypeEnum.OTHER.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100392, "其他福利个人合计") + "</span>", "otherPerSum"));
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100393, "个人合计") + "</span>", "perSum"));
|
|
|
|
|
comColumns.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100394, "社保单位合计") + "</span>", "socialComSum"));
|
|
|
|
|
comColumns.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100395, "公积金单位合计") + "</span>", "fundComSum"));
|
|
|
|
|
comColumns.get(WelfareTypeEnum.OTHER.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100396, "其他福利单位合计") + "</span>", "otherComSum"));
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100397, "单位合计") + "</span>", "comSum"));
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100398, "社保合计") + "</span>", "socialSum"));
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100399, "公积金合计") + "</span>", "fundSum"));
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 100400, "其他福利合计") + "</span>", "otherSum"));
|
|
|
|
|
list.add(new WeaTableColumn("150px","<span style=\"color:blue\">" + SalaryI18nUtil.getI18nLabel( 93278, "合计") + "</span>", "total"));
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<Integer, Map<String, String>> buildPaymentTitle(List<InsuranceAccountDetailPO> pos, Map<String, String> categoryIdNameMap, Long employeeId, String tenantKey) {
|
|
|
|
|
Set<String> socailIds = new HashSet<>();
|
|
|
|
|
Set<String> fundIds = new HashSet<>();
|
|
|
|
|
Set<String> otherIds = new HashSet<>();
|
|
|
|
|
Map<Integer, Map<String, String>> result = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
pos.stream().forEach(item -> {
|
|
|
|
|
if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) {
|
|
|
|
|
Map<String, String> socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(socialJson!=null){
|
|
|
|
|
socialJson.forEach((k, v) -> {
|
|
|
|
|
socailIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) {
|
|
|
|
|
Map<String, String> fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(fundJson!=null){
|
|
|
|
|
fundJson.forEach((k, v) -> {
|
|
|
|
|
fundIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) {
|
|
|
|
|
Map<String, String> otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(otherJson!=null){
|
|
|
|
|
otherJson.forEach((k, v) -> {
|
|
|
|
|
otherIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
Map<String, String> socialColumns = new HashMap<>();
|
|
|
|
|
Map<String, String> fundColumns = new HashMap<>();
|
|
|
|
|
Map<String, String> otherColumns = new HashMap<>();
|
|
|
|
|
socailIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "socialBase");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
fundIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "fundBase");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
otherIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "otherBase");
|
|
|
|
|
}
|
|
|
|
|
});
|
2023-06-13 14:49:26 +08:00
|
|
|
// map根据value排序
|
|
|
|
|
LinkedHashMap<String, String> socialColumnsWithAscValue = socialColumns.entrySet().stream()
|
|
|
|
|
.sorted(Map.Entry.comparingByValue())
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
|
|
|
|
|
LinkedHashMap::new));
|
|
|
|
|
LinkedHashMap<String, String> fundColumnsWithAscValue = fundColumns.entrySet().stream()
|
|
|
|
|
.sorted(Map.Entry.comparingByValue())
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
|
|
|
|
|
LinkedHashMap::new));
|
|
|
|
|
LinkedHashMap<String, String> otherColumnsWithAscValue = otherColumns.entrySet().stream()
|
|
|
|
|
.sorted(Map.Entry.comparingByValue())
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
|
|
|
|
|
LinkedHashMap::new));
|
|
|
|
|
|
|
|
|
|
result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue);
|
|
|
|
|
result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue);
|
|
|
|
|
result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue);
|
2022-04-12 19:29:19 +08:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<Integer, Map<String, String>> buildPersonalTitle(List<InsuranceAccountDetailPO> pos, Map<String, String> categoryIdNameMap, Long employeeId, String tenantKey) {
|
|
|
|
|
Set<String> socailIds = new HashSet<>();
|
|
|
|
|
Set<String> fundIds = new HashSet<>();
|
|
|
|
|
Set<String> otherIds = new HashSet<>();
|
|
|
|
|
Map<Integer, Map<String, String>> result = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
pos.stream().forEach(item -> {
|
|
|
|
|
if (StringUtils.isNotBlank(item.getSocialPerJson())) {
|
|
|
|
|
Map<String, String> socialJson = JSON.parseObject(item.getSocialPerJson(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(socialJson!=null){
|
|
|
|
|
socialJson.forEach((k, v) -> {
|
|
|
|
|
socailIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getFundPerJson())) {
|
|
|
|
|
Map<String, String> fundJson = JSON.parseObject(item.getFundPerJson(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(fundJson!=null){
|
|
|
|
|
fundJson.forEach((k, v) -> {
|
|
|
|
|
fundIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getOtherPerJson())) {
|
|
|
|
|
Map<String, String> otherJson = JSON.parseObject(item.getOtherPerJson(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(otherJson!=null){
|
|
|
|
|
otherJson.forEach((k, v) -> {
|
|
|
|
|
otherIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
Map<String, String> socialColumns = new HashMap<>();
|
|
|
|
|
Map<String, String> fundColumns = new HashMap<>();
|
|
|
|
|
Map<String, String> otherColumns = new HashMap<>();
|
|
|
|
|
socailIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 87159, "个人"), social + "socialPer");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
fundIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 87159, "个人"), social + "fundPer");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
otherIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 87159, "个人"), social + "otherPer");
|
|
|
|
|
}
|
|
|
|
|
});
|
2023-06-13 14:49:26 +08:00
|
|
|
// map根据value排序
|
|
|
|
|
LinkedHashMap<String, String> socialColumnsWithAscValue = socialColumns.entrySet().stream()
|
|
|
|
|
.sorted(Map.Entry.comparingByValue())
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
|
|
|
|
|
LinkedHashMap::new));
|
|
|
|
|
LinkedHashMap<String, String> fundColumnsWithAscValue = fundColumns.entrySet().stream()
|
|
|
|
|
.sorted(Map.Entry.comparingByValue())
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
|
|
|
|
|
LinkedHashMap::new));
|
|
|
|
|
LinkedHashMap<String, String> otherColumnsWithAscValue = otherColumns.entrySet().stream()
|
|
|
|
|
.sorted(Map.Entry.comparingByValue())
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
|
|
|
|
|
LinkedHashMap::new));
|
|
|
|
|
|
|
|
|
|
result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue);
|
|
|
|
|
result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue);
|
|
|
|
|
result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue);
|
2022-04-12 19:29:19 +08:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<Integer, Map<String, String>> buildComTitle(List<InsuranceAccountDetailPO> pos, Map<String, String> categoryIdNameMap, Long employeeId, String tenantKey) {
|
|
|
|
|
Set<String> socailIds = new HashSet<>();
|
|
|
|
|
Set<String> fundIds = new HashSet<>();
|
|
|
|
|
Set<String> otherIds = new HashSet<>();
|
|
|
|
|
Map<Integer, Map<String, String>> result = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
pos.stream().forEach(item -> {
|
|
|
|
|
if (StringUtils.isNotBlank(item.getSocialComJson())) {
|
|
|
|
|
Map<String, String> socialJson = JSON.parseObject(item.getSocialComJson(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(socialJson!=null){
|
|
|
|
|
socialJson.forEach((k, v) -> {
|
|
|
|
|
socailIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getFundComJson())) {
|
|
|
|
|
Map<String, String> fundJson = JSON.parseObject(item.getFundComJson(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(fundJson!=null){
|
|
|
|
|
fundJson.forEach((k, v) -> {
|
|
|
|
|
fundIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(item.getOtherComJson())) {
|
|
|
|
|
Map<String, String> otherJson = JSON.parseObject(item.getOtherComJson(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(otherJson!=null){
|
|
|
|
|
otherJson.forEach((k, v) -> {
|
|
|
|
|
otherIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
Map<String, String> socialColumns = new HashMap<>();
|
|
|
|
|
Map<String, String> fundColumns = new HashMap<>();
|
|
|
|
|
Map<String, String> otherColumns = new HashMap<>();
|
|
|
|
|
socailIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100289, "单位"), social + "socialCom");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
fundIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100289, "单位"), social + "fundCom");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
otherIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100289, "单位"), social + "otherCom");
|
|
|
|
|
}
|
|
|
|
|
});
|
2023-06-13 14:49:26 +08:00
|
|
|
// map根据value排序
|
|
|
|
|
LinkedHashMap<String, String> socialColumnsWithAscValue = socialColumns.entrySet().stream()
|
|
|
|
|
.sorted(Map.Entry.comparingByValue())
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
|
|
|
|
|
LinkedHashMap::new));
|
|
|
|
|
LinkedHashMap<String, String> fundColumnsWithAscValue = fundColumns.entrySet().stream()
|
|
|
|
|
.sorted(Map.Entry.comparingByValue())
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
|
|
|
|
|
LinkedHashMap::new));
|
|
|
|
|
LinkedHashMap<String, String> otherColumnsWithAscValue = otherColumns.entrySet().stream()
|
|
|
|
|
.sorted(Map.Entry.comparingByValue())
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
|
|
|
|
|
LinkedHashMap::new));
|
|
|
|
|
|
|
|
|
|
result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue);
|
|
|
|
|
result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue);
|
|
|
|
|
result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue);
|
2022-04-12 19:29:19 +08:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
2022-04-16 16:43:33 +08:00
|
|
|
public List<WeaTableColumn> buildCommonColumns(List<InsuranceAccountDetailPO> pos) {
|
2022-04-12 19:29:19 +08:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2022-10-28 15:25:58 +08:00
|
|
|
public List<WeaTableColumn> buildInspectColumns(List<InsuranceAccountInspectPO> pos, Long paymentOrganization) {
|
2022-04-16 16:43:33 +08:00
|
|
|
List<WeaTableColumn> list = new ArrayList<>();
|
|
|
|
|
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
|
|
|
|
List<Long> employeeIds = pos.stream().map(InsuranceAccountInspectPO::getEmployeeId).collect(Collectors.toList());
|
2022-10-28 15:25:58 +08:00
|
|
|
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization);
|
2023-03-07 14:21:01 +08:00
|
|
|
Map<String, String> categoryIdNameMap = getICategoryMapper().listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName));
|
2022-04-16 16:43:33 +08:00
|
|
|
Map<Integer, Map<String, String>> columns = buildInspectTableTitle(new ArrayList<>(insuranceArchivesAccountPOMap.values()), categoryIdNameMap);
|
|
|
|
|
WeaTableColumn weaTableNameColumn = new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 85429, "姓名"), "userName");
|
|
|
|
|
weaTableNameColumn.setFixed("left");
|
|
|
|
|
WeaTableColumn idColumn = new WeaTableColumn("150px", "id", "id");
|
|
|
|
|
idColumn.setIsPrimarykey(WeaBoolAttr.TRUE);
|
|
|
|
|
idColumn.setDisplay(WeaBoolAttr.FALSE);
|
|
|
|
|
list.add(idColumn);
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 86185, "部门"), "department"));
|
|
|
|
|
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86186, "手机号"), "mobile"));
|
|
|
|
|
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86187, "员工状态"), "employeeStatus"));
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 100544, "缴纳情况"), "supplementaryMonth"));
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91323, "社保方案名称"), "socialSchemeName"));
|
|
|
|
|
//组装社保基数
|
|
|
|
|
columns.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91485, "公积金方案名称"), "fundSchemeName"));
|
|
|
|
|
//组装公积金基数
|
|
|
|
|
columns.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
|
|
|
|
list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91496, "其他福利方案名称"), "otherSchemeName"));
|
|
|
|
|
columns.get(WelfareTypeEnum.OTHER.getValue()).forEach((k, v) -> {
|
|
|
|
|
list.add(new WeaTableColumn("150px",k, v));
|
|
|
|
|
});
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<Integer, Map<String, String>> buildInspectTableTitle(List<InsuranceArchivesAccountPO> pos, Map<String, String> categoryIdNameMap
|
|
|
|
|
) {
|
|
|
|
|
Set<String> socailIds = new HashSet<>();
|
|
|
|
|
Set<String> fundIds = new HashSet<>();
|
|
|
|
|
Set<String> otherIds = new HashSet<>();
|
|
|
|
|
Map<Integer, Map<String, String>> result = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
pos.stream().forEach(item -> {
|
|
|
|
|
InsuranceArchivesSocialSchemePO social = item.getSocial();
|
|
|
|
|
if (social != null && StringUtils.isNotBlank(social.getSocialPaymentBaseString())) {
|
|
|
|
|
Map<String, String> socialJson = JSON.parseObject(social.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(socialJson!=null){
|
|
|
|
|
socialJson.forEach((k, v) -> {
|
|
|
|
|
socailIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
}
|
|
|
|
|
InsuranceArchivesFundSchemePO fund = item.getFund();
|
|
|
|
|
if (fund != null && StringUtils.isNotBlank(fund.getFundPaymentBaseString())) {
|
|
|
|
|
Map<String, String> fundJson = JSON.parseObject(fund.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(fundJson!=null){
|
|
|
|
|
fundJson.forEach((k, v) -> {
|
|
|
|
|
fundIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
}
|
|
|
|
|
InsuranceArchivesOtherSchemePO other = item.getOther();
|
|
|
|
|
if (other != null && StringUtils.isNotBlank(other.getOtherPaymentBaseString())) {
|
|
|
|
|
Map<String, String> otherJson = JSON.parseObject(other.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
|
2022-07-21 17:28:47 +08:00
|
|
|
if(otherJson!=null){
|
|
|
|
|
otherJson.forEach((k, v) -> {
|
|
|
|
|
otherIds.add(k);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-16 16:43:33 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
Map<String, String> socialColumns = new HashMap<>();
|
|
|
|
|
Map<String, String> fundColumns = new HashMap<>();
|
|
|
|
|
Map<String, String> otherColumns = new HashMap<>();
|
|
|
|
|
socailIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "socialBase");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
fundIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "fundBase");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
otherIds.stream().forEach(social -> {
|
|
|
|
|
if (categoryIdNameMap.containsKey(social)) {
|
|
|
|
|
otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "otherBase");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumns);
|
|
|
|
|
result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumns);
|
|
|
|
|
result.put(WelfareTypeEnum.OTHER.getValue(), otherColumns);
|
|
|
|
|
return result;
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|
2022-11-29 15:33:57 +08:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<WeaTableColumn> buildCompensationColumns() {
|
|
|
|
|
List<WeaTableColumn> list = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
WeaTableColumn weaTableNameColumn = new WeaTableColumn("300px",SalaryI18nUtil.getI18nLabel( 87000, "调差对象"), "target");
|
|
|
|
|
weaTableNameColumn.setFixed("left");
|
2022-11-30 17:57:25 +08:00
|
|
|
list.add(weaTableNameColumn);
|
2022-11-29 15:33:57 +08:00
|
|
|
|
|
|
|
|
list.add(new WeaTableColumn("100px",SalaryI18nUtil.getI18nLabel( 87001, "统计调差福利"), "welfareType"));
|
|
|
|
|
list.add(new WeaTableColumn("200px",SalaryI18nUtil.getI18nLabel( 87001, "统计调差福利类型(单位)"), "categoryType"));
|
|
|
|
|
list.add(new WeaTableColumn("200px",SalaryI18nUtil.getI18nLabel( 87002, "国家核算金额(单位)"), "countryTotal"));
|
|
|
|
|
list.add(new WeaTableColumn("200px",SalaryI18nUtil.getI18nLabel( 87003, "公司核算金额(单位)"), "companyTotal"));
|
|
|
|
|
list.add(new WeaTableColumn("100px",SalaryI18nUtil.getI18nLabel( 87004, "应调差金额"), "adjustmentTotal"));
|
|
|
|
|
list.add(new WeaTableColumn("200px",SalaryI18nUtil.getI18nLabel( 87005, "调差到(单位)"), "adjustTo"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
}
|