社保福利台账 - 合计列
This commit is contained in:
parent
b331152d27
commit
accb0d3d2b
|
|
@ -278,11 +278,29 @@ public interface SIAccountService {
|
|||
|
||||
|
||||
/**
|
||||
* 合计行
|
||||
* 正常缴纳合计行
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> listCommonSum(InsuranceAccountDetailParam queryParam);
|
||||
|
||||
/**
|
||||
* 补缴合计行
|
||||
* @param insuranceAccountDetailParam
|
||||
*/
|
||||
Map<String, Object> listSupplementarySum(InsuranceAccountDetailParam insuranceAccountDetailParam);
|
||||
|
||||
/**
|
||||
* 退差合计列
|
||||
* @param insuranceAccountDetailParam
|
||||
*/
|
||||
Map<String, Object> listRecessionSum(InsuranceAccountDetailParam insuranceAccountDetailParam);
|
||||
|
||||
/**
|
||||
* 补差合计列
|
||||
* @param insuranceAccountDetailParam
|
||||
*/
|
||||
Map<String, Object> listBalanceSum(InsuranceAccountDetailParam insuranceAccountDetailParam);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2834,6 +2834,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listCommonSum(InsuranceAccountDetailParam queryParam) {
|
||||
|
||||
|
|
@ -2846,13 +2847,128 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
|
||||
// 数据组装
|
||||
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
|
||||
Map<String, Object> maxSizeRecord = records.stream().reduce(new HashMap<>(), (a, b) -> a.size() > b.size() ? a : b);
|
||||
// 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);
|
||||
|
||||
//过滤出福利档案基础信息表中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);
|
||||
|
||||
//补缴缴纳列表
|
||||
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 ){
|
||||
// 获取需要统计的列
|
||||
String[] keys = {"Base", "Com", "Sum", "Per", "total"};
|
||||
List<String> numKeys = new ArrayList<>();
|
||||
for(String key : maxSizeRecord.keySet()){
|
||||
if(StringUtils.containsAny(key,keys)){
|
||||
numKeys.add(key);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, Object> sumRow = new HashMap<>();
|
||||
|
|
@ -2869,10 +2985,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
}
|
||||
sumRow.put(numKey,value);
|
||||
}
|
||||
datas.put("sumRow", sumRow);
|
||||
return datas;
|
||||
return sumRow;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查补差数据中的福利缴纳费用相关福利类别,是否在正常缴纳中有设置缴纳
|
||||
* @param po
|
||||
|
|
|
|||
|
|
@ -150,6 +150,23 @@ public class SIAccountController {
|
|||
return new ResponseResult<InsuranceAccountDetailParam, Map<String, Object>>(user).run(getService(user)::listSupplementaryPage, insuranceAccountDetailParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取补缴缴纳列表合计行
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param insuranceAccountDetailParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/detail/supplementary/list/sum")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listSupplementarySum(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@RequestBody InsuranceAccountDetailParam insuranceAccountDetailParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<InsuranceAccountDetailParam, Map<String, Object>>(user).run(getService(user)::listSupplementarySum, insuranceAccountDetailParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据姓名获取补缴缴纳列表
|
||||
*
|
||||
|
|
@ -677,6 +694,24 @@ public class SIAccountController {
|
|||
return new ResponseResult<InsuranceAccountDetailParam, Map<String, Object>>(user).run(getService(user)::listRecessionPage, insuranceAccountDetailParam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取退差列表合计列
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param insuranceAccountDetailParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/detail/recession/list/sum")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listRecessionSum(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@RequestBody InsuranceAccountDetailParam insuranceAccountDetailParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<InsuranceAccountDetailParam, Map<String, Object>>(user).run(getService(user)::listRecessionSum, insuranceAccountDetailParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取InsuranceAccountDetailPO中的社保、公积金、其他福利个人和公司缴纳数据
|
||||
* @param request
|
||||
|
|
@ -896,6 +931,23 @@ public class SIAccountController {
|
|||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<InsuranceAccountDetailParam, Map<String, Object>>(user).run(getService(user)::listBalancePage, insuranceAccountDetailParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取补差列表合计列
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param insuranceAccountDetailParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/detail/balance/list/sum")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listBalanceSum(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@RequestBody InsuranceAccountDetailParam insuranceAccountDetailParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<InsuranceAccountDetailParam, Map<String, Object>>(user).run(getService(user)::listBalanceSum, insuranceAccountDetailParam);
|
||||
}
|
||||
// **********************************补差 end*********************************/
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue