提供字段描述给薪资账套

This commit is contained in:
Chengliang 2022-04-27 16:21:24 +08:00
parent 7e28c952cc
commit fb4f1a13fb
4 changed files with 89 additions and 1 deletions

View File

@ -186,5 +186,12 @@ public interface SIAccountService {
*/
List<Map<String, Object>> welfareData(String billMonth, List<Long> employeeIds);
/**
* 给套账提供字段名对应字段释义
*
* @return
*/
Map<String, String> welfareColumns();
}

View File

@ -19,4 +19,11 @@ public interface SICategoryService {
Map<String, Object> updateStatusById(Map<String, Object> params);
Map<String, Object> listPage(Map<String, Object> params);
/**
* 根据tenantKey获取name和id的map结构
*
* @return map
*/
Map<String, String> categoryIdNameMap();
}

View File

@ -21,15 +21,17 @@ import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.siaccount.BillStatusEnum;
import com.engine.salary.enums.siaccount.InspectStatusEnum;
import com.engine.salary.enums.siaccount.PaymentStatusEnum;
import com.engine.salary.enums.siaccount.ProjectTypeEnum;
import com.engine.salary.mapper.datacollection.EmployMapper;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper;
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
import com.engine.salary.mapper.siaccount.InsuranceAccountInspectMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.service.ColumnBuildService;
import com.engine.salary.service.RecordsBuildService;
import com.engine.salary.service.SIAccountService;
@ -38,6 +40,7 @@ import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import com.engine.salary.service.SICategoryService;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryFormItemUtil;
import com.engine.salary.util.SalaryI18nUtil;
@ -72,6 +75,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
return ServiceUtil.getService(ColumnBuildServiceImpl.class,user);
}
public SICategoryService getSICategoryService(User user) {
return ServiceUtil.getService(SICategoryServiceImpl.class,user);
}
@Override
public Map<String, Object> listPage(InsuranceAccountBatchParam queryParam) {
@ -645,6 +652,49 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
return result;
}
@Override
public Map<String, String> welfareColumns() {
List<ICategoryPO> listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
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");
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");
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;
}
public List<SearchConditionOption> buildBillProjectsOptions() {

View File

@ -2,9 +2,15 @@ package com.engine.salary.service.impl;
import com.engine.core.impl.Service;
import com.engine.salary.cmd.sicategory.*;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.service.SICategoryService;
import com.engine.salary.util.db.MapperProxyFactory;
import org.apache.commons.collections4.MapUtils;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author weaver_cl
@ -38,4 +44,22 @@ public class SICategoryServiceImpl extends Service implements SICategoryService
public Map<String, Object> listPage(Map<String, Object> params) {
return commandExecutor.execute(new SICategoryListCmd(params,user));
}
@Override
public Map<String, String> categoryIdNameMap() {
//系统福利类型
Map<Long, String> systemAndCustomMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream()
.collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName));
HashMap<Long, String> total = new HashMap<>();
if (MapUtils.isNotEmpty(systemAndCustomMap)) {
total.putAll(systemAndCustomMap);
}
HashMap<String, String> result = new HashMap<>();
total.forEach((k, v) -> {
result.put(String.valueOf(k), v);
});
return result;
}
}